Skip to content

Commit b3b408b

Browse files
authored
[Fuchsia] Include baremetal ARM builtins and libc (#83949)
For now we only include the armv6m-unknown-eabi target but we plan to include more targets in the future (including multilibs).
1 parent 13cd0a9 commit b3b408b

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

clang/cmake/caches/Fuchsia-stage2.cmake

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,39 @@ if(FUCHSIA_SDK)
300300
set(LLVM_RUNTIME_MULTILIB_hwasan+noexcept_TARGETS "aarch64-unknown-fuchsia;riscv64-unknown-fuchsia" CACHE STRING "")
301301
endif()
302302

303+
foreach(target armv6m-unknown-eabi)
304+
list(APPEND BUILTIN_TARGETS "${target}")
305+
set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Generic CACHE STRING "")
306+
set(BUILTINS_${target}_CMAKE_SYSTEM_PROCESSOR arm CACHE STRING "")
307+
set(BUILTINS_${target}_CMAKE_SYSROOT "" CACHE STRING "")
308+
set(BUILTINS_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
309+
foreach(lang C;CXX;ASM)
310+
set(BUILTINS_${target}_CMAKE_${lang}_FLAGS "--target=${target} -mcpu=cortex-m0plus -mthumb" CACHE STRING "")
311+
endforeach()
312+
foreach(type SHARED;MODULE;EXE)
313+
set(BUILTINS_${target}_CMAKE_${type}_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
314+
endforeach()
315+
set(BUILTINS_${target}_COMPILER_RT_BAREMETAL_BUILD ON CACHE BOOL "")
316+
317+
list(APPEND RUNTIME_TARGETS "${target}")
318+
set(RUNTIMES_${target}_CMAKE_SYSTEM_NAME Generic CACHE STRING "")
319+
set(RUNTIMES_${target}_CMAKE_SYSTEM_PROCESSOR arm CACHE STRING "")
320+
set(RUNTIMES_${target}_CMAKE_SYSROOT "" CACHE STRING "")
321+
set(RUNTIMES_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
322+
set(RUNTIMES_${target}_CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY CACHE STRING "")
323+
foreach(lang C;CXX;ASM)
324+
set(RUNTIMES_${target}_CMAKE_${lang}_FLAGS "--target=${target} -mcpu=cortex-m0plus -mthumb" CACHE STRING "")
325+
endforeach()
326+
foreach(type SHARED;MODULE;EXE)
327+
set(RUNTIMES_${target}_CMAKE_${type}_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
328+
endforeach()
329+
set(RUNTIMES_${target}_LLVM_LIBC_FULL_BUILD ON CACHE BOOL "")
330+
set(RUNTIMES_${target}_LIBC_ENABLE_USE_BY_CLANG ON CACHE BOOL "")
331+
set(RUNTIMES_${target}_LLVM_INCLUDE_TESTS OFF CACHE BOOL "")
332+
set(RUNTIMES_${target}_LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "")
333+
set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "libc" CACHE STRING "")
334+
endforeach()
335+
303336
foreach(target riscv32-unknown-elf)
304337
list(APPEND BUILTIN_TARGETS "${target}")
305338
set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Generic CACHE STRING "")

0 commit comments

Comments
 (0)