mirror of
https://github.com/intel/llvm.git
synced 2026-01-19 09:31:59 +08:00
[clang-repl] Limit use of PLT offset flag to linkers that support it
Follow-up fix from https://github.com/llvm/llvm-project/pull/78959
This commit is contained in:
@@ -24,6 +24,11 @@ if(CLANG_PLUGIN_SUPPORT)
|
||||
endif()
|
||||
|
||||
string(TOUPPER ${CMAKE_SYSTEM_PROCESSOR} system_processor)
|
||||
if(${system_processor} MATCHES "ARM")
|
||||
target_link_options(clang-repl PRIVATE LINKER:--long-plt)
|
||||
if(system_processor MATCHES "ARM")
|
||||
set(FLAG_LONG_PLT "-Wl,--long-plt")
|
||||
llvm_check_linker_flag(CXX ${FLAG_LONG_PLT} LINKER_HAS_FLAG_LONG_PLT)
|
||||
# Linkers without this flag are assumed to have long PLTs by default
|
||||
if(LINKER_HAS_FLAG_LONG_PLT)
|
||||
target_link_options(clang-repl PRIVATE ${FLAG_LONG_PLT})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user