From b3e3eeea3d64a7443ff7253f8ce4609b17ed5e3f Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 9 Mar 2022 17:18:06 -0800 Subject: clang: Upgrade to latest on 14.x Enable __int128 for compiler-rt/ppc32 Drop redundant ppc patch which is fixed upstream already Brings these fixes * e879b2bf82ef [libcxxabi] [test] Depend on unwind only if available * 569b773323a3 [libcxx][CI] Set Arm triples to match native clang build's default * f7007c570a21 Lambdas are not necessarily locals. This resolves DR48250. * eb84577cbc23 Revert "[release] Use the Bootstrapping build for building LLVM releases" * d843bde69aab [clang][driver] Fix float128 diagnostics with glibc >= 2.32 * ba9ff030d302 [SimplifyCFG][PhaseOrdering] Defer lowering switch into an integer range comparison and branch until after at least the IPSCCP * da3953fb0315 [NFC][PhaseOrdering] Add some tests from D119839 * 8b51e5ee0a2e [NewPM][Inliner] Make inlined calls to functions in same SCC as callee exponentially expensive * 6a713120502a [llvm] [bindings/OCaml] Remove unused dep on ounit2 * 2de2a2bba998 [LICM][PhaseOrder] Don't speculate in LICM until after running loop rotate * 7d1cd3380add [NFC][PhaseOrdering] Improve test coverage for D119975 * 1f4613675051 [NFC][PhaseOrdering] spurious-peeling.ll: also test -O1/-O2 results * 36bf1a9e628d [NFC][PhaseOrdering] Precommit tests from D119965 * 67555104d23a [MachineSink] Disable if there are any irreducible cycles * 1e4fd59253c6 [CodeGen] Add test for PR53990 (NFC) * bfaed485756a [BOLT][CMAKE] Remove CMake 3.13.4 incompatible parameter * 43b4544023b7 [LLD] [COFF] Order .debug_* sections at the end, to avoid leaving gaps if stripped * e6d2aa9b0f13 [MC][WebAssembly] Fix crash when relocation addend underlows U32 * f6a4df3a0a3d [WebAssembly] Covert llvm/test/MC/WebAssembly/reloc-code.ll to asm. NFC * 9d54fe21c67f [docs] Add RISC-V release notes for LLVM 14 * 1e3d5ccab6b6 Add cmake to source release tarballs * 0205cc086e50 [OpenMP][FIX] Ensure custom state machine works * 0826716786cd [Mips] support "sp" named register * 09546e1b5103 [libc++][doc] Update the release notes. * 8f9f84c6873e [docs] clang/docs/ReleaseNotes.rst: Add blank line * aab33202d239 [docs] PowerPC release notes formatting/grammar fixes * acf67b7a0dfc [docs] Tweak wording of note re: LTO on AIX * ce1e90fc8dba [docs] Add PowerPC release notes for LLVM 14 Signed-off-by: Khem Raj --- recipes-devtools/clang/clang.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 +- .../0005-llvm-allow-env-override-of-exe-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 | 38 +++++++ ...-ppc-does-not-support-128-bit-long-double.patch | 25 ----- ...inside-the-target-sysroot-for-compiler-ru.patch | 40 +++++++ .../0009-clang-Prepend-trailing-to-sysroot.patch | 38 ------- ...ang-Define-releative-gcc-installation-dir.patch | 46 ++++++++ ...inside-the-target-sysroot-for-compiler-ru.patch | 40 ------- ...pthread-and-ldl-along-with-lunwind-for-st.patch | 34 ++++++ ...ang-Define-releative-gcc-installation-dir.patch | 46 -------- ..._EXECUTABLE-when-cross-compiling-for-nati.patch | 23 ++++ ...pthread-and-ldl-along-with-lunwind-for-st.patch | 34 ------ .../0013-Check-for-atomic-double-intrinsics.patch | 33 ++++++ ..._EXECUTABLE-when-cross-compiling-for-nati.patch | 23 ---- .../0014-Check-for-atomic-double-intrinsics.patch | 33 ------ ...compiler-runtime-library-to-link-step-for.patch | 37 +++++++ ...cmake-Fix-configure-for-packages-using-fi.patch | 116 +++++++++++++++++++++ ...compiler-runtime-library-to-link-step-for.patch | 37 ------- ...esource-dir-location-for-cross-toolchains.patch | 39 +++++++ ...cmake-Fix-configure-for-packages-using-fi.patch | 116 --------------------- ...esource-dir-location-for-cross-toolchains.patch | 39 ------- ...r-Add-dyld-prefix-when-checking-sysroot-f.patch | 67 ++++++++++++ .../0018-clang-Use-python3-in-python-scripts.patch | 90 ++++++++++++++++ ...r-Add-dyld-prefix-when-checking-sysroot-f.patch | 67 ------------ ...4-set-Yocto-based-GCC-install-search-path.patch | 70 +++++++++++++ .../0019-clang-Use-python3-in-python-scripts.patch | 90 ---------------- ...4-set-Yocto-based-GCC-install-search-path.patch | 70 ------------- ...-llvm-Do-not-use-find_library-for-ncurses.patch | 44 ++++++++ ...-llvm-Do-not-use-find_library-for-ncurses.patch | 44 -------- ...-anchor-for-adding-OE-distro-vendor-names.patch | 32 ++++++ ...ompiler-rt-Use-mcr-based-barrier-on-armv6.patch | 71 +++++++++++++ ...-anchor-for-adding-OE-distro-vendor-names.patch | 32 ------ ...-Do-not-use-backtrace-APIs-on-non-glibc-l.patch | 68 ++++++++++++ ...ompiler-rt-Use-mcr-based-barrier-on-armv6.patch | 71 ------------- ...86-triple-for-non-debian-multiarch-linux-.patch | 27 +++++ ...-Do-not-use-backtrace-APIs-on-non-glibc-l.patch | 68 ------------ ...86-triple-for-non-debian-multiarch-linux-.patch | 27 ----- ...-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch | 28 +++++ ...-Link-scudo-standalone-with-libatomic-on-.patch | 29 ++++++ ...-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch | 28 ----- ...-Link-scudo-standalone-with-libatomic-on-.patch | 29 ------ ...0027-libunwind-Added-unw_backtrace-method.patch | 55 ++++++++++ .../0028-Do-not-force-thumb-mode-directive.patch | 46 ++++++++ ...0028-libunwind-Added-unw_backtrace-method.patch | 55 ---------- .../0029-Do-not-force-thumb-mode-directive.patch | 46 -------- ...-Do-not-use-install-relative-libc-headers.patch | 32 ++++++ ...-Do-not-use-install-relative-libc-headers.patch | 32 ------ ...ow-driver-finds-GCC-installation-path-on-.patch | 97 +++++++++++++++++ .../0031-Fix-lib-paths-for-OpenEmbedded-Host.patch | 79 ++++++++++++++ ...ow-driver-finds-GCC-installation-path-on-.patch | 97 ----------------- ...library-search-path-for-OpenEmbedded-Host.patch | 84 +++++++++++++++ .../0032-Fix-lib-paths-for-OpenEmbedded-Host.patch | 79 -------------- ...library-search-path-for-OpenEmbedded-Host.patch | 84 --------------- .../0033-lldb-Link-with-libatomic-on-x86.patch | 33 ++++++ ...de-openembedded-distributions-from-settin.patch | 35 +++++++ .../0034-lldb-Link-with-libatomic-on-x86.patch | 33 ------ ...de-openembedded-distributions-from-settin.patch | 35 ------- ...035-compiler-rt-Enable-__int128-for-ppc32.patch | 58 +++++++++++ recipes-devtools/clang/common.inc | 56 +++++----- 65 files changed, 1487 insertions(+), 1454 deletions(-) create mode 100644 recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch delete mode 100644 recipes-devtools/clang/clang/0008-clang-musl-ppc-does-not-support-128-bit-long-double.patch create mode 100644 recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch delete mode 100644 recipes-devtools/clang/clang/0009-clang-Prepend-trailing-to-sysroot.patch create mode 100644 recipes-devtools/clang/clang/0010-clang-Define-releative-gcc-installation-dir.patch delete mode 100644 recipes-devtools/clang/clang/0010-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch create mode 100644 recipes-devtools/clang/clang/0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch delete mode 100644 recipes-devtools/clang/clang/0011-clang-Define-releative-gcc-installation-dir.patch create mode 100644 recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch delete mode 100644 recipes-devtools/clang/clang/0012-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch create mode 100644 recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch delete mode 100644 recipes-devtools/clang/clang/0013-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch delete mode 100644 recipes-devtools/clang/clang/0014-Check-for-atomic-double-intrinsics.patch create mode 100644 recipes-devtools/clang/clang/0014-libcxx-Add-compiler-runtime-library-to-link-step-for.patch create mode 100644 recipes-devtools/clang/clang/0015-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch delete mode 100644 recipes-devtools/clang/clang/0015-libcxx-Add-compiler-runtime-library-to-link-step-for.patch create mode 100644 recipes-devtools/clang/clang/0016-clang-Fix-resource-dir-location-for-cross-toolchains.patch delete mode 100644 recipes-devtools/clang/clang/0016-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch delete mode 100644 recipes-devtools/clang/clang/0017-clang-Fix-resource-dir-location-for-cross-toolchains.patch create mode 100644 recipes-devtools/clang/clang/0017-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch create mode 100644 recipes-devtools/clang/clang/0018-clang-Use-python3-in-python-scripts.patch delete mode 100644 recipes-devtools/clang/clang/0018-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch create mode 100644 recipes-devtools/clang/clang/0019-For-x86_64-set-Yocto-based-GCC-install-search-path.patch delete mode 100644 recipes-devtools/clang/clang/0019-clang-Use-python3-in-python-scripts.patch delete mode 100644 recipes-devtools/clang/clang/0020-For-x86_64-set-Yocto-based-GCC-install-search-path.patch create mode 100644 recipes-devtools/clang/clang/0020-llvm-Do-not-use-find_library-for-ncurses.patch delete mode 100644 recipes-devtools/clang/clang/0021-llvm-Do-not-use-find_library-for-ncurses.patch create mode 100644 recipes-devtools/clang/clang/0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch create mode 100644 recipes-devtools/clang/clang/0022-compiler-rt-Use-mcr-based-barrier-on-armv6.patch delete mode 100644 recipes-devtools/clang/clang/0022-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch create mode 100644 recipes-devtools/clang/clang/0023-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch delete mode 100644 recipes-devtools/clang/clang/0023-compiler-rt-Use-mcr-based-barrier-on-armv6.patch create mode 100644 recipes-devtools/clang/clang/0024-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch delete mode 100644 recipes-devtools/clang/clang/0024-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch delete mode 100644 recipes-devtools/clang/clang/0025-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch create mode 100644 recipes-devtools/clang/clang/0025-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch create mode 100644 recipes-devtools/clang/clang/0026-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch delete mode 100644 recipes-devtools/clang/clang/0026-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch delete mode 100644 recipes-devtools/clang/clang/0027-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch create mode 100644 recipes-devtools/clang/clang/0027-libunwind-Added-unw_backtrace-method.patch create mode 100644 recipes-devtools/clang/clang/0028-Do-not-force-thumb-mode-directive.patch delete mode 100644 recipes-devtools/clang/clang/0028-libunwind-Added-unw_backtrace-method.patch delete mode 100644 recipes-devtools/clang/clang/0029-Do-not-force-thumb-mode-directive.patch create mode 100644 recipes-devtools/clang/clang/0029-clang-Do-not-use-install-relative-libc-headers.patch delete mode 100644 recipes-devtools/clang/clang/0030-clang-Do-not-use-install-relative-libc-headers.patch create mode 100644 recipes-devtools/clang/clang/0030-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch create mode 100644 recipes-devtools/clang/clang/0031-Fix-lib-paths-for-OpenEmbedded-Host.patch delete mode 100644 recipes-devtools/clang/clang/0031-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch create mode 100644 recipes-devtools/clang/clang/0032-Correct-library-search-path-for-OpenEmbedded-Host.patch delete mode 100644 recipes-devtools/clang/clang/0032-Fix-lib-paths-for-OpenEmbedded-Host.patch delete mode 100644 recipes-devtools/clang/clang/0033-Correct-library-search-path-for-OpenEmbedded-Host.patch create mode 100644 recipes-devtools/clang/clang/0033-lldb-Link-with-libatomic-on-x86.patch create mode 100644 recipes-devtools/clang/clang/0034-clang-exclude-openembedded-distributions-from-settin.patch delete mode 100644 recipes-devtools/clang/clang/0034-lldb-Link-with-libatomic-on-x86.patch delete mode 100644 recipes-devtools/clang/clang/0035-clang-exclude-openembedded-distributions-from-settin.patch create mode 100644 recipes-devtools/clang/clang/0035-compiler-rt-Enable-__int128-for-ppc32.patch (limited to 'recipes-devtools/clang') diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc index 7fb914a..46a8526 100644 --- a/recipes-devtools/clang/clang.inc +++ b/recipes-devtools/clang/clang.inc @@ -8,7 +8,7 @@ MAJOR_VER = "14" MINOR_VER = "0" PATCH_VER = "0" -SRCREV ?= "65d53279b1fddeae4bd455d588ea7527aed50bb9" +SRCREV ?= "e879b2bf82ef2d096d2c0e5147ebac541a7b8828" PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}" BRANCH = "release/14.x" diff --git a/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch b/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch index 8c4d979..83f09a3 100644 --- a/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch +++ b/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch @@ -1,4 +1,4 @@ -From c158da8da9876522e23e15e5c21ac7bd45650c3d Mon Sep 17 00:00:00 2001 +From b823a37835767fa1adb3d992d93f97fef748822a 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/recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch b/recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch index 60d85d4..643bdd8 100644 --- a/recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch +++ b/recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch @@ -1,4 +1,4 @@ -From 59c803e2c49b4add4b73a72844dd02faa3b62c92 Mon Sep 17 00:00:00 2001 +From 8d5dee6f4286fe343b5178e03a5fbd1c6a013dbf 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/recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch b/recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch index 221fff1..5347d0a 100644 --- a/recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch +++ b/recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch @@ -1,4 +1,4 @@ -From e96506e267151bd88a47b9f8582d182b5295e94c Mon Sep 17 00:00:00 2001 +From 114f3b0c10f9693d0b5db21689d50d498e98165f 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/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch b/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch index 72e641e..7631575 100644 --- a/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch +++ b/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch @@ -1,4 +1,4 @@ -From 521d1e4ff1bb60afd61e297e27d58e320de8675b Mon Sep 17 00:00:00 2001 +From 728eeaa231d3da4e150a773b6823e74f5f823add 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/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-path.patch b/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-path.patch index 812cbe0..92e6864 100644 --- a/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-path.patch +++ b/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-path.patch @@ -1,4 +1,4 @@ -From 8bb24d5fb76c78cc99c5f086081963e3d93a09d3 Mon Sep 17 00:00:00 2001 +From a853cb73337e6bf88a7368cec873206619fc8103 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 path diff --git a/recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch b/recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch index a6a03e5..bcb980b 100644 --- a/recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch +++ b/recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch @@ -1,4 +1,4 @@ -From 030eb6411a016cf1ba3081d2e5ba330f8d4acca6 Mon Sep 17 00:00:00 2001 +From 6e918991053943e4194f17798bfcf2eebe8114c8 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/recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch b/recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch index 70d5610..94fcf96 100644 --- a/recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch +++ b/recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch @@ -1,4 +1,4 @@ -From b5b6e5e0cf456c99d18eb3dbe8e6a945e12c2ba6 Mon Sep 17 00:00:00 2001 +From c7774d37208517f25f60f6d78bdbbb4041ca1a9f 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/recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch b/recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch new file mode 100644 index 0000000..6f99733 --- /dev/null +++ b/recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch @@ -0,0 +1,38 @@ +From d3bba128b26cef0bdf8703d74aaedf767575f980 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 + +This is needed to handle a case where clang +isntall and target sysroot are perilously same + +e.g. + +sysroot = /mnt/clang/recipe-sysroot +clang install = /mnt/clang/recipe-sysroot-native + +in this case it will mistakenly assume that +clang is installed under the same sysroot dir +and it will try to add relative ../lib paths +to linker steps which would then be wrong +since they will become relative to clang +installation and not sysroot + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Linux.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index 97e987c37e4a..f9e233f15dfc 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -181,7 +181,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) + Multilibs = GCCInstallation.getMultilibs(); + SelectedMultilib = GCCInstallation.getMultilib(); + llvm::Triple::ArchType Arch = Triple.getArch(); +- std::string SysRoot = computeSysRoot(); ++ std::string SysRoot = computeSysRoot() + "/"; + ToolChain::path_list &PPaths = getProgramPaths(); + + Generic_GCC::PushPPaths(PPaths); diff --git a/recipes-devtools/clang/clang/0008-clang-musl-ppc-does-not-support-128-bit-long-double.patch b/recipes-devtools/clang/clang/0008-clang-musl-ppc-does-not-support-128-bit-long-double.patch deleted file mode 100644 index eea3d16..0000000 --- a/recipes-devtools/clang/clang/0008-clang-musl-ppc-does-not-support-128-bit-long-double.patch +++ /dev/null @@ -1,25 +0,0 @@ -From ac686a30478e35d458a463b98a7e54b38a4ab5c4 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Tue, 10 May 2016 02:00:11 -0700 -Subject: [PATCH] clang: musl/ppc does not support 128-bit long double - -Signed-off-by: Khem Raj ---- - clang/lib/Basic/Targets/PPC.h | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/clang/lib/Basic/Targets/PPC.h b/clang/lib/Basic/Targets/PPC.h -index ac52eb219f54..ff2eb80b7d64 100644 ---- a/clang/lib/Basic/Targets/PPC.h -+++ b/clang/lib/Basic/Targets/PPC.h -@@ -395,6 +395,10 @@ public: - LongDoubleFormat = &llvm::APFloat::IEEEdouble(); - } - -+ if (getTriple().isMusl()) { -+ LongDoubleWidth = LongDoubleAlign = 64; -+ LongDoubleFormat = &llvm::APFloat::IEEEdouble(); -+ } - // PPC32 supports atomics up to 4 bytes. - MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32; - } diff --git a/recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch b/recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch new file mode 100644 index 0000000..7c08b37 --- /dev/null +++ b/recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch @@ -0,0 +1,40 @@ +From 8e05f66620f1b46348348e5e835a1ecd258922bd 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 + +In OE compiler-rt and libc++ are built and staged into target +sysroot and not into resourcedir which is relative to clang +driver installation where the libraries are not instlled + +Specific to cross compiling the way yocto/OE works + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChain.cpp | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp +index d657d21bfcdb..e83a556b708c 100644 +--- a/clang/lib/Driver/ToolChain.cpp ++++ b/clang/lib/Driver/ToolChain.cpp +@@ -13,6 +13,7 @@ + #include "ToolChains/InterfaceStubs.h" + #include "clang/Basic/ObjCRuntime.h" + #include "clang/Basic/Sanitizers.h" ++#include "clang/Basic/Version.h" + #include "clang/Config/config.h" + #include "clang/Driver/Action.h" + #include "clang/Driver/Driver.h" +@@ -419,7 +420,10 @@ StringRef ToolChain::getOSLibName() const { + } + + std::string ToolChain::getCompilerRTPath() const { +- SmallString<128> Path(getDriver().ResourceDir); ++ SmallString<128> Path(getDriver().SysRoot); ++ StringRef ClangLibdirSuffix(CLANG_LIBDIR_SUFFIX); ++ llvm::sys::path::append(Path, "/usr/", Twine("lib") + ClangLibdirSuffix, "clang", ++ CLANG_VERSION_STRING); + if (Triple.isOSUnknown()) { + llvm::sys::path::append(Path, "lib"); + } else { diff --git a/recipes-devtools/clang/clang/0009-clang-Prepend-trailing-to-sysroot.patch b/recipes-devtools/clang/clang/0009-clang-Prepend-trailing-to-sysroot.patch deleted file mode 100644 index f7c04ff..0000000 --- a/recipes-devtools/clang/clang/0009-clang-Prepend-trailing-to-sysroot.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 227331cfc2a56186ba53a583fcab8351ebbec3a0 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 - -This is needed to handle a case where clang -isntall and target sysroot are perilously same - -e.g. - -sysroot = /mnt/clang/recipe-sysroot -clang install = /mnt/clang/recipe-sysroot-native - -in this case it will mistakenly assume that -clang is installed under the same sysroot dir -and it will try to add relative ../lib paths -to linker steps which would then be wrong -since they will become relative to clang -installation and not sysroot - -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Linux.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 97e987c37e4a..f9e233f15dfc 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -181,7 +181,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) - Multilibs = GCCInstallation.getMultilibs(); - SelectedMultilib = GCCInstallation.getMultilib(); - llvm::Triple::ArchType Arch = Triple.getArch(); -- std::string SysRoot = computeSysRoot(); -+ std::string SysRoot = computeSysRoot() + "/"; - ToolChain::path_list &PPaths = getProgramPaths(); - - Generic_GCC::PushPPaths(PPaths); diff --git a/recipes-devtools/clang/clang/0010-clang-Define-releative-gcc-installation-dir.patch b/recipes-devtools/clang/clang/0010-clang-Define-releative-gcc-installation-dir.patch new file mode 100644 index 0000000..33ea852 --- /dev/null +++ b/recipes-devtools/clang/clang/0010-clang-Define-releative-gcc-installation-dir.patch @@ -0,0 +1,46 @@ +From 45c334c76a1010d525ee4b1bd4cc135bc9f8279d 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 + +This is required for OE gcc installation to work. +Without this its not able to find the paths for libgcc +and other standard headers and libraries from gcc +installation in OE + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 633daa58590d..d22eaf698eb8 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2517,19 +2517,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + // Whether this library suffix is relevant for the triple. + bool Active; + } Suffixes[] = { +- // This is the normal place. +- {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists}, +- +- // Debian puts cross-compilers in gcc-cross. +- {"gcc-cross/" + CandidateTriple.str(), "../..", GCCCrossDirExists}, +- + // The Freescale PPC SDK has the gcc libraries in + // /usr/lib//x.y.z so have a look there as well. Only do + // this on Freescale triples, though, since some systems put a *lot* of + // files in that location, not just GCC installation data. + {CandidateTriple.str(), "..", + TargetTriple.getVendor() == llvm::Triple::Freescale || +- TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}}; ++ TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}, ++ ++ // This is the normal place. ++ {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists}, ++ ++ // Debian puts cross-compilers in gcc-cross. ++ {"gcc-cross/" + CandidateTriple.str(), "../..", GCCCrossDirExists}}; + + for (auto &Suffix : Suffixes) { + if (!Suffix.Active) diff --git a/recipes-devtools/clang/clang/0010-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch b/recipes-devtools/clang/clang/0010-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch deleted file mode 100644 index d4bcc6c..0000000 --- a/recipes-devtools/clang/clang/0010-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 6226652ca539faf02f7834a3c2c158b5ae1e5f05 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 - -In OE compiler-rt and libc++ are built and staged into target -sysroot and not into resourcedir which is relative to clang -driver installation where the libraries are not instlled - -Specific to cross compiling the way yocto/OE works - -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChain.cpp | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp -index d657d21bfcdb..e83a556b708c 100644 ---- a/clang/lib/Driver/ToolChain.cpp -+++ b/clang/lib/Driver/ToolChain.cpp -@@ -13,6 +13,7 @@ - #include "ToolChains/InterfaceStubs.h" - #include "clang/Basic/ObjCRuntime.h" - #include "clang/Basic/Sanitizers.h" -+#include "clang/Basic/Version.h" - #include "clang/Config/config.h" - #include "clang/Driver/Action.h" - #include "clang/Driver/Driver.h" -@@ -419,7 +420,10 @@ StringRef ToolChain::getOSLibName() const { - } - - std::string ToolChain::getCompilerRTPath() const { -- SmallString<128> Path(getDriver().ResourceDir); -+ SmallString<128> Path(getDriver().SysRoot); -+ StringRef ClangLibdirSuffix(CLANG_LIBDIR_SUFFIX); -+ llvm::sys::path::append(Path, "/usr/", Twine("lib") + ClangLibdirSuffix, "clang", -+ CLANG_VERSION_STRING); - if (Triple.isOSUnknown()) { - llvm::sys::path::append(Path, "lib"); - } else { diff --git a/recipes-devtools/clang/clang/0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch b/recipes-devtools/clang/clang/0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch new file mode 100644 index 0000000..9fd8909 --- /dev/null +++ b/recipes-devtools/clang/clang/0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch @@ -0,0 +1,34 @@ +From 44339dbae2aa20c99bf77d9b9d16d37e5f822c76 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 + linking + +When doing static liking with --unwindlib=libunwind -static we encounter +undefined symbols +libunwind/src/RWMutex.hpp:68: undefined reference to `pthread_rwlock_wrlock' + +and + +libunwind/src/AddressSpace.hpp:597: undefined reference to `dladdr' + +therefore we need to link in libpthread and libdl to fill these symbols + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/CommonArgs.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp +index dfcef2304040..dbc91e427dfb 100644 +--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp ++++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp +@@ -1472,6 +1472,8 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D, + CmdArgs.push_back("-lunwind"); + } else if (LGT == LibGccType::StaticLibGcc) { + CmdArgs.push_back("-l:libunwind.a"); ++ CmdArgs.push_back("-lpthread"); ++ CmdArgs.push_back("-ldl"); + } else if (TC.getTriple().isOSCygMing()) { + if (LGT == LibGccType::SharedLibGcc) + CmdArgs.push_back("-l:libunwind.dll.a"); diff --git a/recipes-devtools/clang/clang/0011-clang-Define-releative-gcc-installation-dir.patch b/recipes-devtools/clang/clang/0011-clang-Define-releative-gcc-installation-dir.patch deleted file mode 100644 index 243e8e1..0000000 --- a/recipes-devtools/clang/clang/0011-clang-Define-releative-gcc-installation-dir.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 1324a97b610567a2ddad82b14bb48ac6f34a6bda 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 - -This is required for OE gcc installation to work. -Without this its not able to find the paths for libgcc -and other standard headers and libraries from gcc -installation in OE - -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Gnu.cpp | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 633daa58590d..d22eaf698eb8 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2517,19 +2517,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( - // Whether this library suffix is relevant for the triple. - bool Active; - } Suffixes[] = { -- // This is the normal place. -- {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists}, -- -- // Debian puts cross-compilers in gcc-cross. -- {"gcc-cross/" + CandidateTriple.str(), "../..", GCCCrossDirExists}, -- - // The Freescale PPC SDK has the gcc libraries in - // /usr/lib//x.y.z so have a look there as well. Only do - // this on Freescale triples, though, since some systems put a *lot* of - // files in that location, not just GCC installation data. - {CandidateTriple.str(), "..", - TargetTriple.getVendor() == llvm::Triple::Freescale || -- TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}}; -+ TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}, -+ -+ // This is the normal place. -+ {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists}, -+ -+ // Debian puts cross-compilers in gcc-cross. -+ {"gcc-cross/" + CandidateTriple.str(), "../..", GCCCrossDirExists}}; - - for (auto &Suffix : Suffixes) { - if (!Suffix.Active) diff --git a/recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch b/recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch new file mode 100644 index 0000000..608ef10 --- /dev/null +++ b/recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch @@ -0,0 +1,23 @@ +From 405b2bafb072f8cb873c2a0bf5bd4b78ce425379 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 + +Signed-off-by: Anuj Mittal +Signed-off-by: Khem Raj +--- + llvm/cmake/modules/CrossCompile.cmake | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake +index 2a39b6a40a28..8a441729c943 100644 +--- a/llvm/cmake/modules/CrossCompile.cmake ++++ b/llvm/cmake/modules/CrossCompile.cmake +@@ -84,6 +84,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype) + -DLLVM_ENABLE_RUNTIMES="${llvm_enable_runtimes_arg}" + ${external_project_source_dirs} + -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN="${LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN}" ++ -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" + ${build_type_flags} ${linker_flag} ${external_clang_dir} + ${ARGN} + WORKING_DIRECTORY ${${project_name}_${target_name}_BUILD} diff --git a/recipes-devtools/clang/clang/0012-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch b/recipes-devtools/clang/clang/0012-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch deleted file mode 100644 index 18495c0..0000000 --- a/recipes-devtools/clang/clang/0012-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 11fbe1b772f545864dde456f2e40e4bd09e05485 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 - linking - -When doing static liking with --unwindlib=libunwind -static we encounter -undefined symbols -libunwind/src/RWMutex.hpp:68: undefined reference to `pthread_rwlock_wrlock' - -and - -libunwind/src/AddressSpace.hpp:597: undefined reference to `dladdr' - -therefore we need to link in libpthread and libdl to fill these symbols - -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/CommonArgs.cpp | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp -index dfcef2304040..dbc91e427dfb 100644 ---- a/clang/lib/Driver/ToolChains/CommonArgs.cpp -+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp -@@ -1472,6 +1472,8 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D, - CmdArgs.push_back("-lunwind"); - } else if (LGT == LibGccType::StaticLibGcc) { - CmdArgs.push_back("-l:libunwind.a"); -+ CmdArgs.push_back("-lpthread"); -+ CmdArgs.push_back("-ldl"); - } else if (TC.getTriple().isOSCygMing()) { - if (LGT == LibGccType::SharedLibGcc) - CmdArgs.push_back("-l:libunwind.dll.a"); diff --git a/recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch b/recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch new file mode 100644 index 0000000..5778aba --- /dev/null +++ b/recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch @@ -0,0 +1,33 @@ +From 3d4effc5db71a4729b5d0152e030bbda2ceabd1c 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 + +On some architectures e.g. x86/32bit gcc decides to inline calls to +double atomic variables but clang does not and defers it to libatomic +therefore detect if clang can use built-ins for atomic if not +then link libatomic, this helps building clangd for x86 on linux systems +with gcc runtime + +Signed-off-by: Khem Raj +--- + llvm/cmake/modules/CheckAtomic.cmake | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/llvm/cmake/modules/CheckAtomic.cmake b/llvm/cmake/modules/CheckAtomic.cmake +index 3c5ba72993a3..34a1b950bbed 100644 +--- a/llvm/cmake/modules/CheckAtomic.cmake ++++ b/llvm/cmake/modules/CheckAtomic.cmake +@@ -30,10 +30,11 @@ function(check_working_cxx_atomics64 varname) + #include + #include + std::atomic x (0); ++std::atomic y (0); + int main() { + uint64_t i = x.load(std::memory_order_relaxed); + (void)i; +- return 0; ++ return int(y); + } + " ${varname}) + set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) diff --git a/recipes-devtools/clang/clang/0013-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch b/recipes-devtools/clang/clang/0013-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch deleted file mode 100644 index e43f0ac..0000000 --- a/recipes-devtools/clang/clang/0013-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch +++ /dev/null @@ -1,23 +0,0 @@ -From b11f3702657190ee638bddebd5be6b57b58953cf 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 - -Signed-off-by: Anuj Mittal -Signed-off-by: Khem Raj ---- - llvm/cmake/modules/CrossCompile.cmake | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake -index 2a39b6a40a28..8a441729c943 100644 ---- a/llvm/cmake/modules/CrossCompile.cmake -+++ b/llvm/cmake/modules/CrossCompile.cmake -@@ -84,6 +84,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype) - -DLLVM_ENABLE_RUNTIMES="${llvm_enable_runtimes_arg}" - ${external_project_source_dirs} - -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN="${LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN}" -+ -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" - ${build_type_flags} ${linker_flag} ${external_clang_dir} - ${ARGN} - WORKING_DIRECTORY ${${project_name}_${target_name}_BUILD} diff --git a/recipes-devtools/clang/clang/0014-Check-for-atomic-double-intrinsics.patch b/recipes-devtools/clang/clang/0014-Check-for-atomic-double-intrinsics.patch deleted file mode 100644 index da1f3eb..0000000 --- a/recipes-devtools/clang/clang/0014-Check-for-atomic-double-intrinsics.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 0158d01d328ad50f963272aea10b181694626679 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 - -On some architectures e.g. x86/32bit gcc decides to inline calls to -double atomic variables but clang does not and defers it to libatomic -therefore detect if clang can use built-ins for atomic if not -then link libatomic, this helps building clangd for x86 on linux systems -with gcc runtime - -Signed-off-by: Khem Raj ---- - llvm/cmake/modules/CheckAtomic.cmake | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/llvm/cmake/modules/CheckAtomic.cmake b/llvm/cmake/modules/CheckAtomic.cmake -index 3c5ba72993a3..34a1b950bbed 100644 ---- a/llvm/cmake/modules/CheckAtomic.cmake -+++ b/llvm/cmake/modules/CheckAtomic.cmake -@@ -30,10 +30,11 @@ function(check_working_cxx_atomics64 varname) - #include - #include - std::atomic x (0); -+std::atomic y (0); - int main() { - uint64_t i = x.load(std::memory_order_relaxed); - (void)i; -- return 0; -+ return int(y); - } - " ${varname}) - set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) diff --git a/recipes-devtools/clang/clang/0014-libcxx-Add-compiler-runtime-library-to-link-step-for.patch b/recipes-devtools/clang/clang/0014-libcxx-Add-compiler-runtime-library-to-link-step-for.patch new file mode 100644 index 0000000..0d85b84 --- /dev/null +++ b/recipes-devtools/clang/clang/0014-libcxx-Add-compiler-runtime-library-to-link-step-for.patch @@ -0,0 +1,37 @@ +From 46c511cf138cfc16dd41dbbd112a10491f5e4131 Mon Sep 17 00:00:00 2001 +From: Jeremy Puhlman +Date: Thu, 16 Jan 2020 21:16:10 +0000 +Subject: [PATCH] libcxx: Add compiler runtime library to link step for libcxx + +This corrects "undefined reference to __divti3" + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Jeremy Puhlman +Signed-off-by: Khem Raj +--- + libcxx/src/CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt +index 12dcdf954405..54e446e2aecd 100644 +--- a/libcxx/src/CMakeLists.txt ++++ b/libcxx/src/CMakeLists.txt +@@ -212,7 +212,7 @@ if (LIBCXX_ENABLE_SHARED) + add_library(cxx_shared SHARED ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS}) + target_include_directories(cxx_shared PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + target_link_libraries(cxx_shared PUBLIC cxx-headers +- PRIVATE ${LIBCXX_LIBRARIES}) ++ PRIVATE ${LIBCXX_LIBRARIES} "$$($$CC --print-libgcc-file-name)") + set_target_properties(cxx_shared + PROPERTIES + COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}" +@@ -290,7 +290,7 @@ if (LIBCXX_ENABLE_STATIC) + add_library(cxx_static STATIC ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS}) + target_include_directories(cxx_static PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + target_link_libraries(cxx_static PUBLIC cxx-headers +- PRIVATE ${LIBCXX_LIBRARIES}) ++ PRIVATE ${LIBCXX_LIBRARIES} "$$($$CC --print-libgcc-file-name)") + set_target_properties(cxx_static + PROPERTIES + COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}" diff --git a/recipes-devtools/clang/clang/0015-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch b/recipes-devtools/clang/clang/0015-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch new file mode 100644 index 0000000..71c6fe2 --- /dev/null +++ b/recipes-devtools/clang/clang/0015-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch @@ -0,0 +1,116 @@ +From 266cd0acf4ade95c61d3a78c0bb70b13e40042a6 Mon Sep 17 00:00:00 2001 +From: Ovidiu Panait +Date: Fri, 31 Jan 2020 10:56:11 +0200 +Subject: [PATCH] clang,llvm: cmake: Fix configure for packages using + find_package() + +Currently, when a package (i.e. bcc [https://github.com/iovisor/bcc.git]) +that depends on LLVM/Clang tries to run cmake find_package() during +do_configure, it will fail with a similar error: + +| The imported target "llvm-tblgen" references the file +| ".../recipe-sysroot/usr/bin/llvm-tblgen" +| +| but this file does not exist. Possible reasons include: +| * The file was deleted, renamed, or moved to another location. +| * An install or uninstall procedure did not complete successfully. +| * The installation package was faulty and contained +| ".../recipe-sysroot/usr/lib/cmake/LLVMExports.cmake" +| but not all the files it references. + +This is due to the fact that currently the cmake scripts look for target +binaries in sysroot. Work around this by not exporting the target binaries in +Exports-* cmake files. + +Upstream-Status: Innapropriate [oe-specific] + +Signed-off-by: Ovidiu Panait +--- + clang/cmake/modules/AddClang.cmake | 2 -- + llvm/cmake/modules/AddLLVM.cmake | 6 ------ + llvm/cmake/modules/TableGen.cmake | 7 ------- + 3 files changed, 15 deletions(-) + +diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake +index 9bbbfc032b7d..7ee5170bbc71 100644 +--- a/clang/cmake/modules/AddClang.cmake ++++ b/clang/cmake/modules/AddClang.cmake +@@ -159,7 +159,6 @@ macro(add_clang_tool name) + if (CLANG_BUILD_TOOLS) + get_target_export_arg(${name} Clang export_to_clangtargets) + install(TARGETS ${name} +- ${export_to_clangtargets} + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + COMPONENT ${name}) + +@@ -168,7 +167,6 @@ macro(add_clang_tool name) + DEPENDS ${name} + COMPONENT ${name}) + endif() +- set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS ${name}) + endif() + endmacro() + +diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake +index 37bc98f9e021..d34083fa52ec 100644 +--- a/llvm/cmake/modules/AddLLVM.cmake ++++ b/llvm/cmake/modules/AddLLVM.cmake +@@ -1251,7 +1251,6 @@ macro(add_llvm_tool name) + if( LLVM_BUILD_TOOLS ) + get_target_export_arg(${name} LLVM export_to_llvmexports) + install(TARGETS ${name} +- ${export_to_llvmexports} + RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR} + COMPONENT ${name}) + +@@ -1262,9 +1261,6 @@ macro(add_llvm_tool name) + endif() + endif() + endif() +- if( LLVM_BUILD_TOOLS ) +- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) +- endif() + set_target_properties(${name} PROPERTIES FOLDER "Tools") + endmacro(add_llvm_tool name) + +@@ -1304,7 +1300,6 @@ macro(add_llvm_utility name) + if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS) + get_target_export_arg(${name} LLVM export_to_llvmexports) + install(TARGETS ${name} +- ${export_to_llvmexports} + RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR} + COMPONENT ${name}) + +@@ -1313,7 +1308,6 @@ macro(add_llvm_utility name) + DEPENDS ${name} + COMPONENT ${name}) + endif() +- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) + elseif(LLVM_BUILD_UTILS) + set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name}) + endif() +diff --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake +index 59fd0d3b0733..3b9ac56ed37f 100644 +--- a/llvm/cmake/modules/TableGen.cmake ++++ b/llvm/cmake/modules/TableGen.cmake +@@ -183,14 +183,8 @@ macro(add_tablegen target project) + endif() + + if ((${project} STREQUAL LLVM OR ${project} STREQUAL MLIR) AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_UTILS) +- set(export_to_llvmexports) +- if(${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR +- NOT LLVM_DISTRIBUTION_COMPONENTS) +- set(export_to_llvmexports EXPORT LLVMExports) +- endif() + + install(TARGETS ${target} +- ${export_to_llvmexports} + COMPONENT ${target} + RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR}) + if(NOT LLVM_ENABLE_IDE) +@@ -199,5 +193,4 @@ macro(add_tablegen target project) + COMPONENT ${target}) + endif() + endif() +- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${target}) + endmacro() diff --git a/recipes-devtools/clang/clang/0015-libcxx-Add-compiler-runtime-library-to-link-step-for.patch b/recipes-devtools/clang/clang/0015-libcxx-Add-compiler-runtime-library-to-link-step-for.patch deleted file mode 100644 index cf6b75b..0000000 --- a/recipes-devtools/clang/clang/0015-libcxx-Add-compiler-runtime-library-to-link-step-for.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 013959ef2f407c0254a14d448d17e5e4a8c9875b Mon Sep 17 00:00:00 2001 -From: Jeremy Puhlman -Date: Thu, 16 Jan 2020 21:16:10 +0000 -Subject: [PATCH] libcxx: Add compiler runtime library to link step for libcxx - -This corrects "undefined reference to __divti3" - -Upstream-Status: Inappropriate [configuration] - -Signed-off-by: Jeremy Puhlman -Signed-off-by: Khem Raj ---- - libcxx/src/CMakeLists.txt | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt -index 12dcdf954405..54e446e2aecd 100644 ---- a/libcxx/src/CMakeLists.txt -+++ b/libcxx/src/CMakeLists.txt -@@ -212,7 +212,7 @@ if (LIBCXX_ENABLE_SHARED) - add_library(cxx_shared SHARED ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS}) - target_include_directories(cxx_shared PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(cxx_shared PUBLIC cxx-headers -- PRIVATE ${LIBCXX_LIBRARIES}) -+ PRIVATE ${LIBCXX_LIBRARIES} "$$($$CC --print-libgcc-file-name)") - set_target_properties(cxx_shared - PROPERTIES - COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}" -@@ -290,7 +290,7 @@ if (LIBCXX_ENABLE_STATIC) - add_library(cxx_static STATIC ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS}) - target_include_directories(cxx_static PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(cxx_static PUBLIC cxx-headers -- PRIVATE ${LIBCXX_LIBRARIES}) -+ PRIVATE ${LIBCXX_LIBRARIES} "$$($$CC --print-libgcc-file-name)") - set_target_properties(cxx_static - PROPERTIES - COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}" diff --git a/recipes-devtools/clang/clang/0016-clang-Fix-resource-dir-location-for-cross-toolchains.patch b/recipes-devtools/clang/clang/0016-clang-Fix-resource-dir-location-for-cross-toolchains.patch new file mode 100644 index 0000000..8df8265 --- /dev/null +++ b/recipes-devtools/clang/clang/0016-clang-Fix-resource-dir-location-for-cross-toolchains.patch @@ -0,0 +1,39 @@ +From e11c45b496affd182880dfa13e983086c3f5c0b0 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 + +When clang looks for the resources directory, it does so based on the binary +location and assumes that the containing directory is a sibling to lib. The +Yocto cross.bbclass defines the default bindir as +${exec_prefix}/bin/${CROSS_TARGET_SYS_DIR}. ex: /usr/bin/aarch64-poky-linux/. +This causes clang to form a path that looks like /usr/bin/lib/clang/... + +As a fix for this, check the parent directory name. If that is "bin", then +use that directory's parent. + +Signed-off-by: Jim Broadus +Signed-off-by: Khem Raj +--- + clang/lib/Driver/Driver.cpp | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp +index 3bfddeefc7b2..8a806efb292b 100644 +--- a/clang/lib/Driver/Driver.cpp ++++ b/clang/lib/Driver/Driver.cpp +@@ -176,7 +176,13 @@ std::string Driver::GetResourcesPath(StringRef BinaryPath, + // With a static-library build of libclang, LibClangPath will contain the + // path of the embedding binary, which for LLVM binaries will be in bin/. + // ../lib gets us to lib/ in both cases. +- P = llvm::sys::path::parent_path(Dir); ++ Dir = std::string(llvm::sys::path::parent_path(Dir)); ++ ++ // OE cross toolchains are installed, by default, in a subdir of bin. ++ if (llvm::sys::path::filename(Dir) == "bin") { ++ Dir = std::string(llvm::sys::path::parent_path(Dir)); ++ } ++ P = Dir; + llvm::sys::path::append(P, Twine("lib") + CLANG_LIBDIR_SUFFIX, "clang", + CLANG_VERSION_STRING); + } diff --git a/recipes-devtools/clang/clang/0016-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch b/recipes-devtools/clang/clang/0016-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch deleted file mode 100644 index faa07f0..0000000 --- a/recipes-devtools/clang/clang/0016-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch +++ /dev/null @@ -1,116 +0,0 @@ -From a720606d47f1a97c489496e1f041d0dd331ed54c Mon Sep 17 00:00:00 2001 -From: Ovidiu Panait -Date: Fri, 31 Jan 2020 10:56:11 +0200 -Subject: [PATCH] clang,llvm: cmake: Fix configure for packages using - find_package() - -Currently, when a package (i.e. bcc [https://github.com/iovisor/bcc.git]) -that depends on LLVM/Clang tries to run cmake find_package() during -do_configure, it will fail with a similar error: - -| The imported target "llvm-tblgen" references the file -| ".../recipe-sysroot/usr/bin/llvm-tblgen" -| -| but this file does not exist. Possible reasons include: -| * The file was deleted, renamed, or moved to another location. -| * An install or uninstall procedure did not complete successfully. -| * The installation package was faulty and contained -| ".../recipe-sysroot/usr/lib/cmake/LLVMExports.cmake" -| but not all the files it references. - -This is due to the fact that currently the cmake scripts look for target -binaries in sysroot. Work around this by not exporting the target binaries in -Exports-* cmake files. - -Upstream-Status: Innapropriate [oe-specific] - -Signed-off-by: Ovidiu Panait ---- - clang/cmake/modules/AddClang.cmake | 2 -- - llvm/cmake/modules/AddLLVM.cmake | 6 ------ - llvm/cmake/modules/TableGen.cmake | 7 ------- - 3 files changed, 15 deletions(-) - -diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake -index 9bbbfc032b7d..7ee5170bbc71 100644 ---- a/clang/cmake/modules/AddClang.cmake -+++ b/clang/cmake/modules/AddClang.cmake -@@ -159,7 +159,6 @@ macro(add_clang_tool name) - if (CLANG_BUILD_TOOLS) - get_target_export_arg(${name} Clang export_to_clangtargets) - install(TARGETS ${name} -- ${export_to_clangtargets} - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" - COMPONENT ${name}) - -@@ -168,7 +167,6 @@ macro(add_clang_tool name) - DEPENDS ${name} - COMPONENT ${name}) - endif() -- set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS ${name}) - endif() - endmacro() - -diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake -index 37bc98f9e021..d34083fa52ec 100644 ---- a/llvm/cmake/modules/AddLLVM.cmake -+++ b/llvm/cmake/modules/AddLLVM.cmake -@@ -1251,7 +1251,6 @@ macro(add_llvm_tool name) - if( LLVM_BUILD_TOOLS ) - get_target_export_arg(${name} LLVM export_to_llvmexports) - install(TARGETS ${name} -- ${export_to_llvmexports} - RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR} - COMPONENT ${name}) - -@@ -1262,9 +1261,6 @@ macro(add_llvm_tool name) - endif() - endif() - endif() -- if( LLVM_BUILD_TOOLS ) -- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) -- endif() - set_target_properties(${name} PROPERTIES FOLDER "Tools") - endmacro(add_llvm_tool name) - -@@ -1304,7 +1300,6 @@ macro(add_llvm_utility name) - if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS) - get_target_export_arg(${name} LLVM export_to_llvmexports) - install(TARGETS ${name} -- ${export_to_llvmexports} - RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR} - COMPONENT ${name}) - -@@ -1313,7 +1308,6 @@ macro(add_llvm_utility name) - DEPENDS ${name} - COMPONENT ${name}) - endif() -- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) - elseif(LLVM_BUILD_UTILS) - set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name}) - endif() -diff --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake -index 59fd0d3b0733..3b9ac56ed37f 100644 ---- a/llvm/cmake/modules/TableGen.cmake -+++ b/llvm/cmake/modules/TableGen.cmake -@@ -183,14 +183,8 @@ macro(add_tablegen target project) - endif() - - if ((${project} STREQUAL LLVM OR ${project} STREQUAL MLIR) AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_UTILS) -- set(export_to_llvmexports) -- if(${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR -- NOT LLVM_DISTRIBUTION_COMPONENTS) -- set(export_to_llvmexports EXPORT LLVMExports) -- endif() - - install(TARGETS ${target} -- ${export_to_llvmexports} - COMPONENT ${target} - RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR}) - if(NOT LLVM_ENABLE_IDE) -@@ -199,5 +193,4 @@ macro(add_tablegen target project) - COMPONENT ${target}) - endif() - endif() -- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${target}) - endmacro() diff --git a/recipes-devtools/clang/clang/0017-clang-Fix-resource-dir-location-for-cross-toolchains.patch b/recipes-devtools/clang/clang/0017-clang-Fix-resource-dir-location-for-cross-toolchains.patch deleted file mode 100644 index 37ccb3e..0000000 --- a/recipes-devtools/clang/clang/0017-clang-Fix-resource-dir-location-for-cross-toolchains.patch +++ /dev/null @@ -1,39 +0,0 @@ -From d1a52c37ff430a99a0e3b1e8a3a4236081c46709 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 - -When clang looks for the resources directory, it does so based on the binary -location and assumes that the containing directory is a sibling to lib. The -Yocto cross.bbclass defines the default bindir as -${exec_prefix}/bin/${CROSS_TARGET_SYS_DIR}. ex: /usr/bin/aarch64-poky-linux/. -This causes clang to form a path that looks like /usr/bin/lib/clang/... - -As a fix for this, check the parent directory name. If that is "bin", then -use that directory's parent. - -Signed-off-by: Jim Broadus -Signed-off-by: Khem Raj ---- - clang/lib/Driver/Driver.cpp | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp -index 3bfddeefc7b2..8a806efb292b 100644 ---- a/clang/lib/Driver/Driver.cpp -+++ b/clang/lib/Driver/Driver.cpp -@@ -176,7 +176,13 @@ std::string Driver::GetResourcesPath(StringRef BinaryPath, - // With a static-library build of libclang, LibClangPath will contain the - // path of the embedding binary, which for LLVM binaries will be in bin/. - // ../lib gets us to lib/ in both cases. -- P = llvm::sys::path::parent_path(Dir); -+ Dir = std::string(llvm::sys::path::parent_path(Dir)); -+ -+ // OE cross toolchains are installed, by default, in a subdir of bin. -+ if (llvm::sys::path::filename(Dir) == "bin") { -+ Dir = std::string(llvm::sys::path::parent_path(Dir)); -+ } -+ P = Dir; - llvm::sys::path::append(P, Twine("lib") + CLANG_LIBDIR_SUFFIX, "clang", - CLANG_VERSION_STRING); - } diff --git a/recipes-devtools/clang/clang/0017-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch b/recipes-devtools/clang/clang/0017-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch new file mode 100644 index 0000000..f05460a --- /dev/null +++ b/recipes-devtools/clang/clang/0017-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch @@ -0,0 +1,67 @@ +From e59e9871fb6255a215ce4aa7304d3ff9ecd4a8b3 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 + path + + * the dyld-prefix shall be taken into account when the default + path for the dynamic linker has to be checked. + + * this patch shall be used as annex to the next patch: + 'clang: driver: Check sysroot for ldso path' which includes + the usrmerge scenario. + +Signed-off-by: Oleksandr Ocheretnyi +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Linux.cpp | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index f9e233f15dfc..bf73b1ef27db 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -493,8 +493,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + LibDir = "lib64"; + Loader = + (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1"; +- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && +- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { + LibDir = "lib"; + } + break; +@@ -502,8 +502,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + LibDir = "lib64"; + Loader = + (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2"; +- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && +- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { + LibDir = "lib"; + } + break; +@@ -527,8 +527,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + case llvm::Triple::sparcv9: + LibDir = "lib64"; + Loader = "ld-linux.so.2"; +- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && +- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { + LibDir = "lib"; + } + break; +@@ -545,8 +545,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + + LibDir = X32 ? "libx32" : "lib64"; + Loader = X32 ? "ld-linux-x32.so.2" : "ld-linux-x86-64.so.2"; +- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && +- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { + LibDir = "lib"; + } + break; diff --git a/recipes-devtools/clang/clang/0018-clang-Use-python3-in-python-scripts.patch b/recipes-devtools/clang/clang/0018-clang-Use-python3-in-python-scripts.patch new file mode 100644 index 0000000..569e546 --- /dev/null +++ b/recipes-devtools/clang/clang/0018-clang-Use-python3-in-python-scripts.patch @@ -0,0 +1,90 @@ +From 8dc8ebe9c9af24a38dd4010098921ddc58304d7b 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 + +Some scripts ask for python, but they work fine with python3 +and in OE python symlink is not exposed to build, only python3 is + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + .../find-all-symbols/tool/run-find-all-symbols.py | 2 +- + clang-tools-extra/clang-tidy/add_new_check.py | 2 +- + clang-tools-extra/clang-tidy/rename_check.py | 2 +- + clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py | 2 +- + clang-tools-extra/clang-tidy/tool/run-clang-tidy.py | 2 +- + clang/tools/clang-format/git-clang-format | 2 +- + clang/tools/scan-view/bin/scan-view | 2 +- + 7 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py +index 8655af137bb2..e95ba59a421c 100755 +--- a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py ++++ b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + #=- run-find-all-symbols.py - Parallel find-all-symbols runner -*- python -*-=# + # +diff --git a/clang-tools-extra/clang-tidy/add_new_check.py b/clang-tools-extra/clang-tidy/add_new_check.py +index 50a220b3f975..ea40cbc48dd2 100755 +--- a/clang-tools-extra/clang-tidy/add_new_check.py ++++ b/clang-tools-extra/clang-tidy/add_new_check.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + #===- add_new_check.py - clang-tidy check generator ---------*- python -*--===# + # +diff --git a/clang-tools-extra/clang-tidy/rename_check.py b/clang-tools-extra/clang-tidy/rename_check.py +index 9c2021751e0e..4bb9af8cbe0a 100755 +--- a/clang-tools-extra/clang-tidy/rename_check.py ++++ b/clang-tools-extra/clang-tidy/rename_check.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + #===- rename_check.py - clang-tidy check renamer ------------*- python -*--===# + # +diff --git a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py +index 6bd05531333b..9e134123ef44 100755 +--- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py ++++ b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + #===- clang-tidy-diff.py - ClangTidy Diff Checker -----------*- python -*--===# + # +diff --git a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py +index e6cff6a7414d..582c113fb173 100755 +--- a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py ++++ b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + #===- run-clang-tidy.py - Parallel clang-tidy runner --------*- python -*--===# + # +diff --git a/clang/tools/clang-format/git-clang-format b/clang/tools/clang-format/git-clang-format +index 7968c4387574..268e4dd14782 100755 +--- a/clang/tools/clang-format/git-clang-format ++++ b/clang/tools/clang-format/git-clang-format +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + #===- git-clang-format - ClangFormat Git Integration ---------*- python -*--===# + # +diff --git a/clang/tools/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view +index 6165432e7af8..07effbca5969 100755 +--- a/clang/tools/scan-view/bin/scan-view ++++ b/clang/tools/scan-view/bin/scan-view +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + + from __future__ import print_function + diff --git a/recipes-devtools/clang/clang/0018-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch b/recipes-devtools/clang/clang/0018-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch deleted file mode 100644 index f39a01f..0000000 --- a/recipes-devtools/clang/clang/0018-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch +++ /dev/null @@ -1,67 +0,0 @@ -From f2424f39c50b3c64eb87f7f2d6fa6c7196ae8c04 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 - path - - * the dyld-prefix shall be taken into account when the default - path for the dynamic linker has to be checked. - - * this patch shall be used as annex to the next patch: - 'clang: driver: Check sysroot for ldso path' which includes - the usrmerge scenario. - -Signed-off-by: Oleksandr Ocheretnyi -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Linux.cpp | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index f9e233f15dfc..bf73b1ef27db 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -493,8 +493,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { - LibDir = "lib64"; - Loader = - (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1"; -- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && -- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { -+ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && -+ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { - LibDir = "lib"; - } - break; -@@ -502,8 +502,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { - LibDir = "lib64"; - Loader = - (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2"; -- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && -- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { -+ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && -+ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { - LibDir = "lib"; - } - break; -@@ -527,8 +527,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { - case llvm::Triple::sparcv9: - LibDir = "lib64"; - Loader = "ld-linux.so.2"; -- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && -- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { -+ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && -+ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { - LibDir = "lib"; - } - break; -@@ -545,8 +545,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { - - LibDir = X32 ? "libx32" : "lib64"; - Loader = X32 ? "ld-linux-x32.so.2" : "ld-linux-x86-64.so.2"; -- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && -- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { -+ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && -+ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { - LibDir = "lib"; - } - break; diff --git a/recipes-devtools/clang/clang/0019-For-x86_64-set-Yocto-based-GCC-install-search-path.patch b/recipes-devtools/clang/clang/0019-For-x86_64-set-Yocto-based-GCC-install-search-path.patch new file mode 100644 index 0000000..e5a7afc --- /dev/null +++ b/recipes-devtools/clang/clang/0019-For-x86_64-set-Yocto-based-GCC-install-search-path.patch @@ -0,0 +1,70 @@ +From b109042e841cceab53232c217b36c0b081b821ba Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Mon, 25 Jan 2021 16:14:35 +0800 +Subject: [PATCH] For x86_64, set Yocto based GCC install search path + +Under Yocto host, while using clang-native to build, it searches +install host gcc failed which causing the include file not found +[snip] +|clang++ -target x86_64-linux -MMD -MF src/base/files/file_path_constants.o.d -I../../../tools/gn/src -I. \ +-isystem/tmp-glibc/work/x86_64-linux/gn-native/87.0.4280.141-r0/recipe-sysroot-native/usr/include -O2 -pipe \ +-std=c++17 -c ../../../tools/gn/src/base/files/file_path_constants.cc -o src/base/files/file_path_constants.o +|../../../tools/gn/src/base/files/file_path_constants.cc:7:10: fatal error: 'iterator' file not found +|#include +| ^~~~~~~~ +[snip] + +Set three Yocto based GCC triple: poky, oe-core and wind river + +Before aplly the patch +[snip] +$ ../recipe-sysroot-native/usr/bin/clang++ -v +clang version 11.0.1 (https://github.com/llvm/llvm-project 43ff75f2c3feef64f9d73328230d34dac8832a91) +Target: x86_64-unknown-linux-gnu +Thread model: posix +InstalledDir:tmp-glibc/work/x86_64-linux/gn-native/87.0.4280.141-r0/chromium-87.0.4280.141/../recipe-sysroot-native/usr/bin +[snip] + +After aplly the patch: +[snip] +$ ../recipe-sysroot-native/usr/bin/clang++ -v +clang version 11.0.1 (https://github.com/llvm/llvm-project 22c3241ff9a6224261df48d0258957fd8acc3d64) +Target: x86_64-unknown-linux-gnu +Thread model: posix +InstalledDir:tmp-glibc/work/x86_64-linux/gn-native/87.0.4280.141-r0/chromium-87.0.4280.141/../recipe-sysroot-native/usr/bin +Found candidate GCC installation: /usr/lib//x86_64-wrs-linux/10.1.0 +Found candidate GCC installation: /usr/lib/gcc/x86_64-wrs-linux/10.1.0 +Selected GCC installation: /usr/lib//x86_64-wrs-linux/10.1.0 +Candidate multilib: .;@m64 +Selected multilib: .;@m64 +[snip] + +BTW, it is hardly to insert a triple by the replacement of TARGET_SYS +(=${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}), since TARGET_VENDOR +is different between clang and clang-native + +The //CLANG_EXTRA_OE_VENDORS_TRIPLES string is replaced with list of +additional triples based on CLANG_EXTRA_OE_VENDORS variable in +recipes-devtools/clang/llvm-project-source.inc:add_more_target_vendors() + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Martin Jansa +Signed-off-by: Hongxu Jia +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index d22eaf698eb8..6fcd5abe7211 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2105,6 +2105,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( + "x86_64-redhat-linux", "x86_64-suse-linux", + "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", + "x86_64-slackware-linux", "x86_64-unknown-linux", ++ "x86_64-oe-linux",//CLANG_EXTRA_OE_VENDORS_TRIPLES + "x86_64-amazon-linux"}; + static const char *const X32Triples[] = {"x86_64-linux-gnux32", + "x86_64-pc-linux-gnux32"}; diff --git a/recipes-devtools/clang/clang/0019-clang-Use-python3-in-python-scripts.patch b/recipes-devtools/clang/clang/0019-clang-Use-python3-in-python-scripts.patch deleted file mode 100644 index 8e350e6..0000000 --- a/recipes-devtools/clang/clang/0019-clang-Use-python3-in-python-scripts.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 0079be23503a86ae7162afe63baa00175fee6d02 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 - -Some scripts ask for python, but they work fine with python3 -and in OE python symlink is not exposed to build, only python3 is - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - .../find-all-symbols/tool/run-find-all-symbols.py | 2 +- - clang-tools-extra/clang-tidy/add_new_check.py | 2 +- - clang-tools-extra/clang-tidy/rename_check.py | 2 +- - clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py | 2 +- - clang-tools-extra/clang-tidy/tool/run-clang-tidy.py | 2 +- - clang/tools/clang-format/git-clang-format | 2 +- - clang/tools/scan-view/bin/scan-view | 2 +- - 7 files changed, 7 insertions(+), 7 deletions(-) - -diff --git a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py -index 8655af137bb2..e95ba59a421c 100755 ---- a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py -+++ b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # - #=- run-find-all-symbols.py - Parallel find-all-symbols runner -*- python -*-=# - # -diff --git a/clang-tools-extra/clang-tidy/add_new_check.py b/clang-tools-extra/clang-tidy/add_new_check.py -index 50a220b3f975..ea40cbc48dd2 100755 ---- a/clang-tools-extra/clang-tidy/add_new_check.py -+++ b/clang-tools-extra/clang-tidy/add_new_check.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # - #===- add_new_check.py - clang-tidy check generator ---------*- python -*--===# - # -diff --git a/clang-tools-extra/clang-tidy/rename_check.py b/clang-tools-extra/clang-tidy/rename_check.py -index 9c2021751e0e..4bb9af8cbe0a 100755 ---- a/clang-tools-extra/clang-tidy/rename_check.py -+++ b/clang-tools-extra/clang-tidy/rename_check.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # - #===- rename_check.py - clang-tidy check renamer ------------*- python -*--===# - # -diff --git a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py -index 6bd05531333b..9e134123ef44 100755 ---- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py -+++ b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # - #===- clang-tidy-diff.py - ClangTidy Diff Checker -----------*- python -*--===# - # -diff --git a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py -index e6cff6a7414d..582c113fb173 100755 ---- a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py -+++ b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # - #===- run-clang-tidy.py - Parallel clang-tidy runner --------*- python -*--===# - # -diff --git a/clang/tools/clang-format/git-clang-format b/clang/tools/clang-format/git-clang-format -index 7968c4387574..268e4dd14782 100755 ---- a/clang/tools/clang-format/git-clang-format -+++ b/clang/tools/clang-format/git-clang-format -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # - #===- git-clang-format - ClangFormat Git Integration ---------*- python -*--===# - # -diff --git a/clang/tools/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view -index 6165432e7af8..07effbca5969 100755 ---- a/clang/tools/scan-view/bin/scan-view -+++ b/clang/tools/scan-view/bin/scan-view -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - - from __future__ import print_function - diff --git a/recipes-devtools/clang/clang/0020-For-x86_64-set-Yocto-based-GCC-install-search-path.patch b/recipes-devtools/clang/clang/0020-For-x86_64-set-Yocto-based-GCC-install-search-path.patch deleted file mode 100644 index c21b060..0000000 --- a/recipes-devtools/clang/clang/0020-For-x86_64-set-Yocto-based-GCC-install-search-path.patch +++ /dev/null @@ -1,70 +0,0 @@ -From b2cde48417f6c7a0674d38ad20b3537b9ac11740 Mon Sep 17 00:00:00 2001 -From: Hongxu Jia -Date: Mon, 25 Jan 2021 16:14:35 +0800 -Subject: [PATCH] For x86_64, set Yocto based GCC install search path - -Under Yocto host, while using clang-native to build, it searches -install host gcc failed which causing the include file not found -[snip] -|clang++ -target x86_64-linux -MMD -MF src/base/files/file_path_constants.o.d -I../../../tools/gn/src -I. \ --isystem/tmp-glibc/work/x86_64-linux/gn-native/87.0.4280.141-r0/recipe-sysroot-native/usr/include -O2 -pipe \ --std=c++17 -c ../../../tools/gn/src/base/files/file_path_constants.cc -o src/base/files/file_path_constants.o -|../../../tools/gn/src/base/files/file_path_constants.cc:7:10: fatal error: 'iterator' file not found -|#include -| ^~~~~~~~ -[snip] - -Set three Yocto based GCC triple: poky, oe-core and wind river - -Before aplly the patch -[snip] -$ ../recipe-sysroot-native/usr/bin/clang++ -v -clang version 11.0.1 (https://github.com/llvm/llvm-project 43ff75f2c3feef64f9d73328230d34dac8832a91) -Target: x86_64-unknown-linux-gnu -Thread model: posix -InstalledDir:tmp-glibc/work/x86_64-linux/gn-native/87.0.4280.141-r0/chromium-87.0.4280.141/../recipe-sysroot-native/usr/bin -[snip] - -After aplly the patch: -[snip] -$ ../recipe-sysroot-native/usr/bin/clang++ -v -clang version 11.0.1 (https://github.com/llvm/llvm-project 22c3241ff9a6224261df48d0258957fd8acc3d64) -Target: x86_64-unknown-linux-gnu -Thread model: posix -InstalledDir:tmp-glibc/work/x86_64-linux/gn-native/87.0.4280.141-r0/chromium-87.0.4280.141/../recipe-sysroot-native/usr/bin -Found candidate GCC installation: /usr/lib//x86_64-wrs-linux/10.1.0 -Found candidate GCC installation: /usr/lib/gcc/x86_64-wrs-linux/10.1.0 -Selected GCC installation: /usr/lib//x86_64-wrs-linux/10.1.0 -Candidate multilib: .;@m64 -Selected multilib: .;@m64 -[snip] - -BTW, it is hardly to insert a triple by the replacement of TARGET_SYS -(=${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}), since TARGET_VENDOR -is different between clang and clang-native - -The //CLANG_EXTRA_OE_VENDORS_TRIPLES string is replaced with list of -additional triples based on CLANG_EXTRA_OE_VENDORS variable in -recipes-devtools/clang/llvm-project-source.inc:add_more_target_vendors() - -Upstream-Status: Inappropriate [oe specific] - -Signed-off-by: Martin Jansa -Signed-off-by: Hongxu Jia -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Gnu.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index d22eaf698eb8..6fcd5abe7211 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2105,6 +2105,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( - "x86_64-redhat-linux", "x86_64-suse-linux", - "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", - "x86_64-slackware-linux", "x86_64-unknown-linux", -+ "x86_64-oe-linux",//CLANG_EXTRA_OE_VENDORS_TRIPLES - "x86_64-amazon-linux"}; - static const char *const X32Triples[] = {"x86_64-linux-gnux32", - "x86_64-pc-linux-gnux32"}; diff --git a/recipes-devtools/clang/clang/0020-llvm-Do-not-use-find_library-for-ncurses.patch b/recipes-devtools/clang/clang/0020-llvm-Do-not-use-find_library-for-ncurses.patch new file mode 100644 index 0000000..017b7de --- /dev/null +++ b/recipes-devtools/clang/clang/0020-llvm-Do-not-use-find_library-for-ncurses.patch @@ -0,0 +1,44 @@ +From 056c7077148b1c44d8a076a79eb8275203ce51ba Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 7 Feb 2021 23:58:41 -0800 +Subject: [PATCH] llvm: Do not use find_library for ncurses + +This ensures that it lets OE to decide which lib to link +otherwise it adds absolute paths to linker cmdline and confuses it +horribly with native and target libs when build clang for target + +TOPDIR/build/tmp/work/cortexa57-yoe-linux-musl/clang/12.0.0-r0/recipe-sysroot-native/usr/lib/libtinfo.so: error adding symbols: file in wrong format +clang-12: error: linker command failed with exit code 1 (use -v to see invocation) + +Signed-off-by: Khem Raj +--- + compiler-rt/cmake/config-ix.cmake | 2 +- + llvm/cmake/modules/FindTerminfo.cmake | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake +index 4299a0589a7b..cb53b6fd14bd 100644 +--- a/compiler-rt/cmake/config-ix.cmake ++++ b/compiler-rt/cmake/config-ix.cmake +@@ -149,7 +149,7 @@ else() + set(MAYBE_REQUIRED) + endif() + if(LLVM_ENABLE_TERMINFO) +- find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED}) ++ find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + endif() + if(COMPILER_RT_TERMINFO_LIB) + set(LLVM_ENABLE_TERMINFO 1) +diff --git a/llvm/cmake/modules/FindTerminfo.cmake b/llvm/cmake/modules/FindTerminfo.cmake +index 65edb80fa69a..a58180be8926 100644 +--- a/llvm/cmake/modules/FindTerminfo.cmake ++++ b/llvm/cmake/modules/FindTerminfo.cmake +@@ -11,7 +11,7 @@ + # Additionally, the following import target will be defined: + # Terminfo::terminfo + +-find_library(Terminfo_LIBRARIES NAMES terminfo tinfo curses ncurses ncursesw) ++find_library(Terminfo_LIBRARIES NAMES terminfo tinfo curses ncurses ncursesw NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + + if(Terminfo_LIBRARIES) + include(CMakePushCheckState) diff --git a/recipes-devtools/clang/clang/0021-llvm-Do-not-use-find_library-for-ncurses.patch b/recipes-devtools/clang/clang/0021-llvm-Do-not-use-find_library-for-ncurses.patch deleted file mode 100644 index 90e8d71..0000000 --- a/recipes-devtools/clang/clang/0021-llvm-Do-not-use-find_library-for-ncurses.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 6db17ef4389d01843f2dd586f3f203ee2663da64 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sun, 7 Feb 2021 23:58:41 -0800 -Subject: [PATCH] llvm: Do not use find_library for ncurses - -This ensures that it lets OE to decide which lib to link -otherwise it adds absolute paths to linker cmdline and confuses it -horribly with native and target libs when build clang for target - -TOPDIR/build/tmp/work/cortexa57-yoe-linux-musl/clang/12.0.0-r0/recipe-sysroot-native/usr/lib/libtinfo.so: error adding symbols: file in wrong format -clang-12: error: linker command failed with exit code 1 (use -v to see invocation) - -Signed-off-by: Khem Raj ---- - compiler-rt/cmake/config-ix.cmake | 2 +- - llvm/cmake/modules/FindTerminfo.cmake | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake -index 4299a0589a7b..cb53b6fd14bd 100644 ---- a/compiler-rt/cmake/config-ix.cmake -+++ b/compiler-rt/cmake/config-ix.cmake -@@ -149,7 +149,7 @@ else() - set(MAYBE_REQUIRED) - endif() - if(LLVM_ENABLE_TERMINFO) -- find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED}) -+ find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - endif() - if(COMPILER_RT_TERMINFO_LIB) - set(LLVM_ENABLE_TERMINFO 1) -diff --git a/llvm/cmake/modules/FindTerminfo.cmake b/llvm/cmake/modules/FindTerminfo.cmake -index 65edb80fa69a..a58180be8926 100644 ---- a/llvm/cmake/modules/FindTerminfo.cmake -+++ b/llvm/cmake/modules/FindTerminfo.cmake -@@ -11,7 +11,7 @@ - # Additionally, the following import target will be defined: - # Terminfo::terminfo - --find_library(Terminfo_LIBRARIES NAMES terminfo tinfo curses ncurses ncursesw) -+find_library(Terminfo_LIBRARIES NAMES terminfo tinfo curses ncurses ncursesw NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - - if(Terminfo_LIBRARIES) - include(CMakePushCheckState) diff --git a/recipes-devtools/clang/clang/0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch b/recipes-devtools/clang/clang/0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch new file mode 100644 index 0000000..cb91877 --- /dev/null +++ b/recipes-devtools/clang/clang/0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch @@ -0,0 +1,32 @@ +From a214aa5b9af68f3a1eaf3dc4dda3f390c2a22380 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 11 Feb 2021 16:42:49 -0800 +Subject: [PATCH] llvm: Insert anchor for adding OE distro vendor names + +This helps in making right detection for OE built gcc toolchains + +The //CLANG_EXTRA_OE_VENDORS_CASES string is replaced with list of +additional Ceses based on CLANG_EXTRA_OE_VENDORS variable in +recipes-devtools/clang/llvm-project-source.inc:add_more_target_vendors() + +Upstream-Status: Inappropriate [OE-specific] + +Signed-off-by: Khem Raj +Signed-off-by: Martin Jansa +--- + llvm/lib/Support/Triple.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp +index a9afcc9db96a..dc48caf02616 100644 +--- a/llvm/lib/Support/Triple.cpp ++++ b/llvm/lib/Support/Triple.cpp +@@ -506,7 +506,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) { + .Case("amd", Triple::AMD) + .Case("mesa", Triple::Mesa) + .Case("suse", Triple::SUSE) +- .Case("oe", Triple::OpenEmbedded) ++ .Case("oe", Triple::OpenEmbedded)//CLANG_EXTRA_OE_VENDORS_CASES + .Default(Triple::UnknownVendor); + } + diff --git a/recipes-devtools/clang/clang/0022-compiler-rt-Use-mcr-based-barrier-on-armv6.patch b/recipes-devtools/clang/clang/0022-compiler-rt-Use-mcr-based-barrier-on-armv6.patch new file mode 100644 index 0000000..e3894d6 --- /dev/null +++ b/recipes-devtools/clang/clang/0022-compiler-rt-Use-mcr-based-barrier-on-armv6.patch @@ -0,0 +1,71 @@ +From cc592ef34f9bdb011223d4fce8010023591a8724 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 24 Mar 2021 00:32:09 -0700 +Subject: [PATCH] compiler-rt: Use mcr based barrier on armv6 + +dsb is an armv7 instruction and wont work when we are building for armv6. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + compiler-rt/lib/builtins/arm/sync-ops.h | 8 ++++---- + compiler-rt/lib/builtins/assembly.h | 8 ++++++++ + 2 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/compiler-rt/lib/builtins/arm/sync-ops.h b/compiler-rt/lib/builtins/arm/sync-ops.h +index c9623249e5d2..7a26170741ad 100644 +--- a/compiler-rt/lib/builtins/arm/sync-ops.h ++++ b/compiler-rt/lib/builtins/arm/sync-ops.h +@@ -19,14 +19,14 @@ + .thumb; \ + .syntax unified; \ + DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ +- dmb; \ ++ DMB; \ + mov r12, r0; \ + LOCAL_LABEL(tryatomic_##op) : ldrex r0, [r12]; \ + op(r2, r0, r1); \ + strex r3, r2, [r12]; \ + cmp r3, #0; \ + bne LOCAL_LABEL(tryatomic_##op); \ +- dmb; \ ++ DMB; \ + bx lr + + #define SYNC_OP_8(op) \ +@@ -35,14 +35,14 @@ + .syntax unified; \ + DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ + push {r4, r5, r6, lr}; \ +- dmb; \ ++ DMB; \ + mov r12, r0; \ + LOCAL_LABEL(tryatomic_##op) : ldrexd r0, r1, [r12]; \ + op(r4, r5, r0, r1, r2, r3); \ + strexd r6, r4, r5, [r12]; \ + cmp r6, #0; \ + bne LOCAL_LABEL(tryatomic_##op); \ +- dmb; \ ++ DMB; \ + pop { r4, r5, r6, pc } + + #define MINMAX_4(rD, rN, rM, cmp_kind) \ +diff --git a/compiler-rt/lib/builtins/assembly.h b/compiler-rt/lib/builtins/assembly.h +index 69a3d8620f92..60bac86df218 100644 +--- a/compiler-rt/lib/builtins/assembly.h ++++ b/compiler-rt/lib/builtins/assembly.h +@@ -189,6 +189,14 @@ + JMP(ip) + #endif + ++#if __ARM_ARCH >= 7 ++#define DMB dmb ++#elif __ARM_ARCH >= 6 ++#define DMB mcr p15, #0, r0, c7, c10, #5 ++#else ++#error Only use this with ARMv6+ ++#endif ++ + #if defined(USE_THUMB_2) + #define WIDE(op) op.w + #else diff --git a/recipes-devtools/clang/clang/0022-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch b/recipes-devtools/clang/clang/0022-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch deleted file mode 100644 index 463c251..0000000 --- a/recipes-devtools/clang/clang/0022-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch +++ /dev/null @@ -1,32 +0,0 @@ -From f9d98db5149a83e5bc4ecb69b750f06ad248c9da Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 11 Feb 2021 16:42:49 -0800 -Subject: [PATCH] llvm: Insert anchor for adding OE distro vendor names - -This helps in making right detection for OE built gcc toolchains - -The //CLANG_EXTRA_OE_VENDORS_CASES string is replaced with list of -additional Ceses based on CLANG_EXTRA_OE_VENDORS variable in -recipes-devtools/clang/llvm-project-source.inc:add_more_target_vendors() - -Upstream-Status: Inappropriate [OE-specific] - -Signed-off-by: Khem Raj -Signed-off-by: Martin Jansa ---- - llvm/lib/Support/Triple.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp -index a9afcc9db96a..dc48caf02616 100644 ---- a/llvm/lib/Support/Triple.cpp -+++ b/llvm/lib/Support/Triple.cpp -@@ -506,7 +506,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) { - .Case("amd", Triple::AMD) - .Case("mesa", Triple::Mesa) - .Case("suse", Triple::SUSE) -- .Case("oe", Triple::OpenEmbedded) -+ .Case("oe", Triple::OpenEmbedded)//CLANG_EXTRA_OE_VENDORS_CASES - .Default(Triple::UnknownVendor); - } - diff --git a/recipes-devtools/clang/clang/0023-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch b/recipes-devtools/clang/clang/0023-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch new file mode 100644 index 0000000..12e12dd --- /dev/null +++ b/recipes-devtools/clang/clang/0023-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch @@ -0,0 +1,68 @@ +From a0d6ea278c70dfdcd448af0d13ba9f2397712d93 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 + +musl e.g. does not provide backtrace APIs + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + .../lib/gwp_asan/optional/backtrace_linux_libc.cpp | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp b/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp +index ea8e72be287d..0344074dd254 100644 +--- a/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp ++++ b/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp +@@ -7,7 +7,9 @@ + //===----------------------------------------------------------------------===// + + #include ++#ifdef __GLIBC__ + #include ++#endif + #include + #include + #include +@@ -21,8 +23,11 @@ + namespace { + size_t Backtrace(uintptr_t *TraceBuffer, size_t Size) { + static_assert(sizeof(uintptr_t) == sizeof(void *), "uintptr_t is not void*"); +- ++#ifdef __GLIBC__ + return backtrace(reinterpret_cast(TraceBuffer), Size); ++#else ++ return -1; ++#endif + } + + // We don't need any custom handling for the Segv backtrace - the libc unwinder +@@ -30,7 +35,11 @@ size_t Backtrace(uintptr_t *TraceBuffer, size_t Size) { + // to avoid the additional frame. + GWP_ASAN_ALWAYS_INLINE size_t SegvBacktrace(uintptr_t *TraceBuffer, size_t Size, + void * /*Context*/) { ++#ifdef __GLIBC__ + return Backtrace(TraceBuffer, Size); ++#else ++ return -1; ++#endif + } + + static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, +@@ -40,6 +49,7 @@ static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, + return; + } + ++#ifdef __GLIBC__ + char **BacktraceSymbols = + backtrace_symbols(reinterpret_cast(Trace), TraceLength); + +@@ -53,6 +63,7 @@ static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, + Printf("\n"); + if (BacktraceSymbols) + free(BacktraceSymbols); ++#endif + } + } // anonymous namespace + diff --git a/recipes-devtools/clang/clang/0023-compiler-rt-Use-mcr-based-barrier-on-armv6.patch b/recipes-devtools/clang/clang/0023-compiler-rt-Use-mcr-based-barrier-on-armv6.patch deleted file mode 100644 index 5566cc6..0000000 --- a/recipes-devtools/clang/clang/0023-compiler-rt-Use-mcr-based-barrier-on-armv6.patch +++ /dev/null @@ -1,71 +0,0 @@ -From df5edef2aed06a61fb6c79dddd1cfcfc036f6eb4 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 24 Mar 2021 00:32:09 -0700 -Subject: [PATCH] compiler-rt: Use mcr based barrier on armv6 - -dsb is an armv7 instruction and wont work when we are building for armv6. - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - compiler-rt/lib/builtins/arm/sync-ops.h | 8 ++++---- - compiler-rt/lib/builtins/assembly.h | 8 ++++++++ - 2 files changed, 12 insertions(+), 4 deletions(-) - -diff --git a/compiler-rt/lib/builtins/arm/sync-ops.h b/compiler-rt/lib/builtins/arm/sync-ops.h -index c9623249e5d2..7a26170741ad 100644 ---- a/compiler-rt/lib/builtins/arm/sync-ops.h -+++ b/compiler-rt/lib/builtins/arm/sync-ops.h -@@ -19,14 +19,14 @@ - .thumb; \ - .syntax unified; \ - DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ -- dmb; \ -+ DMB; \ - mov r12, r0; \ - LOCAL_LABEL(tryatomic_##op) : ldrex r0, [r12]; \ - op(r2, r0, r1); \ - strex r3, r2, [r12]; \ - cmp r3, #0; \ - bne LOCAL_LABEL(tryatomic_##op); \ -- dmb; \ -+ DMB; \ - bx lr - - #define SYNC_OP_8(op) \ -@@ -35,14 +35,14 @@ - .syntax unified; \ - DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ - push {r4, r5, r6, lr}; \ -- dmb; \ -+ DMB; \ - mov r12, r0; \ - LOCAL_LABEL(tryatomic_##op) : ldrexd r0, r1, [r12]; \ - op(r4, r5, r0, r1, r2, r3); \ - strexd r6, r4, r5, [r12]; \ - cmp r6, #0; \ - bne LOCAL_LABEL(tryatomic_##op); \ -- dmb; \ -+ DMB; \ - pop { r4, r5, r6, pc } - - #define MINMAX_4(rD, rN, rM, cmp_kind) \ -diff --git a/compiler-rt/lib/builtins/assembly.h b/compiler-rt/lib/builtins/assembly.h -index 69a3d8620f92..60bac86df218 100644 ---- a/compiler-rt/lib/builtins/assembly.h -+++ b/compiler-rt/lib/builtins/assembly.h -@@ -189,6 +189,14 @@ - JMP(ip) - #endif - -+#if __ARM_ARCH >= 7 -+#define DMB dmb -+#elif __ARM_ARCH >= 6 -+#define DMB mcr p15, #0, r0, c7, c10, #5 -+#else -+#error Only use this with ARMv6+ -+#endif -+ - #if defined(USE_THUMB_2) - #define WIDE(op) op.w - #else diff --git a/recipes-devtools/clang/clang/0024-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch b/recipes-devtools/clang/clang/0024-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch new file mode 100644 index 0000000..d3b3a18 --- /dev/null +++ b/recipes-devtools/clang/clang/0024-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch @@ -0,0 +1,27 @@ +From bec11d41e5a9c8810652f55a5774acd060a96cef 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 + +OpenEmbedded does not hardcode mutli-arch like debian therefore ensure +that it still uses the proper tuple + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Linux.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index bf73b1ef27db..eb92a037c930 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -636,6 +636,9 @@ void Linux::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, + GCCInstallation.getTriple().getArch() == llvm::Triple::x86 + ? "i386-linux-gnu" + : TripleStr; ++ // OpenEmbedded does not hardcode the triple to i386-linux-gnu like debian ++ if (GCCInstallation.getTriple().getVendor() == llvm::Triple::OpenEmbedded) ++ DebianMultiarch = TripleStr; + + // Try generic GCC detection first. + if (Generic_GCC::addGCCLibStdCxxIncludePaths(DriverArgs, CC1Args, diff --git a/recipes-devtools/clang/clang/0024-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch b/recipes-devtools/clang/clang/0024-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch deleted file mode 100644 index 344cf69..0000000 --- a/recipes-devtools/clang/clang/0024-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 12da843779b64d902575c988466d609398ad87ea 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 - -musl e.g. does not provide backtrace APIs - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - .../lib/gwp_asan/optional/backtrace_linux_libc.cpp | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) - -diff --git a/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp b/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp -index ea8e72be287d..0344074dd254 100644 ---- a/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp -+++ b/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp -@@ -7,7 +7,9 @@ - //===----------------------------------------------------------------------===// - - #include -+#ifdef __GLIBC__ - #include -+#endif - #include - #include - #include -@@ -21,8 +23,11 @@ - namespace { - size_t Backtrace(uintptr_t *TraceBuffer, size_t Size) { - static_assert(sizeof(uintptr_t) == sizeof(void *), "uintptr_t is not void*"); -- -+#ifdef __GLIBC__ - return backtrace(reinterpret_cast(TraceBuffer), Size); -+#else -+ return -1; -+#endif - } - - // We don't need any custom handling for the Segv backtrace - the libc unwinder -@@ -30,7 +35,11 @@ size_t Backtrace(uintptr_t *TraceBuffer, size_t Size) { - // to avoid the additional frame. - GWP_ASAN_ALWAYS_INLINE size_t SegvBacktrace(uintptr_t *TraceBuffer, size_t Size, - void * /*Context*/) { -+#ifdef __GLIBC__ - return Backtrace(TraceBuffer, Size); -+#else -+ return -1; -+#endif - } - - static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, -@@ -40,6 +49,7 @@ static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, - return; - } - -+#ifdef __GLIBC__ - char **BacktraceSymbols = - backtrace_symbols(reinterpret_cast(Trace), TraceLength); - -@@ -53,6 +63,7 @@ static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, - Printf("\n"); - if (BacktraceSymbols) - free(BacktraceSymbols); -+#endif - } - } // anonymous namespace - diff --git a/recipes-devtools/clang/clang/0025-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch b/recipes-devtools/clang/clang/0025-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch deleted file mode 100644 index de9d140..0000000 --- a/recipes-devtools/clang/clang/0025-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 3ce002f1254a071a0cd70c7302949e9ec99ee56f 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 - -OpenEmbedded does not hardcode mutli-arch like debian therefore ensure -that it still uses the proper tuple - -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Linux.cpp | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index bf73b1ef27db..eb92a037c930 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -636,6 +636,9 @@ void Linux::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, - GCCInstallation.getTriple().getArch() == llvm::Triple::x86 - ? "i386-linux-gnu" - : TripleStr; -+ // OpenEmbedded does not hardcode the triple to i386-linux-gnu like debian -+ if (GCCInstallation.getTriple().getVendor() == llvm::Triple::OpenEmbedded) -+ DebianMultiarch = TripleStr; - - // Try generic GCC detection first. - if (Generic_GCC::addGCCLibStdCxxIncludePaths(DriverArgs, CC1Args, diff --git a/recipes-devtools/clang/clang/0025-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch b/recipes-devtools/clang/clang/0025-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch new file mode 100644 index 0000000..39c5a5a --- /dev/null +++ b/recipes-devtools/clang/clang/0025-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch @@ -0,0 +1,28 @@ +From 47dead61e4b1bb7eefeb9885604dc28adcb58d8c Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 19 May 2021 21:49:18 -0700 +Subject: [PATCH] compiler-rt: Link scudo with SANITIZER_CXX_ABI_LIBRARIES + +If SANITIZER_CXX_ABI_LIBRARIES is set then link scudo with it, this +fixes build time errors like + +projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.armhf.dir/sanitizer_posix_libcdep.cpp.o: in function `__sanitizer::UnsetAlternateSignalStack()': +| sanitizer_posix_libcdep.cpp:(.text+0x3d2): undefined reference to `__cxa_guard_acquire' + +Signed-off-by: Khem Raj +--- + compiler-rt/lib/scudo/CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/compiler-rt/lib/scudo/CMakeLists.txt b/compiler-rt/lib/scudo/CMakeLists.txt +index 995e853e2a4d..25b79a8d17e8 100644 +--- a/compiler-rt/lib/scudo/CMakeLists.txt ++++ b/compiler-rt/lib/scudo/CMakeLists.txt +@@ -15,6 +15,7 @@ append_list_if(COMPILER_RT_HAS_LIBDL dl SCUDO_MINIMAL_DYNAMIC_LIBS) + append_list_if(COMPILER_RT_HAS_LIBRT rt SCUDO_MINIMAL_DYNAMIC_LIBS) + append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread SCUDO_MINIMAL_DYNAMIC_LIBS) + append_list_if(COMPILER_RT_HAS_LIBLOG log SCUDO_MINIMAL_DYNAMIC_LIBS) ++append_list_if(SANITIZER_CXX_ABI_LIBRARIES ${SANITIZER_CXX_ABI_LIBRARIES} SCUDO_MINIMAL_DYNAMIC_LIBS) + append_list_if(COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG -fno-omit-frame-pointer + SCUDO_CFLAGS) + diff --git a/recipes-devtools/clang/clang/0026-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch b/recipes-devtools/clang/clang/0026-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch new file mode 100644 index 0000000..514114c --- /dev/null +++ b/recipes-devtools/clang/clang/0026-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch @@ -0,0 +1,29 @@ +From 292fcadd76c98e94d418f91f3f3b799f09434a7c Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 21 May 2021 08:14:29 -0700 +Subject: [PATCH] compiler-rt: Link scudo standalone with libatomic on mips + +clang on mips generate atomic built-ins which should be provided by +libatomic + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + compiler-rt/lib/scudo/standalone/CMakeLists.txt | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/compiler-rt/lib/scudo/standalone/CMakeLists.txt b/compiler-rt/lib/scudo/standalone/CMakeLists.txt +index 739f131bdefd..5862545b842b 100644 +--- a/compiler-rt/lib/scudo/standalone/CMakeLists.txt ++++ b/compiler-rt/lib/scudo/standalone/CMakeLists.txt +@@ -137,6 +137,10 @@ append_list_if(COMPILER_RT_HAS_LIBPTHREAD -pthread SCUDO_LINK_FLAGS) + + append_list_if(FUCHSIA zircon SCUDO_LINK_LIBS) + ++if (CMAKE_SYSTEM_PROCESSOR MATCHES "mips" AND CMAKE_SYSTEM_NAME MATCHES "Linux") ++ list(APPEND SCUDO_LINK_LIBS atomic) ++endif() ++ + if(COMPILER_RT_HAS_SCUDO_STANDALONE) + add_compiler_rt_object_libraries(RTScudoStandalone + ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH} diff --git a/recipes-devtools/clang/clang/0026-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch b/recipes-devtools/clang/clang/0026-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch deleted file mode 100644 index d81f7a3..0000000 --- a/recipes-devtools/clang/clang/0026-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch +++ /dev/null @@ -1,28 +0,0 @@ -From c1ac3d62106f9cfe8644c7f167297012b7bbe198 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 19 May 2021 21:49:18 -0700 -Subject: [PATCH] compiler-rt: Link scudo with SANITIZER_CXX_ABI_LIBRARIES - -If SANITIZER_CXX_ABI_LIBRARIES is set then link scudo with it, this -fixes build time errors like - -projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.armhf.dir/sanitizer_posix_libcdep.cpp.o: in function `__sanitizer::UnsetAlternateSignalStack()': -| sanitizer_posix_libcdep.cpp:(.text+0x3d2): undefined reference to `__cxa_guard_acquire' - -Signed-off-by: Khem Raj ---- - compiler-rt/lib/scudo/CMakeLists.txt | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/compiler-rt/lib/scudo/CMakeLists.txt b/compiler-rt/lib/scudo/CMakeLists.txt -index 995e853e2a4d..25b79a8d17e8 100644 ---- a/compiler-rt/lib/scudo/CMakeLists.txt -+++ b/compiler-rt/lib/scudo/CMakeLists.txt -@@ -15,6 +15,7 @@ append_list_if(COMPILER_RT_HAS_LIBDL dl SCUDO_MINIMAL_DYNAMIC_LIBS) - append_list_if(COMPILER_RT_HAS_LIBRT rt SCUDO_MINIMAL_DYNAMIC_LIBS) - append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread SCUDO_MINIMAL_DYNAMIC_LIBS) - append_list_if(COMPILER_RT_HAS_LIBLOG log SCUDO_MINIMAL_DYNAMIC_LIBS) -+append_list_if(SANITIZER_CXX_ABI_LIBRARIES ${SANITIZER_CXX_ABI_LIBRARIES} SCUDO_MINIMAL_DYNAMIC_LIBS) - append_list_if(COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG -fno-omit-frame-pointer - SCUDO_CFLAGS) - diff --git a/recipes-devtools/clang/clang/0027-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch b/recipes-devtools/clang/clang/0027-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch deleted file mode 100644 index 95d7b40..0000000 --- a/recipes-devtools/clang/clang/0027-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch +++ /dev/null @@ -1,29 +0,0 @@ -From c1635bb9812f275b55f77960c609cedc6c4ac405 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Fri, 21 May 2021 08:14:29 -0700 -Subject: [PATCH] compiler-rt: Link scudo standalone with libatomic on mips - -clang on mips generate atomic built-ins which should be provided by -libatomic - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - compiler-rt/lib/scudo/standalone/CMakeLists.txt | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/compiler-rt/lib/scudo/standalone/CMakeLists.txt b/compiler-rt/lib/scudo/standalone/CMakeLists.txt -index 739f131bdefd..5862545b842b 100644 ---- a/compiler-rt/lib/scudo/standalone/CMakeLists.txt -+++ b/compiler-rt/lib/scudo/standalone/CMakeLists.txt -@@ -137,6 +137,10 @@ append_list_if(COMPILER_RT_HAS_LIBPTHREAD -pthread SCUDO_LINK_FLAGS) - - append_list_if(FUCHSIA zircon SCUDO_LINK_LIBS) - -+if (CMAKE_SYSTEM_PROCESSOR MATCHES "mips" AND CMAKE_SYSTEM_NAME MATCHES "Linux") -+ list(APPEND SCUDO_LINK_LIBS atomic) -+endif() -+ - if(COMPILER_RT_HAS_SCUDO_STANDALONE) - add_compiler_rt_object_libraries(RTScudoStandalone - ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH} diff --git a/recipes-devtools/clang/clang/0027-libunwind-Added-unw_backtrace-method.patch b/recipes-devtools/clang/clang/0027-libunwind-Added-unw_backtrace-method.patch new file mode 100644 index 0000000..3ad6b4f --- /dev/null +++ b/recipes-devtools/clang/clang/0027-libunwind-Added-unw_backtrace-method.patch @@ -0,0 +1,55 @@ +From 0177c3239a1b44e123ab656b46d62fe0ce740936 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 + +Source: https://github.com/ClickHouse-Extras/libunwind/commit/52f0f7861926cbfaef7e6c97d8a6d7ba2a1f6747#diff-a82fc885e2e4facf4b92d26171c13aa4aa5db296f77e1158ba2f8664e3bd1f5c +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + libunwind/include/libunwind.h | 1 + + libunwind/src/libunwind.cpp | 18 ++++++++++++++++++ + 2 files changed, 19 insertions(+) + +diff --git a/libunwind/include/libunwind.h b/libunwind/include/libunwind.h +index 9a74faa48d6f..f7480c9cf27a 100644 +--- a/libunwind/include/libunwind.h ++++ b/libunwind/include/libunwind.h +@@ -127,6 +127,7 @@ extern int unw_is_fpreg(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL; + extern int unw_is_signal_frame(unw_cursor_t *) LIBUNWIND_AVAIL; + extern int unw_get_proc_name(unw_cursor_t *, char *, size_t, unw_word_t *) LIBUNWIND_AVAIL; + //extern int unw_get_save_loc(unw_cursor_t*, int, unw_save_loc_t*); ++extern int unw_backtrace(void **, int) LIBUNWIND_AVAIL; + + extern unw_addr_space_t unw_local_addr_space; + +diff --git a/libunwind/src/libunwind.cpp b/libunwind/src/libunwind.cpp +index 03f8b75b5bba..730e2393a8f8 100644 +--- a/libunwind/src/libunwind.cpp ++++ b/libunwind/src/libunwind.cpp +@@ -326,7 +326,25 @@ void __unw_remove_dynamic_eh_frame_section(unw_word_t eh_frame_start) { + #endif // defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) + #endif // !defined(__USING_SJLJ_EXCEPTIONS__) + ++int unw_backtrace(void **buffer, int size) { ++ unw_context_t context; ++ unw_cursor_t cursor; ++ if (unw_getcontext(&context) || unw_init_local(&cursor, &context)) { ++ return 0; ++ } ++ ++ unw_word_t ip; ++ int current = 0; ++ while (unw_step(&cursor) > 0) { ++ if (current >= size || unw_get_reg(&cursor, UNW_REG_IP, &ip)) { ++ break; ++ } + ++ buffer[current++] = reinterpret_cast(static_cast(ip)); ++ } ++ ++ return current; ++} + + // Add logging hooks in Debug builds only + #ifndef NDEBUG diff --git a/recipes-devtools/clang/clang/0028-Do-not-force-thumb-mode-directive.patch b/recipes-devtools/clang/clang/0028-Do-not-force-thumb-mode-directive.patch new file mode 100644 index 0000000..87a0cae --- /dev/null +++ b/recipes-devtools/clang/clang/0028-Do-not-force-thumb-mode-directive.patch @@ -0,0 +1,46 @@ +From 3b37d5cba75fa66e2fc50a457256b1db8b575c9b Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 12 Jun 2021 08:42:36 -0700 +Subject: [PATCH] Do not force thumb mode directive + +.thumb_func was not switching mode until [1] +so it did not show up but now that .thumb_func (without argument) is +switching mode, its causing build failures on armv6 ( rpi0 ) even when +build is explicitly asking for this file to be built with -marm (ARM +mode), therefore use DEFINE_COMPILERRT_FUNCTION macro to add function +header which considers arch and mode from compiler cmdline to decide if +the function is built using thumb mode or arm mode. + +[1] https://reviews.llvm.org/D101975 + +Signed-off-by: Khem Raj +--- + compiler-rt/lib/builtins/arm/sync-ops.h | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/compiler-rt/lib/builtins/arm/sync-ops.h b/compiler-rt/lib/builtins/arm/sync-ops.h +index 7a26170741ad..d914f9d3a109 100644 +--- a/compiler-rt/lib/builtins/arm/sync-ops.h ++++ b/compiler-rt/lib/builtins/arm/sync-ops.h +@@ -16,9 +16,8 @@ + + #define SYNC_OP_4(op) \ + .p2align 2; \ +- .thumb; \ + .syntax unified; \ +- DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ ++ DEFINE_COMPILERRT_FUNCTION(__sync_fetch_and_##op) \ + DMB; \ + mov r12, r0; \ + LOCAL_LABEL(tryatomic_##op) : ldrex r0, [r12]; \ +@@ -31,9 +30,8 @@ + + #define SYNC_OP_8(op) \ + .p2align 2; \ +- .thumb; \ + .syntax unified; \ +- DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ ++ DEFINE_COMPILERRT_FUNCTION(__sync_fetch_and_##op) \ + push {r4, r5, r6, lr}; \ + DMB; \ + mov r12, r0; \ diff --git a/recipes-devtools/clang/clang/0028-libunwind-Added-unw_backtrace-method.patch b/recipes-devtools/clang/clang/0028-libunwind-Added-unw_backtrace-method.patch deleted file mode 100644 index af9d5e1..0000000 --- a/recipes-devtools/clang/clang/0028-libunwind-Added-unw_backtrace-method.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 4f97a54738b626f970682d0922b466fb608deb75 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 - -Source: https://github.com/ClickHouse-Extras/libunwind/commit/52f0f7861926cbfaef7e6c97d8a6d7ba2a1f6747#diff-a82fc885e2e4facf4b92d26171c13aa4aa5db296f77e1158ba2f8664e3bd1f5c -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - libunwind/include/libunwind.h | 1 + - libunwind/src/libunwind.cpp | 18 ++++++++++++++++++ - 2 files changed, 19 insertions(+) - -diff --git a/libunwind/include/libunwind.h b/libunwind/include/libunwind.h -index 9a74faa48d6f..f7480c9cf27a 100644 ---- a/libunwind/include/libunwind.h -+++ b/libunwind/include/libunwind.h -@@ -127,6 +127,7 @@ extern int unw_is_fpreg(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL; - extern int unw_is_signal_frame(unw_cursor_t *) LIBUNWIND_AVAIL; - extern int unw_get_proc_name(unw_cursor_t *, char *, size_t, unw_word_t *) LIBUNWIND_AVAIL; - //extern int unw_get_save_loc(unw_cursor_t*, int, unw_save_loc_t*); -+extern int unw_backtrace(void **, int) LIBUNWIND_AVAIL; - - extern unw_addr_space_t unw_local_addr_space; - -diff --git a/libunwind/src/libunwind.cpp b/libunwind/src/libunwind.cpp -index 03f8b75b5bba..730e2393a8f8 100644 ---- a/libunwind/src/libunwind.cpp -+++ b/libunwind/src/libunwind.cpp -@@ -326,7 +326,25 @@ void __unw_remove_dynamic_eh_frame_section(unw_word_t eh_frame_start) { - #endif // defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) - #endif // !defined(__USING_SJLJ_EXCEPTIONS__) - -+int unw_backtrace(void **buffer, int size) { -+ unw_context_t context; -+ unw_cursor_t cursor; -+ if (unw_getcontext(&context) || unw_init_local(&cursor, &context)) { -+ return 0; -+ } -+ -+ unw_word_t ip; -+ int current = 0; -+ while (unw_step(&cursor) > 0) { -+ if (current >= size || unw_get_reg(&cursor, UNW_REG_IP, &ip)) { -+ break; -+ } - -+ buffer[current++] = reinterpret_cast(static_cast(ip)); -+ } -+ -+ return current; -+} - - // Add logging hooks in Debug builds only - #ifndef NDEBUG diff --git a/recipes-devtools/clang/clang/0029-Do-not-force-thumb-mode-directive.patch b/recipes-devtools/clang/clang/0029-Do-not-force-thumb-mode-directive.patch deleted file mode 100644 index 58ce5fd..0000000 --- a/recipes-devtools/clang/clang/0029-Do-not-force-thumb-mode-directive.patch +++ /dev/null @@ -1,46 +0,0 @@ -From a62207f89f1bea871bb9aff23872d02a9197e467 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 12 Jun 2021 08:42:36 -0700 -Subject: [PATCH] Do not force thumb mode directive - -.thumb_func was not switching mode until [1] -so it did not show up but now that .thumb_func (without argument) is -switching mode, its causing build failures on armv6 ( rpi0 ) even when -build is explicitly asking for this file to be built with -marm (ARM -mode), therefore use DEFINE_COMPILERRT_FUNCTION macro to add function -header which considers arch and mode from compiler cmdline to decide if -the function is built using thumb mode or arm mode. - -[1] https://reviews.llvm.org/D101975 - -Signed-off-by: Khem Raj ---- - compiler-rt/lib/builtins/arm/sync-ops.h | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - -diff --git a/compiler-rt/lib/builtins/arm/sync-ops.h b/compiler-rt/lib/builtins/arm/sync-ops.h -index 7a26170741ad..d914f9d3a109 100644 ---- a/compiler-rt/lib/builtins/arm/sync-ops.h -+++ b/compiler-rt/lib/builtins/arm/sync-ops.h -@@ -16,9 +16,8 @@ - - #define SYNC_OP_4(op) \ - .p2align 2; \ -- .thumb; \ - .syntax unified; \ -- DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ -+ DEFINE_COMPILERRT_FUNCTION(__sync_fetch_and_##op) \ - DMB; \ - mov r12, r0; \ - LOCAL_LABEL(tryatomic_##op) : ldrex r0, [r12]; \ -@@ -31,9 +30,8 @@ - - #define SYNC_OP_8(op) \ - .p2align 2; \ -- .thumb; \ - .syntax unified; \ -- DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ -+ DEFINE_COMPILERRT_FUNCTION(__sync_fetch_and_##op) \ - push {r4, r5, r6, lr}; \ - DMB; \ - mov r12, r0; \ diff --git a/recipes-devtools/clang/clang/0029-clang-Do-not-use-install-relative-libc-headers.patch b/recipes-devtools/clang/clang/0029-clang-Do-not-use-install-relative-libc-headers.patch new file mode 100644 index 0000000..68e9023 --- /dev/null +++ b/recipes-devtools/clang/clang/0029-clang-Do-not-use-install-relative-libc-headers.patch @@ -0,0 +1,32 @@ +From 9dbb503008ecf894d71ec49bfcf4e88380084eb7 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 11 Aug 2021 18:37:11 -0700 +Subject: [PATCH] clang: Do not use install relative libc++ headers + +In OE we use same clang for native and cross builds, therefore we need +to ensure that native sysroot install of libc++ is not searched for +headers when doing cross compile instead it searches the target sysroot +this is especially troublesome when libcxx-native is staged along with +libcxx e.g. chromium + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 6fcd5abe7211..0d04a199a7af 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2919,7 +2919,9 @@ Generic_GCC::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, + + // Android never uses the libc++ headers installed alongside the toolchain, + // which are generally incompatible with the NDK libraries anyway. +- if (!getTriple().isAndroid()) ++ // And also do not add it when --sysroot is specified, since it would expect ++ // libc++ headers from sysroot ++ if (!getTriple().isAndroid() && SysRoot.empty()) + if (AddIncludePath(getDriver().Dir + "/../include")) + return; + // If this is a development, non-installed, clang, libcxx will diff --git a/recipes-devtools/clang/clang/0030-clang-Do-not-use-install-relative-libc-headers.patch b/recipes-devtools/clang/clang/0030-clang-Do-not-use-install-relative-libc-headers.patch deleted file mode 100644 index 48073a6..0000000 --- a/recipes-devtools/clang/clang/0030-clang-Do-not-use-install-relative-libc-headers.patch +++ /dev/null @@ -1,32 +0,0 @@ -From edbbdb9fd9b4bd781a950be5349afc78d495e251 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 11 Aug 2021 18:37:11 -0700 -Subject: [PATCH] clang: Do not use install relative libc++ headers - -In OE we use same clang for native and cross builds, therefore we need -to ensure that native sysroot install of libc++ is not searched for -headers when doing cross compile instead it searches the target sysroot -this is especially troublesome when libcxx-native is staged along with -libcxx e.g. chromium - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Gnu.cpp | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 6fcd5abe7211..0d04a199a7af 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2919,7 +2919,9 @@ Generic_GCC::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, - - // Android never uses the libc++ headers installed alongside the toolchain, - // which are generally incompatible with the NDK libraries anyway. -- if (!getTriple().isAndroid()) -+ // And also do not add it when --sysroot is specified, since it would expect -+ // libc++ headers from sysroot -+ if (!getTriple().isAndroid() && SysRoot.empty()) - if (AddIncludePath(getDriver().Dir + "/../include")) - return; - // If this is a development, non-installed, clang, libcxx will diff --git a/recipes-devtools/clang/clang/0030-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch b/recipes-devtools/clang/clang/0030-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch new file mode 100644 index 0000000..62bae0b --- /dev/null +++ b/recipes-devtools/clang/clang/0030-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch @@ -0,0 +1,97 @@ +From e18e3a2f7a74ad8fe4bf8f42ce2fc07105f6647b Mon Sep 17 00:00:00 2001 +From: David Abdurachmanov +Date: Wed, 20 Oct 2021 17:30:36 -0700 +Subject: [PATCH] clang: Fix how driver finds GCC installation path on + OpenEmbedded + +Fix how Clang Driver finds GCC installation path on OpenEmbedded + +- For RISCV (riscv{32,64}) we define new two multi-lib options without any + subdirectories (e.g., lib32/ilp32d or lib64/lp64d). OpenEmbedded GCC + builds don't use them. +- Modify how Clang Driver finds GCC installation path. This is important + because GCC files on OpenEmbedded are in two different directories: + (1) /usr/bin/../lib/gcc/riscv64-oe-linux/9.2.0 + (2) /usr/lib/riscv64-oe-linux/9.2.0 + +Clang Driver will check (1) first. The directory exist, but will produce +no valid multi-libs and there will be no multi-lib selected. (2) contains +actual GCC run-time objects/libraries, but because the path has exact +same GCC version (9.2.0) it will be skipped. + +We modify the approach by allowing to check other directories with the same +GCC version. We also avoid picking GCC installation path if it results in +an empty multi-lib list. + +Upstream-Status: Pending +Signed-off-by: David Abdurachmanov +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 39 +++++++++++++++++++++-------- + 1 file changed, 28 insertions(+), 11 deletions(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 0d04a199a7af..1e5a3cc2c1f1 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -1641,18 +1641,29 @@ static void findRISCVMultilibs(const Driver &D, + return findRISCVBareMetalMultilibs(D, TargetTriple, Path, Args, Result); + + FilterNonExistent NonExistent(Path, "/crtbegin.o", D.getVFS()); +- Multilib Ilp32 = makeMultilib("lib32/ilp32").flag("+m32").flag("+mabi=ilp32"); +- Multilib Ilp32f = ++ MultilibSet RISCVMultilibs; ++ ++ if (TargetTriple.getVendor() == llvm::Triple::OpenEmbedded) { ++ Multilib OpenEmbeddedIlp32d = makeMultilib("").flag("+m32").flag("+mabi=ilp32d"); ++ Multilib OpenEmbeddedLp64d = makeMultilib("").flag("+m64").flag("+mabi=lp64d"); ++ RISCVMultilibs = ++ MultilibSet() ++ .Either({OpenEmbeddedIlp32d, OpenEmbeddedLp64d}) ++ .FilterOut(NonExistent); ++ } else { ++ Multilib Ilp32 = makeMultilib("lib32/ilp32").flag("+m32").flag("+mabi=ilp32"); ++ Multilib Ilp32f = + makeMultilib("lib32/ilp32f").flag("+m32").flag("+mabi=ilp32f"); +- Multilib Ilp32d = ++ Multilib Ilp32d = + makeMultilib("lib32/ilp32d").flag("+m32").flag("+mabi=ilp32d"); +- Multilib Lp64 = makeMultilib("lib64/lp64").flag("+m64").flag("+mabi=lp64"); +- Multilib Lp64f = makeMultilib("lib64/lp64f").flag("+m64").flag("+mabi=lp64f"); +- Multilib Lp64d = makeMultilib("lib64/lp64d").flag("+m64").flag("+mabi=lp64d"); +- MultilibSet RISCVMultilibs = +- MultilibSet() +- .Either({Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d}) +- .FilterOut(NonExistent); ++ Multilib Lp64 = makeMultilib("lib64/lp64").flag("+m64").flag("+mabi=lp64"); ++ Multilib Lp64f = makeMultilib("lib64/lp64f").flag("+m64").flag("+mabi=lp64f"); ++ Multilib Lp64d = makeMultilib("lib64/lp64d").flag("+m64").flag("+mabi=lp64d"); ++ RISCVMultilibs = ++ MultilibSet() ++ .Either({Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d}) ++ .FilterOut(NonExistent); ++ } + + Multilib::flags_list Flags; + bool IsRV64 = TargetTriple.getArch() == llvm::Triple::riscv64; +@@ -2549,13 +2560,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + continue; // Saw this path before; no need to look at it again. + if (CandidateVersion.isOlderThan(4, 1, 1)) + continue; +- if (CandidateVersion <= Version) ++ if (CandidateVersion < Version) + continue; + + if (!ScanGCCForMultilibs(TargetTriple, Args, LI->path(), + NeedsBiarchSuffix)) + continue; + ++ // We might have found existing directory with GCCVersion, but it ++ // might not have GCC libraries we are looking for (i.e. return an ++ // empty Mulilibs) ++ if (Multilibs.size() == 0) ++ continue; ++ + Version = CandidateVersion; + GCCTriple.setTriple(CandidateTriple); + // FIXME: We hack together the directory name here instead of diff --git a/recipes-devtools/clang/clang/0031-Fix-lib-paths-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0031-Fix-lib-paths-for-OpenEmbedded-Host.patch new file mode 100644 index 0000000..0bb5b5c --- /dev/null +++ b/recipes-devtools/clang/clang/0031-Fix-lib-paths-for-OpenEmbedded-Host.patch @@ -0,0 +1,79 @@ +From 318d1ce6f4bb51ab5fb16504d2143cd27628ffcd Mon Sep 17 00:00:00 2001 +From: Changqing Li +Date: Tue, 7 Dec 2021 04:08:22 +0000 +Subject: [PATCH] Fix lib paths for OpenEmbedded Host + +Under OpenEmbedded Host, while building with clang-native, it cannot find +the GCCInstallPath, which causing following error: +[snip] +compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang +-target x86_64-linux +-isystem/path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/include +-O2 -pipe +/path/to/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/share/cmake-3.21/Modules/CMakeCCompilerABI.c` +hosttools/ld: cannot find crtbeginS.o: No such file or directory +[snip] + +Before this patch: +compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang +clang version 13.0.1 (https://github.com/llvm/llvm-project 08e3a5ccd952edee36b3c002e3a29c6b1b5153de) +Target: x86_64-unknown-linux-gnu +Thread model: posix +InstalledDir: /build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin +Found candidate GCC installation: /usr/lib/gcc/x86_64-wrs-linux/10.2.0 + +After this patch: +compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang +clang version 13.0.1 (https://github.com/llvm/llvm-project 08e3a5ccd952edee36b3c002e3a29c6b1b5153de) +Thread model: posix +InstalledDir: /build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin +Found candidate GCC installation: /usr/lib/gcc/x86_64-wrs-linux/10.2.0 +Found candidate GCC installation: /usr/lib/x86_64-wrs-linux/10.2.0 +Selected GCC installation: /usr/lib/x86_64-wrs-linux/10.2.0 +Candidate multilib: .;@m64 +Selected multilib: .;@m64 + +Summary: +For OpenEmbedded Host, sysroots are of the form/usr/lib//x.y.z. +Take x86-64 as example, the default triple is x86_64-unknown-linux-gnu. +For clang-native, the target vendor is '-unknown', need to test current distro +to follow above form. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Changqing Li +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 1e5a3cc2c1f1..d3574b86cb26 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -22,6 +22,7 @@ + #include "clang/Driver/Options.h" + #include "clang/Driver/Tool.h" + #include "clang/Driver/ToolChain.h" ++#include "clang/Driver/Distro.h" + #include "llvm/Option/ArgList.h" + #include "llvm/Support/CodeGen.h" + #include "llvm/Support/Path.h" +@@ -2518,6 +2519,7 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + const llvm::Triple &TargetTriple, const ArgList &Args, + const std::string &LibDir, StringRef CandidateTriple, + bool NeedsBiarchSuffix, bool GCCDirExists, bool GCCCrossDirExists) { ++ Distro Distro(D.getVFS(), TargetTriple); + // Locations relative to the system lib directory where GCC's triple-specific + // directories might reside. + struct GCCLibSuffix { +@@ -2535,7 +2537,8 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + // files in that location, not just GCC installation data. + {CandidateTriple.str(), "..", + TargetTriple.getVendor() == llvm::Triple::Freescale || +- TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}, ++ TargetTriple.getVendor() == llvm::Triple::OpenEmbedded || ++ Distro.IsOpenEmbedded()}, + + // This is the normal place. + {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists}, diff --git a/recipes-devtools/clang/clang/0031-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch b/recipes-devtools/clang/clang/0031-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch deleted file mode 100644 index 1c31632..0000000 --- a/recipes-devtools/clang/clang/0031-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 3badef231c62bcd5b9909b545a1ab6df732c99ca Mon Sep 17 00:00:00 2001 -From: David Abdurachmanov -Date: Wed, 20 Oct 2021 17:30:36 -0700 -Subject: [PATCH] clang: Fix how driver finds GCC installation path on - OpenEmbedded - -Fix how Clang Driver finds GCC installation path on OpenEmbedded - -- For RISCV (riscv{32,64}) we define new two multi-lib options without any - subdirectories (e.g., lib32/ilp32d or lib64/lp64d). OpenEmbedded GCC - builds don't use them. -- Modify how Clang Driver finds GCC installation path. This is important - because GCC files on OpenEmbedded are in two different directories: - (1) /usr/bin/../lib/gcc/riscv64-oe-linux/9.2.0 - (2) /usr/lib/riscv64-oe-linux/9.2.0 - -Clang Driver will check (1) first. The directory exist, but will produce -no valid multi-libs and there will be no multi-lib selected. (2) contains -actual GCC run-time objects/libraries, but because the path has exact -same GCC version (9.2.0) it will be skipped. - -We modify the approach by allowing to check other directories with the same -GCC version. We also avoid picking GCC installation path if it results in -an empty multi-lib list. - -Upstream-Status: Pending -Signed-off-by: David Abdurachmanov -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Gnu.cpp | 39 +++++++++++++++++++++-------- - 1 file changed, 28 insertions(+), 11 deletions(-) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 0d04a199a7af..1e5a3cc2c1f1 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -1641,18 +1641,29 @@ static void findRISCVMultilibs(const Driver &D, - return findRISCVBareMetalMultilibs(D, TargetTriple, Path, Args, Result); - - FilterNonExistent NonExistent(Path, "/crtbegin.o", D.getVFS()); -- Multilib Ilp32 = makeMultilib("lib32/ilp32").flag("+m32").flag("+mabi=ilp32"); -- Multilib Ilp32f = -+ MultilibSet RISCVMultilibs; -+ -+ if (TargetTriple.getVendor() == llvm::Triple::OpenEmbedded) { -+ Multilib OpenEmbeddedIlp32d = makeMultilib("").flag("+m32").flag("+mabi=ilp32d"); -+ Multilib OpenEmbeddedLp64d = makeMultilib("").flag("+m64").flag("+mabi=lp64d"); -+ RISCVMultilibs = -+ MultilibSet() -+ .Either({OpenEmbeddedIlp32d, OpenEmbeddedLp64d}) -+ .FilterOut(NonExistent); -+ } else { -+ Multilib Ilp32 = makeMultilib("lib32/ilp32").flag("+m32").flag("+mabi=ilp32"); -+ Multilib Ilp32f = - makeMultilib("lib32/ilp32f").flag("+m32").flag("+mabi=ilp32f"); -- Multilib Ilp32d = -+ Multilib Ilp32d = - makeMultilib("lib32/ilp32d").flag("+m32").flag("+mabi=ilp32d"); -- Multilib Lp64 = makeMultilib("lib64/lp64").flag("+m64").flag("+mabi=lp64"); -- Multilib Lp64f = makeMultilib("lib64/lp64f").flag("+m64").flag("+mabi=lp64f"); -- Multilib Lp64d = makeMultilib("lib64/lp64d").flag("+m64").flag("+mabi=lp64d"); -- MultilibSet RISCVMultilibs = -- MultilibSet() -- .Either({Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d}) -- .FilterOut(NonExistent); -+ Multilib Lp64 = makeMultilib("lib64/lp64").flag("+m64").flag("+mabi=lp64"); -+ Multilib Lp64f = makeMultilib("lib64/lp64f").flag("+m64").flag("+mabi=lp64f"); -+ Multilib Lp64d = makeMultilib("lib64/lp64d").flag("+m64").flag("+mabi=lp64d"); -+ RISCVMultilibs = -+ MultilibSet() -+ .Either({Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d}) -+ .FilterOut(NonExistent); -+ } - - Multilib::flags_list Flags; - bool IsRV64 = TargetTriple.getArch() == llvm::Triple::riscv64; -@@ -2549,13 +2560,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( - continue; // Saw this path before; no need to look at it again. - if (CandidateVersion.isOlderThan(4, 1, 1)) - continue; -- if (CandidateVersion <= Version) -+ if (CandidateVersion < Version) - continue; - - if (!ScanGCCForMultilibs(TargetTriple, Args, LI->path(), - NeedsBiarchSuffix)) - continue; - -+ // We might have found existing directory with GCCVersion, but it -+ // might not have GCC libraries we are looking for (i.e. return an -+ // empty Mulilibs) -+ if (Multilibs.size() == 0) -+ continue; -+ - Version = CandidateVersion; - GCCTriple.setTriple(CandidateTriple); - // FIXME: We hack together the directory name here instead of diff --git a/recipes-devtools/clang/clang/0032-Correct-library-search-path-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0032-Correct-library-search-path-for-OpenEmbedded-Host.patch new file mode 100644 index 0000000..b6b5373 --- /dev/null +++ b/recipes-devtools/clang/clang/0032-Correct-library-search-path-for-OpenEmbedded-Host.patch @@ -0,0 +1,84 @@ +From 39ae2f79f41eaf7b699ba677b0b827a489920537 Mon Sep 17 00:00:00 2001 +From: Changqing Li +Date: Tue, 7 Dec 2021 04:55:48 +0000 +Subject: [PATCH] Correct library search path for OpenEmbedded Host + +For OpenEmbedded Host, the gcc install path is +/usr/lib/x86_64-[distroname]-linux/[gcc-version]. +So the library search path is not found with default triple +'x86_64-linux-gnu' for x86_64. Causing following error: +[snip] +compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang +-target x86_64-linux +-isystem/path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/include +-O2 -pipe +/path/to/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/share/cmake-3.21/Modules/CMakeCCompilerABI.c` +| /build/tmp-glibc/hosttools/ld: cannot find -lgcc +| /build/tmp-glibc/hosttools/ld: cannot find -lgcc +| clang-13: error: linker command failed with exit code 1 (use -v to see invocation) +[snip] + +before this patch: +b59da142f2b0:$ /path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --print-search-dirs +programs: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin +libraries: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/lib/clang/13.0.1:/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/../lib://lib://usr/lib + +after this patch: +b59da142f2b0:$ /path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --print-search-dirs +programs: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin +libraries: =/build/tmp-glibc/work/x84_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/lib/clang/13.0.1:/usr/lib/x86_64-wrs-linux/10.2.0://lib/x86_64-wrs-linux://usr/lib/x86_64-wrs-linux:/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/../lib://lib://usr/lib + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Changqing Li +Signed-off-by: Khem Raj +--- + clang/include/clang/Driver/Distro.h | 2 ++ + clang/lib/Driver/Distro.cpp | 1 + + clang/lib/Driver/ToolChains/Linux.cpp | 1 + + 3 files changed, 4 insertions(+) + +diff --git a/clang/include/clang/Driver/Distro.h b/clang/include/clang/Driver/Distro.h +index 2723f75e8945..cd43e8f11574 100644 +--- a/clang/include/clang/Driver/Distro.h ++++ b/clang/include/clang/Driver/Distro.h +@@ -44,6 +44,7 @@ public: + RHEL7, + Fedora, + Gentoo, ++ //CLANG_EXTRA_OE_DISTRO_NAME + OpenSUSE, + UbuntuHardy, + UbuntuIntrepid, +@@ -132,6 +133,7 @@ public: + + bool IsGentoo() const { return DistroVal == Gentoo; } + ++ //CLANG_EXTRA_OE_DISTRO_CHECK + /// @} + }; + +diff --git a/clang/lib/Driver/Distro.cpp b/clang/lib/Driver/Distro.cpp +index 5ac38c34d112..f20dd4b526e5 100644 +--- a/clang/lib/Driver/Distro.cpp ++++ b/clang/lib/Driver/Distro.cpp +@@ -44,6 +44,7 @@ static Distro::DistroType DetectOsRelease(llvm::vfs::FileSystem &VFS) { + .Case("sles", Distro::OpenSUSE) + .Case("opensuse", Distro::OpenSUSE) + .Case("exherbo", Distro::Exherbo) ++ //CLANG_EXTRA_OE_DISTRO_CASE + .Default(Distro::UnknownDistro); + return Version; + } +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index eb92a037c930..c92cef442005 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -77,6 +77,7 @@ std::string Linux::getMultiarchTriple(const Driver &D, + return "x86_64-linux-android"; + if (TargetEnvironment == llvm::Triple::GNUX32) + return "x86_64-linux-gnux32"; ++ //CLANG_EXTRA_OE_DISTRO_TRIPLE + return "x86_64-linux-gnu"; + case llvm::Triple::aarch64: + if (IsAndroid) diff --git a/recipes-devtools/clang/clang/0032-Fix-lib-paths-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0032-Fix-lib-paths-for-OpenEmbedded-Host.patch deleted file mode 100644 index 53e3279..0000000 --- a/recipes-devtools/clang/clang/0032-Fix-lib-paths-for-OpenEmbedded-Host.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 10fd1fea36b270ac6a942b36b76f97e6a9b699b3 Mon Sep 17 00:00:00 2001 -From: Changqing Li -Date: Tue, 7 Dec 2021 04:08:22 +0000 -Subject: [PATCH] Fix lib paths for OpenEmbedded Host - -Under OpenEmbedded Host, while building with clang-native, it cannot find -the GCCInstallPath, which causing following error: -[snip] -compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --target x86_64-linux --isystem/path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/include --O2 -pipe -/path/to/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/share/cmake-3.21/Modules/CMakeCCompilerABI.c` -hosttools/ld: cannot find crtbeginS.o: No such file or directory -[snip] - -Before this patch: -compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang -clang version 13.0.1 (https://github.com/llvm/llvm-project 08e3a5ccd952edee36b3c002e3a29c6b1b5153de) -Target: x86_64-unknown-linux-gnu -Thread model: posix -InstalledDir: /build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin -Found candidate GCC installation: /usr/lib/gcc/x86_64-wrs-linux/10.2.0 - -After this patch: -compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang -clang version 13.0.1 (https://github.com/llvm/llvm-project 08e3a5ccd952edee36b3c002e3a29c6b1b5153de) -Thread model: posix -InstalledDir: /build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin -Found candidate GCC installation: /usr/lib/gcc/x86_64-wrs-linux/10.2.0 -Found candidate GCC installation: /usr/lib/x86_64-wrs-linux/10.2.0 -Selected GCC installation: /usr/lib/x86_64-wrs-linux/10.2.0 -Candidate multilib: .;@m64 -Selected multilib: .;@m64 - -Summary: -For OpenEmbedded Host, sysroots are of the form/usr/lib//x.y.z. -Take x86-64 as example, the default triple is x86_64-unknown-linux-gnu. -For clang-native, the target vendor is '-unknown', need to test current distro -to follow above form. - -Upstream-Status: Inappropriate [oe specific] - -Signed-off-by: Changqing Li -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Gnu.cpp | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 1e5a3cc2c1f1..d3574b86cb26 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -22,6 +22,7 @@ - #include "clang/Driver/Options.h" - #include "clang/Driver/Tool.h" - #include "clang/Driver/ToolChain.h" -+#include "clang/Driver/Distro.h" - #include "llvm/Option/ArgList.h" - #include "llvm/Support/CodeGen.h" - #include "llvm/Support/Path.h" -@@ -2518,6 +2519,7 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( - const llvm::Triple &TargetTriple, const ArgList &Args, - const std::string &LibDir, StringRef CandidateTriple, - bool NeedsBiarchSuffix, bool GCCDirExists, bool GCCCrossDirExists) { -+ Distro Distro(D.getVFS(), TargetTriple); - // Locations relative to the system lib directory where GCC's triple-specific - // directories might reside. - struct GCCLibSuffix { -@@ -2535,7 +2537,8 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( - // files in that location, not just GCC installation data. - {CandidateTriple.str(), "..", - TargetTriple.getVendor() == llvm::Triple::Freescale || -- TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}, -+ TargetTriple.getVendor() == llvm::Triple::OpenEmbedded || -+ Distro.IsOpenEmbedded()}, - - // This is the normal place. - {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists}, diff --git a/recipes-devtools/clang/clang/0033-Correct-library-search-path-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0033-Correct-library-search-path-for-OpenEmbedded-Host.patch deleted file mode 100644 index 098c17e..0000000 --- a/recipes-devtools/clang/clang/0033-Correct-library-search-path-for-OpenEmbedded-Host.patch +++ /dev/null @@ -1,84 +0,0 @@ -From ae279cdbcc87bdfa06beb3b5cb43075d8943822a Mon Sep 17 00:00:00 2001 -From: Changqing Li -Date: Tue, 7 Dec 2021 04:55:48 +0000 -Subject: [PATCH] Correct library search path for OpenEmbedded Host - -For OpenEmbedded Host, the gcc install path is -/usr/lib/x86_64-[distroname]-linux/[gcc-version]. -So the library search path is not found with default triple -'x86_64-linux-gnu' for x86_64. Causing following error: -[snip] -compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --target x86_64-linux --isystem/path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/include --O2 -pipe -/path/to/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/share/cmake-3.21/Modules/CMakeCCompilerABI.c` -| /build/tmp-glibc/hosttools/ld: cannot find -lgcc -| /build/tmp-glibc/hosttools/ld: cannot find -lgcc -| clang-13: error: linker command failed with exit code 1 (use -v to see invocation) -[snip] - -before this patch: -b59da142f2b0:$ /path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --print-search-dirs -programs: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin -libraries: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/lib/clang/13.0.1:/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/../lib://lib://usr/lib - -after this patch: -b59da142f2b0:$ /path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --print-search-dirs -programs: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin -libraries: =/build/tmp-glibc/work/x84_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/lib/clang/13.0.1:/usr/lib/x86_64-wrs-linux/10.2.0://lib/x86_64-wrs-linux://usr/lib/x86_64-wrs-linux:/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/../lib://lib://usr/lib - -Upstream-Status: Inappropriate [oe specific] - -Signed-off-by: Changqing Li -Signed-off-by: Khem Raj ---- - clang/include/clang/Driver/Distro.h | 2 ++ - clang/lib/Driver/Distro.cpp | 1 + - clang/lib/Driver/ToolChains/Linux.cpp | 1 + - 3 files changed, 4 insertions(+) - -diff --git a/clang/include/clang/Driver/Distro.h b/clang/include/clang/Driver/Distro.h -index 2723f75e8945..cd43e8f11574 100644 ---- a/clang/include/clang/Driver/Distro.h -+++ b/clang/include/clang/Driver/Distro.h -@@ -44,6 +44,7 @@ public: - RHEL7, - Fedora, - Gentoo, -+ //CLANG_EXTRA_OE_DISTRO_NAME - OpenSUSE, - UbuntuHardy, - UbuntuIntrepid, -@@ -132,6 +133,7 @@ public: - - bool IsGentoo() const { return DistroVal == Gentoo; } - -+ //CLANG_EXTRA_OE_DISTRO_CHECK - /// @} - }; - -diff --git a/clang/lib/Driver/Distro.cpp b/clang/lib/Driver/Distro.cpp -index 5ac38c34d112..f20dd4b526e5 100644 ---- a/clang/lib/Driver/Distro.cpp -+++ b/clang/lib/Driver/Distro.cpp -@@ -44,6 +44,7 @@ static Distro::DistroType DetectOsRelease(llvm::vfs::FileSystem &VFS) { - .Case("sles", Distro::OpenSUSE) - .Case("opensuse", Distro::OpenSUSE) - .Case("exherbo", Distro::Exherbo) -+ //CLANG_EXTRA_OE_DISTRO_CASE - .Default(Distro::UnknownDistro); - return Version; - } -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index eb92a037c930..c92cef442005 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -77,6 +77,7 @@ std::string Linux::getMultiarchTriple(const Driver &D, - return "x86_64-linux-android"; - if (TargetEnvironment == llvm::Triple::GNUX32) - return "x86_64-linux-gnux32"; -+ //CLANG_EXTRA_OE_DISTRO_TRIPLE - return "x86_64-linux-gnu"; - case llvm::Triple::aarch64: - if (IsAndroid) diff --git a/recipes-devtools/clang/clang/0033-lldb-Link-with-libatomic-on-x86.patch b/recipes-devtools/clang/clang/0033-lldb-Link-with-libatomic-on-x86.patch new file mode 100644 index 0000000..1483c7a --- /dev/null +++ b/recipes-devtools/clang/clang/0033-lldb-Link-with-libatomic-on-x86.patch @@ -0,0 +1,33 @@ +From 986c994d2fdf0979711f2440cca119a6d4d1575f 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 + +cmake atomic check is not sufficient for i686 target where clang14 still +generates __atomic_store calls but the check does not entail this +function and happily thinks that compiler can resolve all atomic via intrinsics +on i686, but thats not the case, ideally the check for determining +atomic operation should be make more robust but until then lets ask to +link with libatomic on i686/linux + +Upstream-Status: Inappropriate [OE-Specific] +Signed-off-by: Khem Raj +--- + lldb/source/Utility/CMakeLists.txt | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/lldb/source/Utility/CMakeLists.txt b/lldb/source/Utility/CMakeLists.txt +index cc0bf5fdb61a..5228bf01c276 100644 +--- a/lldb/source/Utility/CMakeLists.txt ++++ b/lldb/source/Utility/CMakeLists.txt +@@ -19,6 +19,10 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows") + list(APPEND LLDB_SYSTEM_LIBS ws2_32 rpcrt4) + endif () + ++if (CMAKE_SYSTEM_PROCESSOR MATCHES "i686" AND CMAKE_SYSTEM_NAME MATCHES "Linux") ++ list(APPEND LLDB_SYSTEM_LIBS atomic) ++endif() ++ + if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB ) + list(APPEND LLDB_SYSTEM_LIBS atomic) + endif() diff --git a/recipes-devtools/clang/clang/0034-clang-exclude-openembedded-distributions-from-settin.patch b/recipes-devtools/clang/clang/0034-clang-exclude-openembedded-distributions-from-settin.patch new file mode 100644 index 0000000..a5116e2 --- /dev/null +++ b/recipes-devtools/clang/clang/0034-clang-exclude-openembedded-distributions-from-settin.patch @@ -0,0 +1,35 @@ +From f6edd0e89b89fcf73c46b858fe5c3303b4b2e2a8 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 11 Feb 2022 12:29:14 -0800 +Subject: [PATCH] clang: exclude openembedded distributions from setting rpath + on openmp executables + +OpenEmbedded based SDKs stage toolchains outsides the target rootfs and +libomp.so is part of the target rootfs and not part of compiler +toolchain install or relative to it. It finds the libraries via +--sysroot during compile. This ensures that -rpath is not added for such +systems, since it is adding cross-compile paths to rpath which is not +correct when the binaries are run on real targets. + +Upstream-Status: Submitted [https://reviews.llvm.org/D119590] +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/CommonArgs.cpp | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp +index dbc91e427dfb..b2cbfca9898c 100644 +--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp ++++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp +@@ -648,6 +648,11 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args, + void tools::addOpenMPRuntimeSpecificRPath(const ToolChain &TC, + const ArgList &Args, + ArgStringList &CmdArgs) { ++ // OpenEmbedded/Yocto installs libomp.so into /usr/lib ++ // therefore using -rpath is not needed, on the contrary it adds ++ // paths from cross compiler install location which is not correct ++ if (TC.getTriple().getVendor() == llvm::Triple::OpenEmbedded) ++ return; + + if (Args.hasFlag(options::OPT_fopenmp_implicit_rpath, + options::OPT_fno_openmp_implicit_rpath, true)) { diff --git a/recipes-devtools/clang/clang/0034-lldb-Link-with-libatomic-on-x86.patch b/recipes-devtools/clang/clang/0034-lldb-Link-with-libatomic-on-x86.patch deleted file mode 100644 index 9988b4f..0000000 --- a/recipes-devtools/clang/clang/0034-lldb-Link-with-libatomic-on-x86.patch +++ /dev/null @@ -1,33 +0,0 @@ -From aa57af181849b91d28f2320d6fc83e239594664c 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 - -cmake atomic check is not sufficient for i686 target where clang14 still -generates __atomic_store calls but the check does not entail this -function and happily thinks that compiler can resolve all atomic via intrinsics -on i686, but thats not the case, ideally the check for determining -atomic operation should be make more robust but until then lets ask to -link with libatomic on i686/linux - -Upstream-Status: Inappropriate [OE-Specific] -Signed-off-by: Khem Raj ---- - lldb/source/Utility/CMakeLists.txt | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/lldb/source/Utility/CMakeLists.txt b/lldb/source/Utility/CMakeLists.txt -index cc0bf5fdb61a..5228bf01c276 100644 ---- a/lldb/source/Utility/CMakeLists.txt -+++ b/lldb/source/Utility/CMakeLists.txt -@@ -19,6 +19,10 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows") - list(APPEND LLDB_SYSTEM_LIBS ws2_32 rpcrt4) - endif () - -+if (CMAKE_SYSTEM_PROCESSOR MATCHES "i686" AND CMAKE_SYSTEM_NAME MATCHES "Linux") -+ list(APPEND LLDB_SYSTEM_LIBS atomic) -+endif() -+ - if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB ) - list(APPEND LLDB_SYSTEM_LIBS atomic) - endif() diff --git a/recipes-devtools/clang/clang/0035-clang-exclude-openembedded-distributions-from-settin.patch b/recipes-devtools/clang/clang/0035-clang-exclude-openembedded-distributions-from-settin.patch deleted file mode 100644 index cf3d0e8..0000000 --- a/recipes-devtools/clang/clang/0035-clang-exclude-openembedded-distributions-from-settin.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 644311972806760b1d98304fe4dcd9c1c8f21f8e Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Fri, 11 Feb 2022 12:29:14 -0800 -Subject: [PATCH] clang: exclude openembedded distributions from setting rpath - on openmp executables - -OpenEmbedded based SDKs stage toolchains outsides the target rootfs and -libomp.so is part of the target rootfs and not part of compiler -toolchain install or relative to it. It finds the libraries via ---sysroot during compile. This ensures that -rpath is not added for such -systems, since it is adding cross-compile paths to rpath which is not -correct when the binaries are run on real targets. - -Upstream-Status: Submitted [https://reviews.llvm.org/D119590] -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/CommonArgs.cpp | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp -index dbc91e427dfb..b2cbfca9898c 100644 ---- a/clang/lib/Driver/ToolChains/CommonArgs.cpp -+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp -@@ -648,6 +648,11 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args, - void tools::addOpenMPRuntimeSpecificRPath(const ToolChain &TC, - const ArgList &Args, - ArgStringList &CmdArgs) { -+ // OpenEmbedded/Yocto installs libomp.so into /usr/lib -+ // therefore using -rpath is not needed, on the contrary it adds -+ // paths from cross compiler install location which is not correct -+ if (TC.getTriple().getVendor() == llvm::Triple::OpenEmbedded) -+ return; - - if (Args.hasFlag(options::OPT_fopenmp_implicit_rpath, - options::OPT_fno_openmp_implicit_rpath, true)) { diff --git a/recipes-devtools/clang/clang/0035-compiler-rt-Enable-__int128-for-ppc32.patch b/recipes-devtools/clang/clang/0035-compiler-rt-Enable-__int128-for-ppc32.patch new file mode 100644 index 0000000..4eca309 --- /dev/null +++ b/recipes-devtools/clang/clang/0035-compiler-rt-Enable-__int128-for-ppc32.patch @@ -0,0 +1,58 @@ +From 8f8877d8b16a59ef308bc9ad7f77a2f645ee3af3 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 + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + compiler-rt/lib/builtins/CMakeLists.txt | 7 +++---- + compiler-rt/lib/builtins/int_types.h | 2 +- + 2 files changed, 4 insertions(+), 5 deletions(-) + +diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt +index ea5ad9cdb864..4d1efc690d71 100644 +--- a/compiler-rt/lib/builtins/CMakeLists.txt ++++ b/compiler-rt/lib/builtins/CMakeLists.txt +@@ -607,8 +607,6 @@ set(mips64_SOURCES ${GENERIC_TF_SOURCES} + set(mips64el_SOURCES ${GENERIC_TF_SOURCES} + ${mips_SOURCES}) + +-set(powerpc_SOURCES ${GENERIC_SOURCES}) +- + set(powerpcspe_SOURCES ${GENERIC_SOURCES}) + + set(powerpc64_SOURCES +@@ -634,6 +632,7 @@ if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "AIX") + ) + endif() + set(powerpc64le_SOURCES ${powerpc64_SOURCES}) ++set(powerpc_SOURCES ${powerpc64_SOURCES}) + + set(riscv_SOURCES + riscv/save.S +@@ -740,9 +739,9 @@ else () + list(APPEND BUILTIN_CFLAGS_${arch} -fomit-frame-pointer -DCOMPILER_RT_ARMHF_TARGET) + endif() + +- # For RISCV32, we must force enable int128 for compiling long ++ # For RISCV32/PPC32, we must force enable int128 for compiling long + # double routines. +- if("${arch}" STREQUAL "riscv32") ++ if("${arch}" STREQUAL "riscv32" OR "${arch}" STREQUAL "powerpc" ) + list(APPEND BUILTIN_CFLAGS_${arch} -fforce-enable-int128) + endif() + +diff --git a/compiler-rt/lib/builtins/int_types.h b/compiler-rt/lib/builtins/int_types.h +index 7a72de480676..9ee5a327b28a 100644 +--- a/compiler-rt/lib/builtins/int_types.h ++++ b/compiler-rt/lib/builtins/int_types.h +@@ -64,7 +64,7 @@ typedef union { + } udwords; + + #if defined(__LP64__) || defined(__wasm__) || defined(__mips64) || \ +- defined(__riscv) || defined(_WIN64) ++ defined(__riscv) || defined(_WIN64) || defined(__powerpc__) + #define CRT_HAS_128BIT + #endif + diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index b8489eb..aed7e32 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -17,34 +17,34 @@ SRC_URI = "\ file://0005-llvm-allow-env-override-of-exe-path.patch \ file://0006-clang-driver-Check-sysroot-for-ldso-path.patch \ file://0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch \ - file://0008-clang-musl-ppc-does-not-support-128-bit-long-double.patch \ - file://0009-clang-Prepend-trailing-to-sysroot.patch \ - file://0010-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch \ - file://0011-clang-Define-releative-gcc-installation-dir.patch \ - file://0012-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch \ - file://0013-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch \ - file://0014-Check-for-atomic-double-intrinsics.patch \ - file://0015-libcxx-Add-compiler-runtime-library-to-link-step-for.patch \ - file://0016-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch \ - file://0017-clang-Fix-resource-dir-location-for-cross-toolchains.patch \ - file://0018-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch \ - file://0019-clang-Use-python3-in-python-scripts.patch \ - file://0020-For-x86_64-set-Yocto-based-GCC-install-search-path.patch \ - file://0021-llvm-Do-not-use-find_library-for-ncurses.patch \ - file://0022-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch \ - file://0023-compiler-rt-Use-mcr-based-barrier-on-armv6.patch \ - file://0024-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch \ - file://0025-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch \ - file://0026-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch \ - file://0027-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch \ - file://0028-libunwind-Added-unw_backtrace-method.patch \ - file://0029-Do-not-force-thumb-mode-directive.patch \ - file://0030-clang-Do-not-use-install-relative-libc-headers.patch \ - file://0031-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch \ - file://0032-Fix-lib-paths-for-OpenEmbedded-Host.patch \ - file://0033-Correct-library-search-path-for-OpenEmbedded-Host.patch \ - file://0034-lldb-Link-with-libatomic-on-x86.patch \ - file://0035-clang-exclude-openembedded-distributions-from-settin.patch \ + file://0008-clang-Prepend-trailing-to-sysroot.patch \ + file://0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch \ + file://0010-clang-Define-releative-gcc-installation-dir.patch \ + file://0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch \ + file://0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch \ + file://0013-Check-for-atomic-double-intrinsics.patch \ + file://0014-libcxx-Add-compiler-runtime-library-to-link-step-for.patch \ + file://0015-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch \ + file://0016-clang-Fix-resource-dir-location-for-cross-toolchains.patch \ + file://0017-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch \ + file://0018-clang-Use-python3-in-python-scripts.patch \ + file://0019-For-x86_64-set-Yocto-based-GCC-install-search-path.patch \ + file://0020-llvm-Do-not-use-find_library-for-ncurses.patch \ + file://0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch \ + file://0022-compiler-rt-Use-mcr-based-barrier-on-armv6.patch \ + file://0023-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch \ + file://0024-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch \ + file://0025-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch \ + file://0026-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch \ + file://0027-libunwind-Added-unw_backtrace-method.patch \ + file://0028-Do-not-force-thumb-mode-directive.patch \ + file://0029-clang-Do-not-use-install-relative-libc-headers.patch \ + file://0030-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch \ + file://0031-Fix-lib-paths-for-OpenEmbedded-Host.patch \ + file://0032-Correct-library-search-path-for-OpenEmbedded-Host.patch \ + file://0033-lldb-Link-with-libatomic-on-x86.patch \ + file://0034-clang-exclude-openembedded-distributions-from-settin.patch \ + file://0035-compiler-rt-Enable-__int128-for-ppc32.patch \ " # Fallback to no-PIE if not set GCCPIE ??= "" -- cgit v1.2.3-54-g00ecf