From 64c111e10fcb2f69855432177d76649b6b789fac Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Tue, 4 Jun 2019 14:09:13 +0200 Subject: Android: Use lld as default linker for Qt Modules We can't use the gold linker with the android NDK, which is the default option. Using the gold linker results in linker crashes. QMake builds also disables the gold linker. Change-Id: I73de93150b160b4411715007bc7e40238b96d400 Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index c73e00be47..fab4543b3e 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1240,6 +1240,12 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") if(NOT ${arg_DISABLE_TOOLS_EXPORT}) qt_export_tools(${target}) endif() + + # We can't use the gold linker on android with the NDK, which is the default + # linker. To build our own target we will use the lld linker. + if (ANDROID) + target_link_options("${target}" PRIVATE -fuse-ld=lld) + endif() endfunction() function(qt_export_tools module_name) -- cgit v1.2.3