From 84512a3497f17224d4595a624c47e18f08ea5392 Mon Sep 17 00:00:00 2001 From: Volodymyr Turanskyy Date: Fri, 24 Apr 2026 16:55:27 +0100 Subject: [PATCH] [ATfE] Enable modular printf in LLVM libc This enables modular printf LLVM libc implementation that for now can leave floating point support out, if it is not used, see https://discourse.llvm.org/t/rfc-printf-code-size-optimization/83146/35 This gives a clear benefit in code size: a trivial printf a float number sample is 37K of code while similar printf an integer is only 13K. --- arm-software/embedded/arm-runtimes/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/arm-software/embedded/arm-runtimes/CMakeLists.txt b/arm-software/embedded/arm-runtimes/CMakeLists.txt index 6153156f04fc..446da9846ca5 100644 --- a/arm-software/embedded/arm-runtimes/CMakeLists.txt +++ b/arm-software/embedded/arm-runtimes/CMakeLists.txt @@ -816,6 +816,7 @@ if(C_LIBRARY STREQUAL llvmlibc) -DLIBC_CONF_ERRNO_MODE=LIBC_ERRNO_MODE_SHARED -DLIBC_CONF_PRINTF_DISABLE_FLOAT=OFF -DLIBC_CONF_PRINTF_FLOAT_TO_STR_USE_FLOAT320=ON + -DLIBC_CONF_PRINTF_MODULAR=ON -DLLVM_CMAKE_DIR=${LLVM_BINARY_DIR}/lib/cmake/llvm -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON -DLLVM_ENABLE_RUNTIMES=libc