From d888e96cc4a06e8a42a5306b2e33e4c0775ec7b7 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 31 Dec 2022 15:08:24 -0800 Subject: sanitizers: Fix build with 64bit time_t Signed-off-by: Khem Raj --- ...-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch | 37 ++++++++++++++++++++++ recipes-devtools/clang/common.inc | 1 + 2 files changed, 38 insertions(+) create mode 100644 recipes-devtools/clang/clang/0036-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch diff --git a/recipes-devtools/clang/clang/0036-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch b/recipes-devtools/clang/clang/0036-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch new file mode 100644 index 0000000..8648736 --- /dev/null +++ b/recipes-devtools/clang/clang/0036-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch @@ -0,0 +1,37 @@ +From 2030455a866828bb6d5f03e901e1147dacd95ed5 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 31 Dec 2022 15:03:24 -0800 +Subject: [PATCH] compiler-rt: Undef _TIME_BITS along with _FILE_OFFSET_BITS on + linux + +On 32bit systems using 64bit time_t build fails because +_FILE_OFFSET_BITS is undefined here but _TIME_BITS is still set to 64 + +Fixes +/usr/include/features-time64.h:26:5: error: "_TIME_BITS=64 is allowed + only with _FILE_OFFSET_BITS=64" +| # error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64" +| ^ +| 1 error generated. + +Upstream-Status: Submitted [https://reviews.llvm.org/D140812] +Signed-off-by: Khem Raj +--- + .../lib/sanitizer_common/sanitizer_platform_limits_posix.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp +index 4e0d428d3284..9e646500350b 100644 +--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp ++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp +@@ -18,6 +18,7 @@ + // depends on _FILE_OFFSET_BITS setting. + // To get this "true" dirent definition, we undefine _FILE_OFFSET_BITS below. + #undef _FILE_OFFSET_BITS ++#undef _TIME_BITS + #endif + + // Must go after undef _FILE_OFFSET_BITS. +-- +2.39.0 + diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index db5463c..fe27306 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -45,6 +45,7 @@ SRC_URI = "\ file://0033-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch \ file://0034-Revert-MIPS-compiler-rt-Fix-stat-struct-s-size-for-O.patch \ file://0035-cmake-Enable-64bit-off_t-on-32bit-glibc-systems.patch \ + file://0036-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch \ " # Fallback to no-PIE if not set GCCPIE ??= "" -- cgit v1.2.3-54-g00ecf