update patch-out-neon-in-freebl.patch
authorPeter Michael Green <plugwash@raspbian.org>
Thu, 9 Dec 2021 20:37:14 +0000 (20:37 +0000)
committerPeter Michael Green <plugwash@raspbian.org>
Thu, 9 Dec 2021 20:37:14 +0000 (20:37 +0000)
debian/patches/patch-out-neon-in-freebl.patch

index 94667aaa1cc98507f873a3b7456755eb2591416c..344c13719a6e7b41b169f6f10e94e9ba8a1eb990 100644 (file)
@@ -6,10 +6,12 @@ Subject: Patch out neon in freebl
 
 ---
 
---- thunderbird-78.4.0.orig/security/nss/lib/freebl/Makefile
-+++ thunderbird-78.4.0/security/nss/lib/freebl/Makefile
-@@ -124,9 +124,9 @@ ifeq ($(CPU_ARCH),aarch64)
-     EXTRA_SRCS += aes-armv8.c gcm-aarch64.c
+diff --git a/security/nss/lib/freebl/Makefile b/security/nss/lib/freebl/Makefile
+index 0b8c6f42fa..cc2d8ca694 100644
+--- a/security/nss/lib/freebl/Makefile
++++ b/security/nss/lib/freebl/Makefile
+@@ -153,9 +153,9 @@ ifeq ($(CPU_ARCH),aarch64)
+     endif
  endif
  ifeq ($(CPU_ARCH),arm)
 -ifndef NSS_DISABLE_ARM32_NEON
@@ -19,10 +21,12 @@ Subject: Patch out neon in freebl
 +#    EXTRA_SRCS += gcm-arm32-neon.c
 +#endif
      ifdef CC_IS_CLANG
-         DEFINES += -DUSE_HW_AES
-         EXTRA_SRCS += aes-armv8.c
---- thunderbird-78.4.0.orig/security/nss/lib/freebl/freebl.gyp
-+++ thunderbird-78.4.0/security/nss/lib/freebl/freebl.gyp
+         DEFINES += -DUSE_HW_AES -DUSE_HW_SHA1 -DUSE_HW_SHA2
+         EXTRA_SRCS += aes-armv8.c sha1-armv8.c sha256-armv8.c
+diff --git a/security/nss/lib/freebl/freebl.gyp b/security/nss/lib/freebl/freebl.gyp
+index e7703baf8d..bf30643dbf 100644
+--- a/security/nss/lib/freebl/freebl.gyp
++++ b/security/nss/lib/freebl/freebl.gyp
 @@ -103,13 +103,13 @@
              ],
            },
@@ -65,19 +69,10 @@ Subject: Patch out neon in freebl
          [ 'target_arch=="x64"', {
            'sources': [
              'verified/Hacl_Poly1305_256.c',
-@@ -219,25 +219,25 @@
-         }]
-       ]
-     },
--    {
--      'target_name': 'gcm-aes-arm32-neon_c_lib',
--      'type': 'static_library',
--      'sources': [
--        'gcm-arm32-neon.c'
--      ],
--      'dependencies': [
--        '<(DEPTH)/exports.gyp:nss_exports'
--      ],
+@@ -260,15 +260,15 @@
+       'dependencies': [
+         '<(DEPTH)/exports.gyp:nss_exports'
+       ],
 -      'cflags': [
 -        '-march=armv7',
 -        '-mfpu=neon',
@@ -87,174 +82,22 @@ Subject: Patch out neon in freebl
 -        '-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',
-@@ -324,37 +324,37 @@
-         'FREEBL_NO_DEPEND',
-       ],
++      #'cflags': [
++      #  '-march=armv7',
++      #  '-mfpu=neon',
++      #  '<@(softfp_cflags)',
++      #],
++      #'cflags_mozilla': [
++      #  '-mfpu=neon',
++      #  '<@(softfp_cflags)',
++      #]
      },
--    {
--      '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',
-@@ -380,21 +380,21 @@
-         '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',
-           ],
-@@ -448,21 +448,21 @@
-         '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',
-           ],
---- thunderbird-78.4.0.orig/security/nss/lib/freebl/gcm.c
-+++ thunderbird-78.4.0/security/nss/lib/freebl/gcm.c
+       'target_name': 'gcm-aes-aarch64_c_lib',
+diff --git a/security/nss/lib/freebl/gcm.c b/security/nss/lib/freebl/gcm.c
+index ac461b4885..67b58fdeea 100644
+--- a/security/nss/lib/freebl/gcm.c
++++ b/security/nss/lib/freebl/gcm.c
 @@ -25,7 +25,7 @@
  #elif defined(__arm__) && defined(IS_LITTLE_ENDIAN) && \
      !defined(NSS_DISABLE_ARM32_NEON)
@@ -264,8 +107,10 @@ Subject: Patch out neon in freebl
  #endif
  
  /* Forward declarations */
---- thunderbird-78.4.0.orig/security/nss/lib/freebl/rijndael.c
-+++ thunderbird-78.4.0/security/nss/lib/freebl/rijndael.c
+diff --git a/security/nss/lib/freebl/rijndael.c b/security/nss/lib/freebl/rijndael.c
+index 82b1f419d9..e255787646 100644
+--- a/security/nss/lib/freebl/rijndael.c
++++ b/security/nss/lib/freebl/rijndael.c
 @@ -20,10 +20,10 @@
  #include "gcm.h"
  #include "mpi.h"
@@ -277,5 +122,5 @@ Subject: Patch out neon in freebl
 -#endif
 +//#endif
  
- #ifdef USE_HW_AES
- #ifdef NSS_X86_OR_X64
+ #ifdef __powerpc64__
+ #include "ppc-crypto.h"