From 4c980d2e9bc8f656179ea32fa3207d98ada59de4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 27 Jan 2014 17:27:36 +0100 Subject: Explicitly use libstdc++ for non-C++11 static builds Otherwise the compiler may choose libc++ based on the deployment target, and we'll end up with broken builds due to the mismatch between the two libraries, eg: Undefined symbols for architecture x86_64: "std::ios_base::Init::Init()", referenced from: __GLOBAL__I_a in libQt5Qml.a(qv4object.o) ... "std::ios_base::Init::~Init()", referenced from: __GLOBAL__I_a in libQt5Qml.a(qv4object.o) ... "std::__throw_length_error(char const*)", referenced from: ... This problem is not iOS specific, which is why the logic is moved to the more generic mac/default_post.prf. Change-Id: I28b94e614f9167fc0db84bbf1c88dd97d5629938 Reviewed-by: Oswald Buddenhagen --- mkspecs/features/mac/default_post.prf | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mkspecs/features/mac/default_post.prf') diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf index 614b336f27..da3e22b5f3 100644 --- a/mkspecs/features/mac/default_post.prf +++ b/mkspecs/features/mac/default_post.prf @@ -25,6 +25,15 @@ qt:!isEmpty(QT_CONFIG) { warning("Qt was not built with C++11 enabled, disabling feature") CONFIG -= c++11 } + + !c++11 { + # Explicitly use libstdc++ if C++11 support is not enabled, + # as otherwise the compiler will choose the standard library + # based on the deployment target, which for iOS 7 and OS X 10.9 + # is libc++, and we can't mix and match the two. + QMAKE_CXXFLAGS += -stdlib=libstdc++ + QMAKE_LFLAGS += -stdlib=libstdc++ + } } } -- cgit v1.2.3