From 0ae0110c30d33a3b2b2e56c657bc0f7aa85bf001 Mon Sep 17 00:00:00 2001 From: Ian Stakenvicius Date: Thu, 25 Apr 2013 15:35:40 -0700 Subject: [PATCH] Bug 809430 - Add symbol versions. r=glandium --- js/src/Makefile.in | 12 ++++++++++++ js/src/symverscript.in | 4 ++++ toolkit/library/Makefile.in | 7 +++++++ toolkit/library/symverscript.in | 4 ++++ 4 files changed, 27 insertions(+) create mode 100644 js/src/symverscript.in create mode 100644 toolkit/library/symverscript.in diff --git a/js/src/Makefile.in b/js/src/Makefile.in index 38ef8a2a2606..fe7a2619c767 100644 --- a/js/src/Makefile.in +++ b/js/src/Makefile.in @@ -530,6 +530,18 @@ config/nsinstall$(HOST_BIN_SUFFIX): $(srcdir)/config/nsinstall.c $(srcdir)/confi $(MAKE) -C config/ nsinstall$(HOST_BIN_SUFFIX) endif +# Ensure symbol versions of shared library on Linux do not conflict +# with those in libxul. +ifeq (Linux,$(OS_TARGET)) +EXTRA_DSO_LDOPTS += -Wl,-version-script,symverscript + +symverscript: symverscript.in + $(PYTHON) $(topsrcdir)/config/Preprocessor.py \ + -DVERSION="$(subst -,_,$(LIBRARY_NAME))" $< > $@ + +EXTRA_DEPS += symverscript +endif + include $(topsrcdir)/config/rules.mk ifdef JS_HAS_CTYPES diff --git a/js/src/symverscript.in b/js/src/symverscript.in new file mode 100644 index 000000000000..ef70826ad4e6 --- /dev/null +++ b/js/src/symverscript.in @@ -0,0 +1,4 @@ +#filter substitution +@VERSION@ { + global: *; +}; diff --git a/toolkit/library/Makefile.in b/toolkit/library/Makefile.in index e961884e5093..52db9a6b0ead 100644 --- a/toolkit/library/Makefile.in +++ b/toolkit/library/Makefile.in @@ -129,6 +129,13 @@ endif ifeq (Linux,$(OS_ARCH)) ifneq (Android,$(OS_TARGET)) OS_LIBS += -lrt +EXTRA_DSO_LDOPTS += -Wl,-version-script,symverscript + +symverscript: symverscript.in + $(PYTHON) $(topsrcdir)/config/Preprocessor.py \ + -DVERSION="$(LIBRARY_NAME)$(MOZILLA_VERSION)" $< > $@ + +EXTRA_DEPS += symverscript endif endif diff --git a/toolkit/library/symverscript.in b/toolkit/library/symverscript.in new file mode 100644 index 000000000000..ef70826ad4e6 --- /dev/null +++ b/toolkit/library/symverscript.in @@ -0,0 +1,4 @@ +#filter substitution +@VERSION@ { + global: *; +};