1 From e954aacbc075355419f5fc99db61f68aca1fcfe4 Mon Sep 17 00:00:00 2001
2 From: Randy Eckenrode <randy@largeandhighquality.com>
3 Date: Fri, 5 Apr 2024 14:16:40 -0400
4 Subject: [PATCH 1/3] Check for -no_exported_symbols linker support
7 CMakeLists.txt | 7 ++++++-
8 1 file changed, 6 insertions(+), 1 deletion(-)
10 diff --git a/tapi/CMakeLists.txt b/tapi/CMakeLists.txt
11 index 62affdf..82426de 100644
12 --- a/tapi/CMakeLists.txt
13 +++ b/tapi/CMakeLists.txt
14 @@ -73,6 +73,9 @@ llvm_check_linker_flag(CXX "-Wl,-no_inits" LINKER_SUPPORTS_NO_INITS)
15 llvm_check_linker_flag(CXX "-Wl,-iosmac_version_min,13.0" LINKER_SUPPORTS_IOSMAC)
18 +# Older versions of ld64 (e.g., in the Darwin bootstrap) do not support this flag.
19 +llvm_check_linker_flag(CXX "-Wl,-no_exported_symbols" LINKER_SUPPORTS_NO_EXPORTED_SYMBOLS)
21 # Check if i386 is supported.
22 SET(CMAKE_OLD_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
23 SET(CMAKE_OLD_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS})
24 @@ -160,7 +163,9 @@ endmacro(add_tapi_library)
25 macro(add_tapi_executable name)
26 add_llvm_executable(${name} ${ARGN})
27 set_target_properties(${name} PROPERTIES FOLDER "Tapi executables")
28 - target_link_options(${name} PRIVATE "-Wl,-no_exported_symbols")
29 + if(LINKER_SUPPORTS_NO_EXPORTED_SYMBOLS)
30 + target_link_options(${name} PRIVATE "-Wl,-no_exported_symbols")
32 endmacro(add_tapi_executable)
34 function(tapi_clang_tablegen)