1 set( LLVM_LINK_COMPONENTS
2 ${LLVM_TARGETS_TO_BUILD}
10 add_clang_tool(clang-repl
17 set_target_properties(clang-repl PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS 1)
20 set(clang_repl_exports ${clang_repl_exports} ??_7type_info@@6B@
21 ?__type_info_root_node@@3U__type_info_node@@A
22 ?nothrow@std@@3Unothrow_t@1@B
25 # Compiler added symbols for static variables. NOT for VStudio < 2015
26 set(clang_repl_exports ${clang_repl_exports} _Init_thread_abort _Init_thread_epoch
27 _Init_thread_footer _Init_thread_header _tls_index
30 if(CMAKE_SIZEOF_VOID_P EQUAL 8)
31 # new/delete variants needed when linking to static msvc runtime (esp. Debug)
32 set(clang_repl_exports ${clang_repl_exports}
40 set(clang_repl_exports ${clang_repl_exports}
50 # List to '/EXPORT:sym0 /EXPORT:sym1 /EXPORT:sym2 ...'
51 list(TRANSFORM clang_repl_exports PREPEND "LINKER:/EXPORT:")
53 set_property(TARGET clang-repl APPEND PROPERTY LINK_OPTIONS ${clang_repl_exports})
57 clang_target_link_libraries(clang-repl PRIVATE
64 # The clang-repl binary can get huge with static linking in debug mode.
65 # Some 32-bit targets use PLT slots with limited branch range by default and we
66 # start to exceed this limit, e.g. when linking for arm-linux-gnueabihf with
67 # gold. This flag tells the linker to build a PLT for the full address range.
68 # Linkers without this flag are assumed to support proper PLTs by default.
69 set(flag_long_plt "LINKER:--long-plt")
70 check_linker_flag(CXX ${flag_long_plt} HAVE_LINKER_FLAG_LONG_PLT)
71 if(HAVE_LINKER_FLAG_LONG_PLT)
72 target_link_options(clang-repl PRIVATE ${flag_long_plt})