Fix linker warning.
authorErik Verbruggen <erik.verbruggen@digia.com>
Tue, 4 Dec 2012 09:54:32 +0000 (10:54 +0100)
committerSimon Hausmann <simon.hausmann@digia.com>
Mon, 10 Dec 2012 09:11:46 +0000 (10:11 +0100)
When compiling LLVM with GCC or Clang, the visibility for inline
methods is set to hidden. When linking code compiled without this
flag to LLVM, the system linker will produce warnings like:

ld: warning: direct access in llvm::fdbgs() to global weak symbol llvm::formatted_raw_ostream::~formatted_raw_ostream() means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.

Change-Id: Ia86ff44660d448c8b0673e229137855e56c895f5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
v4.pro

diff --git a/v4.pro b/v4.pro
index ce1409b..3aecdab 100644 (file)
--- a/v4.pro
+++ b/v4.pro
@@ -57,7 +57,7 @@ HEADERS += \
 INCLUDEPATH += \
     $$system($$LLVM_CONFIG --includedir)
 
-QMAKE_CXXFLAGS += $$system($$LLVM_CONFIG --cppflags)
+QMAKE_CXXFLAGS += $$system($$LLVM_CONFIG --cppflags) -fvisibility-inlines-hidden
 
 LIBS += \
     $$system($$LLVM_CONFIG --ldflags) \