Bug 1350362 Fix NSS Build System for MinGW r=ted

MozReview-Commit-ID: 4QROlna5Cvg

--HG--
extra : rebase_source : a13c7080a6ee445bf3d10248305a6eb88405c173
This commit is contained in:
Tom Ritter 2017-05-12 11:39:00 -05:00
Родитель 539791ed1e
Коммит 9d75725eb8
3 изменённых файлов: 16 добавлений и 6 удалений

Просмотреть файл

@ -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)

Просмотреть файл

@ -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]

Просмотреть файл

@ -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',