Patch out neon in freebl
authorPeter Michael Green <plugwash@raspbian.org>
Thu, 29 Oct 2020 03:19:17 +0000 (03:19 +0000)
committerRaspbian forward porter <root@raspbian.org>
Fri, 27 Aug 2021 03:35:37 +0000 (04:35 +0100)
Gbp-Pq: Name patch-out-neon-in-freebl.patch

security/nss/lib/freebl/Makefile
security/nss/lib/freebl/freebl.gyp
security/nss/lib/freebl/gcm.c
security/nss/lib/freebl/rijndael.c

index 5f7384429aa8761065b6a77878229890f5610609..202409d5b4025b8352b177b25e5b01d082d3e049 100644 (file)
@@ -124,9 +124,9 @@ ifeq ($(CPU_ARCH),aarch64)
     EXTRA_SRCS += aes-armv8.c gcm-aarch64.c
 endif
 ifeq ($(CPU_ARCH),arm)
-ifndef NSS_DISABLE_ARM32_NEON
-    EXTRA_SRCS += gcm-arm32-neon.c
-endif
+#ifndef NSS_DISABLE_ARM32_NEON
+#    EXTRA_SRCS += gcm-arm32-neon.c
+#endif
     ifdef CC_IS_CLANG
         DEFINES += -DUSE_HW_AES
         EXTRA_SRCS += aes-armv8.c
index f3bb8a71a66e689039b2f942fe5589be684a5741..7fa2339e2cc6189e8f006a7b6b5239d0e45b68fd 100644 (file)
             ],
           },
         }],
-        [ 'target_arch=="arm"', {
-          # Gecko doesn't support non-NEON platform on Android, but tier-3
-          # platform such as Linux/arm will need it
-          'cflags_mozilla': [
-            '-mfpu=neon'
-          ],
-        }],
+        #[ 'target_arch=="arm"', {
+        #  # Gecko doesn't support non-NEON platform on Android, but tier-3
+        #  # platform such as Linux/arm will need it
+        #  'cflags_mozilla': [
+        #    '-mfpu=neon'
+        #  ],
+        #}],
         [ 'target_arch=="x64"', {
           'sources': [
             'verified/Hacl_Poly1305_128.c',
             ],
           },
         }],
-        [ 'target_arch=="arm"', {
-          # Gecko doesn't support non-NEON platform on Android, but tier-3
-          # platform such as Linux/arm will need it
-          'cflags_mozilla': [
-            '-mfpu=neon'
-          ],
-        }],
+        #[ 'target_arch=="arm"', {
+        #  # Gecko doesn't support non-NEON platform on Android, but tier-3
+        #  # platform such as Linux/arm will need it
+        #  'cflags_mozilla': [
+        #    '-mfpu=neon'
+        #  ],
+        #}],
         [ 'target_arch=="x64"', {
           'sources': [
             'verified/Hacl_Poly1305_256.c',
         }]
       ]
     },
-    {
-      'target_name': 'gcm-aes-arm32-neon_c_lib',
-      'type': 'static_library',
-      'sources': [
-        'gcm-arm32-neon.c'
-      ],
-      'dependencies': [
-        '<(DEPTH)/exports.gyp:nss_exports'
-      ],
-      'cflags': [
-        '-march=armv7',
-        '-mfpu=neon',
-        '<@(softfp_cflags)',
-      ],
-      'cflags_mozilla': [
-        '-mfpu=neon',
-        '<@(softfp_cflags)',
-      ]
-    },
+    #{
+    #  'target_name': 'gcm-aes-arm32-neon_c_lib',
+    #  'type': 'static_library',
+    #  'sources': [
+    #    'gcm-arm32-neon.c'
+    #  ],
+    #  'dependencies': [
+    #    '<(DEPTH)/exports.gyp:nss_exports'
+    #  ],
+    #  'cflags': [
+    #    '-march=armv7',
+    #    '-mfpu=neon',
+    #    '<@(softfp_cflags)',
+    #  ],
+    #  'cflags_mozilla': [
+    #    '-mfpu=neon',
+    #    '<@(softfp_cflags)',
+    #  ]
+    #},
     {
       'target_name': 'gcm-aes-aarch64_c_lib',
       'type': 'static_library',
         'FREEBL_NO_DEPEND',
       ],
     },
-    {
-      'target_name': 'armv8_c_lib',
-      'type': 'static_library',
-      'sources': [
-        'aes-armv8.c',
-      ],
-      'dependencies': [
-        '<(DEPTH)/exports.gyp:nss_exports'
-      ],
-      'conditions': [
-        [ 'target_arch=="arm"', {
-          'cflags': [
-            '-march=armv8-a',
-            '-mfpu=crypto-neon-fp-armv8',
-            '<@(softfp_cflags)',
-          ],
-          'cflags_mozilla': [
-            '-march=armv8-a',
-            '-mfpu=crypto-neon-fp-armv8',
-            '<@(softfp_cflags)',
-          ],
-        }, 'target_arch=="arm64" or target_arch=="aarch64"', {
-          'cflags': [
-            '-march=armv8-a+crypto'
-          ],
-          'cflags_mozilla': [
-            '-march=armv8-a+crypto'
-          ],
-        }]
-      ]
-    },
+    #{
+    #  'target_name': 'armv8_c_lib',
+    #  'type': 'static_library',
+    #  'sources': [
+    #    'aes-armv8.c',
+    #  ],
+    #  'dependencies': [
+    #    '<(DEPTH)/exports.gyp:nss_exports'
+    #  ],
+    #  'conditions': [
+    #    [ 'target_arch=="arm"', {
+    #      'cflags': [
+    #        '-march=armv8-a',
+    #        '-mfpu=crypto-neon-fp-armv8',
+    #        '<@(softfp_cflags)',
+    #      ],
+    #      'cflags_mozilla': [
+    #        '-march=armv8-a',
+    #        '-mfpu=crypto-neon-fp-armv8',
+    #        '<@(softfp_cflags)',
+    #      ],
+    #    }, 'target_arch=="arm64" or target_arch=="aarch64"', {
+    #      'cflags': [
+    #        '-march=armv8-a+crypto'
+    #      ],
+    #      'cflags_mozilla': [
+    #        '-march=armv8-a+crypto'
+    #      ],
+    #    }]
+    #  ]
+    #},
     {
       'target_name': 'freebl',
       'type': 'static_library',
         'hw-acc-crypto-avx2',
       ],
       'conditions': [
-        [ 'target_arch=="ia32" or target_arch=="x64"', {
-          'dependencies': [
-            'gcm-aes-x86_c_lib',
-          ],
-        }, 'disable_arm_hw_aes==0 and (target_arch=="arm" or target_arch=="arm64" or target_arch=="aarch64")', {
-          'dependencies': [
-            'armv8_c_lib'
-          ],
-        }],
-        [ 'disable_arm32_neon==0 and target_arch=="arm"', {
-          'dependencies': [
-            'gcm-aes-arm32-neon_c_lib',
-          ],
-        }],
-        [ 'disable_arm32_neon==1 and target_arch=="arm"', {
+        #[ 'target_arch=="ia32" or target_arch=="x64"', {
+        #  'dependencies': [
+        #    'gcm-aes-x86_c_lib',
+        #  ],
+        #}, 'disable_arm_hw_aes==0 and (target_arch=="arm" or target_arch=="arm64" or target_arch=="aarch64")', {
+        #  'dependencies': [
+        #    'armv8_c_lib'
+        #  ],
+        #}],
+        #[ 'disable_arm32_neon==0 and target_arch=="arm"', {
+        #  'dependencies': [
+        #    'gcm-aes-arm32-neon_c_lib',
+        #  ],
+        #}],
+        [ 'target_arch=="arm"', {
           'defines!': [
             'NSS_DISABLE_ARM32_NEON',
           ],
         'hw-acc-crypto-avx2',
       ],
       'conditions': [
-        [ 'target_arch=="ia32" or target_arch=="x64"', {
-          'dependencies': [
-            'gcm-aes-x86_c_lib',
-          ]
-        }, 'target_arch=="arm" or target_arch=="arm64" or target_arch=="aarch64"', {
-          'dependencies': [
-            'armv8_c_lib',
-          ],
-        }],
-        [ 'disable_arm32_neon==0 and target_arch=="arm"', {
-          'dependencies': [
-            'gcm-aes-arm32-neon_c_lib',
-          ],
-        }],
-        [ 'disable_arm32_neon==1 and target_arch=="arm"', {
+        #[ 'target_arch=="ia32" or target_arch=="x64"', {
+        #  'dependencies': [
+        #    'gcm-aes-x86_c_lib',
+        #  ]
+        #}, 'target_arch=="arm" or target_arch=="arm64" or target_arch=="aarch64"', {
+        #  'dependencies': [
+        #    'armv8_c_lib',
+        #  ],
+        #}],
+        #[ 'disable_arm32_neon==0 and target_arch=="arm"', {
+        #  'dependencies': [
+        #    'gcm-aes-arm32-neon_c_lib',
+        #  ],
+        #}],
+        [ 'target_arch=="arm"', {
           'defines!': [
             'NSS_DISABLE_ARM32_NEON',
           ],
index c2cc18d91a5ef93a8a592f49c3370dac5d76cd7c..6c6a6c9286bca8599bead6ecfe78e93a443d0134 100644 (file)
@@ -25,7 +25,7 @@
 #elif defined(__arm__) && defined(IS_LITTLE_ENDIAN) && \
     !defined(NSS_DISABLE_ARM32_NEON)
 /* We don't test on big endian platform, so disable this on big endian. */
-#define USE_ARM_GCM
+//#define USE_ARM_GCM
 #endif
 
 /* Forward declarations */
index 449557cbe5f89c237f4d3a40bf0d89c4e347bba4..bc989c77390970aa5b71428d125d7e435bd1f9c0 100644 (file)
 #include "gcm.h"
 #include "mpi.h"
 
-#if !defined(IS_LITTLE_ENDIAN) && !defined(NSS_X86_OR_X64)
+//#if !defined(IS_LITTLE_ENDIAN) && !defined(NSS_X86_OR_X64)
 // not test yet on big endian platform of arm
 #undef USE_HW_AES
-#endif
+//#endif
 
 #ifdef USE_HW_AES
 #ifdef NSS_X86_OR_X64