[clang] 2bb6d7b - [clang-repl] Limit use of PLT offset flag to linkers that support it
Stefan Gränitz via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 22 08:17:49 PST 2024
Author: Stefan Gränitz
Date: 2024-01-22T17:16:52+01:00
New Revision: 2bb6d7b8a4d1e31d5c856174c163e77d7d3a0b94
URL: https://github.com/llvm/llvm-project/commit/2bb6d7b8a4d1e31d5c856174c163e77d7d3a0b94
DIFF: https://github.com/llvm/llvm-project/commit/2bb6d7b8a4d1e31d5c856174c163e77d7d3a0b94.diff
LOG: [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
Added:
Modified:
clang/tools/clang-repl/CMakeLists.txt
Removed:
################################################################################
diff --git a/clang/tools/clang-repl/CMakeLists.txt b/clang/tools/clang-repl/CMakeLists.txt
index b0aaf39f0115472..2a0f617a2c0ff6b 100644
--- a/clang/tools/clang-repl/CMakeLists.txt
+++ b/clang/tools/clang-repl/CMakeLists.txt
@@ -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()
More information about the cfe-commits
mailing list