[libc-commits] [libc] [libc] Suppress GCC's <mm_malloc.h> in freestanding builds (PR #234863)

via libc-commits libc-commits at lists.llvm.org
Fri Oct 23 00:06:11 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/modules/LLVMLibCCompileOptionRules.cmake libc/cmake/modules/LLVMLibCTestRules.cmake
``````````

You can also preview the formatting diff without modifying files:

``````````bash
python3 libc/utils/cmake_format.py --dry-run --diff libc/cmake/modules/LLVMLibCCompileOptionRules.cmake libc/cmake/modules/LLVMLibCTestRules.cmake
``````````

</details>

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

``````````diff
--- a/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
+++ b/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
@@ -246,7 +246,7 @@
         # -ffreestanding, which in turn includes <stdlib.h>. Suppress it by
         # defining its header guard.
         if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND
-           (LIBC_TARGET_ARCHITECTURE_IS_X86_64 OR LIBC_TARGET_ARCHITECTURE_IS_X86))
+          (LIBC_TARGET_ARCHITECTURE_IS_X86_64 OR LIBC_TARGET_ARCHITECTURE_IS_X86))
           list(APPEND compile_options "-D_MM_MALLOC_H_INCLUDED")
         endif()
       endif()
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -54,7 +54,7 @@
       # Only add -ffreestanding flag in full build mode.
       list(APPEND compile_options "-ffreestanding")
       if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND
-         (LIBC_TARGET_ARCHITECTURE_IS_X86_64 OR LIBC_TARGET_ARCHITECTURE_IS_X86))
+        (LIBC_TARGET_ARCHITECTURE_IS_X86_64 OR LIBC_TARGET_ARCHITECTURE_IS_X86))
         list(APPEND compile_options "-D_MM_MALLOC_H_INCLUDED")
       endif()
       list(APPEND compile_options "-fno-exceptions")

``````````

</details>


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


More information about the libc-commits mailing list