Update NSS to 3.48 while keeping vc2013 hackfix and no-sslkeylogfile intact.

This commit is contained in:
Roy Tam 2020-01-03 13:36:26 +08:00
commit 171849c8e5
351 changed files with 115185 additions and 57946 deletions

View file

@ -21,6 +21,7 @@ ifeq ($(USE_PTHREADS),1)
endif
DEFAULT_COMPILER = gcc
DEFINES += -D_DEFAULT_SOURCE -D_BSD_SOURCE
ifeq ($(OS_TARGET),Android)
ifndef ANDROID_NDK

View file

@ -36,6 +36,11 @@ DSO_CFLAGS = -fPIC -DPIC
DSO_LDOPTS = -shared -fPIC -Wl,-soname,lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
MKSHLIB = $(CC) $(DSO_LDOPTS)
ifdef MAPFILE
MKSHLIB += -Wl,--version-script,$(MAPFILE)
endif
PROCESS_MAP_FILE = grep -v ';-' $< | \
sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
USE_SYSTEM_ZLIB = 1
ZLIB_LIBS = -lz

View file

@ -14,9 +14,7 @@ ifdef BUILD_OPT
DEFINES += -UDEBUG -DNDEBUG
else
OPTIMIZER += -g
USERNAME := $(shell whoami)
USERNAME := $(subst -,_,$(USERNAME))
DEFINES += -DDEBUG -UNDEBUG -DDEBUG_$(USERNAME)
DEFINES += -DDEBUG -UNDEBUG
endif
ifdef BUILD_TREE

View file

@ -104,7 +104,7 @@ endif
DLL_SUFFIX = dll
ifdef NS_USE_GCC
OS_CFLAGS += -mwindows -mms-bitfields
OS_CFLAGS += -mwindows
_GEN_IMPORT_LIB=-Wl,--out-implib,$(IMPORT_LIBRARY)
DLLFLAGS += -mwindows -o $@ -shared -Wl,--export-all-symbols $(if $(IMPORT_LIBRARY),$(_GEN_IMPORT_LIB))
ifdef BUILD_OPT
@ -116,11 +116,7 @@ ifdef NS_USE_GCC
DEFINES += -UDEBUG -DNDEBUG
else
OPTIMIZER += -g
NULLSTRING :=
SPACE := $(NULLSTRING) # end of the line
USERNAME := $(subst $(SPACE),_,$(USERNAME))
USERNAME := $(subst -,_,$(USERNAME))
DEFINES += -DDEBUG -UNDEBUG -DDEBUG_$(USERNAME)
DEFINES += -DDEBUG -UNDEBUG
endif
else # !NS_USE_GCC
WARNING_CFLAGS = -W3 -nologo -D_CRT_SECURE_NO_WARNINGS \
@ -179,10 +175,7 @@ else # !NS_USE_GCC
else
OPTIMIZER += -Zi -Fd$(OBJDIR)/ -Od
NULLSTRING :=
SPACE := $(NULLSTRING) # end of the line
USERNAME := $(subst $(SPACE),_,$(USERNAME))
USERNAME := $(subst -,_,$(USERNAME))
DEFINES += -DDEBUG -UNDEBUG -DDEBUG_$(USERNAME)
DEFINES += -DDEBUG -UNDEBUG
DLLFLAGS += -DEBUG -OUT:$@
LDFLAGS += -DEBUG
ifeq ($(_MSC_VER),$(_MSC_VER_6))
@ -268,6 +261,12 @@ else
endif
endif
# clear any CSTD and CXXSTD unless we're using GCC
ifndef NS_USE_GCC
CSTD =
CXXSTD =
endif
#
# override the definitions of RELEASE_TREE found in tree.mk
#

View file

@ -14,6 +14,8 @@ CCF = $(CC) $(CFLAGS)
LINK_DLL = $(LD) $(OS_DLLFLAGS) $(DLLFLAGS) $(XLDFLAGS)
CFLAGS = $(OPTIMIZER) $(OS_CFLAGS) $(WARNING_CFLAGS) $(XP_DEFINE) \
$(DEFINES) $(INCLUDES) $(XCFLAGS)
CSTD = -std=c99
CXXSTD = -std=c++11
PERL = perl
RANLIB = echo
TAR = /bin/tar

View file

@ -96,6 +96,7 @@
'cc_is_gcc%': '<(cc_is_gcc)',
'cc_use_gnu_ld%': '<(cc_use_gnu_ld)',
# Some defaults
'disable_arm_hw_aes%': 0,
'disable_tests%': 0,
'disable_chachapoly%': 0,
'disable_dbm%': 0,
@ -106,7 +107,6 @@
'moz_fold_libs%': 0,
'moz_folded_library_name%': '',
'sanitizer_flags%': 0,
'test_build%': 0,
'static_libs%': 0,
'no_zdefs%': 0,
'fuzz%': 0,
@ -130,7 +130,6 @@
# This is mostly for linking to libraries.
'variables': {
'mapfile%': '',
'test_build%': 0,
'static_libs%': 0,
'debug_optimization_level%': '0',
'release_optimization_level%': '2',
@ -152,11 +151,6 @@
'NSS_NO_INIT_SUPPORT',
],
}],
[ 'static_libs==1', {
'variables': {
'standalone_static_library': '1',
},
}],
[ 'OS!="android" and OS!="mac" and OS!="ios" and OS!="win"', {
'libraries': [
'-lpthread',
@ -233,7 +227,7 @@
'product_dir': '<(nss_dist_obj_dir)/lib'
}, '_type=="executable"', {
'product_dir': '<(nss_dist_obj_dir)/bin'
}, '_standalone_static_library==1', {
}, 'static_libs==1 or _standalone_static_library==1', {
'product_dir': '<(nss_dist_obj_dir)/lib'
}],
# mapfile handling
@ -324,6 +318,9 @@
},
},
}],
[ '_type=="static_library" and static_libs==1', {
'standalone_static_library': 1,
}],
],
'default_configuration': 'Debug',
'configurations': {
@ -358,6 +355,8 @@
'LINUX2_1',
'LINUX',
'linux',
'_DEFAULT_SOURCE', # for <endian.h> functions, strdup, realpath, and getentropy
'_BSD_SOURCE', # for the above in glibc <= 2.19
],
}],
[ 'OS=="dragonfly" or OS=="freebsd"', {
@ -394,8 +393,11 @@
'-ffunction-sections',
'-fdata-sections',
],
'cflags_c': [
'-std=c99',
],
'cflags_cc': [
'-std=c++0x',
'-std=c++11',
],
'ldflags': [
'-z', 'noexecstack',

View file

@ -10,4 +10,3 @@
*/
#error "Do not include this header file."

View file

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

View file

@ -36,15 +36,30 @@ nspr_build()
extra_params+=(--enable-64bit)
fi
echo "NSPR [1/3] configure ..."
echo "NSPR [1/5] configure ..."
pushd "$nspr_dir" >/dev/null
CFLAGS="$nspr_cflags" CXXFLAGS="$nspr_cxxflags" \
LDFLAGS="$nspr_ldflags" CC="$CC" CXX="$CCC" \
run_verbose ../configure "${extra_params[@]}" "$@"
popd >/dev/null
echo "NSPR [2/3] make ..."
echo "NSPR [2/5] make ..."
run_verbose make -C "$nspr_dir"
echo "NSPR [3/3] install ..."
if [ "$build_nspr_tests" = 1 ]; then
echo "NSPR [3/5] build tests ..."
run_verbose make -C "$nspr_dir/pr/tests"
else
echo "NSPR [3/5] NOT building tests"
fi
if [[ "$build_nspr_tests" = 1 && "$run_nspr_tests" = 1 ]]; then
echo "NSPR [4/5] run tests ..."
run_verbose make -C "$nspr_dir/pr/tests" runtests
else
echo "NSPR [4/5] NOT running tests"
fi
echo "NSPR [5/5] install ..."
run_verbose make -C "$nspr_dir" install
}

View file

@ -391,23 +391,23 @@ core_abspath = '$(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD
$(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.c
@$(MAKE_OBJDIR)
ifdef USE_NT_C_SYNTAX
$(CC) -Fo$@ -c $(CFLAGS) $(call core_abspath,$<)
$(CC) -Fo$@ -c $(CSTD) $(CFLAGS) $(call core_abspath,$<)
else
ifdef NEED_ABSOLUTE_PATH
$(CC) -o $@ -c $(CFLAGS) $(call core_abspath,$<)
$(CC) -o $@ -c $(CSTD) $(CFLAGS) $(call core_abspath,$<)
else
$(CC) -o $@ -c $(CFLAGS) $<
$(CC) -o $@ -c $(CSTD) $(CFLAGS) $<
endif
endif
$(PROG_PREFIX)%$(OBJ_SUFFIX): %.c
ifdef USE_NT_C_SYNTAX
$(CC) -Fo$@ -c $(CFLAGS) $(call core_abspath,$<)
$(CC) -Fo$@ -c $(CSTD) $(CFLAGS) $(call core_abspath,$<)
else
ifdef NEED_ABSOLUTE_PATH
$(CC) -o $@ -c $(CFLAGS) $(call core_abspath,$<)
$(CC) -o $@ -c $(CSTD) $(CFLAGS) $(call core_abspath,$<)
else
$(CC) -o $@ -c $(CFLAGS) $<
$(CC) -o $@ -c $(CSTD) $(CFLAGS) $<
endif
endif
@ -428,12 +428,12 @@ $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.S
$(OBJDIR)/$(PROG_PREFIX)%: %.cpp
@$(MAKE_OBJDIR)
ifdef USE_NT_C_SYNTAX
$(CCC) -Fo$@ -c $(CFLAGS) $(CXXFLAGS) $(call core_abspath,$<)
$(CCC) -Fo$@ -c $(CXXSTD) $(CFLAGS) $(CXXFLAGS) $(call core_abspath,$<)
else
ifdef NEED_ABSOLUTE_PATH
$(CCC) -o $@ -c $(CFLAGS) $(CXXFLAGS) $(call core_abspath,$<)
$(CCC) -o $@ -c $(CXXSTD) $(CFLAGS) $(CXXFLAGS) $(call core_abspath,$<)
else
$(CCC) -o $@ -c $(CFLAGS) $(CXXFLAGS) $<
$(CCC) -o $@ -c $(CXXSTD) $(CFLAGS) $(CXXFLAGS) $<
endif
endif
@ -444,16 +444,16 @@ $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.cc
$(MAKE_OBJDIR)
ifdef STRICT_CPLUSPLUS_SUFFIX
echo "#line 1 \"$<\"" | cat - $< > $(OBJDIR)/t_$*.cc
$(CCC) -o $@ -c $(CFLAGS) $(CXXFLAGS) $(OBJDIR)/t_$*.cc
$(CCC) -o $@ -c $(CXXSTD) $(CFLAGS) $(CXXFLAGS) $(OBJDIR)/t_$*.cc
rm -f $(OBJDIR)/t_$*.cc
else
ifdef USE_NT_C_SYNTAX
$(CCC) -Fo$@ -c $(CFLAGS) $(CXXFLAGS) $(call core_abspath,$<)
$(CCC) -Fo$@ -c $(CXXSTD) $(CFLAGS) $(CXXFLAGS) $(call core_abspath,$<)
else
ifdef NEED_ABSOLUTE_PATH
$(CCC) -o $@ -c $(CFLAGS) $(CXXFLAGS) $(call core_abspath,$<)
$(CCC) -o $@ -c $(CXXSTD) $(CFLAGS) $(CXXFLAGS) $(call core_abspath,$<)
else
$(CCC) -o $@ -c $(CFLAGS) $(CXXFLAGS) $<
$(CCC) -o $@ -c $(CXXSTD) $(CFLAGS) $(CXXFLAGS) $<
endif
endif
endif #STRICT_CPLUSPLUS_SUFFIX
@ -462,16 +462,16 @@ $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.cpp
@$(MAKE_OBJDIR)
ifdef STRICT_CPLUSPLUS_SUFFIX
echo "#line 1 \"$<\"" | cat - $< > $(OBJDIR)/t_$*.cc
$(CCC) -o $@ -c $(CFLAGS) $(CXXFLAGS) $(OBJDIR)/t_$*.cc
$(CCC) -o $@ -c $(CXXSTD) $(CFLAGS) $(CXXFLAGS) $(OBJDIR)/t_$*.cc
rm -f $(OBJDIR)/t_$*.cc
else
ifdef USE_NT_C_SYNTAX
$(CCC) -Fo$@ -c $(CFLAGS) $(CXXFLAGS) $(call core_abspath,$<)
$(CCC) -Fo$@ -c $(CXXSTD) $(CFLAGS) $(CXXFLAGS) $(call core_abspath,$<)
else
ifdef NEED_ABSOLUTE_PATH
$(CCC) -o $@ -c $(CFLAGS) $(CXXFLAGS) $(call core_abspath,$<)
$(CCC) -o $@ -c $(CXXSTD) $(CFLAGS) $(CXXFLAGS) $(call core_abspath,$<)
else
$(CCC) -o $@ -c $(CFLAGS) $(CXXFLAGS) $<
$(CCC) -o $@ -c $(CXXSTD) $(CFLAGS) $(CXXFLAGS) $<
endif
endif
endif #STRICT_CPLUSPLUS_SUFFIX