Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / cmake / caches / Fuchsia-stage2.cmake
blob13bb5ad3546e98f2dbec998d70031ae68d89579d
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_USE_COMPILER_RT ON CACHE BOOL "")
85   set(RUNTIMES_CMAKE_ARGS "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13;-DCMAKE_OSX_ARCHITECTURES=arm64|x86_64" CACHE STRING "")
86 endif()
88 if(WIN32 OR LLVM_WINSYSROOT)
89   if((NOT WIN32) AND (NOT LLVM_VFSOVERLAY))
90     message(FATAL_ERROR "LLVM_VFSOVERLAY should be defined.")
91   endif()
92   set(target "x86_64-pc-windows-msvc")
94   if (LLVM_WINSYSROOT)
95     set(WINDOWS_COMPILER_FLAGS
96       -Xclang
97       -ivfsoverlay
98       -Xclang
99       ${LLVM_VFSOVERLAY}
100       # TODO: /winsysroot should be set by HandleLLVMOptions.cmake automatically
101       # but it current has a bug that prevents it from working under cross
102       # compilation. Set this flag manually for now.
103       /winsysroot
104       ${LLVM_WINSYSROOT})
105     string(REPLACE ";" " " WINDOWS_COMPILER_FLAGS "${WINDOWS_COMPILER_FLAGS}")
106     set(WINDOWS_LINK_FLAGS
107       # TODO: lld-link has a bug that it cannot infer the machine type
108       # correctly when /winsysroot is set while Windows libraries search paths
109       # are not explicitly defined.
110       # Explicitly set the machine type for now.
111       /machine:X64
112       /vfsoverlay:${LLVM_VFSOVERLAY}
113       /winsysroot:${LLVM_WINSYSROOT})
114     string(REPLACE ";" " " WINDOWS_LINK_FLAGS "${WINDOWS_LINK_FLAGS}")
115   endif()
117   list(APPEND BUILTIN_TARGETS "${target}")
118   set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Windows CACHE STRING "")
119   set(BUILTINS_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
120   set(BUILTINS_${target}_CMAKE_C_FLAGS ${WINDOWS_COMPILER_FLAGS} CACHE STRING "")
121   set(BUILTINS_${target}_CMAKE_CXX_FLAGS ${WINDOWS_COMPILER_FLAGS} CACHE STRING "")
122   set(BUILTINS_${target}_CMAKE_EXE_LINKER_FLAGS ${WINDOWS_LINK_FLAGS} CACHE STRING "")
123   set(BUILTINS_${target}_CMAKE_SHARED_LINKER_FLAGS ${WINDOWS_LINK_FLAGS} CACHE STRING "")
124   set(BUILTINS_${target}_CMAKE_MODULE_LINKER_FLAGS ${WINDOWS_LINK_FLAGS} CACHE STRING "")
126   list(APPEND RUNTIME_TARGETS "${target}")
127   set(RUNTIMES_${target}_CMAKE_SYSTEM_NAME Windows CACHE STRING "")
128   set(RUNTIMES_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
129   set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
130   set(RUNTIMES_${target}_LIBCXX_ENABLE_ABI_LINKER_SCRIPT OFF CACHE BOOL "")
131   set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
132   set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx" CACHE STRING "")
133   set(RUNTIMES_${target}_CMAKE_C_FLAGS ${WINDOWS_COMPILER_FLAGS} CACHE STRING "")
134   set(RUNTIMES_${target}_CMAKE_CXX_FLAGS ${WINDOWS_COMPILER_FLAGS} CACHE STRING "")
135   set(RUNTIMES_${target}_CMAKE_EXE_LINKER_FLAGS ${WINDOWS_LINK_FLAGS} CACHE STRING "")
136   set(RUNTIMES_${target}_CMAKE_SHARED_LINKER_FLAGS ${WINDOWS_LINK_FLAGS} CACHE STRING "")
137   set(RUNTIMES_${target}_CMAKE_MODULE_LINKER_FLAGS ${WINDOWS_LINK_FLAGS} CACHE STRING "")
138 endif()
140 foreach(target aarch64-unknown-linux-gnu;armv7-unknown-linux-gnueabihf;i386-unknown-linux-gnu;riscv64-unknown-linux-gnu;x86_64-unknown-linux-gnu)
141   if(LINUX_${target}_SYSROOT)
142     # Set the per-target builtins options.
143     list(APPEND BUILTIN_TARGETS "${target}")
144     set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
145     set(BUILTINS_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
146     set(BUILTINS_${target}_CMAKE_C_FLAGS "--target=${target}" CACHE STRING "")
147     set(BUILTINS_${target}_CMAKE_CXX_FLAGS "--target=${target}" CACHE STRING "")
148     set(BUILTINS_${target}_CMAKE_ASM_FLAGS "--target=${target}" CACHE STRING "")
149     set(BUILTINS_${target}_CMAKE_SYSROOT ${LINUX_${target}_SYSROOT} CACHE STRING "")
150     set(BUILTINS_${target}_CMAKE_SHARED_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
151     set(BUILTINS_${target}_CMAKE_MODULE_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
152     set(BUILTINS_${target}_CMAKE_EXE_LINKER_FLAG "-fuse-ld=lld" CACHE STRING "")
153     set(BUILTINS_${target}_COMPILER_RT_BUILD_STANDALONE_LIBATOMIC ON CACHE BOOL "")
155     # Set the per-target runtimes options.
156     list(APPEND RUNTIME_TARGETS "${target}")
157     set(RUNTIMES_${target}_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
158     set(RUNTIMES_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
159     set(RUNTIMES_${target}_CMAKE_C_FLAGS "--target=${target}" CACHE STRING "")
160     set(RUNTIMES_${target}_CMAKE_CXX_FLAGS "--target=${target}" CACHE STRING "")
161     set(RUNTIMES_${target}_CMAKE_ASM_FLAGS "--target=${target}" CACHE STRING "")
162     set(RUNTIMES_${target}_CMAKE_SYSROOT ${LINUX_${target}_SYSROOT} CACHE STRING "")
163     set(RUNTIMES_${target}_CMAKE_SHARED_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
164     set(RUNTIMES_${target}_CMAKE_MODULE_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
165     set(RUNTIMES_${target}_CMAKE_EXE_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
166     set(RUNTIMES_${target}_COMPILER_RT_CXX_LIBRARY "libcxx" CACHE STRING "")
167     set(RUNTIMES_${target}_COMPILER_RT_USE_BUILTINS_LIBRARY ON CACHE BOOL "")
168     set(RUNTIMES_${target}_COMPILER_RT_USE_LLVM_UNWINDER ON CACHE BOOL "")
169     set(RUNTIMES_${target}_COMPILER_RT_CAN_EXECUTE_TESTS ON CACHE BOOL "")
170     set(RUNTIMES_${target}_COMPILER_RT_BUILD_STANDALONE_LIBATOMIC ON CACHE BOOL "")
171     set(RUNTIMES_${target}_LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
172     set(RUNTIMES_${target}_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
173     set(RUNTIMES_${target}_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
174     set(RUNTIMES_${target}_LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
175     set(RUNTIMES_${target}_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
176     set(RUNTIMES_${target}_LIBCXXABI_INSTALL_LIBRARY OFF CACHE BOOL "")
177     set(RUNTIMES_${target}_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
178     set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
179     set(RUNTIMES_${target}_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
180     set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
181     set(RUNTIMES_${target}_LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "")
182     set(RUNTIMES_${target}_SANITIZER_CXX_ABI "libc++" CACHE STRING "")
183     set(RUNTIMES_${target}_SANITIZER_CXX_ABI_INTREE ON CACHE BOOL "")
184     set(RUNTIMES_${target}_SANITIZER_TEST_CXX "libc++" CACHE STRING "")
185     set(RUNTIMES_${target}_SANITIZER_TEST_CXX_INTREE ON CACHE BOOL "")
186     set(RUNTIMES_${target}_LLVM_TOOLS_DIR "${CMAKE_BINARY_DIR}/bin" CACHE BOOL "")
187     set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
189     # Use .build-id link.
190     list(APPEND RUNTIME_BUILD_ID_LINK "${target}")
191   endif()
192 endforeach()
194 if(FUCHSIA_SDK)
195   set(FUCHSIA_aarch64-unknown-fuchsia_NAME arm64)
196   set(FUCHSIA_i386-unknown-fuchsia_NAME x64)
197   set(FUCHSIA_x86_64-unknown-fuchsia_NAME x64)
198   set(FUCHSIA_riscv64-unknown-fuchsia_NAME riscv64)
199   foreach(target i386-unknown-fuchsia;x86_64-unknown-fuchsia;aarch64-unknown-fuchsia;riscv64-unknown-fuchsia)
200     set(FUCHSIA_${target}_COMPILER_FLAGS "--target=${target} -I${FUCHSIA_SDK}/pkg/sync/include -I${FUCHSIA_SDK}/pkg/fdio/include")
201     set(FUCHSIA_${target}_LINKER_FLAGS "-L${FUCHSIA_SDK}/arch/${FUCHSIA_${target}_NAME}/lib")
202     set(FUCHSIA_${target}_SYSROOT "${FUCHSIA_SDK}/arch/${FUCHSIA_${target}_NAME}/sysroot")
203   endforeach()
205   foreach(target i386-unknown-fuchsia;x86_64-unknown-fuchsia;aarch64-unknown-fuchsia;riscv64-unknown-fuchsia)
206     # Set the per-target builtins options.
207     list(APPEND BUILTIN_TARGETS "${target}")
208     set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
209     set(BUILTINS_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
210     set(BUILTINS_${target}_CMAKE_ASM_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE STRING "")
211     set(BUILTINS_${target}_CMAKE_C_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE STRING "")
212     set(BUILTINS_${target}_CMAKE_CXX_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE STRING "")
213     set(BUILTINS_${target}_CMAKE_SHARED_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE STRING "")
214     set(BUILTINS_${target}_CMAKE_MODULE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE STRING "")
215     set(BUILTINS_${target}_CMAKE_EXE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE STRING "")
216     set(BUILTINS_${target}_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} CACHE PATH "")
217   endforeach()
219   foreach(target x86_64-unknown-fuchsia;aarch64-unknown-fuchsia;riscv64-unknown-fuchsia)
220     # Set the per-target runtimes options.
221     list(APPEND RUNTIME_TARGETS "${target}")
222     set(RUNTIMES_${target}_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
223     set(RUNTIMES_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
224     set(RUNTIMES_${target}_CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE BOOL "")
225     set(RUNTIMES_${target}_CMAKE_ASM_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE STRING "")
226     set(RUNTIMES_${target}_CMAKE_C_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE STRING "")
227     set(RUNTIMES_${target}_CMAKE_CXX_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE STRING "")
228     set(RUNTIMES_${target}_CMAKE_SHARED_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE STRING "")
229     set(RUNTIMES_${target}_CMAKE_MODULE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE STRING "")
230     set(RUNTIMES_${target}_CMAKE_EXE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE STRING "")
231     set(RUNTIMES_${target}_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} CACHE PATH "")
232     set(RUNTIMES_${target}_COMPILER_RT_CXX_LIBRARY "libcxx" CACHE STRING "")
233     set(RUNTIMES_${target}_COMPILER_RT_USE_BUILTINS_LIBRARY ON CACHE BOOL "")
234     set(RUNTIMES_${target}_COMPILER_RT_USE_LLVM_UNWINDER ON CACHE BOOL "")
235     set(RUNTIMES_${target}_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
236     set(RUNTIMES_${target}_LIBUNWIND_HIDE_SYMBOLS ON CACHE BOOL "")
237     set(RUNTIMES_${target}_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
238     set(RUNTIMES_${target}_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
239     set(RUNTIMES_${target}_LIBCXXABI_HERMETIC_STATIC_LIBRARY ON CACHE BOOL "")
240     set(RUNTIMES_${target}_LIBCXXABI_INSTALL_STATIC_LIBRARY OFF CACHE BOOL "")
241     set(RUNTIMES_${target}_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
242     set(RUNTIMES_${target}_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
243     set(RUNTIMES_${target}_LIBCXX_HERMETIC_STATIC_LIBRARY ON CACHE BOOL "")
244     set(RUNTIMES_${target}_LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY OFF CACHE BOOL "")
245     set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
246     set(RUNTIMES_${target}_LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "")
247     set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
249     # Compat multilibs.
250     set(RUNTIMES_${target}+compat_LLVM_BUILD_COMPILER_RT OFF CACHE BOOL "")
251     set(RUNTIMES_${target}+compat_LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
252     set(RUNTIMES_${target}+compat_LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
253     set(RUNTIMES_${target}+compat_CMAKE_CXX_FLAGS "${FUCHSIA_${target}_COMPILER_FLAGS} -fc++-abi=itanium" CACHE STRING "")
255     set(RUNTIMES_${target}+asan_LLVM_BUILD_COMPILER_RT OFF CACHE BOOL "")
256     set(RUNTIMES_${target}+asan_LLVM_USE_SANITIZER "Address" CACHE STRING "")
257     set(RUNTIMES_${target}+asan_LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
258     set(RUNTIMES_${target}+asan_LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
260     set(RUNTIMES_${target}+noexcept_LLVM_BUILD_COMPILER_RT OFF CACHE BOOL "")
261     set(RUNTIMES_${target}+noexcept_LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
262     set(RUNTIMES_${target}+noexcept_LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
264     set(RUNTIMES_${target}+asan+noexcept_LLVM_BUILD_COMPILER_RT OFF CACHE BOOL "")
265     set(RUNTIMES_${target}+asan+noexcept_LLVM_USE_SANITIZER "Address" CACHE STRING "")
266     set(RUNTIMES_${target}+asan+noexcept_LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
267     set(RUNTIMES_${target}+asan+noexcept_LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
268     set(RUNTIMES_${target}+asan+noexcept_LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
269     set(RUNTIMES_${target}+asan+noexcept_LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
271     # Use .build-id link.
272     list(APPEND RUNTIME_BUILD_ID_LINK "${target}")
273   endforeach()
275   # HWAsan
276   set(RUNTIMES_aarch64-unknown-fuchsia+hwasan_LLVM_BUILD_COMPILER_RT OFF CACHE BOOL "")
277   set(RUNTIMES_aarch64-unknown-fuchsia+hwasan_LLVM_USE_SANITIZER "HWAddress" CACHE STRING "")
278   set(RUNTIMES_aarch64-unknown-fuchsia+hwasan_LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
279   set(RUNTIMES_aarch64-unknown-fuchsia+hwasan_LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
281   # HWASan+noexcept
282   set(RUNTIMES_aarch64-unknown-fuchsia+hwasan+noexcept_LLVM_BUILD_COMPILER_RT OFF CACHE BOOL "")
283   set(RUNTIMES_aarch64-unknown-fuchsia+hwasan+noexcept_LLVM_USE_SANITIZER "HWAddress" CACHE STRING "")
284   set(RUNTIMES_aarch64-unknown-fuchsia+hwasan+noexcept_LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
285   set(RUNTIMES_aarch64-unknown-fuchsia+hwasan+noexcept_LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
286   set(RUNTIMES_aarch64-unknown-fuchsia+hwasan+noexcept_LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
287   set(RUNTIMES_aarch64-unknown-fuchsia+hwasan+noexcept_LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
289   set(LLVM_RUNTIME_MULTILIBS "asan;noexcept;compat;asan+noexcept;hwasan;hwasan+noexcept" CACHE STRING "")
291   set(LLVM_RUNTIME_MULTILIB_asan_TARGETS "x86_64-unknown-fuchsia;aarch64-unknown-fuchsia;riscv64-unknown-fuchsia" CACHE STRING "")
292   set(LLVM_RUNTIME_MULTILIB_noexcept_TARGETS "x86_64-unknown-fuchsia;aarch64-unknown-fuchsia;riscv64-unknown-fuchsia" CACHE STRING "")
293   set(LLVM_RUNTIME_MULTILIB_compat_TARGETS "x86_64-unknown-fuchsia;aarch64-unknown-fuchsia;riscv64-unknown-fuchsia" CACHE STRING "")
294   set(LLVM_RUNTIME_MULTILIB_asan+noexcept_TARGETS "x86_64-unknown-fuchsia;aarch64-unknown-fuchsia;riscv64-unknown-fuchsia" CACHE STRING "")
295   set(LLVM_RUNTIME_MULTILIB_hwasan_TARGETS "aarch64-unknown-fuchsia;riscv64-unknown-fuchsia" CACHE STRING "")
296   set(LLVM_RUNTIME_MULTILIB_hwasan+noexcept_TARGETS "aarch64-unknown-fuchsia;riscv64-unknown-fuchsia" CACHE STRING "")
297 endif()
299 set(LLVM_BUILTIN_TARGETS "${BUILTIN_TARGETS}" CACHE STRING "")
300 set(LLVM_RUNTIME_TARGETS "${RUNTIME_TARGETS}" CACHE STRING "")
302 # Setup toolchain.
303 set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "")
304 set(LLVM_TOOLCHAIN_TOOLS
305   dsymutil
306   llvm-ar
307   llvm-cov
308   llvm-cxxfilt
309   llvm-debuginfod
310   llvm-debuginfod-find
311   llvm-dlltool
312   ${LLVM_DRIVER_TARGET}
313   llvm-dwarfdump
314   llvm-dwp
315   llvm-ifs
316   llvm-gsymutil
317   llvm-lib
318   llvm-libtool-darwin
319   llvm-lipo
320   llvm-ml
321   llvm-mt
322   llvm-nm
323   llvm-objcopy
324   llvm-objdump
325   llvm-otool
326   llvm-pdbutil
327   llvm-profdata
328   llvm-rc
329   llvm-ranlib
330   llvm-readelf
331   llvm-readobj
332   llvm-size
333   llvm-strings
334   llvm-strip
335   llvm-symbolizer
336   llvm-undname
337   llvm-xray
338   sancov
339   scan-build-py
340   CACHE STRING "")
342 set(LLVM_Toolchain_DISTRIBUTION_COMPONENTS
343   bolt
344   clang
345   lld
346   clang-apply-replacements
347   clang-doc
348   clang-format
349   clang-resource-headers
350   clang-include-fixer
351   clang-refactor
352   clang-scan-deps
353   clang-tidy
354   clangd
355   find-all-symbols
356   builtins
357   runtimes
358   ${LLVM_TOOLCHAIN_TOOLS}
359   CACHE STRING "")
361 set(_FUCHSIA_DISTRIBUTIONS Toolchain)
363 if(FUCHSIA_ENABLE_LLDB)
364   list(APPEND _FUCHSIA_ENABLE_PROJECTS lldb)
365   list(APPEND _FUCHSIA_DISTRIBUTIONS Debugger)
366   set(_FUCHSIA_LLDB_COMPONENTS
367     lldb
368     liblldb
369     lldb-server
370     lldb-argdumper
371     lldb-dap
372   )
373   if(LLDB_ENABLE_PYTHON)
374     list(APPEND _FUCHSIA_LLDB_COMPONENTS lldb-python-scripts)
375   endif()
376   set(LLVM_Debugger_DISTRIBUTION_COMPONENTS ${_FUCHSIA_LLDB_COMPONENTS} CACHE STRING "")
377 endif()
379 set(LLVM_DISTRIBUTIONS ${_FUCHSIA_DISTRIBUTIONS} CACHE STRING "")
380 set(LLVM_ENABLE_PROJECTS ${_FUCHSIA_ENABLE_PROJECTS} CACHE STRING "")