CMake: Implement configure -linker [bfd,gold,lld]
Fixes: QTBUG-86155 Change-Id: I5ba2d3b52d9ca240b48904c492f7902a056c0292 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
parent
df28355981
commit
2f1a55c0b1
@ -213,6 +213,14 @@ if(DEFINED QT_EXTRA_FRAMEWORKPATHS AND APPLE)
|
|||||||
unset(__qt_fw_flags)
|
unset(__qt_fw_flags)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(QT_FEATURE_use_gold_linker)
|
||||||
|
target_link_options(PlatformCommonInternal INTERFACE "-fuse-ld=gold")
|
||||||
|
elseif(QT_FEATURE_use_bfd_linker)
|
||||||
|
target_link_options(PlatformCommonInternal INTERFACE "-fuse-ld=bfd")
|
||||||
|
elseif(QT_FEATURE_use_lld_linker)
|
||||||
|
target_link_options(PlatformCommonInternal INTERFACE "-fuse-ld=lld")
|
||||||
|
endif()
|
||||||
|
|
||||||
function(qt_get_implicit_sse2_genex_condition out_var)
|
function(qt_get_implicit_sse2_genex_condition out_var)
|
||||||
set(is_shared_lib "$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>")
|
set(is_shared_lib "$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>")
|
||||||
set(is_static_lib "$<STREQUAL:$<TARGET_PROPERTY:TYPE>,STATIC_LIBRARY>")
|
set(is_static_lib "$<STREQUAL:$<TARGET_PROPERTY:TYPE>,STATIC_LIBRARY>")
|
||||||
|
@ -66,7 +66,8 @@ The effort of this is tracked in QTBUG-85373 and QTBUG-85349.
|
|||||||
| -static-runtime | -DFEATURE_static_runtime=ON | |
|
| -static-runtime | -DFEATURE_static_runtime=ON | |
|
||||||
| -pch | -DBUILD_WITH_PCH=ON | |
|
| -pch | -DBUILD_WITH_PCH=ON | |
|
||||||
| -ltcg | | |
|
| -ltcg | | |
|
||||||
| -linker [bfd,gold,lld] | | |
|
| -linker [bfd,gold,lld] | -DINPUT_linker=<name> or | |
|
||||||
|
| | -DFEATURE_use_<name>_linker=ON | |
|
||||||
| -incredibuild-xge | | |
|
| -incredibuild-xge | | |
|
||||||
| -ccache | -DQT_USE_CCACHE=ON | |
|
| -ccache | -DQT_USE_CCACHE=ON | |
|
||||||
| -make-tool <tool> | n/a | |
|
| -make-tool <tool> | n/a | |
|
||||||
|
@ -393,6 +393,14 @@ qt_feature("use_gold_linker_alias"
|
|||||||
AUTODETECT false
|
AUTODETECT false
|
||||||
CONDITION NOT WIN32 AND NOT INTEGRITY AND NOT WASM AND TEST_use_gold_linker
|
CONDITION NOT WIN32 AND NOT INTEGRITY AND NOT WASM AND TEST_use_gold_linker
|
||||||
)
|
)
|
||||||
|
qt_feature("use_gold_linker"
|
||||||
|
LABEL "gold"
|
||||||
|
AUTODETECT false
|
||||||
|
CONDITION NOT WIN32 AND NOT INTEGRITY AND NOT WASM AND NOT rtems AND TEST_use_gold_linker
|
||||||
|
ENABLE INPUT_linker STREQUAL 'gold' OR QT_FEATURE_use_gold_linker_alias
|
||||||
|
DISABLE INPUT_linker STREQUAL 'bfd' OR INPUT_linker STREQUAL 'lld'
|
||||||
|
)
|
||||||
|
qt_feature_config("use_gold_linker" QMAKE_PRIVATE_CONFIG)
|
||||||
qt_feature("use_lld_linker"
|
qt_feature("use_lld_linker"
|
||||||
LABEL "lld"
|
LABEL "lld"
|
||||||
AUTODETECT false
|
AUTODETECT false
|
||||||
@ -912,6 +920,12 @@ qt_configure_add_summary_entry(
|
|||||||
ARGS "ccache"
|
ARGS "ccache"
|
||||||
CONDITION UNIX
|
CONDITION UNIX
|
||||||
)
|
)
|
||||||
|
qt_configure_add_summary_entry(
|
||||||
|
TYPE "firstAvailableFeature"
|
||||||
|
ARGS "use_bfd_linker use_gold_linker use_lld_linker"
|
||||||
|
MESSAGE "Linker"
|
||||||
|
CONDITION QT_FEATURE_use_bfd_linker OR QT_FEATURE_use_gold_linker OR QT_FEATURE_use_lld_linker
|
||||||
|
)
|
||||||
qt_configure_add_summary_entry(
|
qt_configure_add_summary_entry(
|
||||||
ARGS "enable_new_dtags"
|
ARGS "enable_new_dtags"
|
||||||
CONDITION LINUX
|
CONDITION LINUX
|
||||||
|
@ -945,7 +945,6 @@ def get_feature_mapping():
|
|||||||
"stl": None, # Do we really need to test for this in 2018?!
|
"stl": None, # Do we really need to test for this in 2018?!
|
||||||
"strip": None,
|
"strip": None,
|
||||||
"tiff": {"condition": "QT_FEATURE_imageformatplugin AND TIFF_FOUND"},
|
"tiff": {"condition": "QT_FEATURE_imageformatplugin AND TIFF_FOUND"},
|
||||||
"use_gold_linker": None,
|
|
||||||
"verifyspec": None, # qmake specific...
|
"verifyspec": None, # qmake specific...
|
||||||
"warnings_are_errors": None, # FIXME: Do we need these?
|
"warnings_are_errors": None, # FIXME: Do we need these?
|
||||||
"webp": {"condition": "QT_FEATURE_imageformatplugin AND WrapWebP_FOUND"},
|
"webp": {"condition": "QT_FEATURE_imageformatplugin AND WrapWebP_FOUND"},
|
||||||
@ -1007,7 +1006,8 @@ def parseFeature(ctx, feature, data, cm_fh):
|
|||||||
if isinstance(o, dict):
|
if isinstance(o, dict):
|
||||||
outputType = o["type"]
|
outputType = o["type"]
|
||||||
|
|
||||||
if outputType in ["varAssign", "varAppend", "varRemove"]:
|
if outputType in ["varAssign", "varAppend", "varRemove",
|
||||||
|
"useBFDLinker", "useGoldLinker", "useLLDLinker"]:
|
||||||
continue
|
continue
|
||||||
elif outputType == "define":
|
elif outputType == "define":
|
||||||
publicDefine = True
|
publicDefine = True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user