From a1351056d0330cb25facfa8a2bf2bce7f7941fdd Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Fri, 30 May 2014 14:12:20 -0400 Subject: [PATCH] Bug 1018375 - part 1 - add LD_VERSION_SCRIPT build variable; r=glandium --- config/config.mk | 1 + config/rules.mk | 4 ++++ python/mozbuild/mozbuild/frontend/emitter.py | 1 + python/mozbuild/mozbuild/frontend/sandbox_symbols.py | 6 ++++++ 4 files changed, 12 insertions(+) diff --git a/config/config.mk b/config/config.mk index a9fa56a95f2c..be861dc7470a 100644 --- a/config/config.mk +++ b/config/config.mk @@ -54,6 +54,7 @@ _MOZBUILD_EXTERNAL_VARIABLES := \ JAR_MANIFEST \ JAVA_JAR_TARGETS \ JS_MODULES_PATH \ + LD_VERSION_SCRIPT \ LIBRARY_NAME \ MODULE \ MSVC_ENABLE_PGO \ diff --git a/config/rules.mk b/config/rules.mk index c9cb9f2a0fe6..b7503a84122a 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -510,6 +510,10 @@ ifeq ($(OS_ARCH),Linux) ifdef IS_COMPONENT EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic endif +ifdef LD_VERSION_SCRIPT +EXTRA_DSO_LDOPTS += -Wl,--version-script,$(LD_VERSION_SCRIPT) +EXTRA_DEPS += $(LD_VERSION_SCRIPT) +endif endif # diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py index 0dad810d7344..eb60dca362b7 100644 --- a/python/mozbuild/mozbuild/frontend/emitter.py +++ b/python/mozbuild/mozbuild/frontend/emitter.py @@ -249,6 +249,7 @@ class TreeMetadataEmitter(LoggingMixin): 'DEFFILE', 'SDK_LIBRARY', 'WIN32_EXE_LDFLAGS', + 'LD_VERSION_SCRIPT', ] for v in varlist: if v in sandbox and sandbox[v]: diff --git a/python/mozbuild/mozbuild/frontend/sandbox_symbols.py b/python/mozbuild/mozbuild/frontend/sandbox_symbols.py index d5d794bc9583..b2e7981f7124 100644 --- a/python/mozbuild/mozbuild/frontend/sandbox_symbols.py +++ b/python/mozbuild/mozbuild/frontend/sandbox_symbols.py @@ -359,6 +359,12 @@ VARIABLES = { This variable can only be used on Windows. """, None), + 'LD_VERSION_SCRIPT': (unicode, unicode, + """The linker version script for shared libraries. + + This variable can only be used on Linux. + """, None), + 'RESOURCE_FILES': (HierarchicalStringListWithFlagsFactory({'preprocess': bool}), list, """List of resources to be exported, and in which subdirectories.