diff --git a/old-configure.in b/old-configure.in index d112aab6e844..1c6c278d4efd 100644 --- a/old-configure.in +++ b/old-configure.in @@ -942,7 +942,7 @@ case "$target" in # in the same library as dllimport caller. To work around it, we build NSPR # and NSS with -mnop-fun-dllimport flag. The drawback of this solution is that # function thunks need to be generated for cross-DLL calls. - MOZ_FOLD_LIBS_FLAGS=-mnop-fun-dllimport + MOZ_FOLD_LIBS_FLAGS="-mnop-fun-dllimport" else TARGET_COMPILER_ABI=msvc if test "$AS_BIN"; then @@ -5350,7 +5350,7 @@ AC_SUBST(MOZ_DEVTOOLS) AC_SUBST(MOZ_PACKAGE_JSSHELL) AC_SUBST(MOZ_FOLD_LIBS) -AC_SUBST(MOZ_FOLD_LIBS_FLAGS) +AC_SUBST_LIST(MOZ_FOLD_LIBS_FLAGS) AC_SUBST(SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE) AC_SUBST(DMG_TOOL) diff --git a/security/generate_mapfile.py b/security/generate_mapfile.py index 22ae8e2392be..5fcb20cf3b96 100644 --- a/security/generate_mapfile.py +++ b/security/generate_mapfile.py @@ -12,18 +12,23 @@ # The NSS build system processes them using a series of sed replacements, # but the Mozilla build system is already running a Python script to generate # the file so it's simpler to just do the replacement in Python. +# +# One difference between the NSS build system and Mozilla's is that +# Mozilla's supports building on Linux for Windows using MinGW. MinGW +# expects all lines containing ;+ removed and all ;- tokens removed. import buildconfig def main(output, input): is_darwin = buildconfig.substs['OS_ARCH'] == 'Darwin' + is_mingw = "WINNT" == buildconfig.substs['OS_ARCH'] and buildconfig.substs['GCC_USE_GNU_LD'] with open(input, 'rb') as f: for line in f: line = line.rstrip() - # Remove all lines containing ';-' - if ';-' in line: + # On everything except MinGW, remove all lines containing ';-' + if not is_mingw and ';-' in line: continue # On OS X, remove all lines containing ';+' if is_darwin and ';+' in line: @@ -31,14 +36,15 @@ def main(output, input): # Remove the string ' DATA '. line = line.replace(' DATA ', '') # Remove the string ';+' - line = line.replace(';+', '') + if not is_mingw: + line = line.replace(';+', '') # Remove the string ';;' line = line.replace(';;', '') # If a ';' is present, remove everything after it, # and on OS X, remove it as well. i = line.find(';') if i != -1: - if is_darwin: + if is_darwin or is_mingw: line = line[:i] else: line = line[:i+1] diff --git a/security/moz.build b/security/moz.build index d30379dbcaf0..b0d84807f25c 100644 --- a/security/moz.build +++ b/security/moz.build @@ -93,6 +93,8 @@ else: # anyway. if CONFIG['CLANG_CXX'] or CONFIG['CLANG_CL']: gyp_vars['cc_is_clang'] = 1 + if CONFIG['GCC_USE_GNU_LD']: + gyp_vars['cc_use_gnu_ld'] = 1 GYP_DIRS += ['nss'] GYP_DIRS['nss'].input = 'nss/nss.gyp' @@ -113,6 +115,8 @@ else: if CONFIG['CPU_ARCH'] == 'x86': # This should really be the default. sandbox_vars['ASFLAGS'] = ['-safeseh'] + if CONFIG['MOZ_FOLD_LIBS_FLAGS']: + sandbox_vars['CFLAGS'] = CONFIG['MOZ_FOLD_LIBS_FLAGS'] if CONFIG['OS_TARGET'] == 'Android': sandbox_vars['CFLAGS'] = [ '-include', TOPSRCDIR + '/security/manager/android_stub.h',