File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -23,12 +23,13 @@ if(CLANG_PLUGIN_SUPPORT)
2323 export_executable_symbols_for_plugins(clang-repl)
2424endif ()
2525
26- string (TOUPPER "${CMAKE_SYSTEM_PROCESSOR} " system_processor )
27- if (system_processor MATCHES "ARM" )
28- set (FLAG_LONG_PLT "-Wl,--long-plt" )
29- llvm_check_linker_flag(CXX ${FLAG_LONG_PLT} LINKER_HAS_FLAG_LONG_PLT)
30- # Linkers without this flag are assumed to have long PLTs by default
31- if (LINKER_HAS_FLAG_LONG_PLT)
32- target_link_options (clang-repl PRIVATE ${FLAG_LONG_PLT} )
33- endif ()
26+ # The clang-repl binary can get huge with static linking in debug mode.
27+ # Some 32-bit targets use PLT slots with limited branch range by default and we
28+ # start to exceed this limit, e.g. when linking for arm-linux-gnueabihf with
29+ # gold. This flag tells the linker to build a PLT for the full address range.
30+ # Linkers without this flag are assumed to support proper PLTs by default.
31+ set (flag_long_plt "-Wl,--long-plt" )
32+ llvm_check_linker_flag(CXX ${flag_long_plt} HAVE_LINKER_FLAG_LONG_PLT)
33+ if (HAVE_LINKER_FLAG_LONG_PLT)
34+ target_link_options (clang-repl PRIVATE ${flag_long_plt} )
3435endif ()
You can’t perform that action at this time.
0 commit comments