[llvm] cbc623c - [gn build] Make HAVE_MALLINFO2 a gn arg, default to false
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 26 10:29:23 PST 2022
Author: Arthur Eubanks
Date: 2022-01-26T10:28:55-08:00
New Revision: cbc623c767c0a0363f32bb09fc8c18139649b2c7
URL: https://github.com/llvm/llvm-project/commit/cbc623c767c0a0363f32bb09fc8c18139649b2c7
DIFF: https://github.com/llvm/llvm-project/commit/cbc623c767c0a0363f32bb09fc8c18139649b2c7.diff
LOG: [gn build] Make HAVE_MALLINFO2 a gn arg, default to false
D117916 broke some people because some distros are still using a glibc
older than 2.33. Add gn arg llvm_have_mallinfo2 and default to false for
now.
Differential Revision: https://reviews.llvm.org/D118269
Added:
Modified:
llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
Removed:
################################################################################
diff --git a/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn b/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
index 07b6453ea9b8a..1a2efb698a419 100644
--- a/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
@@ -46,6 +46,10 @@ declare_args() {
# Iterate unordered llvm containers in reverse.
llvm_enable_reverse_iteration = false
+
+ # glibc is at least 2.33 which has mallinfo2.
+ # TODO: remove this once nobody using the gn build is building against an old glibc.
+ llvm_have_mallinfo2 = false
}
write_cmake_config("abi-breaking") {
@@ -142,7 +146,6 @@ write_cmake_config("config") {
"HAVE_LINK_H=1",
"HAVE_LSEEK64=1",
"HAVE_MALLINFO=1",
- "HAVE_MALLINFO2=1",
"HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=1",
]
} else {
@@ -151,7 +154,6 @@ write_cmake_config("config") {
"HAVE_LINK_H=",
"HAVE_LSEEK64=",
"HAVE_MALLINFO=",
- "HAVE_MALLINFO2=",
"HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=",
]
}
@@ -322,6 +324,12 @@ write_cmake_config("config") {
} else {
values += [ "LLVM_ENABLE_LIBXML2=" ]
}
+
+ if (llvm_have_mallinfo2) {
+ values += [ "HAVE_MALLINFO2=1" ]
+ } else {
+ values += [ "HAVE_MALLINFO2=" ]
+ }
}
write_cmake_config("llvm-config") {
More information about the llvm-commits
mailing list