From 72ba0079c3967bdfa26acdce78ce6cb98b30c27b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 2 Jun 2015 11:10:22 -0700 Subject: Add a linker version script to Qt libraries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This linker script is only enabled for systems with GCC or GCC-like compilers, though technically it should work on the BSDs too (will enable after testing). For regular modules, this declares one ELF version "Qt_5" and places all QtCore symbols inside, then it declares unused ELF versions "Qt_5.x" for each older minor release. For modules declared "internal_module", all symbols are placed in version Qt_5_PRIVATE_API. The big advantage of an ELF version is that, when we do Qt 6, both versions of QtCore could be loaded in memory without conflicts and all symbols would be resolved to the correct library. No module can talk to both at the same time, but this avoids mistakes of loading them indirectly by plugins. The extra Qt_5.x versions will be used in the next commit. Change-Id: I049a653beeb5454c9539ffff13e3fe6f050fdf31 Reviewed-by: Lisandro Damián Nicanor Pérez Meyer Reviewed-by: Oswald Buddenhagen Reviewed-by: Thiago Macieira --- mkspecs/common/gcc-base-unix.conf | 1 + mkspecs/common/qcc-base-qnx.conf | 1 + 2 files changed, 2 insertions(+) (limited to 'mkspecs/common') diff --git a/mkspecs/common/gcc-base-unix.conf b/mkspecs/common/gcc-base-unix.conf index f82c8a8430..0178bda75a 100644 --- a/mkspecs/common/gcc-base-unix.conf +++ b/mkspecs/common/gcc-base-unix.conf @@ -22,3 +22,4 @@ QMAKE_LFLAGS_USE_GOLD = -fuse-ld=gold # -Bsymbolic-functions (ld) support QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list, +QMAKE_LFLAGS_VERSION_SCRIPT = -Wl,--version-script, diff --git a/mkspecs/common/qcc-base-qnx.conf b/mkspecs/common/qcc-base-qnx.conf index f7da151a41..dbbf346ea2 100644 --- a/mkspecs/common/qcc-base-qnx.conf +++ b/mkspecs/common/qcc-base-qnx.conf @@ -19,6 +19,7 @@ QMAKE_LFLAGS_RPATHLINK = -Wl,-rpath-link, # -Bsymbolic-functions (ld) support QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list, +QMAKE_LFLAGS_VERSION_SCRIPT = -Wl,--version-script, # Generic options for all BlackBerry/QNX qcc mkspecs QMAKE_CFLAGS_THREAD = -D_REENTRANT -- cgit v1.2.3