diff --git a/security/build/Makefile.in b/security/build/Makefile.in index 4be03a8c991..a764de160c6 100644 --- a/security/build/Makefile.in +++ b/security/build/Makefile.in @@ -353,7 +353,22 @@ nss3.def: $(nss_def_files) $(DEPTH)/db/sqlite3/src/sqlite-processed.def echo EXPORTS >> $@.tmp grep -v -h -e ^LIBRARY -e ^EXPORTS -e ^\; $^ >> $@.tmp mv $@.tmp $@ -endif +else +ifdef GCC_USE_GNU_LD +sqlite_def_file := $(topsrcdir)/db/sqlite3/src/sqlite.def +nspr_def_file := $(srcdir)/nspr-dummy.def + +nss3.def: $(nss_def_files) $(sqlite_def_file) $(nspr_def_file) + @$(call py_action,convert_def_file, \ + $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) -o $@ \ + $(addprefix --nss-file=,$(nss_def_files)) \ + $(sqlite_def_file) $(nspr_def_file)) + +GARBAGE += \ + nss3.def \ + $(NULL) +endif # GCC_USE_GNU_LD +endif # WINNT ifneq (,$(filter WINNT,$(OS_ARCH))) SDK_LIBRARY = $(IMPORT_LIBRARY) diff --git a/security/build/moz.build b/security/build/moz.build index 99fe8d6de1e..da294e02624 100644 --- a/security/build/moz.build +++ b/security/build/moz.build @@ -12,3 +12,8 @@ if CONFIG['MOZ_FOLD_LIBS']: if CONFIG['OS_TARGET'] == 'WINNT': DEFFILE = 'nss3.def' + +if CONFIG['OS_ARCH'] == 'Linux' and \ + CONFIG['MOZ_FOLD_LIBS'] and \ + CONFIG['GCC_USE_GNU_LD']: + LD_VERSION_SCRIPT = 'nss3.def' diff --git a/security/build/nspr-dummy.def b/security/build/nspr-dummy.def new file mode 100644 index 00000000000..b14fcf82c84 --- /dev/null +++ b/security/build/nspr-dummy.def @@ -0,0 +1,15 @@ +; This Source Code Form is subject to the terms of the Mozilla Public +; License, v. 2.0. If a copy of the MPL was not distributed with this +; file, You can obtain one at http://mozilla.org/MPL/2.0/. +; +; This is a fake .def file, to be used for generating linker scripts +; for our folded libnss when MOZ_FOLD_LIBS. NSPR, unlike NSS, exports +; symbols with symbol visibility (Unix) or __declspec (Windows). When +; using a linker script, however, we need to explicitly specify that +; NSPR's symbols should be globally visible. Otherwise, NSPR's exported +; symbols would match the |local: *| rule and be hidden. +LIBRARY libnsprdummy +EXPORTS +PR_* ; Actual .def files don't allow wildcards, of course. +_PR_* +PL_*