-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[Fuchsia] Include baremetal ARM builtins and libc #83949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-clang Author: Petr Hosek (petrhosek) ChangesFor now we only include the armv6m-unknown-eabi target but we plan to include more targets in the future (including multilibs). Full diff: https://github.com/llvm/llvm-project/pull/83949.diff 1 Files Affected:
diff --git a/clang/cmake/caches/Fuchsia-stage2.cmake b/clang/cmake/caches/Fuchsia-stage2.cmake
index eee37c5e7901fa..97c93969e18e80 100644
--- a/clang/cmake/caches/Fuchsia-stage2.cmake
+++ b/clang/cmake/caches/Fuchsia-stage2.cmake
@@ -300,10 +300,43 @@ if(FUCHSIA_SDK)
set(LLVM_RUNTIME_MULTILIB_hwasan+noexcept_TARGETS "aarch64-unknown-fuchsia;riscv64-unknown-fuchsia" CACHE STRING "")
endif()
+foreach(target armv6m-unknown-eabi)
+ list(APPEND BUILTIN_TARGETS "${target}")
+ set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Generic CACHE STRING "")
+ set(BUILTINS_${target}_CMAKE_SYSTEM_PROCESSOR arm CACHE STRING "")
+ set(BUILTINS_${target}_CMAKE_SYSROOT "" CACHE STRING "")
+ set(BUILTINS_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
+ foreach(lang C;CXX;ASM)
+ set(BUILTINS_${target}_CMAKE_${lang}_FLAGS "--target=${target} -mcpu=cortex-m0plus -mthumb" CACHE STRING "")
+ endforeach()
+ foreach(type SHARED;MODULE;EXE)
+ set(BUILTINS_${target}_CMAKE_${type}_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
+ endforeach()
+ set(BUILTINS_${target}_COMPILER_RT_BAREMETAL_BUILD ON CACHE BOOL "")
+
+ list(APPEND RUNTIME_TARGETS "${target}")
+ set(RUNTIMES_${target}_CMAKE_SYSTEM_NAME Generic CACHE STRING "")
+ set(RUNTIMES_${target}_CMAKE_SYSTEM_PROCESSOR arm CACHE STRING "")
+ set(RUNTIMES_${target}_CMAKE_SYSROOT "" CACHE STRING "")
+ set(RUNTIMES_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
+ set(RUNTIMES_${target}_CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY CACHE STRING "")
+ foreach(lang C;CXX;ASM)
+ set(RUNTIMES_${target}_CMAKE_${lang}_FLAGS "--target=${target} -mcpu=cortex-m0plus -mthumb" CACHE STRING "")
+ endforeach()
+ foreach(type SHARED;MODULE;EXE)
+ set(RUNTIMES_${target}_CMAKE_${type}_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
+ endforeach()
+ set(RUNTIMES_${target}_LLVM_LIBC_FULL_BUILD ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBC_ENABLE_USE_BY_CLANG ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LLVM_INCLUDE_TESTS OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "libc" CACHE STRING "")
+endforeach()
+
foreach(target riscv32-unknown-elf)
list(APPEND BUILTIN_TARGETS "${target}")
set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Generic CACHE STRING "")
- set(BUILTINS_${target}_CMAKE_SYSTEM_PROCESSOR RISCV CACHE STRING "")
+ set(BUILTINS_${target}_CMAKE_SYSTEM_PROCESSOR riscv CACHE STRING "")
set(BUILTINS_${target}_CMAKE_SYSROOT "" CACHE STRING "")
set(BUILTINS_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
foreach(lang C;CXX;ASM)
@@ -316,7 +349,7 @@ foreach(target riscv32-unknown-elf)
list(APPEND RUNTIME_TARGETS "${target}")
set(RUNTIMES_${target}_CMAKE_SYSTEM_NAME Generic CACHE STRING "")
- set(RUNTIMES_${target}_CMAKE_SYSTEM_PROCESSOR RISCV CACHE STRING "")
+ set(RUNTIMES_${target}_CMAKE_SYSTEM_PROCESSOR riscv CACHE STRING "")
set(RUNTIMES_${target}_CMAKE_SYSROOT "" CACHE STRING "")
set(RUNTIMES_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
set(RUNTIMES_${target}_CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY CACHE STRING "")
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM other than the nit.
foreach(target riscv32-unknown-elf) | ||
list(APPEND BUILTIN_TARGETS "${target}") | ||
set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Generic CACHE STRING "") | ||
set(BUILTINS_${target}_CMAKE_SYSTEM_PROCESSOR RISCV CACHE STRING "") | ||
set(BUILTINS_${target}_CMAKE_SYSTEM_PROCESSOR riscv CACHE STRING "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: does this and the riscv bit below need to be modified in this change? It seems unrelated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
For now we only include the armv6m-unknown-eabi target but we plan to include more targets in the future (including multilibs).
7924ab4
to
8c5829c
Compare
For now we only include the armv6m-unknown-eabi target but we plan to include more targets in the future (including multilibs).