aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Fabrice Fontaine <fontaine.fabrice@gmail.com>2018-06-04 19:09:26 +0200
committerGravatar Peter Korsgaard <peter@korsgaard.com>2018-11-25 23:40:57 +0100
commitb12d8ac04980c8352af7167d691c0d0bf2b4dab0 (patch)
treeefc51378962dbe2c08747df3bbd035a7ccd5a7f8
parent9d6fa812119b0649446bfdaee7ff54c3f0259b09 (diff)
downloadbuildroot-b12d8ac04980c8352af7167d691c0d0bf2b4dab0.tar.gz
buildroot-b12d8ac04980c8352af7167d691c0d0bf2b4dab0.tar.bz2
libnss: fix build without int128
Patch retrieved from upstream, more info here: https://bugzilla.mozilla.org/show_bug.cgi?format=default&id=1459739 Fixes: - http://autobuild.buildroot.net/results/093113829d7ce19d578a920e76caa10822774139 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> (cherry picked from commit 46706ced359300b2cad65d630e8485c9f8136645) Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
-rw-r--r--package/libnss/0003-Bug-1432455-Build-FStar-c-when-not-building-with-int128-support.patch143
1 files changed, 143 insertions, 0 deletions
diff --git a/package/libnss/0003-Bug-1432455-Build-FStar-c-when-not-building-with-int128-support.patch b/package/libnss/0003-Bug-1432455-Build-FStar-c-when-not-building-with-int128-support.patch
new file mode 100644
index 0000000000..1216429696
--- /dev/null
+++ b/package/libnss/0003-Bug-1432455-Build-FStar-c-when-not-building-with-int128-support.patch
@@ -0,0 +1,143 @@
+
+# HG changeset patch
+# User Mike Hommey <mh@glandium.org>
+# Date 1527430800 -7200
+# Node ID 3d3e34bb75172462c7b4bbe7bd5e3e47ed65e464
+# Parent 8e600e2af5bf0c29e88f928471e6aba1a734d05b
+Bug 1432455 - Build FStar.c when not building with int128 support. r=fkiefer
+
+Patch retrieved and slightly updated (to add nss path) from:
+https://hg.mozilla.org/projects/nss/rev/3d3e34bb75172462c7b4bbe7bd5e3e47ed65e464
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+
+diff --git a/nss/lib/freebl/Makefile b/nss/lib/freebl/Makefile
+--- a/nss/lib/freebl/Makefile
++++ b/nss/lib/freebl/Makefile
+@@ -530,22 +530,26 @@ ifndef NSS_DISABLE_CHACHAPOLY
+ VERIFIED_SRCS += Hacl_Chacha20.c
+ VERIFIED_SRCS += Hacl_Chacha20_Vec128.c
+ endif # NSS_DISABLE_CHACHAPOLY
+
+ ifeq (,$(filter-out i386 x386 x86 x86_64 aarch64,$(CPU_ARCH)))
+ # All intel architectures get the 64 bit version
+ # With custom uint128 if necessary (faster than generic 32 bit version).
+ ECL_SRCS += curve25519_64.c
+- VERIFIED_SRCS += Hacl_Curve25519.c FStar.c
++ VERIFIED_SRCS += Hacl_Curve25519.c
+ else
+ # All non intel architectures get the generic 32 bit implementation (slow!)
+ ECL_SRCS += curve25519_32.c
+ endif
+
++ifndef HAVE_INT128_SUPPORT
++ VERIFIED_SRCS += FStar.c
++endif
++
+ #######################################################################
+ # (5) Execute "global" rules. (OPTIONAL) #
+ #######################################################################
+
+ include $(CORE_DEPTH)/coreconf/rules.mk
+
+ #######################################################################
+ # (6) Execute "component" rules. (OPTIONAL) #
+diff --git a/nss/lib/freebl/freebl.gyp b/nss/lib/freebl/freebl.gyp
+--- a/nss/lib/freebl/freebl.gyp
++++ b/nss/lib/freebl/freebl.gyp
+@@ -272,28 +272,20 @@
+ },
+ }],
+ [ 'cc_use_gnu_ld==1 and OS=="win" and target_arch=="x64"', {
+ # mingw x64
+ 'defines': [
+ 'MP_IS_LITTLE_ENDIAN',
+ ],
+ }],
+- [ 'OS!="win"', {
+- 'conditions': [
+- [ 'target_arch=="x64" or target_arch=="arm64" or target_arch=="aarch64"', {
+- 'defines': [
+- # The Makefile does version-tests on GCC, but we're not doing that here.
+- 'HAVE_INT128_SUPPORT',
+- ],
+- }, {
+- 'defines': [
+- 'KRML_NOUINT128',
+- ],
+- }],
++ [ 'have_int128_support==1', {
++ 'defines': [
++ # The Makefile does version-tests on GCC, but we're not doing that here.
++ 'HAVE_INT128_SUPPORT',
+ ],
+ }, {
+ 'defines': [
+ 'KRML_NOUINT128',
+ ],
+ }],
+ [ 'OS=="linux"', {
+ 'defines': [
+@@ -345,10 +337,23 @@
+ ],
+ }],
+ ],
+ }],
+ ],
+ },
+ 'variables': {
+ 'module': 'nss',
++ 'conditions': [
++ [ 'OS!="win"', {
++ 'conditions': [
++ [ 'target_arch=="x64" or target_arch=="arm64" or target_arch=="aarch64"', {
++ 'have_int128_support%': 1,
++ }, {
++ 'have_int128_support%': 0,
++ }],
++ ],
++ }, {
++ 'have_int128_support%': 0,
++ }],
++ ],
+ }
+ }
+diff --git a/nss/lib/freebl/freebl_base.gypi b/nss/lib/freebl/freebl_base.gypi
+--- a/nss/lib/freebl/freebl_base.gypi
++++ b/nss/lib/freebl/freebl_base.gypi
+@@ -55,17 +55,16 @@
+ 'rsa.c',
+ 'rsapkcs.c',
+ 'seed.c',
+ 'sha512.c',
+ 'sha_fast.c',
+ 'shvfy.c',
+ 'sysrand.c',
+ 'tlsprfalg.c',
+- 'verified/FStar.c',
+ ],
+ 'conditions': [
+ [ 'OS=="linux" or OS=="android"', {
+ 'conditions': [
+ [ 'target_arch=="x64"', {
+ 'sources': [
+ 'arcfour-amd64-gas.s',
+ 'intel-aes.s',
+@@ -215,13 +214,16 @@
+ 'MP_USE_UINT_DIGIT',
+ 'MP_ASSEMBLY_MULTIPLY',
+ 'MP_ASSEMBLY_SQUARE',
+ 'MP_ASSEMBLY_DIV_2DX1D',
+ ],
+ }],
+ ],
+ }],
++ [ 'have_int128_support==0', {
++ 'sources': [ 'verified/FStar.c' ],
++ }],
+ ],
+ 'ldflags': [
+ '-Wl,-Bsymbolic'
+ ],
+ }
+