[compiler-rt] 63eb7c4 - [scudo] Do not compile timing.cpp if LLVM_LIBC_INCLUDE_SCUDO=on
Sam James via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 15 16:09:46 PDT 2023
Author: Alfred Persson Forsberg
Date: 2023-06-16T00:09:39+01:00
New Revision: 63eb7c4e6620279c63bd42d13177a94928cabb3c
URL: https://github.com/llvm/llvm-project/commit/63eb7c4e6620279c63bd42d13177a94928cabb3c
DIFF: https://github.com/llvm/llvm-project/commit/63eb7c4e6620279c63bd42d13177a94928cabb3c.diff
LOG: [scudo] Do not compile timing.cpp if LLVM_LIBC_INCLUDE_SCUDO=on
Temporary hack until LLVM libc supports inttypes.h print format macros
timing.h uses the PRId64 macro which is not included in llvm libc yet
Bug: https://github.com/llvm/llvm-project/issues/63317
Reviewed By: michaelrj, thesamesam, Chia-hungDuan
Differential Revision: https://reviews.llvm.org/D152979
Added:
Modified:
compiler-rt/lib/scudo/standalone/CMakeLists.txt
compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt
Removed:
################################################################################
diff --git a/compiler-rt/lib/scudo/standalone/CMakeLists.txt b/compiler-rt/lib/scudo/standalone/CMakeLists.txt
index 0f9a483071693..9f75ba328fb8b 100644
--- a/compiler-rt/lib/scudo/standalone/CMakeLists.txt
+++ b/compiler-rt/lib/scudo/standalone/CMakeLists.txt
@@ -114,6 +114,13 @@ set(SCUDO_SOURCES
timing.cpp
)
+# Temporary hack until LLVM libc supports inttypes.h print format macros
+# See: https://github.com/llvm/llvm-project/issues/63317#issuecomment-1591906241
+if(LLVM_LIBC_INCLUDE_SCUDO)
+ list(REMOVE_ITEM SCUDO_HEADERS timing.h)
+ list(REMOVE_ITEM SCUDO_SOURCES timing.cpp)
+endif()
+
# Enable the necessary instruction set for scudo_crc32.cpp, if available.
# Newer compiler versions use -mcrc32 rather than -msse4.2.
if (COMPILER_RT_HAS_MCRC32_FLAG)
diff --git a/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt b/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt
index 335e4b7dbd899..cbb85ce3ec2e2 100644
--- a/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt
+++ b/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt
@@ -111,6 +111,12 @@ set(SCUDO_UNIT_TEST_SOURCES
scudo_unit_test_main.cpp
)
+# Temporary hack until LLVM libc supports inttypes.h print format macros
+# See: https://github.com/llvm/llvm-project/issues/63317#issuecomment-1591906241
+if(LLVM_LIBC_INCLUDE_SCUDO)
+ list(REMOVE_ITEM SCUDO_UNIT_TEST_SOURCES timing_test.cpp)
+endif()
+
add_scudo_unittest(ScudoUnitTest
SOURCES ${SCUDO_UNIT_TEST_SOURCES})
More information about the llvm-commits
mailing list