summaryrefslogtreecommitdiffstats
path: root/src/core/core_module.pro
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2017-12-14 12:45:44 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-01-10 17:09:18 +0000
commit0b406584b711e5c6e12baeb15e10045f02914af4 (patch)
tree001ae66482f34f58c557fbb166c72cca7fec2d93 /src/core/core_module.pro
parent8c4904e6079aa54dded654f8617e0f85a33aa6e1 (diff)
Fix sanitizer build
Task-number: QTBUG-64726 Change-Id: Ic88eed62e85ad1d95afcbd154c6556509e42bd47 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'src/core/core_module.pro')
-rw-r--r--src/core/core_module.pro13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/core/core_module.pro b/src/core/core_module.pro
index 2409ccb12..d21985e60 100644
--- a/src/core/core_module.pro
+++ b/src/core/core_module.pro
@@ -40,8 +40,17 @@ else: LIBS_PRIVATE += $$NINJA_ARCHIVES
LIBS_PRIVATE += $$NINJA_LIB_DIRS $$NINJA_LIBS
# GN's LFLAGS doesn't always work across all the Linux configurations we support.
# The Windows and macOS ones from GN does provide a few useful flags however
-linux: QMAKE_LFLAGS += -Wl,--gc-sections -Wl,-O1 -Wl,-z,now -Wl,-z,defs
-else: QMAKE_LFLAGS += $$NINJA_LFLAGS
+
+linux {
+ QMAKE_LFLAGS += -Wl,--gc-sections -Wl,-O1 -Wl,-z,now
+ # Embedded address sanitizer symbols are undefined and are picked up by the dynamic link loader
+ # at runtime. Thus we do not to pass the linker flag below, because the linker would complain
+ # about the undefined sanitizer symbols.
+ !sanitizer: QMAKE_LFLAGS += -Wl,-z,defs
+} else {
+ QMAKE_LFLAGS += $$NINJA_LFLAGS
+}
+
POST_TARGETDEPS += $$NINJA_TARGETDEPS