File tree Expand file tree Collapse file tree 16 files changed +41
-40
lines changed Expand file tree Collapse file tree 16 files changed +41
-40
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ clang_target_link_libraries(clangTidyMain
3333# Support plugins.
3434if (CLANG_PLUGIN_SUPPORT)
3535 set (support_plugins SUPPORT_PLUGINS)
36- set (export_symbols EXPORT_SYMBOLS_FOR_PLUGINS)
3736endif ()
3837
3938add_clang_tool(clang-tidy
@@ -42,7 +41,6 @@ add_clang_tool(clang-tidy
4241 DEPENDS
4342 clang-resource -headers
4443 ${support_plugins}
45- ${export_symbols}
4644 )
4745clang_target_link_libraries(clang-tidy
4846 PRIVATE
@@ -59,6 +57,10 @@ target_link_libraries(clang-tidy
5957 ${ALL_CLANG_TIDY_CHECKS}
6058 )
6159
60+ if (CLANG_PLUGIN_SUPPORT)
61+ export_executable_symbols_for_plugins(clang-tidy)
62+ endif ()
63+
6264install (PROGRAMS clang-tidy-diff.py
6365 DESTINATION "${CMAKE_INSTALL_DATADIR} /clang"
6466 COMPONENT clang-tidy)
Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ macro(add_clang_tool name)
160160 AND (NOT LLVM_DISTRIBUTION_COMPONENTS OR ${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS)
161161 )
162162 set (get_obj_args ${ARGN} )
163- list (FILTER get_obj_args EXCLUDE REGEX "^( SUPPORT_PLUGINS|EXPORT_SYMBOLS_FOR_PLUGINS) $" )
163+ list (FILTER get_obj_args EXCLUDE REGEX "^SUPPORT_PLUGINS$" )
164164 generate_llvm_objects(${name} ${get_obj_args} )
165165 add_custom_target (${name} DEPENDS llvm-driver clang-resource -headers)
166166 else ()
Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ add_clang_tool(clang-linker-wrapper
3131
3232 DEPENDS
3333 ${tablegen_deps}
34- EXPORT_SYMBOLS_FOR_PLUGINS
3534 )
3635
3736set (CLANG_LINKER_WRAPPER_LIB_DEPS
@@ -42,3 +41,5 @@ target_link_libraries(clang-linker-wrapper
4241 PRIVATE
4342 ${CLANG_LINKER_WRAPPER_LIB_DEPS}
4443 )
44+
45+ export_executable_symbols_for_plugins(clang-linker-wrapper)
Original file line number Diff line number Diff line change @@ -9,8 +9,6 @@ set( LLVM_LINK_COMPONENTS
99
1010add_clang_tool(clang-repl
1111 ClangRepl.cpp
12-
13- EXPORT_SYMBOLS_FOR_PLUGINS
1412 )
1513
1614if (MSVC )
@@ -63,6 +61,8 @@ clang_target_link_libraries(clang-repl PRIVATE
6361 clangInterpreter
6462 )
6563
64+ export_executable_symbols_for_plugins(clang-repl)
65+
6666# The clang-repl binary can get huge with static linking in debug mode.
6767# Some 32-bit targets use PLT slots with limited branch range by default and we
6868# start to exceed this limit, e.g. when linking for arm-linux-gnueabihf with
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ set( LLVM_LINK_COMPONENTS
2121# Support plugins.
2222if (CLANG_PLUGIN_SUPPORT)
2323 set (support_plugins SUPPORT_PLUGINS)
24- set (export_symbols EXPORT_SYMBOLS_FOR_PLUGINS)
2524endif ()
2625
2726add_clang_tool(clang
@@ -36,7 +35,6 @@ add_clang_tool(clang
3635 ARMTargetParserTableGen
3736 AArch64TargetParserTableGen
3837 ${support_plugins}
39- ${export_symbols}
4038 GENERATE_DRIVER
4139 )
4240
@@ -56,6 +54,11 @@ else()
5654 set_target_properties (clang PROPERTIES VERSION ${CLANG_EXECUTABLE_VERSION} )
5755endif ()
5856
57+ # Support plugins.
58+ if (CLANG_PLUGIN_SUPPORT)
59+ export_executable_symbols_for_plugins(clang)
60+ endif ()
61+
5962add_dependencies (clang clang-resource -headers)
6063
6164if (NOT CLANG_LINKS_TO_CREATE)
Original file line number Diff line number Diff line change @@ -11,18 +11,9 @@ set( LLVM_LINK_COMPONENTS
1111 TargetParser
1212)
1313
14- option (FLANG_PLUGIN_SUPPORT "Build Flang with plugin support." ON )
15-
16- # Enable support for plugins, which need access to symbols from flang-new
17- if (FLANG_PLUGIN_SUPPORT)
18- set (export_symbols EXPORT_SYMBOLS_FOR_PLUGINS)
19- endif ()
20-
2114add_flang_tool(flang-new
2215 driver.cpp
2316 fc1_main.cpp
24-
25- ${export_symbols}
2617)
2718
2819target_link_libraries (flang-new
@@ -37,4 +28,11 @@ clang_target_link_libraries(flang-new
3728 clangBasic
3829)
3930
31+ option (FLANG_PLUGIN_SUPPORT "Build Flang with plugin support." ON )
32+
33+ # Enable support for plugins, which need access to symbols from flang-new
34+ if (FLANG_PLUGIN_SUPPORT)
35+ export_executable_symbols_for_plugins(flang-new)
36+ endif ()
37+
4038install (TARGETS flang-new DESTINATION "${CMAKE_INSTALL_BINDIR} " )
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ macro(add_lld_tool name)
4444 AND (NOT LLVM_DISTRIBUTION_COMPONENTS OR ${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS)
4545 )
4646 set (get_obj_args ${ARGN} )
47- list (FILTER get_obj_args EXCLUDE REGEX "^( SUPPORT_PLUGINS|EXPORT_SYMBOLS_FOR_PLUGINS) $" )
47+ list (FILTER get_obj_args EXCLUDE REGEX "^SUPPORT_PLUGINS$" )
4848 generate_llvm_objects(${name} ${get_obj_args} )
4949 add_custom_target (${name} DEPENDS llvm-driver)
5050 else ()
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ add_lld_tool(lld
88
99 SUPPORT_PLUGINS
1010 GENERATE_DRIVER
11- EXPORT_SYMBOLS_FOR_PLUGINS
1211 )
12+ export_executable_symbols_for_plugins(lld)
1313
1414function (lld_target_link_libraries target type )
1515 if (TARGET obj.${target} )
Original file line number Diff line number Diff line change @@ -1010,7 +1010,7 @@ endmacro()
10101010
10111011macro (add_llvm_executable name )
10121012 cmake_parse_arguments (ARG
1013- "DISABLE_LLVM_LINK_LLVM_DYLIB;IGNORE_EXTERNALIZE_DEBUGINFO;NO_INSTALL_RPATH;SUPPORT_PLUGINS;EXPORT_SYMBOLS;EXPORT_SYMBOLS_FOR_PLUGINS "
1013+ "DISABLE_LLVM_LINK_LLVM_DYLIB;IGNORE_EXTERNALIZE_DEBUGINFO;NO_INSTALL_RPATH;SUPPORT_PLUGINS;EXPORT_SYMBOLS"
10141014 "ENTITLEMENTS;BUNDLE_PATH"
10151015 ""
10161016 ${ARGN} )
@@ -1081,12 +1081,6 @@ macro(add_llvm_executable name)
10811081 endif ()
10821082 endif ()
10831083
1084- if (ARG_EXPORT_SYMBOLS)
1085- export_executable_symbols(${name} )
1086- elseif (ARG_EXPORT_SYMBOLS_FOR_PLUGINS)
1087- export_executable_symbols_for_plugins(${name} )
1088- endif ()
1089-
10901084 if (LLVM_LINK_LLVM_DYLIB AND NOT ARG_DISABLE_LLVM_LINK_LLVM_DYLIB)
10911085 set (USE_SHARED USE_SHARED)
10921086 endif ()
@@ -1118,6 +1112,10 @@ macro(add_llvm_executable name)
11181112 endif ()
11191113
11201114 llvm_codesign(${name} ENTITLEMENTS ${ARG_ENTITLEMENTS} BUNDLE_PATH ${ARG_BUNDLE_PATH} )
1115+
1116+ if (ARG_EXPORT_SYMBOLS)
1117+ export_executable_symbols(${name} )
1118+ endif ()
11211119endmacro (add_llvm_executable name )
11221120
11231121# add_llvm_pass_plugin(name [NO_MODULE] ...)
Original file line number Diff line number Diff line change @@ -37,5 +37,5 @@ add_llvm_tool(bugpoint
3737 DEPENDS
3838 intrinsics_gen
3939 SUPPORT_PLUGINS
40- EXPORT_SYMBOLS_FOR_PLUGINS
4140 )
41+ export_executable_symbols_for_plugins(bugpoint)
You can’t perform that action at this time.
0 commit comments