[clang] [clang-repl] Fix PLT offset too large linker error on ARM (PR #78959)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 22 03:13:59 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Stefan Gränitz (weliveindetail)

<details>
<summary>Changes</summary>

I cross-compile clang-repl with GCC-10 on Ubuntu 20.04 and get this error when linking with gold: PLT offset too large, try linking with --long-plt

---
Full diff: https://github.com/llvm/llvm-project/pull/78959.diff


1 Files Affected:

- (modified) clang/tools/clang-repl/CMakeLists.txt (+4) 


``````````diff
diff --git a/clang/tools/clang-repl/CMakeLists.txt b/clang/tools/clang-repl/CMakeLists.txt
index 2ccbe292fd49e09..8589e37418354e7 100644
--- a/clang/tools/clang-repl/CMakeLists.txt
+++ b/clang/tools/clang-repl/CMakeLists.txt
@@ -22,3 +22,7 @@ clang_target_link_libraries(clang-repl PRIVATE
 if(CLANG_PLUGIN_SUPPORT)
   export_executable_symbols_for_plugins(clang-repl)
 endif()
+
+if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "ARM")
+  target_link_options(clang-repl PRIVATE LINKER:--long-plt)
+endif()

``````````

</details>


https://github.com/llvm/llvm-project/pull/78959


More information about the cfe-commits mailing list