[libc-commits] [libc] [libc][NFC] Workaround for environ_internal when building with gcc-12. (PR #196471)
via libc-commits
libc-commits at lists.llvm.org
Thu May 7 22:31:06 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: lntue
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/196471.diff
1 Files Affected:
- (modified) libc/src/stdlib/CMakeLists.txt (+10)
``````````diff
diff --git a/libc/src/stdlib/CMakeLists.txt b/libc/src/stdlib/CMakeLists.txt
index 1185f1a0fa461..7e587235447b0 100644
--- a/libc/src/stdlib/CMakeLists.txt
+++ b/libc/src/stdlib/CMakeLists.txt
@@ -67,12 +67,22 @@ add_entrypoint_object(
.environ_internal
)
+# GCC-12 crashed when building environ_internal during GIMPLE pass: waccess.
+set(environ_internal_gcc12_workaround "")
+if((${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") AND
+ (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12") AND
+ (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "13"))
+ set(environ_internal_gcc12_workaround "-Wno-stringop-overflow")
+endif()
+
add_object_library(
environ_internal
SRCS
environ_internal.cpp
HDRS
environ_internal.h
+ COMPILE_OPTIONS
+ ${environ_internal_gcc12_workaround}
DEPENDS
libc.config.app_h
libc.hdr.types.size_t
``````````
</details>
https://github.com/llvm/llvm-project/pull/196471
More information about the libc-commits
mailing list