[Flang] remove whole-archive option for AIX linker (#76039)
[llvm-project.git] / clang / cmake / caches / Fuchsia-stage2.cmake
blobc4673c8a54c5ef531f2e77502d4338ce29c7a52d
1 # This file sets up a CMakeCache for the second stage of a Fuchsia toolchain build.
3 option(FUCHSIA_ENABLE_LLDB "Enable LLDB")
5 set(LLVM_TARGETS_TO_BUILD X86;ARM;AArch64;RISCV CACHE STRING "")
7 set(PACKAGE_VENDOR Fuchsia CACHE STRING "")
9 set(_FUCHSIA_ENABLE_PROJECTS "bolt;clang;clang-tools-extra;lld;llvm;polly")
10 set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
12 set(LLVM_ENABLE_BACKTRACES OFF CACHE BOOL "")
13 set(LLVM_ENABLE_DIA_SDK OFF CACHE BOOL "")
14 set(LLVM_ENABLE_HTTPLIB ON CACHE BOOL "")
15 set(LLVM_ENABLE_LIBCXX ON CACHE BOOL "")
16 set(LLVM_ENABLE_LIBEDIT OFF CACHE BOOL "")
17 set(LLVM_ENABLE_LLD ON CACHE BOOL "")
18 set(LLVM_ENABLE_LTO ON CACHE BOOL "")
19 set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
20 set(LLVM_ENABLE_PLUGINS OFF CACHE BOOL "")
21 set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "")
22 set(LLVM_ENABLE_UNWIND_TABLES OFF CACHE BOOL "")
23 set(LLVM_ENABLE_Z3_SOLVER OFF CACHE BOOL "")
24 set(LLVM_ENABLE_ZLIB ON CACHE BOOL "")
25 set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
26 set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
27 set(LLVM_STATIC_LINK_CXX_STDLIB ON CACHE BOOL "")
28 set(LLVM_USE_RELATIVE_PATHS_IN_FILES ON CACHE BOOL "")
29 set(LLDB_ENABLE_CURSES OFF CACHE BOOL "")
30 set(LLDB_ENABLE_LIBEDIT OFF CACHE BOOL "")
32 if(WIN32)
33   set(FUCHSIA_DISABLE_DRIVER_BUILD ON)
34 endif()
36 if (NOT FUCHSIA_DISABLE_DRIVER_BUILD)
37   set(LLVM_TOOL_LLVM_DRIVER_BUILD ON CACHE BOOL "")
38   set(LLVM_DRIVER_TARGET llvm-driver)
39 endif()
41 set(CLANG_DEFAULT_CXX_STDLIB libc++ CACHE STRING "")
42 set(CLANG_DEFAULT_LINKER lld CACHE STRING "")
43 set(CLANG_DEFAULT_OBJCOPY llvm-objcopy CACHE STRING "")
44 set(CLANG_DEFAULT_RTLIB compiler-rt CACHE STRING "")
45 set(CLANG_DEFAULT_UNWINDLIB libunwind CACHE STRING "")
46 set(CLANG_ENABLE_ARCMT OFF CACHE BOOL "")
47 set(CLANG_ENABLE_STATIC_ANALYZER ON CACHE BOOL "")
48 set(CLANG_PLUGIN_SUPPORT OFF CACHE BOOL "")
50 set(ENABLE_LINKER_BUILD_ID ON CACHE BOOL "")
51 set(ENABLE_X86_RELAX_RELOCATIONS ON CACHE BOOL "")
53 # TODO(#67176): relative-vtables doesn't play well with different default
54 # visibilities. Making everything hidden visibility causes other complications
55 # let's choose default visibility for our entire toolchain.
56 set(CMAKE_C_VISIBILITY_PRESET default CACHE STRING "")
57 set(CMAKE_CXX_VISIBILITY_PRESET default CACHE STRING "")
59 set(CMAKE_BUILD_TYPE Release CACHE STRING "")
60 if (APPLE)
61   set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "")
62 elseif(WIN32)
63   set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded" CACHE STRING "")
64 endif()
66 if(APPLE)
67   list(APPEND BUILTIN_TARGETS "default")
68   list(APPEND RUNTIME_TARGETS "default")
70   set(COMPILER_RT_ENABLE_TVOS OFF CACHE BOOL "")
71   set(COMPILER_RT_ENABLE_WATCHOS OFF CACHE BOOL "")
72   set(COMPILER_RT_USE_BUILTINS_LIBRARY ON CACHE BOOL "")
74   set(LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
75   set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
76   set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
77   set(LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE BOOL "")
78   set(LIBCXXABI_INSTALL_LIBRARY OFF CACHE BOOL "")
79   set(LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
80   set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
81   set(LIBCXX_ABI_VERSION 2 CACHE STRING "")
82   set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
83   set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
84   set(LIBCXX_HARDENING_MODE "none" CACHE STRING "")
85   set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
86   set(RUNTIMES_CMAKE_ARGS "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13;-DCMAKE_OSX_ARCHITECTURES=arm64|x86_64" CACHE STRING "")
87 endif()
89 if(WIN32 OR LLVM_WINSYSROOT)
90   if((NOT WIN32) AND (NOT LLVM_VFSOVERLAY))
91     message(FATAL_ERROR "LLVM_VFSOVERLAY should be defined.")
92   endif()
93   set(target "x86_64-pc-windows-msvc")
95   if (LLVM_WINSYSROOT)
96     set(WINDOWS_COMPILER_FLAGS
97       -Xclang
98       -ivfsoverlay
99       -Xclang
100       ${LLVM_VFSOVERLAY}
101       # TODO: /winsysroot should be set by HandleLLVMOptions.cmake automatically
102       # but it current has a bug that prevents it from working under cross
103       # compilation. Set this flag manually for now.
104       /winsysroot
105       ${LLVM_WINSYSROOT})
106     string(REPLACE ";" " " WINDOWS_COMPILER_FLAGS "${WINDOWS_COMPILER_FLAGS}")
107     set(WINDOWS_LINK_FLAGS
108       # TODO: lld-link has a bug that it cannot infer the machine type
109       # correctly when /winsysroot is set while Windows libraries search paths
110       # are not explicitly defined.
111       # Explicitly set the machine type for now.
112       /machine:X64
113       /vfsoverlay:${LLVM_VFSOVERLAY}
114       /winsysroot:${LLVM_WINSYSROOT})
115     string(REPLACE ";" " " WINDOWS_LINK_FLAGS "${WINDOWS_LINK_FLAGS}")
116   endif()
118   list(APPEND BUILTIN_TARGETS "${target}")
119   set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Windows CACHE STRING "")
120   set(BUILTINS_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
121   set(BUILTINS_${target}_CMAKE_C_FLAGS ${WINDOWS_COMPILER_FLAGS} CACHE STRING "")
122   set(BUILTINS_${target}_CMAKE_CXX_FLAGS ${WINDOWS_COMPILER_FLAGS} CACHE STRING "")
123   set(BUILTINS_${target}_CMAKE_EXE_LINKER_FLAGS ${WINDOWS_LINK_FLAGS} CACHE STRING "")
124   set(BUILTINS_${target}_CMAKE_SHARED_LINKER_FLAGS ${WINDOWS_LINK_FLAGS} CACHE STRING "")
125   set(BUILTINS_${target}_CMAKE_MODULE_LINKER_FLAGS ${WINDOWS_LINK_FLAGS} CACHE STRING "")
127   list(APPEND RUNTIME_TARGETS "${target}")
128   set(RUNTIMES_${target}_CMAKE_SYSTEM_NAME Windows CACHE STRING "")
129   set(RUNTIMES_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
130   set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
131   set(RUNTIMES_${target}_LIBCXX_ENABLE_ABI_LINKER_SCRIPT OFF CACHE BOOL "")
132   set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
133   set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx" CACHE STRING "")
134   set(RUNTIMES_${target}_CMAKE_C_FLAGS ${WINDOWS_COMPILER_FLAGS} CACHE STRING "")
135   set(RUNTIMES_${target}_CMAKE_CXX_FLAGS ${WINDOWS_COMPILER_FLAGS} CACHE STRING "")
136   set(RUNTIMES_${target}_CMAKE_EXE_LINKER_FLAGS ${WINDOWS_LINK_FLAGS} CACHE STRING "")
137   set(RUNTIMES_${target}_CMAKE_SHARED_LINKER_FLAGS ${WINDOWS_LINK_FLAGS} CACHE STRING "")
138   set(RUNTIMES_${target}_CMAKE_MODULE_LINKER_FLAGS ${WINDOWS_LINK_FLAGS} CACHE STRING "")
139 endif()
141 foreach(target aarch64-unknown-linux-gnu;armv7-unknown-linux-gnueabihf;i386-unknown-linux-gnu;riscv64-unknown-linux-gnu;x86_64-unknown-linux-gnu)
142   if(LINUX_${target}_SYSROOT)
143     # Set the per-target builtins options.
144     list(APPEND BUILTIN_TARGETS "${target}")
145     set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
146     set(BUILTINS_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
147     set(BUILTINS_${target}_CMAKE_C_FLAGS "--target=${target}" CACHE STRING "")
148     set(BUILTINS_${target}_CMAKE_CXX_FLAGS "--target=${target}" CACHE STRING "")
149     set(BUILTINS_${target}_CMAKE_ASM_FLAGS "--target=${target}" CACHE STRING "")
150     set(BUILTINS_${target}_CMAKE_SYSROOT ${LINUX_${target}_SYSROOT} CACHE STRING "")
151     set(BUILTINS_${target}_CMAKE_SHARED_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
152     set(BUILTINS_${target}_CMAKE_MODULE_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
153     set(BUILTINS_${target}_CMAKE_EXE_LINKER_FLAG "-fuse-ld=lld" CACHE STRING "")
154     set(BUILTINS_${target}_COMPILER_RT_BUILD_STANDALONE_LIBATOMIC ON CACHE BOOL "")
156     # Set the per-target runtimes options.
157     list(APPEND RUNTIME_TARGETS "${target}")
158     set(RUNTIMES_${target}_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
159     set(RUNTIMES_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
160     set(RUNTIMES_${target}_CMAKE_C_FLAGS "--target=${target}" CACHE STRING "")
161     set(RUNTIMES_${target}_CMAKE_CXX_FLAGS "--target=${target}" CACHE STRING "")
162     set(RUNTIMES_${target}_CMAKE_ASM_FLAGS "--target=${target}" CACHE STRING "")
163     set(RUNTIMES_${target}_CMAKE_SYSROOT ${LINUX_${target}_SYSROOT} CACHE STRING "")
164     set(RUNTIMES_${target}_CMAKE_SHARED_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
165     set(RUNTIMES_${target}_CMAKE_MODULE_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
166     set(RUNTIMES_${target}_CMAKE_EXE_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
167     set(RUNTIMES_${target}_COMPILER_RT_CXX_LIBRARY "libcxx" CACHE STRING "")
168     set(RUNTIMES_${target}_COMPILER_RT_USE_BUILTINS_LIBRARY ON CACHE BOOL "")
169     set(RUNTIMES_${target}_COMPILER_RT_USE_LLVM_UNWINDER ON CACHE BOOL "")
170     set(RUNTIMES_${target}_COMPILER_RT_CAN_EXECUTE_TESTS ON CACHE BOOL "")
171     set(RUNTIMES_${target}_COMPILER_RT_BUILD_STANDALONE_LIBATOMIC ON CACHE BOOL "")
172     set(RUNTIMES_${target}_LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
173     set(RUNTIMES_${target}_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
174     set(RUNTIMES_${target}_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
175     set(RUNTIMES_${target}_LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
176     set(RUNTIMES_${target}_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
177     set(RUNTIMES_${target}_LIBCXXABI_INSTALL_LIBRARY OFF CACHE BOOL "")
178     set(RUNTIMES_${target}_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
179     set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
180     set(RUNTIMES_${target}_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
181     set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
182     set(RUNTIMES_${target}_LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "")
183     set(RUNTIMES_${target}_SANITIZER_CXX_ABI "libc++" CACHE STRING "")
184     set(RUNTIMES_${target}_SANITIZER_CXX_ABI_INTREE ON CACHE BOOL "")
185     set(RUNTIMES_${target}_SANITIZER_TEST_CXX "libc++" CACHE STRING "")
186     set(RUNTIMES_${target}_SANITIZER_TEST_CXX_INTREE ON CACHE BOOL "")
187     set(RUNTIMES_${target}_LLVM_TOOLS_DIR "${CMAKE_BINARY_DIR}/bin" CACHE BOOL "")
188     set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
190     # Use .build-id link.
191     list(APPEND RUNTIME_BUILD_ID_LINK "${target}")
192   endif()
193 endforeach()
195 if(FUCHSIA_SDK)
196   set(FUCHSIA_aarch64-unknown-fuchsia_NAME arm64)
197   set(FUCHSIA_i386-unknown-fuchsia_NAME x64)
198   set(FUCHSIA_x86_64-unknown-fuchsia_NAME x64)
199   set(FUCHSIA_riscv64-unknown-fuchsia_NAME riscv64)
200   foreach(target i386-unknown-fuchsia;x86_64-unknown-fuchsia;aarch64-unknown-fuchsia;riscv64-unknown-fuchsia)
201     set(FUCHSIA_${target}_COMPILER_FLAGS "--target=${target} -I${FUCHSIA_SDK}/pkg/sync/include -I${FUCHSIA_SDK}/pkg/fdio/include")
202     set(FUCHSIA_${target}_LINKER_FLAGS "-L${FUCHSIA_SDK}/arch/${FUCHSIA_${target}_NAME}/lib")
203     set(FUCHSIA_${target}_SYSROOT "${FUCHSIA_SDK}/arch/${FUCHSIA_${target}_NAME}/sysroot")
204   endforeach()
206   foreach(target i386-unknown-fuchsia;x86_64-unknown-fuchsia;aarch64-unknown-fuchsia;riscv64-unknown-fuchsia)
207     # Set the per-target builtins options.
208     list(APPEND BUILTIN_TARGETS "${target}")
209     set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
210     set(BUILTINS_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
211     set(BUILTINS_${target}_CMAKE_ASM_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE STRING "")
212     set(BUILTINS_${target}_CMAKE_C_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE STRING "")
213     set(BUILTINS_${target}_CMAKE_CXX_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE STRING "")
214     set(BUILTINS_${target}_CMAKE_SHARED_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE STRING "")
215     set(BUILTINS_${target}_CMAKE_MODULE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE STRING "")
216     set(BUILTINS_${target}_CMAKE_EXE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE STRING "")
217     set(BUILTINS_${target}_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} CACHE PATH "")
218   endforeach()
220   foreach(target x86_64-unknown-fuchsia;aarch64-unknown-fuchsia;riscv64-unknown-fuchsia)
221     # Set the per-target runtimes options.
222     list(APPEND RUNTIME_TARGETS "${target}")
223     set(RUNTIMES_${target}_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
224     set(RUNTIMES_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
225     set(RUNTIMES_${target}_CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE BOOL "")
226     set(RUNTIMES_${target}_CMAKE_ASM_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE STRING "")
227     set(RUNTIMES_${target}_CMAKE_C_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE STRING "")
228     set(RUNTIMES_${target}_CMAKE_CXX_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE STRING "")
229     set(RUNTIMES_${target}_CMAKE_SHARED_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE STRING "")
230     set(RUNTIMES_${target}_CMAKE_MODULE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE STRING "")
231     set(RUNTIMES_${target}_CMAKE_EXE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE STRING "")
232     set(RUNTIMES_${target}_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} CACHE PATH "")
233     set(RUNTIMES_${target}_COMPILER_RT_CXX_LIBRARY "libcxx" CACHE STRING "")
234     set(RUNTIMES_${target}_COMPILER_RT_USE_BUILTINS_LIBRARY ON CACHE BOOL "")
235     set(RUNTIMES_${target}_COMPILER_RT_USE_LLVM_UNWINDER ON CACHE BOOL "")
236     set(RUNTIMES_${target}_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
237     set(RUNTIMES_${target}_LIBUNWIND_HIDE_SYMBOLS ON CACHE BOOL "")
238     set(RUNTIMES_${target}_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
239     set(RUNTIMES_${target}_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
240     set(RUNTIMES_${target}_LIBCXXABI_HERMETIC_STATIC_LIBRARY ON CACHE BOOL "")
241     set(RUNTIMES_${target}_LIBCXXABI_INSTALL_STATIC_LIBRARY OFF CACHE BOOL "")
242     set(RUNTIMES_${target}_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
243     set(RUNTIMES_${target}_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
244     set(RUNTIMES_${target}_LIBCXX_HERMETIC_STATIC_LIBRARY ON CACHE BOOL "")
245     set(RUNTIMES_${target}_LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY OFF CACHE BOOL "")
246     set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
247     set(RUNTIMES_${target}_LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "")
248     set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
250     # Compat multilibs.
251     set(RUNTIMES_${target}+compat_LLVM_BUILD_COMPILER_RT OFF CACHE BOOL "")
252     set(RUNTIMES_${target}+compat_LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
253     set(RUNTIMES_${target}+compat_LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
254     set(RUNTIMES_${target}+compat_CMAKE_CXX_FLAGS "${FUCHSIA_${target}_COMPILER_FLAGS} -fc++-abi=itanium" CACHE STRING "")
256     set(RUNTIMES_${target}+asan_LLVM_BUILD_COMPILER_RT OFF CACHE BOOL "")
257     set(RUNTIMES_${target}+asan_LLVM_USE_SANITIZER "Address" CACHE STRING "")
258     set(RUNTIMES_${target}+asan_LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
259     set(RUNTIMES_${target}+asan_LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
261     set(RUNTIMES_${target}+noexcept_LLVM_BUILD_COMPILER_RT OFF CACHE BOOL "")
262     set(RUNTIMES_${target}+noexcept_LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
263     set(RUNTIMES_${target}+noexcept_LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
265     set(RUNTIMES_${target}+asan+noexcept_LLVM_BUILD_COMPILER_RT OFF CACHE BOOL "")
266     set(RUNTIMES_${target}+asan+noexcept_LLVM_USE_SANITIZER "Address" CACHE STRING "")
267     set(RUNTIMES_${target}+asan+noexcept_LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
268     set(RUNTIMES_${target}+asan+noexcept_LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
269     set(RUNTIMES_${target}+asan+noexcept_LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
270     set(RUNTIMES_${target}+asan+noexcept_LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
272     # Use .build-id link.
273     list(APPEND RUNTIME_BUILD_ID_LINK "${target}")
274   endforeach()
276   # HWAsan
277   set(RUNTIMES_aarch64-unknown-fuchsia+hwasan_LLVM_BUILD_COMPILER_RT OFF CACHE BOOL "")
278   set(RUNTIMES_aarch64-unknown-fuchsia+hwasan_LLVM_USE_SANITIZER "HWAddress" CACHE STRING "")
279   set(RUNTIMES_aarch64-unknown-fuchsia+hwasan_LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
280   set(RUNTIMES_aarch64-unknown-fuchsia+hwasan_LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
282   # HWASan+noexcept
283   set(RUNTIMES_aarch64-unknown-fuchsia+hwasan+noexcept_LLVM_BUILD_COMPILER_RT OFF CACHE BOOL "")
284   set(RUNTIMES_aarch64-unknown-fuchsia+hwasan+noexcept_LLVM_USE_SANITIZER "HWAddress" CACHE STRING "")
285   set(RUNTIMES_aarch64-unknown-fuchsia+hwasan+noexcept_LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
286   set(RUNTIMES_aarch64-unknown-fuchsia+hwasan+noexcept_LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
287   set(RUNTIMES_aarch64-unknown-fuchsia+hwasan+noexcept_LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
288   set(RUNTIMES_aarch64-unknown-fuchsia+hwasan+noexcept_LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
290   set(LLVM_RUNTIME_MULTILIBS "asan;noexcept;compat;asan+noexcept;hwasan;hwasan+noexcept" CACHE STRING "")
292   set(LLVM_RUNTIME_MULTILIB_asan_TARGETS "x86_64-unknown-fuchsia;aarch64-unknown-fuchsia;riscv64-unknown-fuchsia" CACHE STRING "")
293   set(LLVM_RUNTIME_MULTILIB_noexcept_TARGETS "x86_64-unknown-fuchsia;aarch64-unknown-fuchsia;riscv64-unknown-fuchsia" CACHE STRING "")
294   set(LLVM_RUNTIME_MULTILIB_compat_TARGETS "x86_64-unknown-fuchsia;aarch64-unknown-fuchsia;riscv64-unknown-fuchsia" CACHE STRING "")
295   set(LLVM_RUNTIME_MULTILIB_asan+noexcept_TARGETS "x86_64-unknown-fuchsia;aarch64-unknown-fuchsia;riscv64-unknown-fuchsia" CACHE STRING "")
296   set(LLVM_RUNTIME_MULTILIB_hwasan_TARGETS "aarch64-unknown-fuchsia;riscv64-unknown-fuchsia" CACHE STRING "")
297   set(LLVM_RUNTIME_MULTILIB_hwasan+noexcept_TARGETS "aarch64-unknown-fuchsia;riscv64-unknown-fuchsia" CACHE STRING "")
298 endif()
300 set(LLVM_BUILTIN_TARGETS "${BUILTIN_TARGETS}" CACHE STRING "")
301 set(LLVM_RUNTIME_TARGETS "${RUNTIME_TARGETS}" CACHE STRING "")
303 # Setup toolchain.
304 set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "")
305 set(LLVM_TOOLCHAIN_TOOLS
306   dsymutil
307   llvm-ar
308   llvm-cov
309   llvm-cxxfilt
310   llvm-debuginfod
311   llvm-debuginfod-find
312   llvm-dlltool
313   ${LLVM_DRIVER_TARGET}
314   llvm-dwarfdump
315   llvm-dwp
316   llvm-ifs
317   llvm-gsymutil
318   llvm-lib
319   llvm-libtool-darwin
320   llvm-lipo
321   llvm-ml
322   llvm-mt
323   llvm-nm
324   llvm-objcopy
325   llvm-objdump
326   llvm-otool
327   llvm-pdbutil
328   llvm-profdata
329   llvm-rc
330   llvm-ranlib
331   llvm-readelf
332   llvm-readobj
333   llvm-size
334   llvm-strings
335   llvm-strip
336   llvm-symbolizer
337   llvm-undname
338   llvm-xray
339   opt-viewer
340   sancov
341   scan-build-py
342   CACHE STRING "")
344 set(LLVM_Toolchain_DISTRIBUTION_COMPONENTS
345   bolt
346   clang
347   lld
348   clang-apply-replacements
349   clang-doc
350   clang-format
351   clang-resource-headers
352   clang-include-fixer
353   clang-refactor
354   clang-scan-deps
355   clang-tidy
356   clangd
357   find-all-symbols
358   builtins
359   runtimes
360   ${LLVM_TOOLCHAIN_TOOLS}
361   CACHE STRING "")
363 set(_FUCHSIA_DISTRIBUTIONS Toolchain)
365 if(FUCHSIA_ENABLE_LLDB)
366   list(APPEND _FUCHSIA_ENABLE_PROJECTS lldb)
367   list(APPEND _FUCHSIA_DISTRIBUTIONS Debugger)
368   set(_FUCHSIA_LLDB_COMPONENTS
369     lldb
370     liblldb
371     lldb-server
372     lldb-argdumper
373     lldb-dap
374   )
375   if(LLDB_ENABLE_PYTHON)
376     list(APPEND _FUCHSIA_LLDB_COMPONENTS lldb-python-scripts)
377   endif()
378   set(LLVM_Debugger_DISTRIBUTION_COMPONENTS ${_FUCHSIA_LLDB_COMPONENTS} CACHE STRING "")
379 endif()
381 set(LLVM_DISTRIBUTIONS ${_FUCHSIA_DISTRIBUTIONS} CACHE STRING "")
382 set(LLVM_ENABLE_PROJECTS ${_FUCHSIA_ENABLE_PROJECTS} CACHE STRING "")