Skip to content

Commit 4821c90

Browse files
[clang-repl] Fix PLT offset too large linker error on ARM (#78959)
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
1 parent 88d1de5 commit 4821c90

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

clang/tools/clang-repl/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,8 @@ clang_target_link_libraries(clang-repl PRIVATE
2222
if(CLANG_PLUGIN_SUPPORT)
2323
export_executable_symbols_for_plugins(clang-repl)
2424
endif()
25+
26+
string(TOUPPER ${CMAKE_SYSTEM_PROCESSOR} system_processor)
27+
if(${system_processor} MATCHES "ARM")
28+
target_link_options(clang-repl PRIVATE LINKER:--long-plt)
29+
endif()

0 commit comments

Comments
 (0)