]> git.pld-linux.org Git - packages/nss.git/blob - disable-hacl-curve25519.patch
disable hacl curve25519_64 entirely as it's broken on so many levels; rel 2
[packages/nss.git] / disable-hacl-curve25519.patch
1
2 # HG changeset patch
3 # User Natalia Kulatova <nkulatova@mozilla.com>
4 # Date 1685981398 0
5 # Node ID 52a5d8fe37410d940e7d3ca244146ebc46a7d52a
6 # Parent  52969cff7db635e0ee10fad66eed2c0cfdcf999b
7 Bug 1836781 - Disabling ASM C25519 for A but X86_64 r=bbeurdouche,nss-reviewers
8
9 Differential Revision: https://phabricator.services.mozilla.com/D179969
10
11 diff --git a/lib/freebl/Makefile b/lib/freebl/Makefile
12 --- a/lib/freebl/Makefile
13 +++ b/lib/freebl/Makefile
14 @@ -563,17 +563,19 @@ endif # target == SunO
15  ifdef USE_64
16  # no __int128 at least up to lcc 1.23 (pretending to be gcc5)
17  # NB: CC_NAME is not defined here
18  ifneq ($(shell $(CC) -? 2>&1 >/dev/null </dev/null | sed -e 's/:.*//;1q'),lcc)
19      ifdef CC_IS_CLANG
20              HAVE_INT128_SUPPORT = 1
21              DEFINES += -DHAVE_INT128_SUPPORT
22      else ifeq (1,$(CC_IS_GCC))
23 -        SUPPORTS_VALE_CURVE25519 = 1
24 +        ifeq ($(CPU_ARCH),x86_64)
25 +            SUPPORTS_VALE_CURVE25519 = 1
26 +        endif
27          ifneq (,$(filter 4.6 4.7 4.8 4.9,$(word 1,$(GCC_VERSION)).$(word 2,$(GCC_VERSION))))
28              HAVE_INT128_SUPPORT = 1
29              DEFINES += -DHAVE_INT128_SUPPORT
30          endif
31          ifneq (,$(filter 0 1 2 3 4,$(word 1,$(GCC_VERSION))))
32              NSS_DISABLE_AVX2 = 1
33          endif
34          ifeq (,$(filter 0 1 2 3 4,$(word 1,$(GCC_VERSION))))
35
36 diff --git a/lib/freebl/Makefile b/lib/freebl/Makefile
37 --- a/lib/freebl/Makefile
38 +++ b/lib/freebl/Makefile
39 @@ -566,13 +566,10 @@
40  ifneq ($(shell $(CC) -? 2>&1 >/dev/null </dev/null | sed -e 's/:.*//;1q'),lcc)
41      ifdef CC_IS_CLANG
42              HAVE_INT128_SUPPORT = 1
43              DEFINES += -DHAVE_INT128_SUPPORT
44      else ifeq (1,$(CC_IS_GCC))
45 -        ifeq ($(CPU_ARCH),x86_64)
46 -            SUPPORTS_VALE_CURVE25519 = 1
47 -        endif
48          ifneq (,$(filter 4.6 4.7 4.8 4.9,$(word 1,$(GCC_VERSION)).$(word 2,$(GCC_VERSION))))
49              HAVE_INT128_SUPPORT = 1
50              DEFINES += -DHAVE_INT128_SUPPORT
51          endif
52          ifneq (,$(filter 0 1 2 3 4,$(word 1,$(GCC_VERSION))))
53 @@ -593,15 +590,10 @@
54  
55  ifndef HAVE_INT128_SUPPORT
56      DEFINES += -DKRML_VERIFIED_UINT128
57  endif
58  
59 -ifdef SUPPORTS_VALE_CURVE25519
60 -    VERIFIED_SRCS += Hacl_Curve25519_64.c
61 -    DEFINES += -DHACL_CAN_COMPILE_INLINE_ASM
62 -endif
63 -
64  ifndef NSS_DISABLE_CHACHAPOLY
65      ifeq ($(CPU_ARCH),x86_64)
66          ifndef NSS_DISABLE_AVX2
67              EXTRA_SRCS += Hacl_Poly1305_256.c Hacl_Chacha20_Vec256.c Hacl_Chacha20Poly1305_256.c
68              DEFINES += -DHACL_CAN_COMPILE_VEC256
69 diff --git a/lib/freebl/freebl.gyp b/lib/freebl/freebl.gyp
70 --- a/lib/freebl/freebl.gyp
71 +++ b/lib/freebl/freebl.gyp
72 @@ -864,16 +864,10 @@
73                'PPC_GCM',
74              ],
75            }],
76          ],
77        }],
78 -      [ 'supports_vale_curve25519==1', {
79 -        'defines': [
80 -          # The Makefile does version-tests on GCC, but we're not doing that here.
81 -          'HACL_CAN_COMPILE_INLINE_ASM',
82 -        ],
83 -      }],
84        [ 'OS=="linux" or OS=="android"', {
85          'conditions': [
86            [ 'target_arch=="x64"', {
87              'defines': [
88                'MP_IS_LITTLE_ENDIAN',
89 @@ -932,15 +926,10 @@
90      ],
91    },
92    'variables': {
93      'module': 'nss',
94      'conditions': [
95 -      [ 'target_arch=="x64" and cc_is_gcc==1', {
96 -        'supports_vale_curve25519%': 1,
97 -      }, {
98 -        'supports_vale_curve25519%': 0,
99 -      }],
100        [ 'target_arch=="x64" or target_arch=="arm64" or target_arch=="aarch64"', {
101          'have_int128_support%': 1,
102        }, {
103          'have_int128_support%': 0,
104        }],
105 diff --git a/lib/freebl/freebl_base.gypi b/lib/freebl/freebl_base.gypi
106 --- a/lib/freebl/freebl_base.gypi
107 +++ b/lib/freebl/freebl_base.gypi
108 @@ -149,15 +149,10 @@
109        'sources': [
110          # All other architectures get the generic 32 bit implementation.
111          'ecl/curve25519_32.c',
112        ],
113      }],
114 -    ['supports_vale_curve25519==1', {
115 -      'sources': [
116 -        'verified/Hacl_Curve25519_64.c',
117 -      ],
118 -    }],
119      ['(target_arch!="ppc64" and target_arch!="ppc64le") or disable_altivec==1', {
120        'sources': [
121          # Gyp does not support per-file cflags, so working around like this.
122          # ppc performance greatly benefits from specific flags.
123          'sha512.c',
124
This page took 0.045111 seconds and 3 git commands to generate.