[libc-commits] [libc] [llvm] [libc] Add premerge CI job for baremetal AArch64 A-profile (PR #247238)

Victor Campos via libc-commits libc-commits at lists.llvm.org
Mon Nov 30 08:52:36 PST 2026


https://github.com/vhscampos created https://github.com/llvm/llvm-project/pull/247238

This patch adds a CMake cache file to configure the build and test of baremetal AArch64 A-profile. The settings are taken from Arm Toolchain for Embedded.

Plus it also adds a new premerge CI job for it.

>From dc6784a99888d35877d40b1f698432f5361aeeeb Mon Sep 17 00:00:00 2001
From: Victor Campos <victor.campos at arm.com>
Date: Mon, 30 Nov 2026 16:22:54 +0000
Subject: [PATCH] [libc] Add premerge CI job for baremetal AArch64 A-profile

This patch adds a CMake cache file to configure the build and test of
baremetal AArch64 A-profile. The settings are taken from Arm Toolchain
for Embedded.

Plus it also adds a new premerge CI job for it.
---
 .github/workflows/libc-fullbuild-tests.yml    |  8 +++
 .../arm-testing/aarch64a-none-elf.cmake       | 54 +++++++++++++++++++
 2 files changed, 62 insertions(+)
 create mode 100644 libc/cmake/caches/arm-testing/aarch64a-none-elf.cmake

diff --git a/.github/workflows/libc-fullbuild-tests.yml b/.github/workflows/libc-fullbuild-tests.yml
index 44fbedf4578511..b2f040d2aab8f6 100644
--- a/.github/workflows/libc-fullbuild-tests.yml
+++ b/.github/workflows/libc-fullbuild-tests.yml
@@ -145,6 +145,14 @@ jobs:
             linker: lld-24
             target: armv8.1m.main-none-eabi
             testing: SKIP
+          - name: baremetal-aarch64a-testing
+            os: ubuntu-26.04
+            build_type: MinSizeRel
+            c_compiler: clang-24
+            cpp_compiler: clang++-24
+            linker: lld-24
+            target: arm-testing/aarch64a-none-elf
+            build_builtins: ON
           - name: baremetal-riscv32
             os: ubuntu-26.04
             build_type: MinSizeRel
diff --git a/libc/cmake/caches/arm-testing/aarch64a-none-elf.cmake b/libc/cmake/caches/arm-testing/aarch64a-none-elf.cmake
new file mode 100644
index 00000000000000..e07648f4c980e7
--- /dev/null
+++ b/libc/cmake/caches/arm-testing/aarch64a-none-elf.cmake
@@ -0,0 +1,54 @@
+set(CMAKE_SYSTEM_PROCESSOR aarch64 CACHE STRING "")
+set(RUNTIMES_TARGET_TRIPLE "aarch64-none-elf" CACHE STRING "")
+set(LLVM_LIBC_FULL_BUILD ON CACHE BOOL "")
+
+foreach(lang C;CXX;ASM)
+  set(CMAKE_${lang}_FLAGS "-march=armv8-a" 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-aarch64" CACHE STRING "")
+
+  # Memory mappings
+  set(__boot_flash 0x40000000)
+  set(__boot_flash_size 0x1000)
+  set(__flash 0x40001000)
+  set(__flash_size 0xfff000)
+  set(__ram 0x41000000)
+  set(__ram_size 0x1000000)
+  set(__stack_size 0x2000)
+  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-aarch64 -M virt -cpu cortex-a57 -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)



More information about the libc-commits mailing list