Skip to content

Commit

Permalink
[clang-repl] Fix PLT offset too large linker error on ARM (#78959)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
weliveindetail committed Jan 22, 2024
1 parent 88d1de5 commit 4821c90
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions clang/tools/clang-repl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ clang_target_link_libraries(clang-repl PRIVATE
if(CLANG_PLUGIN_SUPPORT)
export_executable_symbols_for_plugins(clang-repl)
endif()

string(TOUPPER ${CMAKE_SYSTEM_PROCESSOR} system_processor)
if(${system_processor} MATCHES "ARM")
target_link_options(clang-repl PRIVATE LINKER:--long-plt)
endif()

0 comments on commit 4821c90

Please sign in to comment.