From 02db64a6923b4eebff79db6378407a14660efcaf Mon Sep 17 00:00:00 2001 From: Tom Ritter Date: Thu, 11 May 2017 15:50:34 -0500 Subject: [PATCH] Bug 1350362 - Support building NSS in Firefox with MinGW on Linux, r=franziskus --HG-- extra : amend_source : 5221cada253c3a1b84595f4920520a18c739a999 --- coreconf/config.gypi | 2 +- lib/freebl/freebl.gyp | 12 ++++++++++++ lib/freebl/freebl_base.gypi | 5 +++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/coreconf/config.gypi b/coreconf/config.gypi index da5a483050..0fd31ec678 100644 --- a/coreconf/config.gypi +++ b/coreconf/config.gypi @@ -218,7 +218,7 @@ '-Wl,--version-script,<(INTERMEDIATE_DIR)/out.>(mapfile)', ], }], - [ 'OS=="win"', { + [ 'cc_use_gnu_ld!=1 and OS=="win"', { # On Windows, .def files are used directly as sources. 'sources': [ '>(mapfile)', diff --git a/lib/freebl/freebl.gyp b/lib/freebl/freebl.gyp index e83d6ec837..f75474252b 100644 --- a/lib/freebl/freebl.gyp +++ b/lib/freebl/freebl.gyp @@ -174,6 +174,7 @@ 'VCCLCompilerTool': { #TODO: -Ox optimize flags 'PreprocessorDefinitions': [ + # Should be copied to mingw defines below 'MP_IS_LITTLE_ENDIAN', 'NSS_BEVAND_ARCFOUR', 'MPI_AMD64', @@ -185,6 +186,17 @@ }, }, }], + [ 'cc_use_gnu_ld==1 and OS=="win" and target_arch=="x64"', { + 'defines': [ + 'MP_IS_LITTLE_ENDIAN', + 'NSS_BEVAND_ARCFOUR', + 'MPI_AMD64', + 'MP_ASSEMBLY_MULTIPLY', + 'NSS_USE_COMBA', + 'USE_HW_AES', + 'INTEL_GCM', + ], + }], [ 'OS!="win"', { 'conditions': [ [ 'target_arch=="x64" or target_arch=="arm64" or target_arch=="aarch64"', { diff --git a/lib/freebl/freebl_base.gypi b/lib/freebl/freebl_base.gypi index bf7dd56ac0..027aa2702c 100644 --- a/lib/freebl/freebl_base.gypi +++ b/lib/freebl/freebl_base.gypi @@ -106,7 +106,7 @@ 'advapi32.lib', ], 'conditions': [ - [ 'target_arch=="x64"', { + [ 'cc_use_gnu_ld!=1 and target_arch=="x64"', { 'sources': [ 'arcfour-amd64-masm.asm', 'mpi/mpi_amd64.c', @@ -115,7 +115,8 @@ 'intel-aes-x64-masm.asm', 'intel-gcm-x64-masm.asm', ], - }, { + }], + [ 'cc_use_gnu_ld!=1 and target_arch!="x64"', { # not x64 'sources': [ 'mpi/mpi_x86_asm.c',