Bug 1018375 - part 4 - use a linker script for libnss3 on Linux-like OSes; r=glandium

This commit is contained in:
Nathan Froyd 2014-05-30 14:34:54 -04:00
parent 7b6f38d2db
commit 9e632a1ea1
3 changed files with 36 additions and 1 deletions

View File

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

View File

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

View File

@ -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_*