Fix Android -ltcg build
We're passing -Oz for release builds, but that's not a flag the linker
understands when -ltcg is enabled. The build fails with:
ld.gold: fatal error: Optimization level must be between 0 and 3
Fix this by using -O2, which -Oz is based on, and -O3 for the "full
optimization" that is used for core and gui.
Pick-to: 6.2
Fixes: QTBUG-89472
Change-Id: Ie1a86888baefce5ca97026e7d635f10d2819f9f4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
bb10
parent
cd36734ff4
commit
80de516565
|
|
@ -168,8 +168,14 @@ endif()
|
|||
|
||||
# Android Clang
|
||||
if(CLANG AND ANDROID)
|
||||
set(QT_CFLAGS_OPTIMIZE "-Oz")
|
||||
set(QT_CFLAGS_OPTIMIZE_FULL "-Oz")
|
||||
if(QT_FEATURE_ltcg)
|
||||
# When using LTCG, the linker cannot cope with -Oz. See QTBUG-89472 for details.
|
||||
set(QT_CFLAGS_OPTIMIZE "-O2")
|
||||
set(QT_CFLAGS_OPTIMIZE_FULL "-O3")
|
||||
else()
|
||||
set(QT_CFLAGS_OPTIMIZE "-Oz")
|
||||
set(QT_CFLAGS_OPTIMIZE_FULL "-Oz")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# qcc
|
||||
|
|
|
|||
|
|
@ -624,6 +624,12 @@ qt_feature("ltcg"
|
|||
CONDITION __qt_ltcg_detected
|
||||
)
|
||||
qt_feature_config("ltcg" QMAKE_PRIVATE_CONFIG)
|
||||
|
||||
if(NOT QT_CONFIGURE_RUNNING)
|
||||
# This feature is used early in QtCompilerOptimization.cmake.
|
||||
qt_evaluate_feature(ltcg)
|
||||
endif()
|
||||
|
||||
qt_feature("enable_new_dtags"
|
||||
LABEL "Using new DTAGS"
|
||||
CONDITION LINUX AND TEST_enable_new_dtags
|
||||
|
|
|
|||
Loading…
Reference in New Issue