[libc-commits] [libc] [llvm] [libc] Add bare-metal Hexagon port (PR #217528)

via libc-commits libc-commits at lists.llvm.org
Sun Oct 11 21:24:17 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {cmake-format}-->


:warning: CMake code formatter, cmake-format found issues in your code. :warning:

<details>
<summary>
You can fix this locally with the following command:
</summary>

``````````bash
python3 libc/utils/cmake_format.py -i libc/cmake/caches/hexagon-unknown-none-elf.cmake libc/src/setjmp/hexagon/CMakeLists.txt libc/startup/baremetal/hexagon/CMakeLists.txt libc/CMakeLists.txt libc/cmake/caches/baremetal_common.cmake libc/cmake/modules/LLVMLibCArchitectures.cmake libc/cmake/modules/LLVMLibCTestRules.cmake libc/test/UnitTest/CMakeLists.txt libc/test/src/compiler/CMakeLists.txt
``````````

You can also preview the formatting diff without modifying files:

``````````bash
python3 libc/utils/cmake_format.py --dry-run --diff libc/cmake/caches/hexagon-unknown-none-elf.cmake libc/src/setjmp/hexagon/CMakeLists.txt libc/startup/baremetal/hexagon/CMakeLists.txt libc/CMakeLists.txt libc/cmake/caches/baremetal_common.cmake libc/cmake/modules/LLVMLibCArchitectures.cmake libc/cmake/modules/LLVMLibCTestRules.cmake libc/test/UnitTest/CMakeLists.txt libc/test/src/compiler/CMakeLists.txt
``````````

</details>

<details>
<summary>
View the diff from cmake-format here.
</summary>

``````````diff
--- a/libc/cmake/caches/hexagon-unknown-none-elf.cmake
+++ b/libc/cmake/caches/hexagon-unknown-none-elf.cmake
@@ -10,21 +10,21 @@
 set(LIBC_TEST_BUILTINS_TARGET "clang_rt.builtins-hexagon" CACHE STRING "")
 
 set(LIBC_COMPILE_OPTIONS_DEFAULT
-    "-mv68;-G0;-fuse-init-array"
-    CACHE STRING "")
+  "-mv68;-G0;-fuse-init-array"
+  CACHE STRING "")
 set(LIBC_LINK_OPTIONS_DEFAULT
-    "-mv68;-G0"
-    CACHE STRING "")
+  "-mv68;-G0"
+  CACHE STRING "")
 set(LIBC_TEST_COMPILE_OPTIONS_DEFAULT "-O0" CACHE STRING "")
 
 # The bare-metal linker script requires explicit memory-region definitions for
 # the test image.
 set(LIBC_TEST_LINK_OPTIONS_DEFAULT
-    "-mv68;-G0;-T;${CMAKE_CURRENT_LIST_DIR}/../../test/UnitTest/llvm-libc-baremetal.ld;-Wl,--defsym=__boot_flash=0x00100000;-Wl,--defsym=__boot_flash_size=0x00001000;-Wl,--defsym=__flash=0x00101000;-Wl,--defsym=__flash_size=0x003ff000;-Wl,--defsym=__ram=0x00500000;-Wl,--defsym=__ram_size=0x00800000;-Wl,--defsym=__stack_size=0x00040000"
-    CACHE STRING "")
+  "-mv68;-G0;-T;${CMAKE_CURRENT_LIST_DIR}/../../test/UnitTest/llvm-libc-baremetal.ld;-Wl,--defsym=__boot_flash=0x00100000;-Wl,--defsym=__boot_flash_size=0x00001000;-Wl,--defsym=__flash=0x00101000;-Wl,--defsym=__flash_size=0x003ff000;-Wl,--defsym=__ram=0x00500000;-Wl,--defsym=__ram_size=0x00800000;-Wl,--defsym=__stack_size=0x00040000"
+  CACHE STRING "")
 set(LIBC_TEST_CMD
-    "qemu-system-hexagon -M sim -cpu v68 -kernel @BINARY@"
-    CACHE STRING "")
+  "qemu-system-hexagon -M sim -cpu v68 -kernel @BINARY@"
+  CACHE STRING "")
 
 include(${CMAKE_CURRENT_LIST_DIR}/baremetal_common.cmake)
 
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -536,10 +536,10 @@
   )
   if(default_builtins_res EQUAL 0 AND default_builtins_file AND EXISTS "${default_builtins_file}")
     set(LIBC_TEST_BUILTINS_LIBRARY "${default_builtins_file}" CACHE FILEPATH
-        "Compiler runtime builtins library to link into libc tests" FORCE)
+      "Compiler runtime builtins library to link into libc tests" FORCE)
   elseif(NOT LIBC_TARGET_OS_IS_BAREMETAL)
     set(LIBC_TEST_BUILTINS_LIBRARY "-lgcc" CACHE STRING
-        "Compiler runtime builtins library to link into libc tests" FORCE)
+      "Compiler runtime builtins library to link into libc tests" FORCE)
   endif()
 endif()
 
--- a/libc/test/UnitTest/CMakeLists.txt
+++ b/libc/test/UnitTest/CMakeLists.txt
@@ -165,7 +165,7 @@
 endif()
 
 set(libc_hermetic_test_support_srcs HermeticTestUtils.cpp)
-set(libc_hermetic_test_support_deps 
+set(libc_hermetic_test_support_deps
   libc.hdr.errno_macros
   libc.hdr.stdint_proxy
   libc.src.__support.libc_errno

``````````

</details>


https://github.com/llvm/llvm-project/pull/217528


More information about the libc-commits mailing list