diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -1063,29 +1063,6 @@ add_compile_definitions(_XOPEN_SOURCE=700) add_compile_definitions(_LARGE_FILE_API) - # CMake versions less than 3.16 set default linker flags to include -brtl, as - # well as setting -G when building libraries, so clear them out. Note we only - # try to clear the form that CMake will set as part of its initial - # configuration, it is still possible the user may force it as part of a - # compound option. - if(CMAKE_VERSION VERSION_LESS 3.16) - string(REGEX REPLACE "(^|[ \t]+)-Wl,-brtl([ \t]+|$)" " " CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") - string(REGEX REPLACE "(^|[ \t]+)-Wl,-brtl([ \t]+|$)" " " CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}") - string(REGEX REPLACE "(^|[ \t]+)-Wl,-brtl([ \t]+|$)" " " CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}") - string(REGEX REPLACE "(^|[ \t]+)(-Wl,)?-G([ \t]+|$)" " " CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS - "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}") - string(REGEX REPLACE "(^|[ \t]+)(-Wl,)?-G([ \t]+|$)" " " CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS - "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}") - string(REGEX REPLACE "(^|[ \t]+)(-Wl,)?-G([ \t]+|$)" " " CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS - "${CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS}") - string(REGEX REPLACE "(^|[ \t]+)-Wl,-G," " -Wl," CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS - "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}") - string(REGEX REPLACE "(^|[ \t]+)-Wl,-G," " -Wl," CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS - "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}") - string(REGEX REPLACE "(^|[ \t]+)-Wl,-G," " -Wl," CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS - "${CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS}") - endif() - # Modules should be built with -shared -Wl,-G, so we can use runtime linking # with plugins. string(APPEND CMAKE_MODULE_LINKER_FLAGS " -shared -Wl,-G")