Bug 809430 - Add symbol-versions to libxul and libmozjs for linux. r=glandium
☠☠ backed out by 3877e6934b56 ☠ ☠
authorIan Stakenvicius <axs@gentoo.org>
Thu, 06 Dec 2012 16:21:02 -0500
changeset 115245 75e0d521bc2b4f96e08b11a3344d8552d74f7638
parent 115244 d5179738abfea901120f4c794ece80e6bcdbb590
child 115246 8a0c82cf76ab86dd24db0b17eafadea2610b9659
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersglandium
bugs809430
milestone20.0a1
Bug 809430 - Add symbol-versions to libxul and libmozjs for linux. r=glandium
js/src/Makefile.in
js/src/symverscript.in
toolkit/library/Makefile.in
toolkit/library/symverscript.in
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -534,16 +534,28 @@ include $(topsrcdir)/config/config.mk
 
 ifeq (,$(MOZ_GLUE_PROGRAM_LDFLAGS))
 # When building standalone, we need to include mfbt sources, and to declare
 # "exported" mfbt symbols on its behalf when we use its headers.
 include $(MFBT_ROOT)/sources.mk
 DEFINES += -DIMPL_MFBT
 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
+
 EXTRA_DSO_LDOPTS += $(NSPR_LIBS)
 
 ifndef BUILD_OPT
 MOCHAFILE	= 1
 endif
 
 # Define keyword generator before rules.mk, see bug 323979 comment 50
 
new file mode 100644
--- /dev/null
+++ b/js/src/symverscript.in
@@ -0,0 +1,5 @@
+#filter substitution
+@VERSION@ {
+	global: *;
+};
+
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -126,16 +126,24 @@ endif #}
 
 ifdef MOZ_IPDL_TESTS
 STATIC_LIBS += ipdlunittest_s
 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="XUL_$(MOZILLA_VERSION)" $< > $@
+
+EXTRA_DEPS += symverscript
+
 endif
 endif
 
 STATIC_LIBS += \
   xpcom_core \
   ucvutil_s \
   chromium_s \
   snappy_s \
new file mode 100644
--- /dev/null
+++ b/toolkit/library/symverscript.in
@@ -0,0 +1,5 @@
+#filter substitution
+@VERSION@ {
+	global: *;
+};
+