Bug 1152625 - Add gyp flag for disabling ARM HW AES r=jcj
authorKevin Jacobs <kjacobs@mozilla.com>
Fri, 11 Oct 2019 19:33:06 +0000
changeset 15332 9abcea09fdd4b252e7774d450c2f9a622f38f1ad
parent 15331 1b0f5c5335ee7480e5856ae3890b0463e4882b95
child 15333 93245f5733b3a042604e3021c0233ea8bfb6e3b9
push id3529
push userjjones@mozilla.com
push dateFri, 11 Oct 2019 19:34:03 +0000
reviewersjcj
bugs1152625
Bug 1152625 - Add gyp flag for disabling ARM HW AES r=jcj Adds an option to disable ARMv8 HW AES, if `-Ddisable_arm_hw_aes=1` is passed to build.sh. Depends on D34473 Differential Revision: https://phabricator.services.mozilla.com/D44018
coreconf/config.gypi
lib/freebl/freebl.gyp
--- a/coreconf/config.gypi
+++ b/coreconf/config.gypi
@@ -91,16 +91,17 @@
     'sqlite_libs%': ['-lsqlite3'],
     'dll_prefix': '<(dll_prefix)',
     'dll_suffix': '<(dll_suffix)',
     'freebl_name': '<(freebl_name)',
     'cc_is_clang%': '<(cc_is_clang)',
     'cc_is_gcc%': '<(cc_is_gcc)',
     'cc_use_gnu_ld%': '<(cc_use_gnu_ld)',
     # Some defaults
+    'disable_arm_hw_aes%': 0,
     'disable_tests%': 0,
     'disable_chachapoly%': 0,
     'disable_dbm%': 0,
     'disable_libpkix%': 1,
     'disable_werror%': 0,
     'mozilla_client%': 0,
     'comm_client%': 0,
     'moz_fold_libs%': 0,
--- a/lib/freebl/freebl.gyp
+++ b/lib/freebl/freebl.gyp
@@ -184,17 +184,17 @@
         '<(DEPTH)/exports.gyp:nss_exports',
         'hw-acc-crypto',
       ],
       '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"', {
+        }, 'disable_arm_hw_aes==0 and (target_arch=="arm" or target_arch=="arm64" or target_arch=="aarch64")', {
           'dependencies': [
             'armv8_c_lib'
           ],
         }],
         [ 'target_arch=="arm64" or target_arch=="aarch64"', {
           'dependencies': [
             'gcm-aes-aarch64_c_lib',
           ],
@@ -461,20 +461,19 @@
           }],
           [ 'target_arch=="arm"', {
             'defines': [
               'MP_ASSEMBLY_MULTIPLY',
               'MP_ASSEMBLY_SQUARE',
               'MP_USE_UINT_DIGIT',
               'SHA_NO_LONG_LONG',
               'ARMHF',
-              'USE_HW_AES',
             ],
           }],
-          [ 'target_arch=="arm64" or target_arch=="aarch64"', {
+          [ 'disable_arm_hw_aes==0 and (target_arch=="arm" or target_arch=="arm64" or target_arch=="aarch64")', {
             'defines': [
               'USE_HW_AES',
             ],
           }],
         ],
       }],
     ],
   },