Skip to contentSkip to conversation

clang: drop obsolete patch D144514

PATCH In review [email protected] 2 participants 3 messages Sep 11, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clang: drop obsolete patch D144514

From: Sunil Dora <[email protected]>

The upstream fix for the TIMEBITS=64 error was committed in LLVM D140812 (commit 26800a2) in sanitizer_platform_limits_posix.cpp, which addresses the issue for Linux builds.

Our patch D144514 (#undef TIMEBITS in sanitizer_platform.h) is no longer needed. Testing compiler-rt-sanitizers for arm32 also succeeded without this patch, confirming it is safe to drop.

Upstream fix:
https://github.com/llvm/llvm-project/commit/26800a2c7e7996dc773b4e990dd5cca41c45e1a9

---
 ...f-_TIME_BITS-along-with-_FILE_OFFSET.patch | 43 -------------------
 meta/recipes-devtools/clang/common.inc        |  1 -
 2 files changed, 44 deletions(-)
 delete mode 100644 meta/recipes-devtools/clang/clang/0026-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch
meta/recipes-devtools/clang/clang/0026-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch deleted +0 -43
deleted file mode 100644
index e129aa245d..0000000000
@@ -1,43 +0,0 @@
-From 6b6a518bc7686af7680f45fcdea7c414a22a2f53 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Tue, 21 Feb 2023 12:46:10 -0800
-Subject: [PATCH] compiler-rt: Undef _TIME_BITS along with _FILE_OFFSET_BITS in
- sanitizers
-
-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
-In file included from compiler-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp:17:
-In file included from compiler-rt/lib/sanitizer_common/sanitizer_platform.h:25:
-In file included from /usr/include/features.h:393:
-/usr/include/features-time64.h:26:5: error: "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
-    ^
-1 error generated.
-
-Upstream-Status: Submitted [https://reviews.llvm.org/D144514]
-Signed-off-by: Khem Raj <[email protected]>
----
- compiler-rt/lib/sanitizer_common/sanitizer_platform.h | 9 +++++++++
- 1 file changed, 9 insertions(+)
-
-diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
-index 57966403c92a..efa83f30eca0 100644
---- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
-+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
-@@ -22,6 +22,15 @@
- // function declarations into a .S file which doesn't compile.
- // https://crbug.com/1162741
- #if __has_include(<features.h>) && !defined(__ANDROID__)
-+// Some sources undefine _FILE_OFFSET_BITS deliberately e.g.
-+// sanitizer_procmaps_solaris.cpp. This is problematic on glibc systems with
-+// 32-bit architectures using 64-bit time_t and users passing _TIME_BITS=64
-+// from build environment, therefore both _FILE_OFFSET_BITS and _TIME_BITS
-+// need to be undefined together since features.h will check for both being 64
-+// if one is set to 64.
-+#  if !defined(_FILE_OFFSET_BITS)
-+#    undef _TIME_BITS
-+#  endif
- #  include <features.h>
- #endif
- 
meta/recipes-devtools/clang/common.inc +0 -1
index cbcc4feded..9f8daad9f1 100644
@@ -46,7 +46,6 @@ SRC_URI = "\
     file://0023-compiler-rt-Enable-__int128-for-ppc32.patch \
     file://0024-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch \
     file://0025-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch \
-    file://0026-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch \
     file://0027-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch \
     file://0028-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch \
     file://0029-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch \
Signature · 1 line
2.49.0
#1 lore raw
Quoted 9 lines · On Thu, Sep 11, 2025 at 4:59 AM <[email protected]> wrote:

From: Sunil Dora <[email protected]>

The upstream fix for the TIMEBITS=64 error was committed in LLVM D140812 (commit 26800a2) in sanitizer_platform_limits_posix.cpp, which addresses the issue for Linux builds.

Our patch D144514 (#undef TIMEBITS in sanitizer_platform.h) is no longer needed. Testing compiler-rt-sanitizers for arm32 also succeeded without this patch, confirming it is safe to drop.

This is already squashed into 21.1.1 upgrade patch

Quoted 92 lines

Upstream fix:

https://github.com/llvm/llvm-project/commit/26800a2c7e7996dc773b4e990dd5cca41c45e1a9

---
 ...f-_TIME_BITS-along-with-_FILE_OFFSET.patch | 43 -------------------
 meta/recipes-devtools/clang/common.inc        |  1 -
 2 files changed, 44 deletions(-)
 delete mode 100644

meta/recipes-devtools/clang/clang/0026-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch

diff --git a/meta/recipes-devtools/clang/clang/0026-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch b/meta/recipes-devtools/clang/clang/0026-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch deleted file mode 100644
index e129aa245d..0000000000
---
a/meta/recipes-devtools/clang/clang/0026-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch +++ /dev/null

meta/recipes-devtools/clang/clang/0026-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch deleted +0 -4
@@ -1,43 +0,0 @@
-From 6b6a518bc7686af7680f45fcdea7c414a22a2f53 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Tue, 21 Feb 2023 12:46:10 -0800
-Subject: [PATCH] compiler-rt: Undef _TIME_BITS along with

_FILE_OFFSET_BITS in
- sanitizers

meta/recipes-devtools/clang/clang/0026-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch deleted +0 -6
-
-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
-In file included from

compiler-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp:17:
-In file included from compiler-rt/lib/sanitizer_common/sanitizer_platform.h:25:

(quoted diff) +0 -2
-In file included from /usr/include/features.h:393:
-/usr/include/features-time64.h:26:5: error: "_TIME_BITS=64 is allowed

only with _FILE_OFFSET_BITS=64"

meta/recipes-devtools/clang/clang/0026-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch deleted +0 -10
-    ^
-1 error generated.
-
-Upstream-Status: Submitted [https://reviews.llvm.org/D144514]
-Signed-off-by: Khem Raj <[email protected]>
----
- compiler-rt/lib/sanitizer_common/sanitizer_platform.h | 9 +++++++++
- 1 file changed, 9 insertions(+)
-
-diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h

b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h -index 57966403c92a..efa83f30eca0 100644
---- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h -+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h -@@ -22,6 +22,15 @@
- // function declarations into a .S file which doesn't compile.
- // https://crbug.com/1162741
- #if __has_include(<features.h>) && !defined(__ANDROID__) -+// Some sources undefine _FILE_OFFSET_BITS deliberately e.g. -+// sanitizer_procmaps_solaris.cpp. This is problematic on glibc systems with
-+// 32-bit architectures using 64-bit time_t and users passing _TIME_BITS=64
-+// from build environment, therefore both _FILE_OFFSET_BITS and _TIME_BITS
-+// need to be undefined together since features.h will check for both being 64
-+// if one is set to 64.
-+# if !defined(_FILE_OFFSET_BITS)
-+# undef _TIME_BITS
-+# endif
- # include <features.h>
- #endif

(quoted diff) +0 -1
-
meta/recipes-devtools/clang/common.inc +0 -1
index cbcc4feded..9f8daad9f1 100644
@@ -46,7 +46,6 @@ SRC_URI = "\
     file://0023-compiler-rt-Enable-__int128-for-ppc32.patch \
     file://0024-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch \
     file://0025-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch \
-
 file://0026-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch \
     file://0027-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch \
     file://0028-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch \
     file://0029-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch \

--
2.49.0

#2 lore raw
Quoted 12 lines · Khem Raj

**
*CAUTION: This email comes from a non Wind River email account!*
Do not click links or open attachments unless you recognize the sender and know the content is safe.

On Thu, Sep 11, 2025 at 4:59 AM <[email protected]> wrote:

From: Sunil Dora <[email protected]>

The upstream fix for the TIMEBITS=64 error was committed in LLVM D140812 (commit 26800a2) in sanitizer_platform_limits_posix.cpp, which addresses the issue for Linux builds.

Quoted 6 lines

Our patch D144514 (#undef TIMEBITS in sanitizer_platform.h) is no longer needed. Testing compiler-rt-sanitizers for arm32 also succeeded without this patch, confirming it is safe to drop.

This is already squashed into 21.1.1 upgrade patch

Thank you for pointing this out. I had missed the upstream commit.

Quoted 105 lines


    Upstream fix:
    https://github.com/llvm/llvm-project/commit/26800a2c7e7996dc773b4e990dd5cca41c45e1a9
    <https://urldefense.com/v3/__https://github.com/llvm/llvm-project/commit/26800a2c7e7996dc773b4e990dd5cca41c45e1a9__;!!AjveYdw8EvQ!eH7j8lFciVtBqvBrcvyjLNTqhg2-u8hxvOdA-U0Nwk7r6hHDXmFOkNZ5A_aexDXqJIPJXbC63Z5viALlFnThCUo$>

    Signed-off-by: Sunil Dora <[email protected]>
    ---
     ...f-_TIME_BITS-along-with-_FILE_OFFSET.patch | 43
    -------------------
     meta/recipes-devtools/clang/common.inc
    <https://urldefense.com/v3/__http://common.inc__;!!AjveYdw8EvQ!eH7j8lFciVtBqvBrcvyjLNTqhg2-u8hxvOdA-U0Nwk7r6hHDXmFOkNZ5A_aexDXqJIPJXbC63Z5viALl54Mv2h0$> 
          |  1 -
     2 files changed, 44 deletions(-)
     delete mode 100644
    meta/recipes-devtools/clang/clang/0026-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch

    diff --git
    a/meta/recipes-devtools/clang/clang/0026-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch
    b/meta/recipes-devtools/clang/clang/0026-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch
    deleted file mode 100644
    index e129aa245d..0000000000
    ---
    a/meta/recipes-devtools/clang/clang/0026-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch
    +++ /dev/null
    @@ -1,43 +0,0 @@
    -From 6b6a518bc7686af7680f45fcdea7c414a22a2f53 Mon Sep 17 00:00:00
    2001
    -From: Khem Raj <[email protected]>
    -Date: Tue, 21 Feb 2023 12:46:10 -0800
    -Subject: [PATCH] compiler-rt: Undef _TIME_BITS along with
    _FILE_OFFSET_BITS in
    - sanitizers
    -
    -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
    -In file included from
    compiler-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp:17:
    -In file included from
    compiler-rt/lib/sanitizer_common/sanitizer_platform.h:25:
    -In file included from /usr/include/features.h:393:
    -/usr/include/features-time64.h:26:5: error: "_TIME_BITS=64 is
    allowed only with _FILE_OFFSET_BITS=64"
    -    ^
    -1 error generated.
    -
    -Upstream-Status: Submitted [https://reviews.llvm.org/D144514
    <https://urldefense.com/v3/__https://reviews.llvm.org/D144514__;!!AjveYdw8EvQ!eH7j8lFciVtBqvBrcvyjLNTqhg2-u8hxvOdA-U0Nwk7r6hHDXmFOkNZ5A_aexDXqJIPJXbC63Z5viALlIvqlFpA$>]
    -Signed-off-by: Khem Raj <[email protected]>
    ----
    - compiler-rt/lib/sanitizer_common/sanitizer_platform.h | 9 +++++++++
    - 1 file changed, 9 insertions(+)
    -
    -diff --git
    a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
    b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
    -index 57966403c92a..efa83f30eca0 100644
    ---- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
    -+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
    -@@ -22,6 +22,15 @@
    - // function declarations into a .S file which doesn't compile.
    - // https://crbug.com/1162741
    <https://urldefense.com/v3/__https://crbug.com/1162741__;!!AjveYdw8EvQ!eH7j8lFciVtBqvBrcvyjLNTqhg2-u8hxvOdA-U0Nwk7r6hHDXmFOkNZ5A_aexDXqJIPJXbC63Z5viALlPH0CaKY$>
    - #if __has_include(<features.h>) && !defined(__ANDROID__)
    -+// Some sources undefine _FILE_OFFSET_BITS deliberately e.g.
    -+// sanitizer_procmaps_solaris.cpp. This is problematic on glibc
    systems with
    -+// 32-bit architectures using 64-bit time_t and users passing
    _TIME_BITS=64
    -+// from build environment, therefore both _FILE_OFFSET_BITS and
    _TIME_BITS
    -+// need to be undefined together since features.h will check for
    both being 64
    -+// if one is set to 64.
    -+#  if !defined(_FILE_OFFSET_BITS)
    -+#    undef _TIME_BITS
    -+#  endif
    - #  include <features.h>
    - #endif
    -
    diff --git a/meta/recipes-devtools/clang/common.inc
    <https://urldefense.com/v3/__http://common.inc__;!!AjveYdw8EvQ!eH7j8lFciVtBqvBrcvyjLNTqhg2-u8hxvOdA-U0Nwk7r6hHDXmFOkNZ5A_aexDXqJIPJXbC63Z5viALl54Mv2h0$>
    b/meta/recipes-devtools/clang/common.inc
    <https://urldefense.com/v3/__http://common.inc__;!!AjveYdw8EvQ!eH7j8lFciVtBqvBrcvyjLNTqhg2-u8hxvOdA-U0Nwk7r6hHDXmFOkNZ5A_aexDXqJIPJXbC63Z5viALl54Mv2h0$>
    index cbcc4feded..9f8daad9f1 100644
    --- a/meta/recipes-devtools/clang/common.inc
    <https://urldefense.com/v3/__http://common.inc__;!!AjveYdw8EvQ!eH7j8lFciVtBqvBrcvyjLNTqhg2-u8hxvOdA-U0Nwk7r6hHDXmFOkNZ5A_aexDXqJIPJXbC63Z5viALl54Mv2h0$>
    +++ b/meta/recipes-devtools/clang/common.inc
    <https://urldefense.com/v3/__http://common.inc__;!!AjveYdw8EvQ!eH7j8lFciVtBqvBrcvyjLNTqhg2-u8hxvOdA-U0Nwk7r6hHDXmFOkNZ5A_aexDXqJIPJXbC63Z5viALl54Mv2h0$>
    @@ -46,7 +46,6 @@ SRC_URI = "\
    file://0023-compiler-rt-Enable-__int128-for-ppc32.patch \
    file://0024-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch \
    file://0025-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch \
    -
    file://0026-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch
    \
    file://0027-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch \
    file://0028-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch \
    file://0029-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch \
    -- 
    2.49.0