nss: update to 3.44.1, with vc2013 fix and gyp fix

This commit is contained in:
Roy Tam 2019-06-24 21:44:17 +08:00
commit d4b834111b
553 changed files with 1515569 additions and 1130 deletions

View file

@ -135,6 +135,10 @@ ifeq ($(KERNEL),Linux)
endif
OS_LIBS = $(OS_PTHREAD) -ldl -lc
ifeq ($(OS_TARGET),Android)
OS_LIBS += -llog
endif
ifdef USE_PTHREADS
DEFINES += -D_REENTRANT
endif

View file

@ -5,17 +5,18 @@ import subprocess
import sys
def main():
if sys.platform == 'win32':
if sys.platform == 'win32' or len(sys.argv) < 2:
print(0)
else:
cc = os.environ.get('CC', 'cc')
try:
cc_is_clang = 'clang' in subprocess.check_output(
cc_is_arg = sys.argv[1] in subprocess.check_output(
[cc, '--version'], universal_newlines=True)
except OSError:
# We probably just don't have CC/cc.
cc_is_clang = False
print(int(cc_is_clang))
cc_is_arg = False
print(int(cc_is_arg))
if __name__ == '__main__':
main()

View file

@ -19,6 +19,8 @@
'conditions': [
['OS=="android"', {
'target_arch%': 'arm',
}, 'OS=="ios"', {
'target_arch%': 'arm64',
}, {
# Default architecture we're building for is the architecture we're
# building on.
@ -35,7 +37,7 @@
},{
'use_system_sqlite%': 0,
}],
['OS=="mac" or OS=="win"', {
['OS=="mac" or OS=="ios" or OS=="win"', {
'cc_use_gnu_ld%': 0,
}, {
'cc_use_gnu_ld%': 1,
@ -54,7 +56,7 @@
'zlib_libs%': ['-lz'],
'dll_prefix': 'lib',
'conditions': [
['OS=="mac"', {
['OS=="mac" or OS=="ios"', {
'moz_debug_flags%': '-gdwarf-2 -gfull',
'dll_suffix': 'dylib',
}, {
@ -64,10 +66,15 @@
],
}],
['"<(GENERATOR)"=="ninja"', {
'cc_is_clang%': '<!(<(python) <(DEPTH)/coreconf/check_cc_clang.py)',
'cc_is_clang%': '<!(<(python) <(DEPTH)/coreconf/check_cc.py clang)',
}, {
'cc_is_clang%': '0',
}],
['"<(GENERATOR)"=="ninja"', {
'cc_is_gcc%': '<!(<(python) <(DEPTH)/coreconf/check_cc.py gcc)',
}, {
'cc_is_gcc%': '0',
}],
],
},
# Copy conditionally-set variables out one scope.
@ -86,6 +93,7 @@
'dll_suffix': '<(dll_suffix)',
'freebl_name': '<(freebl_name)',
'cc_is_clang%': '<(cc_is_clang)',
'cc_is_gcc%': '<(cc_is_gcc)',
'cc_use_gnu_ld%': '<(cc_use_gnu_ld)',
# Some defaults
'disable_tests%': 0,
@ -99,6 +107,7 @@
'moz_folded_library_name%': '',
'sanitizer_flags%': 0,
'test_build%': 0,
'static_libs%': 0,
'no_zdefs%': 0,
'fuzz%': 0,
'fuzz_tls%': 0,
@ -122,6 +131,7 @@
'variables': {
'mapfile%': '',
'test_build%': 0,
'static_libs%': 0,
'debug_optimization_level%': '0',
'release_optimization_level%': '2',
},
@ -142,7 +152,12 @@
'NSS_NO_INIT_SUPPORT',
],
}],
[ 'OS!="android" and OS!="mac" and OS!="win"', {
[ 'static_libs==1', {
'variables': {
'standalone_static_library': '1',
},
}],
[ 'OS!="android" and OS!="mac" and OS!="ios" and OS!="win"', {
'libraries': [
'-lpthread',
],
@ -153,6 +168,11 @@
'-lc',
],
}],
[ 'OS=="android"', {
'libraries': [
'-llog',
],
}],
[ 'fuzz==1', {
'variables': {
'debug_optimization_level%': '1',
@ -257,7 +277,7 @@
}],
}]
],
}, 'test_build==1 and _type=="shared_library"', {
}, 'static_libs==1 and _type=="shared_library"', {
# When linking a shared lib against a static one, XCode doesn't
# export the latter's symbols by default. -all_load fixes that.
'xcode_settings': {
@ -355,7 +375,7 @@
'OPENBSD',
],
}],
['OS=="mac" or OS=="dragonfly" or OS=="freebsd" or OS=="netbsd" or OS=="openbsd"', {
['OS=="mac" or OS=="ios" or OS=="dragonfly" or OS=="freebsd" or OS=="netbsd" or OS=="openbsd"', {
'defines': [
'HAVE_BSD_FLOCK',
],
@ -367,7 +387,7 @@
'_REENTRANT',
],
}],
[ 'OS!="mac" and OS!="win"', {
[ 'OS!="mac" and OS!="ios" and OS!="win"', {
'cflags': [
'-fPIC',
'-pipe',
@ -393,7 +413,7 @@
}],
[ 'use_pprof==1 and OS!="android" and OS!="win"', {
'conditions': [
[ 'OS=="mac"', {
[ 'OS=="mac" or OS=="ios"', {
'xcode_settings': {
'OTHER_LDFLAGS': [ '-lprofiler' ],
},
@ -453,7 +473,7 @@
'ANDROID',
],
}],
[ 'OS=="mac"', {
[ 'OS=="mac" or OS=="ios"', {
'defines': [
'DARWIN',
],
@ -468,8 +488,18 @@
'ARCHS': ['x86_64'],
},
}],
[ 'target_arch=="arm64"', {
'xcode_settings': {
'ARCHS': ['arm64'],
},
}],
],
}],
[ 'OS=="ios"', {
'xcode_settings': {
'IPHONEOS_DEPLOYMENT_TARGET': '<(iphone_deployment_target)',
},
}],
[ 'OS=="win"', {
'defines': [
'_WINDOWS',
@ -537,7 +567,7 @@
'Debug': {
'inherit_from': ['Common'],
'conditions': [
[ 'OS!="mac" and OS!="win"', {
[ 'OS!="mac" and OS!="ios" and OS!="win"', {
'cflags': [
'-g',
'<(moz_debug_flags)',
@ -607,7 +637,7 @@
'process_map_file': ['/bin/sh', '-c', '/usr/bin/env grep -v ";-" >(mapfile) | sed -e "s,;+,," -e "s; DATA ;;" -e "s,;;,," -e "s,;.*,;," > >@(_outputs)'],
},
}],
[ 'OS=="mac"', {
[ 'OS=="mac" or OS=="ios"', {
'variables': {
'process_map_file': ['/bin/sh', '-c', '/usr/bin/grep -v ";+" >(mapfile) | grep -v ";-" | sed -e "s; DATA ;;" -e "s,;;,," -e "s,;.*,," -e "s,^,_," > >@(_outputs)'],
},

View file

@ -14,7 +14,7 @@ if [ -z "$CC" ]; then
export CXX=clang++
fi
gyp_params+=(-Dtest_build=1 -Dfuzz=1 -Dsign_libs=0)
gyp_params+=(-Dtest_build=1 -Dstatic_libs=1 -Dfuzz=1 -Dsign_libs=0)
# Add debug symbols even for opt builds.
nspr_params+=(--enable-debug-symbols)