From 0e853c1ce71a629bd98c64a0b4fbfc8500e085ba Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 10 Sep 2025 14:06:24 -0700 Subject: clang: Upgrade to 21.1.1 release Brings following bugfixes on top of 21.1.0 * 5a86dc996c26 [Xtensa] Fix lowering FP compare operations. * bb383adfafca [SCEVExp] Fix early exit in ComputeEndCheck. (#156910) * 2daad319889d [LV] Don't run instcombine for interleaved-accesses test. * 2d726485a4a3 [LV] Add more tests for interleave groups requiring predicates. * 81d3b6ee82bf [X86] Only fold AND/ANDNP back to VSELECT if we know the predicated mask select is legal (#156663) * 41df6d5e08b0 [CMake][AIX] Enable CMP0182: Create shared library archives by default (#155686) * 35f812f23263 compiler-rt: Use OpenBSD's elf_aux_info to detect AArch64 HW features (#155768) * c75a0754d358 [builtins] Rename freebsd to elf_aux_info to reflect the function called. NFCI (#155749) * 0bbb93672952 [libc++] Fix broken precondition of __bit_log2 (#155476) * 677a8a2d3c5a [compiler-rt] Remove leftovers of FreeBSD md5/sha2 interceptors (#153351) * fa462a66e418 [lldb][DataFormatter] Allow std::string formatters to match against custom allocators (#156050) * 12fbb344a1e8 [Coroutines] Restore accidentally dropped intrinsic IDs * 160ad51687cc [clang][docs] Fix implicit-int-conversion-on-negation typos * e0d94d9626e4 [lldb][DWARFASTParserClang] Don't complete conflicting Objective-C++ types (#156681) * b4274c3bc8ee [DebugInfo] When referencing structured bindings use the reference's location, not the binding's declaration's location (#153637) * 7a077a1b312b [libc++][AIX] Fixup problems with ABI list checking (#155643) * 85e3f8ec7ff6 Remove EH_LABEL comments from tests * 3751e53c3e89 [AArch64][BTI] Add BTI at EH entries. (#155308) * f8a0ecfc6108 [compiler-rt] Avoid depending on the libnvmm header for NetBSD (#153534) * 113916ccf75f [lldb][ClangASTImporter] Don't ASTImport LambdaExpr nodes (#154962) * 362b99f60ef5 [libcxx][fstream][NFC] Make __failed helper lambda a member function (#149390) * b7c18c1e7ac0 [libc++] Ensure that we restore invariants in basic_filebuf::overflow (#147389) * b63daf6312ab [RISCV] Cost casts with illegal types that can't be legalized (#153030) * ca11cf3afa42 [clang-format] Use proper flags for git diff-tree (#155247) * 27f0e6e579b7 [clang][PAC] Fix builtins that claim address discriminated types are bitwise compatible (#154490) * e35cb1a59b3e [clang] Make sure EvalInfo pointer isn't null (#155563) * acabba4f6d30 [NVPTX] don't erase CopyToRegs when folding movs into loads (#149393) * 0e5c3f9b58b9 [mlir][cmake] Fix mlir target export (#153341) * 1f1a20bcb03d [AArch64][PAC] Do not execute AUT instructions speculatively (#155372) * d69907d99beb [AArch64][PAC] Fix clobbering registers by BLRA and AUTH_TCRETURN (#155373) * 9f3f813c94f5 Add pointer auth documentation to contents (#155763) * 7dbfe40cb318 [libc++] Disable cv-qualified arithmetic hash specializations (#155786) * ef3a6bd37c15 [Clang][CMake] Use IRPGO instead of FE PGO for Cmake Caches (#155957) * 35215b6412b4 [SLP]Do not to try to revectorize previously vectorized phis in loops * 64dd5399f7a1 [sanitizer_common] Older Haiku needs _GNU_SOURCE (#156291) * 95608643573a [LoongArch] Fix broadcast load with extension. (#155960) * 0d6736704f38 [X86] getScalarMaskingNode - if the mask is zero just return the blended passthrough and preserved source value (#153575) * 1db648d1016d [release] Correct download links for Windows on Arm packages (#156459) * 562605cef22a ThinLTOBitcodeWriter: Emit __cfi_check to full LTO part of bitcode file. * 33e18acf4a03 [Analyzer] No longer crash with VLA operands to unary type traits (#151719) * 8b6caff342c3 Bump version to 21.1.1 (From OE-Core rev: 98a1ef53e6f3d10b3cc65ea3dd107300cf2cb722) Signed-off-by: Khem Raj Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- meta/conf/distro/include/maintainers.inc | 2 +- ...ind-libunwind-headers-when-LIBCXXABI_LIBU.patch | 2 +- ...er-rt-support-a-new-embedded-linux-target.patch | 2 +- ...-Simplify-cross-compilation.-Don-t-use-na.patch | 2 +- ...LibraryInfo-Undefine-libc-functions-if-th.patch | 2 +- ...allow-env-override-of-exe-and-libdir-path.patch | 2 +- ...-clang-driver-Check-sysroot-for-ldso-path.patch | 2 +- ...iver-tools.cpp-Add-lssp_nonshared-on-musl.patch | 2 +- .../0008-clang-Prepend-trailing-to-sysroot.patch | 2 +- ...inside-the-target-sysroot-for-compiler-ru.patch | 2 +- ...ang-Define-releative-gcc-installation-dir.patch | 2 +- ...pthread-and-ldl-along-with-lunwind-for-st.patch | 2 +- ..._EXECUTABLE-when-cross-compiling-for-nati.patch | 2 +- .../0013-Check-for-atomic-double-intrinsics.patch | 2 +- ...configure-for-packages-using-find_package.patch | 2 +- ...esource-dir-location-for-cross-toolchains.patch | 2 +- ...r-Add-dyld-prefix-when-checking-sysroot-f.patch | 2 +- .../0017-clang-Use-python3-in-python-scripts.patch | 2 +- ...Insert-anchor-for-adding-OE-distro-vendor.patch | 2 +- ...-Do-not-use-backtrace-APIs-on-non-glibc-l.patch | 2 +- ...86-triple-for-non-debian-multiarch-linux-.patch | 2 +- ...0021-libunwind-Added-unw_backtrace-method.patch | 2 +- .../0022-lldb-Link-with-libatomic-on-x86.patch | 2 +- ...023-compiler-rt-Enable-__int128-for-ppc32.patch | 2 +- ...-Do-not-use-cmake-infra-to-detect-libzstd.patch | 2 +- ...ler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch | 2 +- ...s-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch | 81 +++++++++++++++++++ ...-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch | 43 ---------- ...s-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch | 81 ------------------- ...vm-Add-OE-specific-ABI-triple-for-N32-ABI.patch | 78 ++++++++++++++++++ ...vm-Add-OE-specific-ABI-triple-for-N32-ABI.patch | 78 ------------------ ...d-libunwind.pc.in-and-llvm-config-scripts.patch | 90 +++++++++++++++++++++ ...d-libunwind.pc.in-and-llvm-config-scripts.patch | 90 --------------------- ...py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch | 92 ++++++++++++++++++++++ ...r-rt-Do-not-pass-target-to-clang-compiler.patch | 29 +++++++ ...py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch | 92 ---------------------- ...mitter-sort-ClassInfo-lists-by-name-as-we.patch | 31 ++++++++ ...r-rt-Do-not-pass-target-to-clang-compiler.patch | 29 ------- ...mitter-sort-ClassInfo-lists-by-name-as-we.patch | 31 -------- ...g-remove-LLVM_LDFLAGS-from-ldflags-output.patch | 32 ++++++++ ...-Exclude-sync_fetch_and_-for-any-pre-ARMv.patch | 64 +++++++++++++++ ...g-remove-LLVM_LDFLAGS-from-ldflags-output.patch | 32 -------- ...-Exclude-sync_fetch_and_-for-any-pre-ARMv.patch | 64 --------------- ...-Hardcode-uptr-sptr-typedefs-on-Mips-Linu.patch | 35 ++++++++ ...ysroot-relative-paths-for-getArchSpecific.patch | 48 +++++++++++ ...-Hardcode-uptr-sptr-typedefs-on-Mips-Linu.patch | 35 -------- .../0036-allow-external-prepare_builtins.patch | 54 +++++++++++++ ...ysroot-relative-paths-for-getArchSpecific.patch | 48 ----------- ...-Remap-headers-in-the-debug-info-when-bui.patch | 36 +++++++++ .../0037-allow-external-prepare_builtins.patch | 54 ------------- ...isiting-block-when-searching-for-noreturn.patch | 41 ++++++++++ ...-Remap-headers-in-the-debug-info-when-bui.patch | 36 --------- ...c-index-test-when-clang-tests-are-include.patch | 43 ++++++++++ ...isiting-block-when-searching-for-noreturn.patch | 41 ---------- ...c-index-test-when-clang-tests-are-include.patch | 43 ---------- ...Allow-users-to-set-LLVM_HAVE_OPT_VIEWER_M.patch | 70 ++++++++++++++++ ...Allow-users-to-set-LLVM_HAVE_OPT_VIEWER_M.patch | 70 ---------------- meta/recipes-devtools/clang/common-clang.inc | 2 +- meta/recipes-devtools/clang/common.inc | 33 ++++---- 59 files changed, 867 insertions(+), 911 deletions(-) create mode 100644 meta/recipes-devtools/clang/clang/0026-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch delete mode 100644 meta/recipes-devtools/clang/clang/0026-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch delete mode 100644 meta/recipes-devtools/clang/clang/0027-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch create mode 100644 meta/recipes-devtools/clang/clang/0027-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch delete mode 100644 meta/recipes-devtools/clang/clang/0028-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch create mode 100644 meta/recipes-devtools/clang/clang/0028-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch delete mode 100644 meta/recipes-devtools/clang/clang/0029-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch create mode 100644 meta/recipes-devtools/clang/clang/0029-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch create mode 100644 meta/recipes-devtools/clang/clang/0030-compiler-rt-Do-not-pass-target-to-clang-compiler.patch delete mode 100644 meta/recipes-devtools/clang/clang/0030-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch create mode 100644 meta/recipes-devtools/clang/clang/0031-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch delete mode 100644 meta/recipes-devtools/clang/clang/0031-compiler-rt-Do-not-pass-target-to-clang-compiler.patch delete mode 100644 meta/recipes-devtools/clang/clang/0032-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch create mode 100644 meta/recipes-devtools/clang/clang/0032-llvm-config-remove-LLVM_LDFLAGS-from-ldflags-output.patch create mode 100644 meta/recipes-devtools/clang/clang/0033-compiler-rt-Exclude-sync_fetch_and_-for-any-pre-ARMv.patch delete mode 100644 meta/recipes-devtools/clang/clang/0033-llvm-config-remove-LLVM_LDFLAGS-from-ldflags-output.patch delete mode 100644 meta/recipes-devtools/clang/clang/0034-compiler-rt-Exclude-sync_fetch_and_-for-any-pre-ARMv.patch create mode 100644 meta/recipes-devtools/clang/clang/0034-compiler-rt-Hardcode-uptr-sptr-typedefs-on-Mips-Linu.patch create mode 100644 meta/recipes-devtools/clang/clang/0035-clang-Use-sysroot-relative-paths-for-getArchSpecific.patch delete mode 100644 meta/recipes-devtools/clang/clang/0035-compiler-rt-Hardcode-uptr-sptr-typedefs-on-Mips-Linu.patch create mode 100644 meta/recipes-devtools/clang/clang/0036-allow-external-prepare_builtins.patch delete mode 100644 meta/recipes-devtools/clang/clang/0036-clang-Use-sysroot-relative-paths-for-getArchSpecific.patch create mode 100644 meta/recipes-devtools/clang/clang/0037-Revert-libc-Remap-headers-in-the-debug-info-when-bui.patch delete mode 100644 meta/recipes-devtools/clang/clang/0037-allow-external-prepare_builtins.patch create mode 100644 meta/recipes-devtools/clang/clang/0038-Prevent-revisiting-block-when-searching-for-noreturn.patch delete mode 100644 meta/recipes-devtools/clang/clang/0038-Revert-libc-Remap-headers-in-the-debug-info-when-bui.patch create mode 100644 meta/recipes-devtools/clang/clang/0039-Only-build-c-index-test-when-clang-tests-are-include.patch delete mode 100644 meta/recipes-devtools/clang/clang/0039-Prevent-revisiting-block-when-searching-for-noreturn.patch delete mode 100644 meta/recipes-devtools/clang/clang/0040-Only-build-c-index-test-when-clang-tests-are-include.patch create mode 100644 meta/recipes-devtools/clang/clang/0040-opt-viewer-Allow-users-to-set-LLVM_HAVE_OPT_VIEWER_M.patch delete mode 100644 meta/recipes-devtools/clang/clang/0041-opt-viewer-Allow-users-to-set-LLVM_HAVE_OPT_VIEWER_M.patch (limited to 'meta') diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc index 6cfa76e2a3..3ede77df4e 100644 --- a/meta/conf/distro/include/maintainers.inc +++ b/meta/conf/distro/include/maintainers.inc @@ -481,7 +481,7 @@ RECIPE_MAINTAINER:pn-linux-yocto-rt = "Bruce Ashfield RECIPE_MAINTAINER:pn-linux-yocto-tiny = "Bruce Ashfield " RECIPE_MAINTAINER:pn-lld = "Khem Raj " RECIPE_MAINTAINER:pn-lldb = "Khem Raj " -RECIPE_MAINTAINER:pn-llvm-project-source-21.1.0 = "Khem Raj " +RECIPE_MAINTAINER:pn-llvm-project-source-21.1.1 = "Khem Raj " RECIPE_MAINTAINER:pn-llvm-tblgen-native = "Khem Raj " RECIPE_MAINTAINER:pn-logrotate = "Yi Zhao " RECIPE_MAINTAINER:pn-log4cplus = "Unassigned " diff --git a/meta/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch b/meta/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch index 8836863e2b..ab84a877fa 100644 --- a/meta/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch +++ b/meta/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch @@ -1,4 +1,4 @@ -From b741b268820d5c81cef9cf16cb9b8b8742220fdc Mon Sep 17 00:00:00 2001 +From 41ba0feeeebcbe242836639ef3b562adc29ffa96 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 27 Aug 2017 10:37:49 -0700 Subject: [PATCH] libcxxabi: Find libunwind headers when diff --git a/meta/recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch b/meta/recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch index e76dc2bbe0..b6885e2f42 100644 --- a/meta/recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch +++ b/meta/recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch @@ -1,4 +1,4 @@ -From 9e42b5a74a86b108c49d9f4cc97ad4aa986af5e8 Mon Sep 17 00:00:00 2001 +From b044e0e56a8af940836056f61145dea1f961cd4c Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 19 Apr 2015 15:16:23 -0700 Subject: [PATCH] compiler-rt: support a new embedded linux target diff --git a/meta/recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch b/meta/recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch index 9bbd6e4027..44cb2299cd 100644 --- a/meta/recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch +++ b/meta/recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch @@ -1,4 +1,4 @@ -From 098622b7dce4f28942a4f4a46d46580742dab972 Mon Sep 17 00:00:00 2001 +From ab6fdb73b582c1eafd1c342e9cde5b3d8ec7ab86 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 19 May 2016 23:11:45 -0700 Subject: [PATCH] compiler-rt: Simplify cross-compilation. Don't use diff --git a/meta/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch b/meta/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch index ef6bd55246..88d1c54222 100644 --- a/meta/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch +++ b/meta/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch @@ -1,4 +1,4 @@ -From bd6aaf1bad7d46da1928a5b1ecfc9f15e4345a84 Mon Sep 17 00:00:00 2001 +From 04afd5f5cb10ccb899022a6c72ca2f2378eca409 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 21 May 2016 00:33:20 +0000 Subject: [PATCH] llvm: TargetLibraryInfo: Undefine libc functions if they are diff --git a/meta/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch b/meta/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch index 1fc9bd3df0..797980f554 100644 --- a/meta/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch +++ b/meta/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch @@ -1,4 +1,4 @@ -From 82bcb02b2bfbad848663726d68344ce919fc8e65 Mon Sep 17 00:00:00 2001 +From fb846030137c14f4f64937f0bfad5a6aad9bb523 Mon Sep 17 00:00:00 2001 From: Martin Kelly Date: Fri, 19 May 2017 00:22:57 -0700 Subject: [PATCH] llvm: allow env override of exe and libdir path diff --git a/meta/recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch b/meta/recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch index 10888fefe9..c4f04e68e8 100644 --- a/meta/recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch +++ b/meta/recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch @@ -1,4 +1,4 @@ -From 1416f9085479ebe08cc299928844541e55f58504 Mon Sep 17 00:00:00 2001 +From d547d656c8063eff2db8dbab3e226e29288acd54 Mon Sep 17 00:00:00 2001 From: Dan McGregor Date: Wed, 26 Apr 2017 20:29:41 -0600 Subject: [PATCH] clang: driver: Check sysroot for ldso path diff --git a/meta/recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch b/meta/recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch index f91cbe7b43..0ebabad3f6 100644 --- a/meta/recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch +++ b/meta/recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch @@ -1,4 +1,4 @@ -From 4facd87cbed8b8179730043efa120122dc86dcf1 Mon Sep 17 00:00:00 2001 +From 007986bc79780a879d9fbf77ac8565bf9c82eb8c Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 19 May 2016 21:11:06 -0700 Subject: [PATCH] clang: Driver/tools.cpp: Add -lssp_nonshared on musl diff --git a/meta/recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch b/meta/recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch index 78bc7661e4..eb11427f96 100644 --- a/meta/recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch +++ b/meta/recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch @@ -1,4 +1,4 @@ -From 41442c26709f438a158b68c0339f1ea66c08864c Mon Sep 17 00:00:00 2001 +From 82ba05d9deeba4188f4a61d6a502565b22dad656 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 16 Mar 2017 09:02:13 -0700 Subject: [PATCH] clang: Prepend trailing '/' to sysroot diff --git a/meta/recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch b/meta/recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch index 7e2fca7783..4d60808814 100644 --- a/meta/recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch +++ b/meta/recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch @@ -1,4 +1,4 @@ -From 04691d1155b246cb884162af863408ec1f471262 Mon Sep 17 00:00:00 2001 +From caf707f3e0dfe6a589dbbd73a4d0edbe759892cd Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 16 Mar 2017 19:06:26 -0700 Subject: [PATCH] clang: Look inside the target sysroot for compiler runtime diff --git a/meta/recipes-devtools/clang/clang/0010-clang-Define-releative-gcc-installation-dir.patch b/meta/recipes-devtools/clang/clang/0010-clang-Define-releative-gcc-installation-dir.patch index 27324a9808..5a170b3113 100644 --- a/meta/recipes-devtools/clang/clang/0010-clang-Define-releative-gcc-installation-dir.patch +++ b/meta/recipes-devtools/clang/clang/0010-clang-Define-releative-gcc-installation-dir.patch @@ -1,4 +1,4 @@ -From 0e77812bc764279a619a3fdd92d9c1f008dfa95a Mon Sep 17 00:00:00 2001 +From efd146e3170d15f5c6fbe177ce98b61f796bb45b Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 20 Mar 2021 16:09:16 -0700 Subject: [PATCH] clang: Define / releative gcc installation dir diff --git a/meta/recipes-devtools/clang/clang/0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch b/meta/recipes-devtools/clang/clang/0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch index 2fc967a79f..35e0e7b8a0 100644 --- a/meta/recipes-devtools/clang/clang/0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch +++ b/meta/recipes-devtools/clang/clang/0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch @@ -1,4 +1,4 @@ -From 3dd872e76d8ee8b9db384051115b7bb6679960b4 Mon Sep 17 00:00:00 2001 +From ec4353ee503799295624e1d3a23bd58f81916942 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 31 Jul 2019 22:51:39 -0700 Subject: [PATCH] clang: Add -lpthread and -ldl along with -lunwind for static diff --git a/meta/recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch b/meta/recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch index 1c2867ba89..64c17d23f2 100644 --- a/meta/recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch +++ b/meta/recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch @@ -1,4 +1,4 @@ -From a338c2ae924451e869b593f66fc67040169c0a43 Mon Sep 17 00:00:00 2001 +From c3600b46f7fae26fb66fa48401617e6ca1be260c Mon Sep 17 00:00:00 2001 From: Anuj Mittal Date: Thu, 26 Dec 2019 12:56:16 -0800 Subject: [PATCH] Pass PYTHON_EXECUTABLE when cross compiling for native build diff --git a/meta/recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch b/meta/recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch index e635cc2c3b..3421465af4 100644 --- a/meta/recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch +++ b/meta/recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch @@ -1,4 +1,4 @@ -From 8b96f0b76e328e877707ab343703f5a7372de016 Mon Sep 17 00:00:00 2001 +From d8aa37bcef7b1def50a84315b9a6165257a3a4f3 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 18 Nov 2019 17:00:29 -0800 Subject: [PATCH] Check for atomic intrinsics diff --git a/meta/recipes-devtools/clang/clang/0014-cmake-Fix-configure-for-packages-using-find_package.patch b/meta/recipes-devtools/clang/clang/0014-cmake-Fix-configure-for-packages-using-find_package.patch index b99d4a36e8..b518da1724 100644 --- a/meta/recipes-devtools/clang/clang/0014-cmake-Fix-configure-for-packages-using-find_package.patch +++ b/meta/recipes-devtools/clang/clang/0014-cmake-Fix-configure-for-packages-using-find_package.patch @@ -1,4 +1,4 @@ -From 2df5d92a84396aeca1689e17a97e16a337a8a5df Mon Sep 17 00:00:00 2001 +From f2232b5332f650f4920e1f2a86530de9b26ef1fc Mon Sep 17 00:00:00 2001 From: Ovidiu Panait Date: Fri, 31 Jan 2020 10:56:11 +0200 Subject: [PATCH] cmake: Fix configure for packages using find_package() diff --git a/meta/recipes-devtools/clang/clang/0015-clang-Fix-resource-dir-location-for-cross-toolchains.patch b/meta/recipes-devtools/clang/clang/0015-clang-Fix-resource-dir-location-for-cross-toolchains.patch index df2f8cca2f..a9841fdc29 100644 --- a/meta/recipes-devtools/clang/clang/0015-clang-Fix-resource-dir-location-for-cross-toolchains.patch +++ b/meta/recipes-devtools/clang/clang/0015-clang-Fix-resource-dir-location-for-cross-toolchains.patch @@ -1,4 +1,4 @@ -From 45d866a863dc78f33104c5c265557886e6f27b45 Mon Sep 17 00:00:00 2001 +From acc6845a5fc31b64640dece7786293f782a33f35 Mon Sep 17 00:00:00 2001 From: Jim Broadus Date: Thu, 26 Mar 2020 16:05:53 -0700 Subject: [PATCH] clang: Fix resource dir location for cross toolchains diff --git a/meta/recipes-devtools/clang/clang/0016-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch b/meta/recipes-devtools/clang/clang/0016-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch index e0b38f10bb..1b8e137813 100644 --- a/meta/recipes-devtools/clang/clang/0016-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch +++ b/meta/recipes-devtools/clang/clang/0016-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch @@ -1,4 +1,4 @@ -From 887bddb6654d942842b2c81f0b726592d27f6be8 Mon Sep 17 00:00:00 2001 +From cbb2d023069d3774a68ac37aa9815ba5e80f2903 Mon Sep 17 00:00:00 2001 From: Oleksandr Ocheretnyi Date: Wed, 15 Apr 2020 00:08:39 +0300 Subject: [PATCH] clang: driver: Add dyld-prefix when checking sysroot for ldso diff --git a/meta/recipes-devtools/clang/clang/0017-clang-Use-python3-in-python-scripts.patch b/meta/recipes-devtools/clang/clang/0017-clang-Use-python3-in-python-scripts.patch index 6db3857d42..d283d77c2b 100644 --- a/meta/recipes-devtools/clang/clang/0017-clang-Use-python3-in-python-scripts.patch +++ b/meta/recipes-devtools/clang/clang/0017-clang-Use-python3-in-python-scripts.patch @@ -1,4 +1,4 @@ -From 9ffa9959c6ebe18527129e6a41c4cdda279ef501 Mon Sep 17 00:00:00 2001 +From 9ed96e86d625e5a08b1142798d6da13e8e9c62c6 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 14 Oct 2020 22:19:57 -0700 Subject: [PATCH] clang: Use python3 in python scripts diff --git a/meta/recipes-devtools/clang/clang/0018-llvm-clang-Insert-anchor-for-adding-OE-distro-vendor.patch b/meta/recipes-devtools/clang/clang/0018-llvm-clang-Insert-anchor-for-adding-OE-distro-vendor.patch index 71d2da4774..696253a602 100644 --- a/meta/recipes-devtools/clang/clang/0018-llvm-clang-Insert-anchor-for-adding-OE-distro-vendor.patch +++ b/meta/recipes-devtools/clang/clang/0018-llvm-clang-Insert-anchor-for-adding-OE-distro-vendor.patch @@ -1,4 +1,4 @@ -From 26b241706a61448a49fcfca5b15683f75735f9c8 Mon Sep 17 00:00:00 2001 +From 7cff6198ade4591b8bf2bfe4e94d7fe57241f926 Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Mon, 25 Jan 2021 16:14:35 +0800 Subject: [PATCH] llvm/clang: Insert anchor for adding OE distro vendor names diff --git a/meta/recipes-devtools/clang/clang/0019-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch b/meta/recipes-devtools/clang/clang/0019-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch index f58427c033..79b396e132 100644 --- a/meta/recipes-devtools/clang/clang/0019-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch +++ b/meta/recipes-devtools/clang/clang/0019-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch @@ -1,4 +1,4 @@ -From 50ed4a22ab3b8e2e9d6c0175133e5aa35ffa9e92 Mon Sep 17 00:00:00 2001 +From 806d90c9bead326dc1d181fdc6449f7c14f6abef Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 19 May 2021 17:32:13 -0700 Subject: [PATCH] compiler-rt: Do not use backtrace APIs on non-glibc linux diff --git a/meta/recipes-devtools/clang/clang/0020-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch b/meta/recipes-devtools/clang/clang/0020-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch index 3116d7cf63..5646fcd026 100644 --- a/meta/recipes-devtools/clang/clang/0020-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch +++ b/meta/recipes-devtools/clang/clang/0020-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch @@ -1,4 +1,4 @@ -From fd360e4c6e70a867e839c7d3237354d52c75a4ce Mon Sep 17 00:00:00 2001 +From 38c0e64da50d88605728f26c5d9dd6fbbb84ec82 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 19 May 2021 17:56:03 -0700 Subject: [PATCH] clang: Fix x86 triple for non-debian multiarch linux distros diff --git a/meta/recipes-devtools/clang/clang/0021-libunwind-Added-unw_backtrace-method.patch b/meta/recipes-devtools/clang/clang/0021-libunwind-Added-unw_backtrace-method.patch index 0e64bae62b..2580c9e68e 100644 --- a/meta/recipes-devtools/clang/clang/0021-libunwind-Added-unw_backtrace-method.patch +++ b/meta/recipes-devtools/clang/clang/0021-libunwind-Added-unw_backtrace-method.patch @@ -1,4 +1,4 @@ -From 54545081ecd42df9c4a0f2dffe629e95c18ce701 Mon Sep 17 00:00:00 2001 +From 04c601a6a77aff75bae5e395c5c6a21446ad1856 Mon Sep 17 00:00:00 2001 From: Maksim Kita Date: Sun, 23 May 2021 10:27:29 +0000 Subject: [PATCH] libunwind: Added unw_backtrace method diff --git a/meta/recipes-devtools/clang/clang/0022-lldb-Link-with-libatomic-on-x86.patch b/meta/recipes-devtools/clang/clang/0022-lldb-Link-with-libatomic-on-x86.patch index 79a0ea43e2..cc25c4b5cb 100644 --- a/meta/recipes-devtools/clang/clang/0022-lldb-Link-with-libatomic-on-x86.patch +++ b/meta/recipes-devtools/clang/clang/0022-lldb-Link-with-libatomic-on-x86.patch @@ -1,4 +1,4 @@ -From fc52c73be9ca2143720be9881b78954132588aee Mon Sep 17 00:00:00 2001 +From 1e5283110b9c089eece00e3104704f2317bd7586 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 8 Feb 2022 01:31:26 -0800 Subject: [PATCH] lldb: Link with libatomic on x86 diff --git a/meta/recipes-devtools/clang/clang/0023-compiler-rt-Enable-__int128-for-ppc32.patch b/meta/recipes-devtools/clang/clang/0023-compiler-rt-Enable-__int128-for-ppc32.patch index ce9cfb2465..866a1ecc70 100644 --- a/meta/recipes-devtools/clang/clang/0023-compiler-rt-Enable-__int128-for-ppc32.patch +++ b/meta/recipes-devtools/clang/clang/0023-compiler-rt-Enable-__int128-for-ppc32.patch @@ -1,4 +1,4 @@ -From 7b690ce5d96bbd80f0f300e6f57a4be46073af76 Mon Sep 17 00:00:00 2001 +From 371173b5c202288f7992fb4855ec631250b691b4 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 9 Mar 2022 16:28:16 -0800 Subject: [PATCH] compiler-rt: Enable __int128 for ppc32 diff --git a/meta/recipes-devtools/clang/clang/0024-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch b/meta/recipes-devtools/clang/clang/0024-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch index 53ee3b0016..6d5e7db46b 100644 --- a/meta/recipes-devtools/clang/clang/0024-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch +++ b/meta/recipes-devtools/clang/clang/0024-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch @@ -1,4 +1,4 @@ -From 2b05b864651cb3bc611435ccbf8d4e4ba15ca62b Mon Sep 17 00:00:00 2001 +From 71b10214a98cdd3fdec3965a1195ce8cc70baf96 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 12 Aug 2022 11:50:57 -0700 Subject: [PATCH] llvm: Do not use cmake infra to detect libzstd diff --git a/meta/recipes-devtools/clang/clang/0025-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch b/meta/recipes-devtools/clang/clang/0025-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch index 8d5708bac8..409b60132e 100644 --- a/meta/recipes-devtools/clang/clang/0025-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch +++ b/meta/recipes-devtools/clang/clang/0025-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch @@ -1,4 +1,4 @@ -From d0cba62df8273177d9fbbb586e786e40cd8fea6e Mon Sep 17 00:00:00 2001 +From 8245da75b5626e2361ed2833cdfd08a51dc70459 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 3 Jan 2023 18:44:34 -0800 Subject: [PATCH] compiler-rt: Fix stat struct's size for O32 ABI diff --git a/meta/recipes-devtools/clang/clang/0026-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch b/meta/recipes-devtools/clang/clang/0026-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch new file mode 100644 index 0000000000..6c8dfb96b7 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0026-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch @@ -0,0 +1,81 @@ +From fa56e3ce3bbd7b795ab553a1b5da4a0f90589fda Mon Sep 17 00:00:00 2001 +From: Martin Jansa +Date: Thu, 31 Aug 2023 18:14:47 +0200 +Subject: [PATCH] ToolChains/Gnu.cpp: ARMLibDirs search also in lib32 + +* in some strange multilib configs we build lib32-image where + 32bit libs are in /usr/lib32 and 64bit in /usr/lib64 but in such + setup the clang search for GCC candidate installation doesn't + check lib32 directory in sysroot and fails to find the installation + + X86LibDirs was already searching in lib32 for very long time: + https://github.com/llvm/llvm-project/commit/621fed5f5a051a0333415aaed75b8f2ed2350dbd + but ARMLibDirs didn't include it for some reason. + +* if we don't add lib32 for arm in getOSLibDir(), then it will + find -lgcc, crtbeginS.o, crtendS.o, but still fail to find + -lgcc_s, -lc, Scrt1.o, crti.o, crtn.o + +* fixes lib32-compiler-rt build failure: + +-- Configuring incomplete, errors occurred! +CMake Error at TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/share/cmake-3.26/Modules/CMakeTestCCompiler.cmake:67 (message): + The C compiler + + "TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang" + + is not able to compile a simple test program. + + It fails with the following output: + + Change Dir: TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build/CMakeFiles/CMakeScratch/TryCompile-rWXyQZ + + Run Build Command(s):ninja -v cmTC_84d18 && [1/2] TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang --target=arm-oemllib32-linux-gnueabi --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -fPIE -MD -MT CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o -c TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build/CMakeFiles/CMakeScratch/TryCompile-rWXyQZ/testCCompiler.c + [2/2] : && TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang --target=arm-oemllib32-linux-gnueabi --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -Wl,-z,relro,-z,now -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ -fuse-ld=lld -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -Wl,-z,relro,-z,now -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ -fuse-ld=lld CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o -o cmTC_84d18 && : + FAILED: cmTC_84d18 + : && TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang --target=arm-oemllib32-linux-gnueabi --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -Wl,-z,relro,-z,now -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ -fuse-ld=lld -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -Wl,-z,relro,-z,now -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ -fuse-ld=lld CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o -o cmTC_84d18 && : + arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open Scrt1.o: No such file or directory + arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open crti.o: No such file or directory + arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open crtbeginS.o: No such file or directory + arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lgcc + arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lgcc_s + arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lc + arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lgcc + arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lgcc_s + arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open crtendS.o: No such file or directory + arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open crtn.o: No such file or directory + clang-16: error: linker command failed with exit code 1 (use -v to see invocation) + ninja: build stopped: subcommand failed. + +Upstream-Status: Pending +Signed-off-by: Martin Jansa +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 2 +- + clang/lib/Driver/ToolChains/Linux.cpp | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index df84e07da1fc..21c8a30719e0 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2350,7 +2350,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( + static const char *const AArch64beLibDirs[] = {"/lib"}; + static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu"}; + +- static const char *const ARMLibDirs[] = {"/lib"}; ++ static const char *const ARMLibDirs[] = {"/lib", "/lib32"}; + static const char *const ARMTriples[] = {"arm-linux-gnueabi"}; + static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf", + "armv7hl-redhat-linux-gnueabi", +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index 6354c4d06570..c77337561b89 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -198,6 +198,7 @@ static StringRef getOSLibDir(const llvm::Triple &Triple, const ArgList &Args) { + // reasoning about oslibdir spellings with the lib dir spellings in the + // GCCInstallationDetector, but that is a more significant refactoring. + if (Triple.getArch() == llvm::Triple::x86 || Triple.isPPC32() || ++ Triple.getArch() == llvm::Triple::arm || Triple.getArch() == llvm::Triple::thumb || + Triple.getArch() == llvm::Triple::sparc) + return "lib32"; + 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 376733e07f..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 20d83be701fe5fd03bbbd8352400179b74563ba7 Mon Sep 17 00:00:00 2001 -From: Khem Raj -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 ---- - 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 13099fe84b0a..8fea7a260c3a 100644 ---- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h -+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h -@@ -23,6 +23,15 @@ - // function declarations into a .S file which doesn't compile. - // https://crbug.com/1162741 - #if __has_include() && !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 - #endif - diff --git a/meta/recipes-devtools/clang/clang/0027-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch b/meta/recipes-devtools/clang/clang/0027-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch deleted file mode 100644 index 5467fb2b68..0000000000 --- a/meta/recipes-devtools/clang/clang/0027-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 7ee4e023df4661e96d5132855165a1d79cb77736 Mon Sep 17 00:00:00 2001 -From: Martin Jansa -Date: Thu, 31 Aug 2023 18:14:47 +0200 -Subject: [PATCH] ToolChains/Gnu.cpp: ARMLibDirs search also in lib32 - -* in some strange multilib configs we build lib32-image where - 32bit libs are in /usr/lib32 and 64bit in /usr/lib64 but in such - setup the clang search for GCC candidate installation doesn't - check lib32 directory in sysroot and fails to find the installation - - X86LibDirs was already searching in lib32 for very long time: - https://github.com/llvm/llvm-project/commit/621fed5f5a051a0333415aaed75b8f2ed2350dbd - but ARMLibDirs didn't include it for some reason. - -* if we don't add lib32 for arm in getOSLibDir(), then it will - find -lgcc, crtbeginS.o, crtendS.o, but still fail to find - -lgcc_s, -lc, Scrt1.o, crti.o, crtn.o - -* fixes lib32-compiler-rt build failure: - --- Configuring incomplete, errors occurred! -CMake Error at TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/share/cmake-3.26/Modules/CMakeTestCCompiler.cmake:67 (message): - The C compiler - - "TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang" - - is not able to compile a simple test program. - - It fails with the following output: - - Change Dir: TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build/CMakeFiles/CMakeScratch/TryCompile-rWXyQZ - - Run Build Command(s):ninja -v cmTC_84d18 && [1/2] TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang --target=arm-oemllib32-linux-gnueabi --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -fPIE -MD -MT CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o -c TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build/CMakeFiles/CMakeScratch/TryCompile-rWXyQZ/testCCompiler.c - [2/2] : && TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang --target=arm-oemllib32-linux-gnueabi --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -Wl,-z,relro,-z,now -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ -fuse-ld=lld -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -Wl,-z,relro,-z,now -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ -fuse-ld=lld CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o -o cmTC_84d18 && : - FAILED: cmTC_84d18 - : && TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang --target=arm-oemllib32-linux-gnueabi --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -Wl,-z,relro,-z,now -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ -fuse-ld=lld -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -Wl,-z,relro,-z,now -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ -fuse-ld=lld CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o -o cmTC_84d18 && : - arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open Scrt1.o: No such file or directory - arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open crti.o: No such file or directory - arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open crtbeginS.o: No such file or directory - arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lgcc - arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lgcc_s - arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lc - arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lgcc - arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lgcc_s - arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open crtendS.o: No such file or directory - arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open crtn.o: No such file or directory - clang-16: error: linker command failed with exit code 1 (use -v to see invocation) - ninja: build stopped: subcommand failed. - -Upstream-Status: Pending -Signed-off-by: Martin Jansa ---- - clang/lib/Driver/ToolChains/Gnu.cpp | 2 +- - clang/lib/Driver/ToolChains/Linux.cpp | 1 + - 2 files changed, 2 insertions(+), 1 deletion(-) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index df84e07da1fc..21c8a30719e0 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2350,7 +2350,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( - static const char *const AArch64beLibDirs[] = {"/lib"}; - static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu"}; - -- static const char *const ARMLibDirs[] = {"/lib"}; -+ static const char *const ARMLibDirs[] = {"/lib", "/lib32"}; - static const char *const ARMTriples[] = {"arm-linux-gnueabi"}; - static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf", - "armv7hl-redhat-linux-gnueabi", -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 6354c4d06570..c77337561b89 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -198,6 +198,7 @@ static StringRef getOSLibDir(const llvm::Triple &Triple, const ArgList &Args) { - // reasoning about oslibdir spellings with the lib dir spellings in the - // GCCInstallationDetector, but that is a more significant refactoring. - if (Triple.getArch() == llvm::Triple::x86 || Triple.isPPC32() || -+ Triple.getArch() == llvm::Triple::arm || Triple.getArch() == llvm::Triple::thumb || - Triple.getArch() == llvm::Triple::sparc) - return "lib32"; - diff --git a/meta/recipes-devtools/clang/clang/0027-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch b/meta/recipes-devtools/clang/clang/0027-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch new file mode 100644 index 0000000000..40fb95439a --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0027-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch @@ -0,0 +1,78 @@ +From 6d381de086b2646c438af919f2f1ed2c46c8e89a Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 3 Feb 2024 16:47:10 -0800 +Subject: [PATCH] clang/llvm: Add OE specific ABI triple for N32 ABI + +Its gnun32 when using OE + +Upstream-Status: Inappropriate [OE-Specific] +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 1 + + clang/lib/Driver/ToolChains/Linux.cpp | 4 ++-- + llvm/lib/TargetParser/Triple.cpp | 4 +++- + 3 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 21c8a30719e0..3a0f1a247481 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2413,6 +2413,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( + + static const char *const MIPSN32LibDirs[] = {"/lib32"}; + static const char *const MIPSN32Triples[] = {"mips64-linux-gnuabin32", ++ "mips64-linux-gnun32", + "mipsisa64r6-linux-gnuabin32"}; + static const char *const MIPSN32ELLibDirs[] = {"/lib32"}; + static const char *const MIPSN32ELTriples[] = { +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index c77337561b89..9a7f8ffd72e2 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -138,7 +138,7 @@ std::string Linux::getMultiarchTriple(const Driver &D, + return IsMipsR6 ? "mipsisa32r6el-linux-gnu" : "mipsel-linux-gnu"; + case llvm::Triple::mips64: { + std::string MT = std::string(IsMipsR6 ? "mipsisa64r6" : "mips64") + +- "-linux-" + (IsMipsN32Abi ? "gnuabin32" : "gnuabi64"); ++ "-linux-" + (IsMipsN32Abi ? "gnun32" : "gnu"); + if (D.getVFS().exists(concat(SysRoot, "/lib", MT))) + return MT; + if (D.getVFS().exists(concat(SysRoot, "/lib/mips64-linux-gnu"))) +@@ -147,7 +147,7 @@ std::string Linux::getMultiarchTriple(const Driver &D, + } + case llvm::Triple::mips64el: { + std::string MT = std::string(IsMipsR6 ? "mipsisa64r6el" : "mips64el") + +- "-linux-" + (IsMipsN32Abi ? "gnuabin32" : "gnuabi64"); ++ "-linux-" + (IsMipsN32Abi ? "gnun32" : "gnu"); + if (D.getVFS().exists(concat(SysRoot, "/lib", MT))) + return MT; + if (D.getVFS().exists(concat(SysRoot, "/lib/mips64el-linux-gnu"))) +diff --git a/llvm/lib/TargetParser/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp +index 6b9567ad0b8d..6eafade97808 100644 +--- a/llvm/lib/TargetParser/Triple.cpp ++++ b/llvm/lib/TargetParser/Triple.cpp +@@ -339,7 +339,7 @@ StringRef Triple::getEnvironmentTypeName(EnvironmentType Kind) { + case GNU: return "gnu"; + case GNUT64: return "gnut64"; + case GNUABI64: return "gnuabi64"; +- case GNUABIN32: return "gnuabin32"; ++ case GNUABIN32: return "gnun32"; + case GNUEABI: return "gnueabi"; + case GNUEABIT64: return "gnueabit64"; + case GNUEABIHF: return "gnueabihf"; +@@ -725,6 +725,7 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) { + .StartsWith("eabihf", Triple::EABIHF) + .StartsWith("eabi", Triple::EABI) + .StartsWith("gnuabin32", Triple::GNUABIN32) ++ .StartsWith("gnun32", Triple::GNUABIN32) + .StartsWith("gnuabi64", Triple::GNUABI64) + .StartsWith("gnueabihft64", Triple::GNUEABIHFT64) + .StartsWith("gnueabihf", Triple::GNUEABIHF) +@@ -1039,6 +1040,7 @@ Triple::Triple(std::string &&Str) : Data(std::move(Str)) { + Environment = + StringSwitch(Components[0]) + .StartsWith("mipsn32", Triple::GNUABIN32) ++ .StartsWith("mips64-n32", Triple::GNUABIN32) + .StartsWith("mips64", Triple::GNUABI64) + .StartsWith("mipsisa64", Triple::GNUABI64) + .StartsWith("mipsisa32", Triple::GNU) diff --git a/meta/recipes-devtools/clang/clang/0028-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch b/meta/recipes-devtools/clang/clang/0028-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch deleted file mode 100644 index 518aeb2fd5..0000000000 --- a/meta/recipes-devtools/clang/clang/0028-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch +++ /dev/null @@ -1,78 +0,0 @@ -From cbd5f24fd6095f69134cb5536f8187e7264ceaa0 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 3 Feb 2024 16:47:10 -0800 -Subject: [PATCH] clang/llvm: Add OE specific ABI triple for N32 ABI - -Its gnun32 when using OE - -Upstream-Status: Inappropriate [OE-Specific] -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Gnu.cpp | 1 + - clang/lib/Driver/ToolChains/Linux.cpp | 4 ++-- - llvm/lib/TargetParser/Triple.cpp | 4 +++- - 3 files changed, 6 insertions(+), 3 deletions(-) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 21c8a30719e0..3a0f1a247481 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2413,6 +2413,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( - - static const char *const MIPSN32LibDirs[] = {"/lib32"}; - static const char *const MIPSN32Triples[] = {"mips64-linux-gnuabin32", -+ "mips64-linux-gnun32", - "mipsisa64r6-linux-gnuabin32"}; - static const char *const MIPSN32ELLibDirs[] = {"/lib32"}; - static const char *const MIPSN32ELTriples[] = { -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index c77337561b89..9a7f8ffd72e2 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -138,7 +138,7 @@ std::string Linux::getMultiarchTriple(const Driver &D, - return IsMipsR6 ? "mipsisa32r6el-linux-gnu" : "mipsel-linux-gnu"; - case llvm::Triple::mips64: { - std::string MT = std::string(IsMipsR6 ? "mipsisa64r6" : "mips64") + -- "-linux-" + (IsMipsN32Abi ? "gnuabin32" : "gnuabi64"); -+ "-linux-" + (IsMipsN32Abi ? "gnun32" : "gnu"); - if (D.getVFS().exists(concat(SysRoot, "/lib", MT))) - return MT; - if (D.getVFS().exists(concat(SysRoot, "/lib/mips64-linux-gnu"))) -@@ -147,7 +147,7 @@ std::string Linux::getMultiarchTriple(const Driver &D, - } - case llvm::Triple::mips64el: { - std::string MT = std::string(IsMipsR6 ? "mipsisa64r6el" : "mips64el") + -- "-linux-" + (IsMipsN32Abi ? "gnuabin32" : "gnuabi64"); -+ "-linux-" + (IsMipsN32Abi ? "gnun32" : "gnu"); - if (D.getVFS().exists(concat(SysRoot, "/lib", MT))) - return MT; - if (D.getVFS().exists(concat(SysRoot, "/lib/mips64el-linux-gnu"))) -diff --git a/llvm/lib/TargetParser/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp -index 6b9567ad0b8d..6eafade97808 100644 ---- a/llvm/lib/TargetParser/Triple.cpp -+++ b/llvm/lib/TargetParser/Triple.cpp -@@ -339,7 +339,7 @@ StringRef Triple::getEnvironmentTypeName(EnvironmentType Kind) { - case GNU: return "gnu"; - case GNUT64: return "gnut64"; - case GNUABI64: return "gnuabi64"; -- case GNUABIN32: return "gnuabin32"; -+ case GNUABIN32: return "gnun32"; - case GNUEABI: return "gnueabi"; - case GNUEABIT64: return "gnueabit64"; - case GNUEABIHF: return "gnueabihf"; -@@ -725,6 +725,7 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) { - .StartsWith("eabihf", Triple::EABIHF) - .StartsWith("eabi", Triple::EABI) - .StartsWith("gnuabin32", Triple::GNUABIN32) -+ .StartsWith("gnun32", Triple::GNUABIN32) - .StartsWith("gnuabi64", Triple::GNUABI64) - .StartsWith("gnueabihft64", Triple::GNUEABIHFT64) - .StartsWith("gnueabihf", Triple::GNUEABIHF) -@@ -1039,6 +1040,7 @@ Triple::Triple(std::string &&Str) : Data(std::move(Str)) { - Environment = - StringSwitch(Components[0]) - .StartsWith("mipsn32", Triple::GNUABIN32) -+ .StartsWith("mips64-n32", Triple::GNUABIN32) - .StartsWith("mips64", Triple::GNUABI64) - .StartsWith("mipsisa64", Triple::GNUABI64) - .StartsWith("mipsisa32", Triple::GNU) diff --git a/meta/recipes-devtools/clang/clang/0028-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch b/meta/recipes-devtools/clang/clang/0028-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch new file mode 100644 index 0000000000..407956f8ee --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0028-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch @@ -0,0 +1,90 @@ +From c9060d3385b65e9a3d514801c68da7aa41647c5b Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 14 May 2024 22:04:43 -0700 +Subject: [PATCH] llvm: Add libunwind.pc.in and llvm-config scripts + +These are added by OE project + +Upstream-Status: Inappropriate [ OE-Specific ] + +Signed-off-by: Khem Raj +--- + libunwind/libunwind.pc.in | 9 ++++++ + llvm/tools/llvm-config/llvm-config | 52 ++++++++++++++++++++++++++++++ + 2 files changed, 61 insertions(+) + create mode 100644 libunwind/libunwind.pc.in + create mode 100644 llvm/tools/llvm-config/llvm-config + +diff --git a/libunwind/libunwind.pc.in b/libunwind/libunwind.pc.in +new file mode 100644 +index 000000000000..a93d676604f9 +--- /dev/null ++++ b/libunwind/libunwind.pc.in +@@ -0,0 +1,9 @@ ++prefix=/usr ++exec_prefix=/usr ++libdir=@LIBDIR@ ++includedir=/usr/include ++ ++Name: libunwind ++Description: libunwind base library ++Version: @VERSION@ ++Libs: -lunwind +diff --git a/llvm/tools/llvm-config/llvm-config b/llvm/tools/llvm-config/llvm-config +new file mode 100644 +index 000000000000..6a0dd54b8eab +--- /dev/null ++++ b/llvm/tools/llvm-config/llvm-config +@@ -0,0 +1,52 @@ ++#!/bin/bash ++# ++# Wrapper script for llvm-config. Supplies the right environment variables ++# for the target and delegates to the native llvm-config for anything else. This ++# is needed because arguments like --ldflags, --cxxflags, etc. are set by the ++# native compile rather than the target compile. ++# ++SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" ++NEXT_LLVM_CONFIG="$(which -a llvm-config | sed -n 2p)" ++export YOCTO_ALTERNATE_EXE_PATH="${YOCTO_ALTERNATE_EXE_PATH:="$(readlink -f "$SCRIPT_DIR/../llvm-config")"}" ++if [ -n "$( echo $base_libdir | sed -n '/lib64/p')" ]; then ++ export YOCTO_ALTERNATE_LIBDIR="${YOCTO_ALTERNATE_LIBDIR:="/lib64"}" ++else ++ export YOCTO_ALTERNATE_LIBDIR="${YOCTO_ALTERNATE_LIBDIR:="/lib"}" ++fi ++if [[ $# == 0 ]]; then ++ exec "$NEXT_LLVM_CONFIG" ++fi ++ ++remain="" ++output="" ++for arg in "$@"; do ++ case "$arg" in ++ --cppflags) ++ output="${output} ${CPPFLAGS}" ++ ;; ++ --cflags) ++ output="${output} ${CFLAGS}" ++ ;; ++ --cxxflags) ++ output="${output} ${CXXFLAGS}" ++ ;; ++ --ldflags) ++ output="${output} ${LDFLAGS}" ++ ;; ++ --shared-mode) ++ output="${output} shared" ++ ;; ++ --link-shared) ++ break ++ ;; ++ *) ++ remain="${remain} ${arg}" ++ ;; ++ esac ++done ++ ++if [ "${remain}" != "" ]; then ++ output="${output} "$("$NEXT_LLVM_CONFIG" ${remain}) ++fi ++ ++echo "${output}" diff --git a/meta/recipes-devtools/clang/clang/0029-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch b/meta/recipes-devtools/clang/clang/0029-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch deleted file mode 100644 index 1545e6b9ec..0000000000 --- a/meta/recipes-devtools/clang/clang/0029-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch +++ /dev/null @@ -1,90 +0,0 @@ -From c4ebc0b6347886e679aa211a3fa3816be9b2fd52 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Tue, 14 May 2024 22:04:43 -0700 -Subject: [PATCH] llvm: Add libunwind.pc.in and llvm-config scripts - -These are added by OE project - -Upstream-Status: Inappropriate [ OE-Specific ] - -Signed-off-by: Khem Raj ---- - libunwind/libunwind.pc.in | 9 ++++++ - llvm/tools/llvm-config/llvm-config | 52 ++++++++++++++++++++++++++++++ - 2 files changed, 61 insertions(+) - create mode 100644 libunwind/libunwind.pc.in - create mode 100644 llvm/tools/llvm-config/llvm-config - -diff --git a/libunwind/libunwind.pc.in b/libunwind/libunwind.pc.in -new file mode 100644 -index 000000000000..a93d676604f9 ---- /dev/null -+++ b/libunwind/libunwind.pc.in -@@ -0,0 +1,9 @@ -+prefix=/usr -+exec_prefix=/usr -+libdir=@LIBDIR@ -+includedir=/usr/include -+ -+Name: libunwind -+Description: libunwind base library -+Version: @VERSION@ -+Libs: -lunwind -diff --git a/llvm/tools/llvm-config/llvm-config b/llvm/tools/llvm-config/llvm-config -new file mode 100644 -index 000000000000..6a0dd54b8eab ---- /dev/null -+++ b/llvm/tools/llvm-config/llvm-config -@@ -0,0 +1,52 @@ -+#!/bin/bash -+# -+# Wrapper script for llvm-config. Supplies the right environment variables -+# for the target and delegates to the native llvm-config for anything else. This -+# is needed because arguments like --ldflags, --cxxflags, etc. are set by the -+# native compile rather than the target compile. -+# -+SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" -+NEXT_LLVM_CONFIG="$(which -a llvm-config | sed -n 2p)" -+export YOCTO_ALTERNATE_EXE_PATH="${YOCTO_ALTERNATE_EXE_PATH:="$(readlink -f "$SCRIPT_DIR/../llvm-config")"}" -+if [ -n "$( echo $base_libdir | sed -n '/lib64/p')" ]; then -+ export YOCTO_ALTERNATE_LIBDIR="${YOCTO_ALTERNATE_LIBDIR:="/lib64"}" -+else -+ export YOCTO_ALTERNATE_LIBDIR="${YOCTO_ALTERNATE_LIBDIR:="/lib"}" -+fi -+if [[ $# == 0 ]]; then -+ exec "$NEXT_LLVM_CONFIG" -+fi -+ -+remain="" -+output="" -+for arg in "$@"; do -+ case "$arg" in -+ --cppflags) -+ output="${output} ${CPPFLAGS}" -+ ;; -+ --cflags) -+ output="${output} ${CFLAGS}" -+ ;; -+ --cxxflags) -+ output="${output} ${CXXFLAGS}" -+ ;; -+ --ldflags) -+ output="${output} ${LDFLAGS}" -+ ;; -+ --shared-mode) -+ output="${output} shared" -+ ;; -+ --link-shared) -+ break -+ ;; -+ *) -+ remain="${remain} ${arg}" -+ ;; -+ esac -+done -+ -+if [ "${remain}" != "" ]; then -+ output="${output} "$("$NEXT_LLVM_CONFIG" ${remain}) -+fi -+ -+echo "${output}" diff --git a/meta/recipes-devtools/clang/clang/0029-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch b/meta/recipes-devtools/clang/clang/0029-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch new file mode 100644 index 0000000000..47af9a0541 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0029-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch @@ -0,0 +1,92 @@ +From 0380d07443155f26cca1fef70a21426faf102624 Mon Sep 17 00:00:00 2001 +From: Martin Jansa +Date: Fri, 13 Sep 2024 13:38:08 +0200 +Subject: [PATCH] scan-build-py: respect LLVM_LIBDIR_SUFFIX like other tools do + +* other libraries are installed in 'lib64' or 'lib32' based on + LLVM_LIBDIR_SUFFIX value, but libscanbuild files were always + installed in 'lib' + +Upstream-Status: Submitted [https://github.com/llvm/llvm-project/pull/108549] + +Signed-off-by: Martin Jansa +--- + clang/tools/scan-build-py/CMakeLists.txt | 38 ++++++++++++------------ + 1 file changed, 19 insertions(+), 19 deletions(-) + +diff --git a/clang/tools/scan-build-py/CMakeLists.txt b/clang/tools/scan-build-py/CMakeLists.txt +index 9273eb5ed977..9033786d2da5 100644 +--- a/clang/tools/scan-build-py/CMakeLists.txt ++++ b/clang/tools/scan-build-py/CMakeLists.txt +@@ -77,52 +77,52 @@ foreach(lib ${LibExecs}) + endforeach() + + foreach(lib ${LibScanbuild}) +- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib} ++ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/${lib} + COMMAND ${CMAKE_COMMAND} -E make_directory +- ${CMAKE_BINARY_DIR}/lib ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} + COMMAND ${CMAKE_COMMAND} -E make_directory +- ${CMAKE_BINARY_DIR}/lib/libscanbuild ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib} +- ${CMAKE_BINARY_DIR}/lib/libscanbuild/ ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib}) +- list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib}) ++ list(APPEND Depends ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/${lib}) + install(FILES lib/libscanbuild/${lib} +- DESTINATION lib/libscanbuild ++ DESTINATION lib${LLVM_LIBDIR_SUFFIX}/libscanbuild + COMPONENT scan-build-py) + endforeach() + + foreach(resource ${LibScanbuildResources}) +- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource} ++ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources/${resource} + COMMAND ${CMAKE_COMMAND} -E make_directory +- ${CMAKE_BINARY_DIR}/lib ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} + COMMAND ${CMAKE_COMMAND} -E make_directory +- ${CMAKE_BINARY_DIR}/lib/libscanbuild ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild + COMMAND ${CMAKE_COMMAND} -E make_directory +- ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource} +- ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource}) +- list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource}) ++ list(APPEND Depends ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources/${resource}) + install(FILES lib/libscanbuild/resources/${resource} +- DESTINATION lib/libscanbuild/resources ++ DESTINATION lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources + COMPONENT scan-build-py) + endforeach() + + foreach(lib ${LibEar}) +- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libear/${lib} ++ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear/${lib} + COMMAND ${CMAKE_COMMAND} -E make_directory +- ${CMAKE_BINARY_DIR}/lib ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} + COMMAND ${CMAKE_COMMAND} -E make_directory +- ${CMAKE_BINARY_DIR}/lib/libear ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib} +- ${CMAKE_BINARY_DIR}/lib/libear/ ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib}) +- list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libear/${lib}) ++ list(APPEND Depends ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear/${lib}) + install(FILES lib/libear/${lib} +- DESTINATION lib/libear ++ DESTINATION lib${LLVM_LIBDIR_SUFFIX}/libear + COMPONENT scan-build-py) + endforeach() + diff --git a/meta/recipes-devtools/clang/clang/0030-compiler-rt-Do-not-pass-target-to-clang-compiler.patch b/meta/recipes-devtools/clang/clang/0030-compiler-rt-Do-not-pass-target-to-clang-compiler.patch new file mode 100644 index 0000000000..3a670bf94f --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0030-compiler-rt-Do-not-pass-target-to-clang-compiler.patch @@ -0,0 +1,29 @@ +From 223ba6978ee5d198e4dd792e702e5049d53bde37 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 13 Mar 2025 00:30:38 -0700 +Subject: [PATCH] compiler-rt: Do not pass --target to clang compiler + +In OE we use -clang and -clang++ which +should resolve the --target correctly. + +Upstream-Status: Inappropriate [ OE-Specific ] +Signed-off-by: Khem Raj +--- + compiler-rt/lib/fuzzer/CMakeLists.txt | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/compiler-rt/lib/fuzzer/CMakeLists.txt b/compiler-rt/lib/fuzzer/CMakeLists.txt +index 6db24610df1f..692e194c2a98 100644 +--- a/compiler-rt/lib/fuzzer/CMakeLists.txt ++++ b/compiler-rt/lib/fuzzer/CMakeLists.txt +@@ -140,10 +140,6 @@ if(OS_NAME MATCHES "Android|Linux|Fuchsia" AND + COMPILER_RT_LIBCXXABI_PATH) + macro(partially_link_libcxx name dir arch) + get_target_flags_for_arch(${arch} target_cflags) +- if(CMAKE_CXX_COMPILER_ID MATCHES Clang) +- get_compiler_rt_target(${arch} target) +- set(target_cflags --target=${target} ${target_cflags}) +- endif() + set(cxx_${arch}_merge_dir "${CMAKE_CURRENT_BINARY_DIR}/cxx_${arch}_merge.dir") + file(MAKE_DIRECTORY ${cxx_${arch}_merge_dir}) + add_custom_command(TARGET clang_rt.${name}-${arch} POST_BUILD diff --git a/meta/recipes-devtools/clang/clang/0030-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch b/meta/recipes-devtools/clang/clang/0030-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch deleted file mode 100644 index b37661aff4..0000000000 --- a/meta/recipes-devtools/clang/clang/0030-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 36b051141be917a466fbc26b140b3ba268d82468 Mon Sep 17 00:00:00 2001 -From: Martin Jansa -Date: Fri, 13 Sep 2024 13:38:08 +0200 -Subject: [PATCH] scan-build-py: respect LLVM_LIBDIR_SUFFIX like other tools do - -* other libraries are installed in 'lib64' or 'lib32' based on - LLVM_LIBDIR_SUFFIX value, but libscanbuild files were always - installed in 'lib' - -Upstream-Status: Submitted [https://github.com/llvm/llvm-project/pull/108549] - -Signed-off-by: Martin Jansa ---- - clang/tools/scan-build-py/CMakeLists.txt | 38 ++++++++++++------------ - 1 file changed, 19 insertions(+), 19 deletions(-) - -diff --git a/clang/tools/scan-build-py/CMakeLists.txt b/clang/tools/scan-build-py/CMakeLists.txt -index 9273eb5ed977..9033786d2da5 100644 ---- a/clang/tools/scan-build-py/CMakeLists.txt -+++ b/clang/tools/scan-build-py/CMakeLists.txt -@@ -77,52 +77,52 @@ foreach(lib ${LibExecs}) - endforeach() - - foreach(lib ${LibScanbuild}) -- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib} -+ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/${lib} - COMMAND ${CMAKE_COMMAND} -E make_directory -- ${CMAKE_BINARY_DIR}/lib -+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} - COMMAND ${CMAKE_COMMAND} -E make_directory -- ${CMAKE_BINARY_DIR}/lib/libscanbuild -+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild - COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib} -- ${CMAKE_BINARY_DIR}/lib/libscanbuild/ -+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/ - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib}) -- list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib}) -+ list(APPEND Depends ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/${lib}) - install(FILES lib/libscanbuild/${lib} -- DESTINATION lib/libscanbuild -+ DESTINATION lib${LLVM_LIBDIR_SUFFIX}/libscanbuild - COMPONENT scan-build-py) - endforeach() - - foreach(resource ${LibScanbuildResources}) -- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource} -+ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources/${resource} - COMMAND ${CMAKE_COMMAND} -E make_directory -- ${CMAKE_BINARY_DIR}/lib -+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} - COMMAND ${CMAKE_COMMAND} -E make_directory -- ${CMAKE_BINARY_DIR}/lib/libscanbuild -+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild - COMMAND ${CMAKE_COMMAND} -E make_directory -- ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources -+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources - COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource} -- ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources -+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource}) -- list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource}) -+ list(APPEND Depends ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources/${resource}) - install(FILES lib/libscanbuild/resources/${resource} -- DESTINATION lib/libscanbuild/resources -+ DESTINATION lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources - COMPONENT scan-build-py) - endforeach() - - foreach(lib ${LibEar}) -- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libear/${lib} -+ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear/${lib} - COMMAND ${CMAKE_COMMAND} -E make_directory -- ${CMAKE_BINARY_DIR}/lib -+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} - COMMAND ${CMAKE_COMMAND} -E make_directory -- ${CMAKE_BINARY_DIR}/lib/libear -+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear - COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib} -- ${CMAKE_BINARY_DIR}/lib/libear/ -+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear/ - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib}) -- list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libear/${lib}) -+ list(APPEND Depends ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear/${lib}) - install(FILES lib/libear/${lib} -- DESTINATION lib/libear -+ DESTINATION lib${LLVM_LIBDIR_SUFFIX}/libear - COMPONENT scan-build-py) - endforeach() - diff --git a/meta/recipes-devtools/clang/clang/0031-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch b/meta/recipes-devtools/clang/clang/0031-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch new file mode 100644 index 0000000000..f5ae5cca4c --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0031-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch @@ -0,0 +1,31 @@ +From be6d7ca8f69615782b7376e61ff65feb0b389b58 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Fri, 27 Nov 2020 10:11:08 +0000 +Subject: [PATCH] AsmMatcherEmitter: sort ClassInfo lists by name as well + +Otherwise, there are instances which are identical in +every other field and therefore sort non-reproducibly +(which breaks binary and source reproducibiliy). + +Upstream-Status: Submitted [https://reviews.llvm.org/D97477] +Signed-off-by: Alexander Kanavin +--- + llvm/utils/TableGen/AsmMatcherEmitter.cpp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp +index bfd158614ae3..7b1a0ec686da 100644 +--- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp ++++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp +@@ -362,7 +362,10 @@ public: + // name of a class shouldn't be significant. However, some of the backends + // accidentally rely on this behaviour, so it will have to stay like this + // until they are fixed. +- return ValueName < RHS.ValueName; ++ if (ValueName != RHS.ValueName) ++ return ValueName < RHS.ValueName; ++ // All else being equal, we should sort by name, for source and binary reproducibility ++ return Name < RHS.Name; + } + }; + diff --git a/meta/recipes-devtools/clang/clang/0031-compiler-rt-Do-not-pass-target-to-clang-compiler.patch b/meta/recipes-devtools/clang/clang/0031-compiler-rt-Do-not-pass-target-to-clang-compiler.patch deleted file mode 100644 index 5483638d12..0000000000 --- a/meta/recipes-devtools/clang/clang/0031-compiler-rt-Do-not-pass-target-to-clang-compiler.patch +++ /dev/null @@ -1,29 +0,0 @@ -From c4da3b294284213bad523c47a9ab1825175ccda6 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 13 Mar 2025 00:30:38 -0700 -Subject: [PATCH] compiler-rt: Do not pass --target to clang compiler - -In OE we use -clang and -clang++ which -should resolve the --target correctly. - -Upstream-Status: Inappropriate [ OE-Specific ] -Signed-off-by: Khem Raj ---- - compiler-rt/lib/fuzzer/CMakeLists.txt | 4 ---- - 1 file changed, 4 deletions(-) - -diff --git a/compiler-rt/lib/fuzzer/CMakeLists.txt b/compiler-rt/lib/fuzzer/CMakeLists.txt -index 6db24610df1f..692e194c2a98 100644 ---- a/compiler-rt/lib/fuzzer/CMakeLists.txt -+++ b/compiler-rt/lib/fuzzer/CMakeLists.txt -@@ -140,10 +140,6 @@ if(OS_NAME MATCHES "Android|Linux|Fuchsia" AND - COMPILER_RT_LIBCXXABI_PATH) - macro(partially_link_libcxx name dir arch) - get_target_flags_for_arch(${arch} target_cflags) -- if(CMAKE_CXX_COMPILER_ID MATCHES Clang) -- get_compiler_rt_target(${arch} target) -- set(target_cflags --target=${target} ${target_cflags}) -- endif() - set(cxx_${arch}_merge_dir "${CMAKE_CURRENT_BINARY_DIR}/cxx_${arch}_merge.dir") - file(MAKE_DIRECTORY ${cxx_${arch}_merge_dir}) - add_custom_command(TARGET clang_rt.${name}-${arch} POST_BUILD diff --git a/meta/recipes-devtools/clang/clang/0032-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch b/meta/recipes-devtools/clang/clang/0032-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch deleted file mode 100644 index 416f29804d..0000000000 --- a/meta/recipes-devtools/clang/clang/0032-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 222b03ed7a0549e7cdbe67a37b6f965f93d3d8fe Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Fri, 27 Nov 2020 10:11:08 +0000 -Subject: [PATCH] AsmMatcherEmitter: sort ClassInfo lists by name as well - -Otherwise, there are instances which are identical in -every other field and therefore sort non-reproducibly -(which breaks binary and source reproducibiliy). - -Upstream-Status: Submitted [https://reviews.llvm.org/D97477] -Signed-off-by: Alexander Kanavin ---- - llvm/utils/TableGen/AsmMatcherEmitter.cpp | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp -index bfd158614ae3..7b1a0ec686da 100644 ---- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp -+++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp -@@ -362,7 +362,10 @@ public: - // name of a class shouldn't be significant. However, some of the backends - // accidentally rely on this behaviour, so it will have to stay like this - // until they are fixed. -- return ValueName < RHS.ValueName; -+ if (ValueName != RHS.ValueName) -+ return ValueName < RHS.ValueName; -+ // All else being equal, we should sort by name, for source and binary reproducibility -+ return Name < RHS.Name; - } - }; - diff --git a/meta/recipes-devtools/clang/clang/0032-llvm-config-remove-LLVM_LDFLAGS-from-ldflags-output.patch b/meta/recipes-devtools/clang/clang/0032-llvm-config-remove-LLVM_LDFLAGS-from-ldflags-output.patch new file mode 100644 index 0000000000..cfa24d8c4b --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0032-llvm-config-remove-LLVM_LDFLAGS-from-ldflags-output.patch @@ -0,0 +1,32 @@ +From ac2b09550c5b7e51e4ac70ff5dfa006a54e0bf0e Mon Sep 17 00:00:00 2001 +From: Dmitry Baryshkov +Date: Wed, 2 Apr 2025 17:05:17 +0300 +Subject: [PATCH] llvm-config: remove LLVM_LDFLAGS from --ldflags output + +On native OE builds the LLVM_LDFLAGS gets a lot of extra flags which may +depend on exact build dir and as such be inappropriate to binaries +shared through sstate-cache. It is not possible to override this +behaviour in llvm-config since crossscripts are not being used for +native builds. As a OE-specific modification ignore LLVM_LDFLAGS for +native builds. + +Upstream-Status: Inappropriate [OE-Specific] +Signed-off-by: Dmitry Baryshkov +Signed-off-by: Khem Raj +--- + llvm/tools/llvm-config/llvm-config.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp +index c092db81bb8f..a02cc25020a7 100644 +--- a/llvm/tools/llvm-config/llvm-config.cpp ++++ b/llvm/tools/llvm-config/llvm-config.cpp +@@ -542,7 +542,7 @@ int main(int argc, char **argv) { + OS << ActiveIncludeOption << ' ' << LLVM_CXXFLAGS << '\n'; + } else if (Arg == "--ldflags") { + OS << ((HostTriple.isWindowsMSVCEnvironment()) ? "-LIBPATH:" : "-L") +- << ActiveLibDir << ' ' << LLVM_LDFLAGS << '\n'; ++ << ActiveLibDir << '\n'; + } else if (Arg == "--system-libs") { + PrintSystemLibs = true; + } else if (Arg == "--libs") { diff --git a/meta/recipes-devtools/clang/clang/0033-compiler-rt-Exclude-sync_fetch_and_-for-any-pre-ARMv.patch b/meta/recipes-devtools/clang/clang/0033-compiler-rt-Exclude-sync_fetch_and_-for-any-pre-ARMv.patch new file mode 100644 index 0000000000..e586de7d99 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0033-compiler-rt-Exclude-sync_fetch_and_-for-any-pre-ARMv.patch @@ -0,0 +1,64 @@ +From 2c1f2effb8a5489fbb384610d7bf515a2c5b9b68 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 10 May 2025 14:03:12 -0700 +Subject: [PATCH] compiler-rt: Exclude sync_fetch_and_* for any pre-ARMv6 + targets + +Sometimes builds may happen where ABI is not indidated by host_triple +e.g. on Yocto the compiler used is called arm-poky-linux-gnueabi-clang +for all arm32 cross compilers, it passed the ABI flags on cmdline in +addition. e.g. + +-march=armv5te -mfloat-abi=soft +or +-march=armv7-a -mfloat-abi=hard + +compiler-rt's makery tries to add arm to COMPILER_RT_SUPPORTED_ARCH +deducing it from triple name. + +which ends up choosing `arm` as one of compiler-rt arch to build for. +This arch is however using armv7+ defaults and then tried to build sync +builtins using + +arm-poky-linux-gnueabi-clang -march=armv5te -mfloat-abi=soft ... + +Which does not compile correctly, in such cases it should simply +remove the sync builtins from list of things to build similar to what +is done when we use armv4t or armv5t + +set(armv4t_SOURCES ${arm_min_SOURCES}) +set(armv5te_SOURCES ${arm_min_SOURCES}) + +This lets compiler-rt build for arm architectures without depending +upong compiler triple, but instead of poking the compiler for what +it is building for + +Upstream-Status: Submitted [https://github.com/llvm/llvm-project/pull/139411] +Signed-off-by: Khem Raj +--- + compiler-rt/lib/builtins/CMakeLists.txt | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt +index 9c1148e2a8e3..9a15606e1e22 100644 +--- a/compiler-rt/lib/builtins/CMakeLists.txt ++++ b/compiler-rt/lib/builtins/CMakeLists.txt +@@ -908,6 +908,18 @@ else () + ${TARGET_${arch}_CFLAGS}) + list(JOIN CMAKE_REQUIRED_FLAGS " " CMAKE_REQUIRED_FLAGS) + message(STATUS "Performing additional configure checks with target flags: ${CMAKE_REQUIRED_FLAGS}") ++ # For ARM archs, exclude any sync builtins if dmb or mcr p15, #0, r0, c7, c10, #5 ++ # is not supported ++ if (${arch} MATCHES "^(arm|armhf)$") ++ try_compile_only(COMPILER_RT_HAS_${arch}_SYNC ++ SOURCE "#if __ARM_ARCH < 6 ++ #error DMB is only supported on ARMv6+ ! ++ #endif ++ int main(void) { return 0; }") ++ if(NOT COMPILER_RT_HAS_${arch}_SYNC) ++ list(REMOVE_ITEM ${arch}_SOURCES ${arm_sync_SOURCES}) ++ endif() ++ endif() + # For ARM archs, exclude any VFP builtins if VFP is not supported + if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em|armv8m.main|armv8.1m.main)$") + check_compile_definition(__ARM_FP "${CMAKE_C_FLAGS}" COMPILER_RT_HAS_${arch}_VFP) diff --git a/meta/recipes-devtools/clang/clang/0033-llvm-config-remove-LLVM_LDFLAGS-from-ldflags-output.patch b/meta/recipes-devtools/clang/clang/0033-llvm-config-remove-LLVM_LDFLAGS-from-ldflags-output.patch deleted file mode 100644 index afd28fb8f5..0000000000 --- a/meta/recipes-devtools/clang/clang/0033-llvm-config-remove-LLVM_LDFLAGS-from-ldflags-output.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 0bd04308858d0a5d582d54584e5c021e10fee1bb Mon Sep 17 00:00:00 2001 -From: Dmitry Baryshkov -Date: Wed, 2 Apr 2025 17:05:17 +0300 -Subject: [PATCH] llvm-config: remove LLVM_LDFLAGS from --ldflags output - -On native OE builds the LLVM_LDFLAGS gets a lot of extra flags which may -depend on exact build dir and as such be inappropriate to binaries -shared through sstate-cache. It is not possible to override this -behaviour in llvm-config since crossscripts are not being used for -native builds. As a OE-specific modification ignore LLVM_LDFLAGS for -native builds. - -Upstream-Status: Inappropriate [OE-Specific] -Signed-off-by: Dmitry Baryshkov -Signed-off-by: Khem Raj ---- - llvm/tools/llvm-config/llvm-config.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp -index c092db81bb8f..a02cc25020a7 100644 ---- a/llvm/tools/llvm-config/llvm-config.cpp -+++ b/llvm/tools/llvm-config/llvm-config.cpp -@@ -542,7 +542,7 @@ int main(int argc, char **argv) { - OS << ActiveIncludeOption << ' ' << LLVM_CXXFLAGS << '\n'; - } else if (Arg == "--ldflags") { - OS << ((HostTriple.isWindowsMSVCEnvironment()) ? "-LIBPATH:" : "-L") -- << ActiveLibDir << ' ' << LLVM_LDFLAGS << '\n'; -+ << ActiveLibDir << '\n'; - } else if (Arg == "--system-libs") { - PrintSystemLibs = true; - } else if (Arg == "--libs") { diff --git a/meta/recipes-devtools/clang/clang/0034-compiler-rt-Exclude-sync_fetch_and_-for-any-pre-ARMv.patch b/meta/recipes-devtools/clang/clang/0034-compiler-rt-Exclude-sync_fetch_and_-for-any-pre-ARMv.patch deleted file mode 100644 index c409509d00..0000000000 --- a/meta/recipes-devtools/clang/clang/0034-compiler-rt-Exclude-sync_fetch_and_-for-any-pre-ARMv.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 83994facdea30da795875b50a26d7f23035ae141 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 10 May 2025 14:03:12 -0700 -Subject: [PATCH] compiler-rt: Exclude sync_fetch_and_* for any pre-ARMv6 - targets - -Sometimes builds may happen where ABI is not indidated by host_triple -e.g. on Yocto the compiler used is called arm-poky-linux-gnueabi-clang -for all arm32 cross compilers, it passed the ABI flags on cmdline in -addition. e.g. - --march=armv5te -mfloat-abi=soft -or --march=armv7-a -mfloat-abi=hard - -compiler-rt's makery tries to add arm to COMPILER_RT_SUPPORTED_ARCH -deducing it from triple name. - -which ends up choosing `arm` as one of compiler-rt arch to build for. -This arch is however using armv7+ defaults and then tried to build sync -builtins using - -arm-poky-linux-gnueabi-clang -march=armv5te -mfloat-abi=soft ... - -Which does not compile correctly, in such cases it should simply -remove the sync builtins from list of things to build similar to what -is done when we use armv4t or armv5t - -set(armv4t_SOURCES ${arm_min_SOURCES}) -set(armv5te_SOURCES ${arm_min_SOURCES}) - -This lets compiler-rt build for arm architectures without depending -upong compiler triple, but instead of poking the compiler for what -it is building for - -Upstream-Status: Submitted [https://github.com/llvm/llvm-project/pull/139411] -Signed-off-by: Khem Raj ---- - compiler-rt/lib/builtins/CMakeLists.txt | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt -index 9c1148e2a8e3..9a15606e1e22 100644 ---- a/compiler-rt/lib/builtins/CMakeLists.txt -+++ b/compiler-rt/lib/builtins/CMakeLists.txt -@@ -908,6 +908,18 @@ else () - ${TARGET_${arch}_CFLAGS}) - list(JOIN CMAKE_REQUIRED_FLAGS " " CMAKE_REQUIRED_FLAGS) - message(STATUS "Performing additional configure checks with target flags: ${CMAKE_REQUIRED_FLAGS}") -+ # For ARM archs, exclude any sync builtins if dmb or mcr p15, #0, r0, c7, c10, #5 -+ # is not supported -+ if (${arch} MATCHES "^(arm|armhf)$") -+ try_compile_only(COMPILER_RT_HAS_${arch}_SYNC -+ SOURCE "#if __ARM_ARCH < 6 -+ #error DMB is only supported on ARMv6+ ! -+ #endif -+ int main(void) { return 0; }") -+ if(NOT COMPILER_RT_HAS_${arch}_SYNC) -+ list(REMOVE_ITEM ${arch}_SOURCES ${arm_sync_SOURCES}) -+ endif() -+ endif() - # For ARM archs, exclude any VFP builtins if VFP is not supported - if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em|armv8m.main|armv8.1m.main)$") - check_compile_definition(__ARM_FP "${CMAKE_C_FLAGS}" COMPILER_RT_HAS_${arch}_VFP) diff --git a/meta/recipes-devtools/clang/clang/0034-compiler-rt-Hardcode-uptr-sptr-typedefs-on-Mips-Linu.patch b/meta/recipes-devtools/clang/clang/0034-compiler-rt-Hardcode-uptr-sptr-typedefs-on-Mips-Linu.patch new file mode 100644 index 0000000000..9ccd4997b0 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0034-compiler-rt-Hardcode-uptr-sptr-typedefs-on-Mips-Linu.patch @@ -0,0 +1,35 @@ +From e7ec5120258d95ac015100cbfe4e595d4592d47b Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 22 May 2025 21:50:45 -0700 +Subject: [PATCH] [compiler-rt] Hardcode uptr/sptr typedefs on Mips/Linux + +Sanitizer build on Mips/Linux faills to build due to assertion errors +mismatched definitions. This is due to inconsistent definitions of +`uptr` of either `unsigned long` or `unsigned int` in compiler-rt. This +is caused by clang defining + +__UINTPTR_TYPE__ long unsigned int where as gcc defines it as +unsigned int + +As a workaround, this hardcodes `uptr`/`sptr` in compiler-rt to +`unsigned int`/`int` on Linux Mips, matching gcc. + +Upstream-Status: Submitted [https://github.com/llvm/llvm-project/pull/141201] +Signed-off-by: Khem Raj +--- + compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h +index fff60c96f632..511ee8fe49cc 100644 +--- a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h ++++ b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h +@@ -139,7 +139,7 @@ + namespace __sanitizer { + + #if defined(__UINTPTR_TYPE__) +-# if defined(__arm__) && defined(__linux__) ++# if (defined(__arm__) || _ABIO32 == 1) && defined(__linux__) + // Linux Arm headers redefine __UINTPTR_TYPE__ and disagree with clang/gcc. + typedef unsigned int uptr; + typedef int sptr; diff --git a/meta/recipes-devtools/clang/clang/0035-clang-Use-sysroot-relative-paths-for-getArchSpecific.patch b/meta/recipes-devtools/clang/clang/0035-clang-Use-sysroot-relative-paths-for-getArchSpecific.patch new file mode 100644 index 0000000000..88e6fa9c4d --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0035-clang-Use-sysroot-relative-paths-for-getArchSpecific.patch @@ -0,0 +1,48 @@ +From c4e8df6a492de2d98be18093de2fe0d97e221d48 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 7 Jul 2025 19:22:07 -0700 +Subject: [PATCH] clang: Use sysroot relative paths for getArchSpecificLibPaths + and getRuntimePath + +Clang's default sysroot implementation differs that what we do in OE, +and we do it with gcc as well where we install c++ runtime headers in +target sysroot, clang does not by default it puts them relative to its +own installation and uses resourcedir to point to it. In order to solve +this we have to raise this question with respective upstreams or rethink +about how we package compiler runtime. + +Upstream-Status: Inappropriate [OE-Specific] + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChain.cpp | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp +index ec28b899f829..f4aafa7996a9 100644 +--- a/clang/lib/Driver/ToolChain.cpp ++++ b/clang/lib/Driver/ToolChain.cpp +@@ -1001,7 +1001,10 @@ ToolChain::getTargetSubDirPath(StringRef BaseDir) const { + } + + std::optional ToolChain::getRuntimePath() const { +- SmallString<128> P(D.ResourceDir); ++ SmallString<128> P(D.SysRoot); ++ StringRef ClangLibdirBasename(CLANG_INSTALL_LIBDIR_BASENAME); ++ llvm::sys::path::append(P, "/usr/", ClangLibdirBasename, "clang", ++ CLANG_VERSION_STRING); + llvm::sys::path::append(P, "lib"); + if (auto Ret = getTargetSubDirPath(P)) + return Ret; +@@ -1029,7 +1032,10 @@ ToolChain::path_list ToolChain::getArchSpecificLibPaths() const { + path_list Paths; + + auto AddPath = [&](const ArrayRef &SS) { +- SmallString<128> Path(getDriver().ResourceDir); ++ SmallString<128> Path(getDriver().SysRoot); ++ StringRef ClangLibdirBasename(CLANG_INSTALL_LIBDIR_BASENAME); ++ llvm::sys::path::append(Path, "/usr/", ClangLibdirBasename, "clang", ++ CLANG_VERSION_STRING); + llvm::sys::path::append(Path, "lib"); + for (auto &S : SS) + llvm::sys::path::append(Path, S); diff --git a/meta/recipes-devtools/clang/clang/0035-compiler-rt-Hardcode-uptr-sptr-typedefs-on-Mips-Linu.patch b/meta/recipes-devtools/clang/clang/0035-compiler-rt-Hardcode-uptr-sptr-typedefs-on-Mips-Linu.patch deleted file mode 100644 index 45d499e60f..0000000000 --- a/meta/recipes-devtools/clang/clang/0035-compiler-rt-Hardcode-uptr-sptr-typedefs-on-Mips-Linu.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 6167af21af9a97fe10d6d5f69aacf7d9785a8fcf Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 22 May 2025 21:50:45 -0700 -Subject: [PATCH] [compiler-rt] Hardcode uptr/sptr typedefs on Mips/Linux - -Sanitizer build on Mips/Linux faills to build due to assertion errors -mismatched definitions. This is due to inconsistent definitions of -`uptr` of either `unsigned long` or `unsigned int` in compiler-rt. This -is caused by clang defining - -__UINTPTR_TYPE__ long unsigned int where as gcc defines it as -unsigned int - -As a workaround, this hardcodes `uptr`/`sptr` in compiler-rt to -`unsigned int`/`int` on Linux Mips, matching gcc. - -Upstream-Status: Submitted [https://github.com/llvm/llvm-project/pull/141201] -Signed-off-by: Khem Raj ---- - compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h -index fff60c96f632..511ee8fe49cc 100644 ---- a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h -+++ b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h -@@ -139,7 +139,7 @@ - namespace __sanitizer { - - #if defined(__UINTPTR_TYPE__) --# if defined(__arm__) && defined(__linux__) -+# if (defined(__arm__) || _ABIO32 == 1) && defined(__linux__) - // Linux Arm headers redefine __UINTPTR_TYPE__ and disagree with clang/gcc. - typedef unsigned int uptr; - typedef int sptr; diff --git a/meta/recipes-devtools/clang/clang/0036-allow-external-prepare_builtins.patch b/meta/recipes-devtools/clang/clang/0036-allow-external-prepare_builtins.patch new file mode 100644 index 0000000000..7331eb6f83 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0036-allow-external-prepare_builtins.patch @@ -0,0 +1,54 @@ +From 61cb0afd40ef8d6a5493cbd3bd60f49f61e8b34f Mon Sep 17 00:00:00 2001 +From: Ross Burton +Date: Wed, 16 Jul 2025 23:24:21 +0100 +Subject: [PATCH] allow external prepare_builtins + +In standalone cross builds, libclc can't build a native prepare_builtins. + +Hack the CMake to allow it to use an existing binary, which we build in the recipe. + +Upstream-Status: Inappropriate [discussion for a proper fix in https://github.com/llvm/llvm-project/issues/149814] +Signed-off-by: Ross Burton +--- + libclc/CMakeLists.txt | 23 +++++++++++++++++------ + 1 file changed, 17 insertions(+), 6 deletions(-) + +diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt +index c98e2043464d..151c5d2d20c6 100644 +--- a/libclc/CMakeLists.txt ++++ b/libclc/CMakeLists.txt +@@ -178,17 +178,28 @@ set(LLVM_LINK_COMPONENTS + IRReader + Support + ) ++ + if( LIBCLC_STANDALONE_BUILD ) +- add_llvm_executable( prepare_builtins utils/prepare-builtins.cpp ) +- set( prepare_builtins_exe prepare_builtins ) +- set( prepare_builtins_target prepare_builtins ) ++ message("cross ${CMAKE_CROSSCOMPILING}") ++ if(CMAKE_CROSSCOMPILING) ++ find_program(PREPARE_BUILTINS prepare_builtins REQUIRED) ++ message("found ${PREPARE_BUILTINS}") ++ set( prepare_builtins_exe ${PREPARE_BUILTINS} ) ++ else() ++ add_llvm_executable( prepare_builtins utils/prepare-builtins.cpp ) ++ set( prepare_builtins_exe prepare_builtins ) ++ set( prepare_builtins_target prepare_builtins ) ++ target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} ) ++ # These were not properly reported in early LLVM and we don't need them ++ target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions ) ++ endif() + else() + add_llvm_utility( prepare_builtins utils/prepare-builtins.cpp ) + setup_host_tool( prepare_builtins PREPARE_BUILTINS prepare_builtins_exe prepare_builtins_target ) ++ target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} ) ++ # These were not properly reported in early LLVM and we don't need them ++ target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions ) + endif() +-target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} ) +-# These were not properly reported in early LLVM and we don't need them +-target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions ) + + # Setup arch devices + set( r600--_devices cedar cypress barts cayman ) diff --git a/meta/recipes-devtools/clang/clang/0036-clang-Use-sysroot-relative-paths-for-getArchSpecific.patch b/meta/recipes-devtools/clang/clang/0036-clang-Use-sysroot-relative-paths-for-getArchSpecific.patch deleted file mode 100644 index 95cb9ce1e5..0000000000 --- a/meta/recipes-devtools/clang/clang/0036-clang-Use-sysroot-relative-paths-for-getArchSpecific.patch +++ /dev/null @@ -1,48 +0,0 @@ -From cda45a69a5fa5cd4106be8588c7e33e8f6535e17 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Mon, 7 Jul 2025 19:22:07 -0700 -Subject: [PATCH] clang: Use sysroot relative paths for getArchSpecificLibPaths - and getRuntimePath - -Clang's default sysroot implementation differs that what we do in OE, -and we do it with gcc as well where we install c++ runtime headers in -target sysroot, clang does not by default it puts them relative to its -own installation and uses resourcedir to point to it. In order to solve -this we have to raise this question with respective upstreams or rethink -about how we package compiler runtime. - -Upstream-Status: Inappropriate [OE-Specific] - -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChain.cpp | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp -index ec28b899f829..f4aafa7996a9 100644 ---- a/clang/lib/Driver/ToolChain.cpp -+++ b/clang/lib/Driver/ToolChain.cpp -@@ -1001,7 +1001,10 @@ ToolChain::getTargetSubDirPath(StringRef BaseDir) const { - } - - std::optional ToolChain::getRuntimePath() const { -- SmallString<128> P(D.ResourceDir); -+ SmallString<128> P(D.SysRoot); -+ StringRef ClangLibdirBasename(CLANG_INSTALL_LIBDIR_BASENAME); -+ llvm::sys::path::append(P, "/usr/", ClangLibdirBasename, "clang", -+ CLANG_VERSION_STRING); - llvm::sys::path::append(P, "lib"); - if (auto Ret = getTargetSubDirPath(P)) - return Ret; -@@ -1029,7 +1032,10 @@ ToolChain::path_list ToolChain::getArchSpecificLibPaths() const { - path_list Paths; - - auto AddPath = [&](const ArrayRef &SS) { -- SmallString<128> Path(getDriver().ResourceDir); -+ SmallString<128> Path(getDriver().SysRoot); -+ StringRef ClangLibdirBasename(CLANG_INSTALL_LIBDIR_BASENAME); -+ llvm::sys::path::append(Path, "/usr/", ClangLibdirBasename, "clang", -+ CLANG_VERSION_STRING); - llvm::sys::path::append(Path, "lib"); - for (auto &S : SS) - llvm::sys::path::append(Path, S); diff --git a/meta/recipes-devtools/clang/clang/0037-Revert-libc-Remap-headers-in-the-debug-info-when-bui.patch b/meta/recipes-devtools/clang/clang/0037-Revert-libc-Remap-headers-in-the-debug-info-when-bui.patch new file mode 100644 index 0000000000..7582134eea --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0037-Revert-libc-Remap-headers-in-the-debug-info-when-bui.patch @@ -0,0 +1,36 @@ +From 4a5e076817be3291d9370a8831f96d1223087a72 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 27 Jul 2025 19:12:13 -0700 +Subject: [PATCH] Revert "[libc++] Remap headers in the debug info when + building the library (#143004)" + +This reverts commit 4d50b405f1585ce172f87cb5f8daf3c1b4145215. + +There is a discussion on this issue on [1] +I have discussed this on PR and also with developer on IRC, I am +hoping that our position will be considered by 22.x release + +[1] https://github.com/llvm/llvm-project/pull/143004/ + +Upstream-Status: Inappropriate [ OE-Specific ] +Signed-off-by: Khem Raj +--- + libcxx/include/CMakeLists.txt | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt +index 9e9852de2a4c..9ee1b4695783 100644 +--- a/libcxx/include/CMakeLists.txt ++++ b/libcxx/include/CMakeLists.txt +@@ -1719,11 +1719,6 @@ add_dependencies(cxx-headers generate-cxx-headers) + target_include_directories(cxx-headers INTERFACE ${LIBCXX_GENERATED_INCLUDE_TARGET_DIR} + ${LIBCXX_GENERATED_INCLUDE_DIR}) + +-# Make sure to map the generated include directory back to libc++'s actual source directory when generating +-# debug information. Otherwise, the debug information will refer to generated headers which are created during +-# the build and generally not persistent. +-target_add_compile_flags_if_supported(cxx-headers INTERFACE "-fdebug-prefix-map=${LIBCXX_GENERATED_INCLUDE_DIR}=${LIBCXX_SOURCE_DIR}/include") +- + if (LIBCXX_INSTALL_HEADERS) + foreach(file ${files}) + get_filename_component(dir ${file} DIRECTORY) diff --git a/meta/recipes-devtools/clang/clang/0037-allow-external-prepare_builtins.patch b/meta/recipes-devtools/clang/clang/0037-allow-external-prepare_builtins.patch deleted file mode 100644 index a9f401b21b..0000000000 --- a/meta/recipes-devtools/clang/clang/0037-allow-external-prepare_builtins.patch +++ /dev/null @@ -1,54 +0,0 @@ -From cd679dff50adb4a96dae132ba54e74d7c7371074 Mon Sep 17 00:00:00 2001 -From: Ross Burton -Date: Wed, 16 Jul 2025 23:24:21 +0100 -Subject: [PATCH] allow external prepare_builtins - -In standalone cross builds, libclc can't build a native prepare_builtins. - -Hack the CMake to allow it to use an existing binary, which we build in the recipe. - -Upstream-Status: Inappropriate [discussion for a proper fix in https://github.com/llvm/llvm-project/issues/149814] -Signed-off-by: Ross Burton ---- - libclc/CMakeLists.txt | 23 +++++++++++++++++------ - 1 file changed, 17 insertions(+), 6 deletions(-) - -diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt -index c98e2043464d..151c5d2d20c6 100644 ---- a/libclc/CMakeLists.txt -+++ b/libclc/CMakeLists.txt -@@ -178,17 +178,28 @@ set(LLVM_LINK_COMPONENTS - IRReader - Support - ) -+ - if( LIBCLC_STANDALONE_BUILD ) -- add_llvm_executable( prepare_builtins utils/prepare-builtins.cpp ) -- set( prepare_builtins_exe prepare_builtins ) -- set( prepare_builtins_target prepare_builtins ) -+ message("cross ${CMAKE_CROSSCOMPILING}") -+ if(CMAKE_CROSSCOMPILING) -+ find_program(PREPARE_BUILTINS prepare_builtins REQUIRED) -+ message("found ${PREPARE_BUILTINS}") -+ set( prepare_builtins_exe ${PREPARE_BUILTINS} ) -+ else() -+ add_llvm_executable( prepare_builtins utils/prepare-builtins.cpp ) -+ set( prepare_builtins_exe prepare_builtins ) -+ set( prepare_builtins_target prepare_builtins ) -+ target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} ) -+ # These were not properly reported in early LLVM and we don't need them -+ target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions ) -+ endif() - else() - add_llvm_utility( prepare_builtins utils/prepare-builtins.cpp ) - setup_host_tool( prepare_builtins PREPARE_BUILTINS prepare_builtins_exe prepare_builtins_target ) -+ target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} ) -+ # These were not properly reported in early LLVM and we don't need them -+ target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions ) - endif() --target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} ) --# These were not properly reported in early LLVM and we don't need them --target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions ) - - # Setup arch devices - set( r600--_devices cedar cypress barts cayman ) diff --git a/meta/recipes-devtools/clang/clang/0038-Prevent-revisiting-block-when-searching-for-noreturn.patch b/meta/recipes-devtools/clang/clang/0038-Prevent-revisiting-block-when-searching-for-noreturn.patch new file mode 100644 index 0000000000..d3d7403854 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0038-Prevent-revisiting-block-when-searching-for-noreturn.patch @@ -0,0 +1,41 @@ +From fdd02ac61cb909711f56f1e990f45439b0beef7b Mon Sep 17 00:00:00 2001 +From: Serge Pavlov +Date: Fri, 25 Jul 2025 13:35:19 +0700 +Subject: [PATCH] Prevent revisiting block when searching for noreturn vars + +When searching for noreturn variable initializations, do not visit CFG +blocks that are already visited, it prevents hanging the analysis. + +It must fix Ihttps://github.com/llvm/llvm-project/issues/150336. + +Upstream-Status: Submitted [https://github.com/llvm/llvm-project/pull/150582] +Signed-off-by: Khem Raj +--- + clang/test/SemaCXX/noreturn-vars.cpp | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/clang/test/SemaCXX/noreturn-vars.cpp b/clang/test/SemaCXX/noreturn-vars.cpp +index ca65fcf5ca31..1bf074149f04 100644 +--- a/clang/test/SemaCXX/noreturn-vars.cpp ++++ b/clang/test/SemaCXX/noreturn-vars.cpp +@@ -225,3 +225,20 @@ extern void abc_02(func_type *); + abc_02(&func_ptr); + func_ptr(); + } // expected-warning {{function declared 'noreturn' should not return}} ++ ++namespace Issue150336 { ++void free(void *); ++typedef void (*sel_freefunc)(void *); ++struct gmx_ana_selmethod_t { ++ sel_freefunc free; ++ int nparams; ++ int *param; ++}; ++void gmx_selelem_free_method(struct gmx_ana_selmethod_t* method, void* mdata) { ++ sel_freefunc free_func = 0; ++ for (int i = 0; i < method->nparams; ++i) ++ free(&method->param[i]); ++ if (mdata && free_func) ++ free_func(mdata); ++} ++} diff --git a/meta/recipes-devtools/clang/clang/0038-Revert-libc-Remap-headers-in-the-debug-info-when-bui.patch b/meta/recipes-devtools/clang/clang/0038-Revert-libc-Remap-headers-in-the-debug-info-when-bui.patch deleted file mode 100644 index 1572911aad..0000000000 --- a/meta/recipes-devtools/clang/clang/0038-Revert-libc-Remap-headers-in-the-debug-info-when-bui.patch +++ /dev/null @@ -1,36 +0,0 @@ -From e5033c176725f7877694cbee6a8aaa00291101c4 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sun, 27 Jul 2025 19:12:13 -0700 -Subject: [PATCH] Revert "[libc++] Remap headers in the debug info when - building the library (#143004)" - -This reverts commit 4d50b405f1585ce172f87cb5f8daf3c1b4145215. - -There is a discussion on this issue on [1] -I have discussed this on PR and also with developer on IRC, I am -hoping that our position will be considered by 22.x release - -[1] https://github.com/llvm/llvm-project/pull/143004/ - -Upstream-Status: Inappropriate [ OE-Specific ] -Signed-off-by: Khem Raj ---- - libcxx/include/CMakeLists.txt | 5 ----- - 1 file changed, 5 deletions(-) - -diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt -index 9e9852de2a4c..9ee1b4695783 100644 ---- a/libcxx/include/CMakeLists.txt -+++ b/libcxx/include/CMakeLists.txt -@@ -1719,11 +1719,6 @@ add_dependencies(cxx-headers generate-cxx-headers) - target_include_directories(cxx-headers INTERFACE ${LIBCXX_GENERATED_INCLUDE_TARGET_DIR} - ${LIBCXX_GENERATED_INCLUDE_DIR}) - --# Make sure to map the generated include directory back to libc++'s actual source directory when generating --# debug information. Otherwise, the debug information will refer to generated headers which are created during --# the build and generally not persistent. --target_add_compile_flags_if_supported(cxx-headers INTERFACE "-fdebug-prefix-map=${LIBCXX_GENERATED_INCLUDE_DIR}=${LIBCXX_SOURCE_DIR}/include") -- - if (LIBCXX_INSTALL_HEADERS) - foreach(file ${files}) - get_filename_component(dir ${file} DIRECTORY) diff --git a/meta/recipes-devtools/clang/clang/0039-Only-build-c-index-test-when-clang-tests-are-include.patch b/meta/recipes-devtools/clang/clang/0039-Only-build-c-index-test-when-clang-tests-are-include.patch new file mode 100644 index 0000000000..d3988b0f36 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0039-Only-build-c-index-test-when-clang-tests-are-include.patch @@ -0,0 +1,43 @@ +From de5737078972d8ba89bc6194fc0f50421c8d5631 Mon Sep 17 00:00:00 2001 +From: David Spickett +Date: Tue, 29 Jul 2025 14:17:56 +0000 +Subject: [PATCH] Only build c-index-test when clang tests are included + +c-index-test is only used for testing, and it's used in tests +that are already guarded by CLANG_INCLUDE_TESTS in clang/CMakeLists.txt. + +This change enables us to do builds with LLVM_INSTALL_TOOLCHAIN_ONLY=OFF, +and CLANG_INCLUDE_TESTS=OFF, which contain the required files +to build other bits of llvm-project standalone, but does not +include c-index-test which we have no need for. + +Upstream-Status: Submitted [https://github.com/llvm/llvm-project/pull/151157] +Signed-off-by: Ross Burton +Signed-off-by: Khem Raj +--- + clang/tools/CMakeLists.txt | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/clang/tools/CMakeLists.txt b/clang/tools/CMakeLists.txt +index 50e3d694236a..196dcb1e8466 100644 +--- a/clang/tools/CMakeLists.txt ++++ b/clang/tools/CMakeLists.txt +@@ -2,7 +2,6 @@ create_subdirectory_options(CLANG TOOL) + + add_clang_subdirectory(diagtool) + add_clang_subdirectory(driver) +-add_clang_subdirectory(apinotes-test) + if(CLANG_ENABLE_CIR) + add_clang_subdirectory(cir-opt) + add_clang_subdirectory(cir-translate) +@@ -23,7 +22,10 @@ if(HAVE_CLANG_REPL_SUPPORT) + add_clang_subdirectory(clang-repl) + endif() + ++if(CLANG_INCLUDE_TESTS) ++add_clang_subdirectory(apinotes-test) + add_clang_subdirectory(c-index-test) ++endif() + + add_clang_subdirectory(clang-refactor) + # For MinGW/Cygwin we only enable shared library if LLVM_LINK_LLVM_DYLIB=ON. diff --git a/meta/recipes-devtools/clang/clang/0039-Prevent-revisiting-block-when-searching-for-noreturn.patch b/meta/recipes-devtools/clang/clang/0039-Prevent-revisiting-block-when-searching-for-noreturn.patch deleted file mode 100644 index 343b65f505..0000000000 --- a/meta/recipes-devtools/clang/clang/0039-Prevent-revisiting-block-when-searching-for-noreturn.patch +++ /dev/null @@ -1,41 +0,0 @@ -From ef88c2d42100d7e9aee8dc876094993080b42b9f Mon Sep 17 00:00:00 2001 -From: Serge Pavlov -Date: Fri, 25 Jul 2025 13:35:19 +0700 -Subject: [PATCH] Prevent revisiting block when searching for noreturn vars - -When searching for noreturn variable initializations, do not visit CFG -blocks that are already visited, it prevents hanging the analysis. - -It must fix Ihttps://github.com/llvm/llvm-project/issues/150336. - -Upstream-Status: Submitted [https://github.com/llvm/llvm-project/pull/150582] -Signed-off-by: Khem Raj ---- - clang/test/SemaCXX/noreturn-vars.cpp | 17 +++++++++++++++++ - 1 file changed, 17 insertions(+) - -diff --git a/clang/test/SemaCXX/noreturn-vars.cpp b/clang/test/SemaCXX/noreturn-vars.cpp -index ca65fcf5ca31..1bf074149f04 100644 ---- a/clang/test/SemaCXX/noreturn-vars.cpp -+++ b/clang/test/SemaCXX/noreturn-vars.cpp -@@ -225,3 +225,20 @@ extern void abc_02(func_type *); - abc_02(&func_ptr); - func_ptr(); - } // expected-warning {{function declared 'noreturn' should not return}} -+ -+namespace Issue150336 { -+void free(void *); -+typedef void (*sel_freefunc)(void *); -+struct gmx_ana_selmethod_t { -+ sel_freefunc free; -+ int nparams; -+ int *param; -+}; -+void gmx_selelem_free_method(struct gmx_ana_selmethod_t* method, void* mdata) { -+ sel_freefunc free_func = 0; -+ for (int i = 0; i < method->nparams; ++i) -+ free(&method->param[i]); -+ if (mdata && free_func) -+ free_func(mdata); -+} -+} diff --git a/meta/recipes-devtools/clang/clang/0040-Only-build-c-index-test-when-clang-tests-are-include.patch b/meta/recipes-devtools/clang/clang/0040-Only-build-c-index-test-when-clang-tests-are-include.patch deleted file mode 100644 index 111e0110bc..0000000000 --- a/meta/recipes-devtools/clang/clang/0040-Only-build-c-index-test-when-clang-tests-are-include.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 70c4615ab54e5380019955a7cb3381b977802b7d Mon Sep 17 00:00:00 2001 -From: David Spickett -Date: Tue, 29 Jul 2025 14:17:56 +0000 -Subject: [PATCH] Only build c-index-test when clang tests are included - -c-index-test is only used for testing, and it's used in tests -that are already guarded by CLANG_INCLUDE_TESTS in clang/CMakeLists.txt. - -This change enables us to do builds with LLVM_INSTALL_TOOLCHAIN_ONLY=OFF, -and CLANG_INCLUDE_TESTS=OFF, which contain the required files -to build other bits of llvm-project standalone, but does not -include c-index-test which we have no need for. - -Upstream-Status: Submitted [https://github.com/llvm/llvm-project/pull/151157] -Signed-off-by: Ross Burton -Signed-off-by: Khem Raj ---- - clang/tools/CMakeLists.txt | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/clang/tools/CMakeLists.txt b/clang/tools/CMakeLists.txt -index 50e3d694236a..196dcb1e8466 100644 ---- a/clang/tools/CMakeLists.txt -+++ b/clang/tools/CMakeLists.txt -@@ -2,7 +2,6 @@ create_subdirectory_options(CLANG TOOL) - - add_clang_subdirectory(diagtool) - add_clang_subdirectory(driver) --add_clang_subdirectory(apinotes-test) - if(CLANG_ENABLE_CIR) - add_clang_subdirectory(cir-opt) - add_clang_subdirectory(cir-translate) -@@ -23,7 +22,10 @@ if(HAVE_CLANG_REPL_SUPPORT) - add_clang_subdirectory(clang-repl) - endif() - -+if(CLANG_INCLUDE_TESTS) -+add_clang_subdirectory(apinotes-test) - add_clang_subdirectory(c-index-test) -+endif() - - add_clang_subdirectory(clang-refactor) - # For MinGW/Cygwin we only enable shared library if LLVM_LINK_LLVM_DYLIB=ON. diff --git a/meta/recipes-devtools/clang/clang/0040-opt-viewer-Allow-users-to-set-LLVM_HAVE_OPT_VIEWER_M.patch b/meta/recipes-devtools/clang/clang/0040-opt-viewer-Allow-users-to-set-LLVM_HAVE_OPT_VIEWER_M.patch new file mode 100644 index 0000000000..4e93756af9 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0040-opt-viewer-Allow-users-to-set-LLVM_HAVE_OPT_VIEWER_M.patch @@ -0,0 +1,70 @@ +From c2b576a49ed1b83def75578f7d2b2e8c3c54e60f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 2 Aug 2025 17:58:20 -0700 +Subject: [PATCH] [opt-viewer] Allow users to set LLVM_HAVE_OPT_VIEWER_MODULES + manually from the CMake + +Check right before setting LLVM_HAVE_OPT_VIEWER_MODULES +so that if the user specifies the variable on the commandline +it takes precedence. If not, fall back to the old logic + +Upstream-Status: Submitted [https://github.com/llvm/llvm-project/pull/151845] +Signed-off-by: Khem Raj +--- + llvm/CMakeLists.txt | 2 ++ + llvm/cmake/config-ix.cmake | 13 ++++++++++--- + llvm/include/llvm/Config/config.h.cmake | 3 +++ + 3 files changed, 15 insertions(+), 3 deletions(-) + +diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt +index cb945b578e46..e4ed9eca6014 100644 +--- a/llvm/CMakeLists.txt ++++ b/llvm/CMakeLists.txt +@@ -7,6 +7,8 @@ set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) + include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake + NO_POLICY_SCOPE) + ++option(LLVM_HAVE_OPT_VIEWER_MODULES "Enable opt-viewer modules support" ON) ++ + # Builds with custom install names and installation rpath setups may not work + # in the build tree. Allow these cases to use CMake's default build tree + # behavior by setting `LLVM_NO_INSTALL_NAME_DIR_FOR_BUILD_TREE` to do this. +diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake +index a8e4e5a63244..17af3dc1e93f 100644 +--- a/llvm/cmake/config-ix.cmake ++++ b/llvm/cmake/config-ix.cmake +@@ -805,10 +805,17 @@ foreach(module ${PYTHON_MODULES}) + find_python_module(${module}) + endforeach() + +-if(PY_PYGMENTS_FOUND AND PY_PYGMENTS_LEXERS_C_CPP_FOUND AND PY_YAML_FOUND) +- set (LLVM_HAVE_OPT_VIEWER_MODULES 1) ++if(NOT DEFINED LLVM_HAVE_OPT_VIEWER_MODULES) ++ if(PY_PYGMENTS_FOUND AND PY_PYGMENTS_LEXERS_C_CPP_FOUND AND PY_YAML_FOUND) ++ set (LLVM_HAVE_OPT_VIEWER_MODULES 1) ++ else() ++ set (LLVM_HAVE_OPT_VIEWER_MODULES 0) ++ endif() ++elseif(LLVM_HAVE_OPT_VIEWER_MODULES) ++ # Use the user-provided value ++ set(LLVM_HAVE_OPT_VIEWER_MODULES 1) + else() +- set (LLVM_HAVE_OPT_VIEWER_MODULES 0) ++ set(LLVM_HAVE_OPT_VIEWER_MODULES 0) + endif() + + function(llvm_get_host_prefixes_and_suffixes) +diff --git a/llvm/include/llvm/Config/config.h.cmake b/llvm/include/llvm/Config/config.h.cmake +index ce83de8e4cba..02cf6d2ec363 100644 +--- a/llvm/include/llvm/Config/config.h.cmake ++++ b/llvm/include/llvm/Config/config.h.cmake +@@ -287,6 +287,9 @@ + /* Define to a function implementing strdup */ + #cmakedefine strdup ${strdup} + ++/* Define indicating opt-viewer modules */ ++#cmakedefine LLVM_HAVE_OPT_VIEWER_MODULES ++ + /* Whether GlobalISel rule coverage is being collected */ + #cmakedefine01 LLVM_GISEL_COV_ENABLED + diff --git a/meta/recipes-devtools/clang/clang/0041-opt-viewer-Allow-users-to-set-LLVM_HAVE_OPT_VIEWER_M.patch b/meta/recipes-devtools/clang/clang/0041-opt-viewer-Allow-users-to-set-LLVM_HAVE_OPT_VIEWER_M.patch deleted file mode 100644 index 4dc01f6e64..0000000000 --- a/meta/recipes-devtools/clang/clang/0041-opt-viewer-Allow-users-to-set-LLVM_HAVE_OPT_VIEWER_M.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 93a51605fccf0f99868f8bae212a08823d01b03a Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 2 Aug 2025 17:58:20 -0700 -Subject: [PATCH] [opt-viewer] Allow users to set LLVM_HAVE_OPT_VIEWER_MODULES - manually from the CMake - -Check right before setting LLVM_HAVE_OPT_VIEWER_MODULES -so that if the user specifies the variable on the commandline -it takes precedence. If not, fall back to the old logic - -Upstream-Status: Submitted [https://github.com/llvm/llvm-project/pull/151845] -Signed-off-by: Khem Raj ---- - llvm/CMakeLists.txt | 2 ++ - llvm/cmake/config-ix.cmake | 13 ++++++++++--- - llvm/include/llvm/Config/config.h.cmake | 3 +++ - 3 files changed, 15 insertions(+), 3 deletions(-) - -diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt -index cb945b578e46..e4ed9eca6014 100644 ---- a/llvm/CMakeLists.txt -+++ b/llvm/CMakeLists.txt -@@ -7,6 +7,8 @@ set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) - include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake - NO_POLICY_SCOPE) - -+option(LLVM_HAVE_OPT_VIEWER_MODULES "Enable opt-viewer modules support" ON) -+ - # Builds with custom install names and installation rpath setups may not work - # in the build tree. Allow these cases to use CMake's default build tree - # behavior by setting `LLVM_NO_INSTALL_NAME_DIR_FOR_BUILD_TREE` to do this. -diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake -index a8e4e5a63244..17af3dc1e93f 100644 ---- a/llvm/cmake/config-ix.cmake -+++ b/llvm/cmake/config-ix.cmake -@@ -805,10 +805,17 @@ foreach(module ${PYTHON_MODULES}) - find_python_module(${module}) - endforeach() - --if(PY_PYGMENTS_FOUND AND PY_PYGMENTS_LEXERS_C_CPP_FOUND AND PY_YAML_FOUND) -- set (LLVM_HAVE_OPT_VIEWER_MODULES 1) -+if(NOT DEFINED LLVM_HAVE_OPT_VIEWER_MODULES) -+ if(PY_PYGMENTS_FOUND AND PY_PYGMENTS_LEXERS_C_CPP_FOUND AND PY_YAML_FOUND) -+ set (LLVM_HAVE_OPT_VIEWER_MODULES 1) -+ else() -+ set (LLVM_HAVE_OPT_VIEWER_MODULES 0) -+ endif() -+elseif(LLVM_HAVE_OPT_VIEWER_MODULES) -+ # Use the user-provided value -+ set(LLVM_HAVE_OPT_VIEWER_MODULES 1) - else() -- set (LLVM_HAVE_OPT_VIEWER_MODULES 0) -+ set(LLVM_HAVE_OPT_VIEWER_MODULES 0) - endif() - - function(llvm_get_host_prefixes_and_suffixes) -diff --git a/llvm/include/llvm/Config/config.h.cmake b/llvm/include/llvm/Config/config.h.cmake -index ce83de8e4cba..02cf6d2ec363 100644 ---- a/llvm/include/llvm/Config/config.h.cmake -+++ b/llvm/include/llvm/Config/config.h.cmake -@@ -287,6 +287,9 @@ - /* Define to a function implementing strdup */ - #cmakedefine strdup ${strdup} - -+/* Define indicating opt-viewer modules */ -+#cmakedefine LLVM_HAVE_OPT_VIEWER_MODULES -+ - /* Whether GlobalISel rule coverage is being collected */ - #cmakedefine01 LLVM_GISEL_COV_ENABLED - diff --git a/meta/recipes-devtools/clang/common-clang.inc b/meta/recipes-devtools/clang/common-clang.inc index 9814319429..bf3a63914a 100644 --- a/meta/recipes-devtools/clang/common-clang.inc +++ b/meta/recipes-devtools/clang/common-clang.inc @@ -5,7 +5,7 @@ LLVM_HTTP ?= "https://github.com/llvm" MAJOR_VER = "21" MINOR_VER = "1" -PATCH_VER = "0" +PATCH_VER = "1" # could be 'rcX' or 'git' or empty ( for release ) VER_SUFFIX = "" diff --git a/meta/recipes-devtools/clang/common.inc b/meta/recipes-devtools/clang/common.inc index 889847c3e1..625b0b064b 100644 --- a/meta/recipes-devtools/clang/common.inc +++ b/meta/recipes-devtools/clang/common.inc @@ -17,7 +17,7 @@ BASEURI ?= "${LLVM_HTTP}/llvm-project/releases/download/llvmorg-${PV}${VER_SUFFI UPSTREAM_CHECK_URI = "${LLVM_HTTP}/llvm-project/releases/" UPSTREAM_CHECK_REGEX = "releases/tag/llvmorg-?(?P\d+(\.\d+)+)" SOURCEDIR ?= "llvm-project-${PV}${VER_SUFFIX}.src" -SRC_URI[sha256sum] = "1672e3efb4c2affd62dbbe12ea898b28a451416c7d95c1bd0190c26cbe878825" +SRC_URI[sha256sum] = "8863980e14484a72a9b7d2c80500e1749054d74f08f8c5102fd540a3c5ac9f8a" SRC_URI = "\ ${BASEURI} \ @@ -46,22 +46,21 @@ 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 \ - file://0030-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch \ - file://0031-compiler-rt-Do-not-pass-target-to-clang-compiler.patch \ - file://0032-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch \ - file://0033-llvm-config-remove-LLVM_LDFLAGS-from-ldflags-output.patch \ - file://0034-compiler-rt-Exclude-sync_fetch_and_-for-any-pre-ARMv.patch \ - file://0035-compiler-rt-Hardcode-uptr-sptr-typedefs-on-Mips-Linu.patch \ - file://0036-clang-Use-sysroot-relative-paths-for-getArchSpecific.patch \ - file://0037-allow-external-prepare_builtins.patch \ - file://0038-Revert-libc-Remap-headers-in-the-debug-info-when-bui.patch \ - file://0039-Prevent-revisiting-block-when-searching-for-noreturn.patch \ - file://0040-Only-build-c-index-test-when-clang-tests-are-include.patch \ - file://0041-opt-viewer-Allow-users-to-set-LLVM_HAVE_OPT_VIEWER_M.patch \ + file://0026-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch \ + file://0027-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch \ + file://0028-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch \ + file://0029-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch \ + file://0030-compiler-rt-Do-not-pass-target-to-clang-compiler.patch \ + file://0031-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch \ + file://0032-llvm-config-remove-LLVM_LDFLAGS-from-ldflags-output.patch \ + file://0033-compiler-rt-Exclude-sync_fetch_and_-for-any-pre-ARMv.patch \ + file://0034-compiler-rt-Hardcode-uptr-sptr-typedefs-on-Mips-Linu.patch \ + file://0035-clang-Use-sysroot-relative-paths-for-getArchSpecific.patch \ + file://0036-allow-external-prepare_builtins.patch \ + file://0037-Revert-libc-Remap-headers-in-the-debug-info-when-bui.patch \ + file://0038-Prevent-revisiting-block-when-searching-for-noreturn.patch \ + file://0039-Only-build-c-index-test-when-clang-tests-are-include.patch \ + file://0040-opt-viewer-Allow-users-to-set-LLVM_HAVE_OPT_VIEWER_M.patch \ " # Fallback to no-PIE if not set GCCPIE ??= "" -- cgit v1.2.3-54-g00ecf