Don't use gold linker if mold linker is provided (#15746)
This commit is contained in:
parent
7f3f576151
commit
f347968a1d
@ -501,6 +501,11 @@ endfunction()
|
|||||||
# Tries to use gold linker in current scope (directory, function)
|
# Tries to use gold linker in current scope (directory, function)
|
||||||
#
|
#
|
||||||
function(ov_try_use_gold_linker)
|
function(ov_try_use_gold_linker)
|
||||||
|
# don't use the gold linker, if the mold linker is set
|
||||||
|
if(CMAKE_EXE_LINKER_FLAGS MATCHES "mold" OR CMAKE_MODULE_LINKER_FLAGS MATCHES "mold" OR CMAKE_SHARED_LINKER_FLAGS MATCHES "mold")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
# gold linker on ubuntu20.04 may fail to link binaries build with sanitizer
|
# gold linker on ubuntu20.04 may fail to link binaries build with sanitizer
|
||||||
if(CMAKE_COMPILER_IS_GNUCXX AND NOT ENABLE_SANITIZER AND NOT CMAKE_CROSSCOMPILING)
|
if(CMAKE_COMPILER_IS_GNUCXX AND NOT ENABLE_SANITIZER AND NOT CMAKE_CROSSCOMPILING)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=gold" PARENT_SCOPE)
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=gold" PARENT_SCOPE)
|
||||||
|
Loading…
Reference in New Issue
Block a user