[libc-commits] [libc] [llvm] [libc] Restore original baremetal Armv7-M build job and move the newer one into a new job (PR #246341)

via libc-commits libc-commits at lists.llvm.org
Thu Nov 26 06:52:11 PST 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-github-workflow

Author: Victor Campos (vhscampos)

<details>
<summary>Changes</summary>

Commit 45c1ca821806398715f6bddf716bc415ca969c0 added run support to the baremetal Armv7-M CMake cache file. However by doing so it changed some libc configuration options that were useful to build the library with.

This patch restores the original CMake cache file, creates a new cache file specific for building and running applications and tests, and finally creates a new premerge job to run with the new cache file.

---
Full diff: https://github.com/llvm/llvm-project/pull/246341.diff


3 Files Affected:

- (modified) .github/workflows/libc-fullbuild-tests.yml (+8) 
- (added) libc/cmake/caches/arm-testing/armv7m-none-eabi.cmake (+54) 
- (modified) libc/cmake/caches/armv7m-none-eabi.cmake (+1-47) 


``````````diff
diff --git a/.github/workflows/libc-fullbuild-tests.yml b/.github/workflows/libc-fullbuild-tests.yml
index 704a918a655aac..86a93fd2c64e47 100644
--- a/.github/workflows/libc-fullbuild-tests.yml
+++ b/.github/workflows/libc-fullbuild-tests.yml
@@ -104,6 +104,14 @@ jobs:
             cpp_compiler: clang++-24
             linker: lld-24
             target: armv7m-none-eabi
+            testing: SKIP
+          - name: baremetal-armv7m-soft-testing
+            os: ubuntu-26.04
+            build_type: MinSizeRel
+            c_compiler: clang-24
+            cpp_compiler: clang++-24
+            linker: lld-24
+            target: arm-testing/armv7m-none-eabi
             build_builtins: ON
           - name: baremetal-armv7em
             os: ubuntu-26.04
diff --git a/libc/cmake/caches/arm-testing/armv7m-none-eabi.cmake b/libc/cmake/caches/arm-testing/armv7m-none-eabi.cmake
new file mode 100644
index 00000000000000..bd7ae07f8790da
--- /dev/null
+++ b/libc/cmake/caches/arm-testing/armv7m-none-eabi.cmake
@@ -0,0 +1,54 @@
+set(CMAKE_SYSTEM_PROCESSOR arm CACHE STRING "")
+set(RUNTIMES_TARGET_TRIPLE "armv7m-none-eabi" CACHE STRING "")
+set(LLVM_LIBC_FULL_BUILD ON CACHE BOOL "")
+
+foreach(lang C;CXX;ASM)
+  set(CMAKE_${lang}_FLAGS "-march=armv7-m -mcpu=cortex-m4 -mfloat-abi=soft -mfpu=none" CACHE STRING "")
+endforeach()
+
+# Offload the errno definition to libc
+set(LIBC_CONF_ERRNO_MODE LIBC_ERRNO_MODE_SHARED CACHE STRING "")
+# Enable floating-point conversions in printf. This became practical with the
+# introduction of float320.
+set(LIBC_CONF_PRINTF_DISABLE_FLOAT OFF CACHE BOOL "")
+set(LIBC_CONF_PRINTF_FLOAT_TO_STR_USE_FLOAT320 ON CACHE BOOL "")
+# Discard unused printf functionality
+set(LIBC_CONF_PRINTF_MODULAR ON CACHE BOOL "")
+
+# Configs for testing and applications are only done if compiler-rt is enabled,
+# as the latter is a dependency for full programs.
+if(compiler-rt IN_LIST LLVM_ENABLE_RUNTIMES)
+  set(LLVM_INCLUDE_TESTS ON CACHE BOOL "")
+  set(LIBC_TEST_BUILTINS_TARGET "clang_rt.builtins-armv7m" CACHE STRING "")
+
+  # Memory mappings
+  set(__boot_flash 0x00000000)
+  set(__boot_flash_size 0x10000)
+  set(__flash 0x21000000)
+  set(__flash_size 0x600000)
+  set(__ram 0x21600000)
+  set(__ram_size 0xA00000)
+  set(__stack_size 0x20000)
+  set(SYMBOLS
+    __boot_flash
+    __boot_flash_size
+    __flash
+    __flash_size
+    __ram
+    __ram_size
+    __stack_size
+  )
+
+  set(DEFSYM_ARGS "")
+  foreach(symbol IN LISTS SYMBOLS)
+    list(APPEND DEFSYM_ARGS "-Wl,--defsym=${symbol}=${${symbol}}")
+  endforeach()
+
+  set(LINKER_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/../../../test/UnitTest/llvm-libc-baremetal.ld")
+
+  set(LIBC_TEST_LINK_OPTIONS_DEFAULT "-T;${LINKER_SCRIPT};${DEFSYM_ARGS}" CACHE STRING "")
+
+  set(LIBC_TEST_CMD "qemu-system-arm -M mps2-an386 -cpu cortex-m4 -chardev stdio,mux=on,id=stdio0 -semihosting-config enable=on,chardev=stdio0 -monitor none -serial none -nographic -kernel @BINARY@" CACHE STRING "")
+endif()
+
+include(${CMAKE_CURRENT_LIST_DIR}/../baremetal_common.cmake)
diff --git a/libc/cmake/caches/armv7m-none-eabi.cmake b/libc/cmake/caches/armv7m-none-eabi.cmake
index 22695fc43ea1cb..ec7c64d5c839cb 100644
--- a/libc/cmake/caches/armv7m-none-eabi.cmake
+++ b/libc/cmake/caches/armv7m-none-eabi.cmake
@@ -1,54 +1,8 @@
 set(CMAKE_SYSTEM_PROCESSOR arm CACHE STRING "")
 set(RUNTIMES_TARGET_TRIPLE "armv7m-none-eabi" CACHE STRING "")
-set(LLVM_LIBC_FULL_BUILD ON CACHE BOOL "")
 
 foreach(lang C;CXX;ASM)
-  set(CMAKE_${lang}_FLAGS "-march=armv7-m -mcpu=cortex-m4 -mfloat-abi=soft -mfpu=none" CACHE STRING "")
+  set(CMAKE_${lang}_FLAGS "-march=armv7m -mcpu=cortex-m4 -mfloat-abi=soft -Wno-atomic-alignment" CACHE STRING "")
 endforeach()
 
-# Offload the errno definition to libc
-set(LIBC_CONF_ERRNO_MODE LIBC_ERRNO_MODE_SHARED CACHE STRING "")
-# Enable floating-point conversions in printf. This became practical with the
-# introduction of float320.
-set(LIBC_CONF_PRINTF_DISABLE_FLOAT OFF CACHE BOOL "")
-set(LIBC_CONF_PRINTF_FLOAT_TO_STR_USE_FLOAT320 ON CACHE BOOL "")
-# Discard unused printf functionality
-set(LIBC_CONF_PRINTF_MODULAR ON CACHE BOOL "")
-
-# Configs for testing and applications are only done if compiler-rt is enabled,
-# as the latter is a dependency for full programs.
-if(compiler-rt IN_LIST LLVM_ENABLE_RUNTIMES)
-  set(LLVM_INCLUDE_TESTS ON CACHE BOOL "")
-  set(LIBC_TEST_BUILTINS_TARGET "clang_rt.builtins-armv7m" CACHE STRING "")
-
-  # Memory mappings
-  set(__boot_flash 0x00000000)
-  set(__boot_flash_size 0x10000)
-  set(__flash 0x21000000)
-  set(__flash_size 0x600000)
-  set(__ram 0x21600000)
-  set(__ram_size 0xA00000)
-  set(__stack_size 0x20000)
-  set(SYMBOLS
-    __boot_flash
-    __boot_flash_size
-    __flash
-    __flash_size
-    __ram
-    __ram_size
-    __stack_size
-  )
-
-  set(DEFSYM_ARGS "")
-  foreach(symbol IN LISTS SYMBOLS)
-    list(APPEND DEFSYM_ARGS "-Wl,--defsym=${symbol}=${${symbol}}")
-  endforeach()
-
-  set(LINKER_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/../../test/UnitTest/llvm-libc-baremetal.ld")
-
-  set(LIBC_TEST_LINK_OPTIONS_DEFAULT "-T;${LINKER_SCRIPT};${DEFSYM_ARGS}" CACHE STRING "")
-
-  set(LIBC_TEST_CMD "qemu-system-arm -M mps2-an386 -cpu cortex-m4 -chardev stdio,mux=on,id=stdio0 -semihosting-config enable=on,chardev=stdio0 -monitor none -serial none -nographic -kernel @BINARY@" CACHE STRING "")
-endif()
-
 include(${CMAKE_CURRENT_LIST_DIR}/baremetal_common.cmake)

``````````

</details>


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


More information about the libc-commits mailing list