From 275d0a5ed688886e907deb71e4ec6fd94fd24f91 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 27 Nov 2024 09:49:46 -0800 Subject: clang: Upgrade to 19.1.4 Signed-off-by: Khem Raj --- recipes-devtools/clang/clang-cross-canadian_git.bb | 2 +- recipes-devtools/clang/clang-cross_git.bb | 2 +- recipes-devtools/clang/clang-crosssdk_git.bb | 4 +- 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 +- ...allow-env-override-of-exe-and-libdir-path.patch | 2 +- ...-clang-driver-Check-sysroot-for-ldso-path.patch | 14 +-- ...iver-tools.cpp-Add-lssp_nonshared-on-musl.patch | 4 +- .../0008-clang-Prepend-trailing-to-sysroot.patch | 4 +- ...inside-the-target-sysroot-for-compiler-ru.patch | 2 +- ...ang-Define-releative-gcc-installation-dir.patch | 6 +- ...pthread-and-ldl-along-with-lunwind-for-st.patch | 2 +- ..._EXECUTABLE-when-cross-compiling-for-nati.patch | 2 +- .../0013-Check-for-atomic-double-intrinsics.patch | 2 +- ...configure-for-packages-using-find_package.patch | 115 +++++++++++++++++++++ ...compiler-runtime-library-to-link-step-for.patch | 37 ------- ...esource-dir-location-for-cross-toolchains.patch | 42 ++++++++ ...configure-for-packages-using-find_package.patch | 115 --------------------- ...esource-dir-location-for-cross-toolchains.patch | 42 -------- ...r-Add-dyld-prefix-when-checking-sysroot-f.patch | 79 ++++++++++++++ .../0017-clang-Use-python3-in-python-scripts.patch | 35 +++++++ ...r-Add-dyld-prefix-when-checking-sysroot-f.patch | 79 -------------- ...4-set-Yocto-based-GCC-install-search-path.patch | 70 +++++++++++++ .../0018-clang-Use-python3-in-python-scripts.patch | 35 ------- ...4-set-Yocto-based-GCC-install-search-path.patch | 70 ------------- ...-anchor-for-adding-OE-distro-vendor-names.patch | 32 ++++++ ...-Do-not-use-backtrace-APIs-on-non-glibc-l.patch | 68 ++++++++++++ ...-anchor-for-adding-OE-distro-vendor-names.patch | 32 ------ ...86-triple-for-non-debian-multiarch-linux-.patch | 28 +++++ ...-Do-not-use-backtrace-APIs-on-non-glibc-l.patch | 68 ------------ ...86-triple-for-non-debian-multiarch-linux-.patch | 28 ----- ...0022-libunwind-Added-unw_backtrace-method.patch | 56 ++++++++++ ...-Do-not-use-install-relative-libc-headers.patch | 34 ++++++ ...0023-libunwind-Added-unw_backtrace-method.patch | 56 ---------- .../0024-Fix-lib-paths-for-OpenEmbedded-Host.patch | 79 ++++++++++++++ ...-Do-not-use-install-relative-libc-headers.patch | 34 ------ ...library-search-path-for-OpenEmbedded-Host.patch | 84 +++++++++++++++ .../0025-Fix-lib-paths-for-OpenEmbedded-Host.patch | 79 -------------- ...library-search-path-for-OpenEmbedded-Host.patch | 84 --------------- .../0026-lldb-Link-with-libatomic-on-x86.patch | 33 ++++++ ...027-compiler-rt-Enable-__int128-for-ppc32.patch | 73 +++++++++++++ .../0027-lldb-Link-with-libatomic-on-x86.patch | 33 ------ ...028-compiler-rt-Enable-__int128-for-ppc32.patch | 73 ------------- ...-Do-not-use-cmake-infra-to-detect-libzstd.patch | 62 +++++++++++ ...ler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch | 44 ++++++++ ...-Do-not-use-cmake-infra-to-detect-libzstd.patch | 62 ----------- ...ler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch | 44 -------- ...-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch | 43 ++++++++ ...s-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch | 81 +++++++++++++++ ...-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch | 43 -------- ...s-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch | 81 --------------- ...vm-Add-OE-specific-ABI-triple-for-N32-ABI.patch | 78 ++++++++++++++ ...vm-Add-OE-specific-ABI-triple-for-N32-ABI.patch | 78 -------------- ...d-libunwind.pc.in-and-llvm-config-scripts.patch | 90 ++++++++++++++++ ...d-libunwind.pc.in-and-llvm-config-scripts.patch | 90 ---------------- ...py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch | 92 +++++++++++++++++ ...py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch | 92 ----------------- recipes-devtools/clang/clang_git.bb | 16 ++- recipes-devtools/clang/common.inc | 45 ++++---- .../clang/compiler-rt-sanitizers_git.bb | 15 +-- recipes-devtools/clang/compiler-rt_git.bb | 40 ++++--- recipes-devtools/clang/libclc_git.bb | 2 +- recipes-devtools/clang/libcxx_git.bb | 36 +++---- recipes-devtools/clang/nativesdk-clang-glue.bb | 2 +- recipes-devtools/clang/openmp_git.bb | 2 +- 68 files changed, 1429 insertions(+), 1458 deletions(-) create mode 100644 recipes-devtools/clang/clang/0014-cmake-Fix-configure-for-packages-using-find_package.patch delete 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-Fix-resource-dir-location-for-cross-toolchains.patch delete mode 100644 recipes-devtools/clang/clang/0015-cmake-Fix-configure-for-packages-using-find_package.patch delete mode 100644 recipes-devtools/clang/clang/0016-clang-Fix-resource-dir-location-for-cross-toolchains.patch create mode 100644 recipes-devtools/clang/clang/0016-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch create mode 100644 recipes-devtools/clang/clang/0017-clang-Use-python3-in-python-scripts.patch delete 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-For-x86_64-set-Yocto-based-GCC-install-search-path.patch delete mode 100644 recipes-devtools/clang/clang/0018-clang-Use-python3-in-python-scripts.patch delete mode 100644 recipes-devtools/clang/clang/0019-For-x86_64-set-Yocto-based-GCC-install-search-path.patch create mode 100644 recipes-devtools/clang/clang/0019-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch create mode 100644 recipes-devtools/clang/clang/0020-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch delete mode 100644 recipes-devtools/clang/clang/0020-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch create mode 100644 recipes-devtools/clang/clang/0021-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch delete mode 100644 recipes-devtools/clang/clang/0021-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch delete mode 100644 recipes-devtools/clang/clang/0022-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch create mode 100644 recipes-devtools/clang/clang/0022-libunwind-Added-unw_backtrace-method.patch create mode 100644 recipes-devtools/clang/clang/0023-clang-Do-not-use-install-relative-libc-headers.patch delete mode 100644 recipes-devtools/clang/clang/0023-libunwind-Added-unw_backtrace-method.patch create mode 100644 recipes-devtools/clang/clang/0024-Fix-lib-paths-for-OpenEmbedded-Host.patch delete mode 100644 recipes-devtools/clang/clang/0024-clang-Do-not-use-install-relative-libc-headers.patch create mode 100644 recipes-devtools/clang/clang/0025-Correct-library-search-path-for-OpenEmbedded-Host.patch delete mode 100644 recipes-devtools/clang/clang/0025-Fix-lib-paths-for-OpenEmbedded-Host.patch delete mode 100644 recipes-devtools/clang/clang/0026-Correct-library-search-path-for-OpenEmbedded-Host.patch create mode 100644 recipes-devtools/clang/clang/0026-lldb-Link-with-libatomic-on-x86.patch create mode 100644 recipes-devtools/clang/clang/0027-compiler-rt-Enable-__int128-for-ppc32.patch delete mode 100644 recipes-devtools/clang/clang/0027-lldb-Link-with-libatomic-on-x86.patch delete mode 100644 recipes-devtools/clang/clang/0028-compiler-rt-Enable-__int128-for-ppc32.patch create mode 100644 recipes-devtools/clang/clang/0028-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch create mode 100644 recipes-devtools/clang/clang/0029-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch delete mode 100644 recipes-devtools/clang/clang/0029-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch delete mode 100644 recipes-devtools/clang/clang/0030-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch create mode 100644 recipes-devtools/clang/clang/0030-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch create mode 100644 recipes-devtools/clang/clang/0031-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch delete mode 100644 recipes-devtools/clang/clang/0031-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch delete mode 100644 recipes-devtools/clang/clang/0032-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch create mode 100644 recipes-devtools/clang/clang/0032-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch delete mode 100644 recipes-devtools/clang/clang/0033-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch create mode 100644 recipes-devtools/clang/clang/0033-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch delete mode 100644 recipes-devtools/clang/clang/0034-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch create mode 100644 recipes-devtools/clang/clang/0034-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch delete mode 100644 recipes-devtools/clang/clang/0035-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch (limited to 'recipes-devtools') diff --git a/recipes-devtools/clang/clang-cross-canadian_git.bb b/recipes-devtools/clang/clang-cross-canadian_git.bb index 33c33c4..f327a12 100644 --- a/recipes-devtools/clang/clang-cross-canadian_git.bb +++ b/recipes-devtools/clang/clang-cross-canadian_git.bb @@ -1,7 +1,7 @@ # Copyright (C) 2014 Khem Raj # Released under the MIT license (see COPYING.MIT for the terms) -DESCRIPTION = "Clang/LLVM based C/C++ compiler (cross-canadian for ${TARGET_ARCH} target)" +SUMMARY = "Clang/LLVM based C/C++ compiler (cross-canadian for ${TARGET_ARCH} target)" HOMEPAGE = "http://clang.llvm.org/" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab" SECTION = "devel" diff --git a/recipes-devtools/clang/clang-cross_git.bb b/recipes-devtools/clang/clang-cross_git.bb index 8aee5cd..a0c215e 100644 --- a/recipes-devtools/clang/clang-cross_git.bb +++ b/recipes-devtools/clang/clang-cross_git.bb @@ -1,7 +1,7 @@ # Copyright (C) 2014 Khem Raj # Released under the MIT license (see COPYING.MIT for the terms) -DESCRIPTION = "Cross compiler wrappers for LLVM based C/C++ compiler" +SUMMARY = "Cross compiler wrappers for LLVM based C/C++ compiler" HOMEPAGE = "http://clang.llvm.org/" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab" SECTION = "devel" diff --git a/recipes-devtools/clang/clang-crosssdk_git.bb b/recipes-devtools/clang/clang-crosssdk_git.bb index fb8bee5..913c49a 100644 --- a/recipes-devtools/clang/clang-crosssdk_git.bb +++ b/recipes-devtools/clang/clang-crosssdk_git.bb @@ -1,12 +1,12 @@ # Copyright (C) 2014 Khem Raj # Released under the MIT license (see COPYING.MIT for the terms) -DESCRIPTION = "SDK Cross compiler wrappers for LLVM based C/C++ compiler" +SUMMARY = "SDK Cross compiler wrappers for LLVM based C/C++ compiler" HOMEPAGE = "http://clang.llvm.org/" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab" SECTION = "devel" -PN = "clang-crosssdk-${TARGET_ARCH}" +PN = "clang-crosssdk-${SDK_SYS}" require clang.inc require common-source.inc diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc index 3604273..0c9bc0e 100644 --- a/recipes-devtools/clang/clang.inc +++ b/recipes-devtools/clang/clang.inc @@ -5,7 +5,7 @@ LLVM_HTTP ?= "https://github.com/llvm" MAJOR_VER = "19" MINOR_VER = "1" -PATCH_VER = "2" +PATCH_VER = "4" # could be 'rcX' or 'git' or empty ( for release ) VER_SUFFIX = "" 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 97397d9..f2cc81e 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 78c27664e7ffee1bc7a8beff604860ea194e27a5 Mon Sep 17 00:00:00 2001 +From 1ae8003c398cb280038301697860ef5769687648 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 95bee5b..e8981b8 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 1b0fd972d7cd2d78061bcf874c177969b19eeaab Mon Sep 17 00:00:00 2001 +From c0462b384da7a882ea924ea47476c3cb49feae46 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 37321a9..0cf0a89 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 11d8cadd76aaf434556eeb9f42ee794ca72802a4 Mon Sep 17 00:00:00 2001 +From 4f2e69944e8a42da9bd1f7d49399dc3d0fad4859 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 ac4edbb..8d8995b 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 7791c1c014b5d2f86142a87a0ede3ad1dc9aea46 Mon Sep 17 00:00:00 2001 +From 0d94f6e299bfa76da9be6451d9e759bc3f6d08a7 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-and-libdir-path.patch b/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch index c5f4147..f767780 100644 --- a/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch +++ b/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch @@ -1,4 +1,4 @@ -From 347fa4394fc2f70ce199ef6edee17d19d64bf74a Mon Sep 17 00:00:00 2001 +From 754c5869819c2dd008786a191f06385e6b97e19b Mon Sep 17 00:00:00 2001 From: Martin Kelly Date: Fri, 19 May 2017 00:22:57 -0700 Subject: [PATCH] llvm: allow env override of exe and libdir path diff --git a/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 24e64b0..9a4621b 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 ff55b613cb917ba96e30ff5c0a09942e52beea7e Mon Sep 17 00:00:00 2001 +From df4c35c458e7f0b752e76500316ce3ab7583dd5b 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 @@ -15,11 +15,11 @@ Signed-off-by: Khem Raj 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 2265138edbff..4067f7560140 100644 +index 35bf39069605..e4f593e462d6 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -510,7 +510,11 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { - Triple.getEnvironment() == llvm::Triple::GNUEABIHF || +@@ -511,7 +511,11 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + Triple.getEnvironment() == llvm::Triple::GNUEABIHFT64 || tools::arm::getARMFloatABI(*this, Args) == tools::arm::FloatABI::Hard; - LibDir = "lib"; @@ -31,7 +31,7 @@ index 2265138edbff..4067f7560140 100644 Loader = HF ? "ld-linux-armhf.so.3" : "ld-linux.so.3"; break; } -@@ -565,11 +569,19 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -566,11 +570,19 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { LibDir = "lib64"; Loader = (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1"; @@ -51,7 +51,7 @@ index 2265138edbff..4067f7560140 100644 break; case llvm::Triple::riscv32: case llvm::Triple::riscv64: { -@@ -587,6 +599,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -588,6 +600,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { case llvm::Triple::sparcv9: LibDir = "lib64"; Loader = "ld-linux.so.2"; @@ -62,7 +62,7 @@ index 2265138edbff..4067f7560140 100644 break; case llvm::Triple::systemz: LibDir = "lib"; -@@ -601,6 +617,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -602,6 +618,10 @@ 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"; 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 bf5a101..fc46b3c 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 db1a59d2537f4d843d51e0a628b8d9596fa3e1d1 Mon Sep 17 00:00:00 2001 +From 7875b568926bbec5b7e3312c55991723c917493e 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 @@ -14,7 +14,7 @@ Signed-off-by: Khem Raj 1 file changed, 6 insertions(+) diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 543f3965dfd4..668b56db37c6 100644 +index 5e9a655eaf82..3e301f2e1d95 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp @@ -632,6 +632,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, 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 index 8f6779f..f21be08 100644 --- a/recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch +++ b/recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch @@ -1,4 +1,4 @@ -From 58b2cb10360b5188be51c1f535412d7fef3c1fef Mon Sep 17 00:00:00 2001 +From 84c1650cac223a4578eb43c905fdfb30b617274e 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 @@ -25,7 +25,7 @@ Signed-off-by: Khem Raj 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 4067f7560140..d4b26fc986d9 100644 +index e4f593e462d6..720bc136528b 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp @@ -222,7 +222,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) 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 index d24d807..2ee776b 100644 --- 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 @@ -1,4 +1,4 @@ -From b54a26dfbdef65bc829779cc84e937fe850e777e Mon Sep 17 00:00:00 2001 +From 4584c7048d003b239593ad66162437ffd669c220 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 16 Mar 2017 19:06:26 -0700 Subject: [PATCH] clang: Look inside the target sysroot for compiler runtime diff --git a/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 index 1b902d8..c897808 100644 --- 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 @@ -1,4 +1,4 @@ -From faf6d96205dad549a7d8214774927f320e3689b0 Mon Sep 17 00:00:00 2001 +From c86ed165440802158757582df52f848cad3c0e57 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 @@ -15,10 +15,10 @@ Signed-off-by: Khem Raj 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 668b56db37c6..e6961b023b5a 100644 +index 3e301f2e1d95..89ffc429d059 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2916,19 +2916,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( +@@ -2918,19 +2918,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( // Whether this library suffix is relevant for the triple. bool Active; } Suffixes[] = { 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 index d4d6b23..b5712d6 100644 --- 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 @@ -1,4 +1,4 @@ -From 7c8bd8b6aeb817bd313517b00a2a54ed187986cf Mon Sep 17 00:00:00 2001 +From 08b05e4e835b6cb73c844e300dcc4eb4919d8154 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 31 Jul 2019 22:51:39 -0700 Subject: [PATCH] clang: Add -lpthread and -ldl along with -lunwind for static diff --git a/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 index acf6921..2086e0a 100644 --- 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 @@ -1,4 +1,4 @@ -From 4af5f0a010f3a7c3af40110b8d049486baa8b647 Mon Sep 17 00:00:00 2001 +From 322385b4a6109f3f53c3679d7a276ec0084dd7b6 Mon Sep 17 00:00:00 2001 From: Anuj Mittal Date: Thu, 26 Dec 2019 12:56:16 -0800 Subject: [PATCH] Pass PYTHON_EXECUTABLE when cross compiling for native build diff --git a/recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch b/recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch index 43665bd..6db24a9 100644 --- a/recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch +++ b/recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch @@ -1,4 +1,4 @@ -From 23cf856d4896656d1625f7ed96c3b33aabc91cdc Mon Sep 17 00:00:00 2001 +From 2f41e0721f964677e8876b2c2f540836f426c83f Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 18 Nov 2019 17:00:29 -0800 Subject: [PATCH] Check for atomic intrinsics diff --git a/recipes-devtools/clang/clang/0014-cmake-Fix-configure-for-packages-using-find_package.patch b/recipes-devtools/clang/clang/0014-cmake-Fix-configure-for-packages-using-find_package.patch new file mode 100644 index 0000000..5e9eb01 --- /dev/null +++ b/recipes-devtools/clang/clang/0014-cmake-Fix-configure-for-packages-using-find_package.patch @@ -0,0 +1,115 @@ +From 6c4f71af6a8c5c0e9261cd20522ecf8d1cdb9e48 Mon Sep 17 00:00:00 2001 +From: Ovidiu Panait +Date: Fri, 31 Jan 2020 10:56:11 +0200 +Subject: [PATCH] cmake: Fix configure for packages using find_package() + +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: Inappropriate [oe-specific] + +Signed-off-by: Ovidiu Panait +--- + clang/cmake/modules/AddClang.cmake | 2 -- + llvm/cmake/modules/AddLLVM.cmake | 7 +------ + llvm/cmake/modules/TableGen.cmake | 6 ------ + 3 files changed, 1 insertion(+), 14 deletions(-) + +diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake +index 9d09be193684..d6123b834337 100644 +--- a/clang/cmake/modules/AddClang.cmake ++++ b/clang/cmake/modules/AddClang.cmake +@@ -169,7 +169,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}) + +@@ -178,7 +177,6 @@ macro(add_clang_tool name) + DEPENDS ${name} + COMPONENT ${name}) + endif() +- set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS ${name}) + endif() + endif() + endmacro() +diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake +index 03f4e1f190fd..6335ab262d19 100644 +--- a/llvm/cmake/modules/AddLLVM.cmake ++++ b/llvm/cmake/modules/AddLLVM.cmake +@@ -1435,7 +1435,6 @@ macro(llvm_add_tool project name) + if( LLVM_BUILD_TOOLS ) + get_target_export_arg(${name} LLVM export_to_llvmexports) + install(TARGETS ${name} +- ${export_to_llvmexports} + RUNTIME DESTINATION ${${project}_TOOLS_INSTALL_DIR} + COMPONENT ${name}) + +@@ -1446,9 +1445,7 @@ macro(llvm_add_tool project name) + endif() + endif() + endif() +- if( LLVM_BUILD_TOOLS ) +- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) +- endif() ++ set_target_properties(${name} PROPERTIES FOLDER "Tools") + endif() + get_subproject_title(subproject_title) + set_target_properties(${name} PROPERTIES FOLDER "${subproject_title}/Tools") +@@ -1497,7 +1494,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}) + +@@ -1506,7 +1502,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 ffcc718b4777..a76f28e74b86 100644 +--- a/llvm/cmake/modules/TableGen.cmake ++++ b/llvm/cmake/modules/TableGen.cmake +@@ -232,12 +232,7 @@ macro(add_tablegen target project) + + if (ADD_TABLEGEN_DESTINATION AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND + (LLVM_BUILD_UTILS OR ${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS)) +- set(export_arg) +- if(ADD_TABLEGEN_EXPORT) +- get_target_export_arg(${target} ${ADD_TABLEGEN_EXPORT} export_arg) +- endif() + install(TARGETS ${target} +- ${export_arg} + COMPONENT ${target} + RUNTIME DESTINATION "${ADD_TABLEGEN_DESTINATION}") + if(NOT LLVM_ENABLE_IDE) +@@ -248,6 +243,5 @@ macro(add_tablegen target project) + endif() + if(ADD_TABLEGEN_EXPORT) + string(TOUPPER ${ADD_TABLEGEN_EXPORT} export_upper) +- set_property(GLOBAL APPEND PROPERTY ${export_upper}_EXPORTS ${target}) + endif() + endmacro() 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 deleted file mode 100644 index f57f459..0000000 --- a/recipes-devtools/clang/clang/0014-libcxx-Add-compiler-runtime-library-to-link-step-for.patch +++ /dev/null @@ -1,37 +0,0 @@ -From cd5e6c265165b4aa31d211ee961c9e0218dee7e1 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 0dfc9647558d..08ddad95a42e 100644 ---- a/libcxx/src/CMakeLists.txt -+++ b/libcxx/src/CMakeLists.txt -@@ -200,7 +200,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 libcxx-libc-shared -- PRIVATE ${LIBCXX_LIBRARIES}) -+ PRIVATE ${LIBCXX_LIBRARIES} "$$($$CC --print-libgcc-file-name)") - set_target_properties(cxx_shared - PROPERTIES - COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}" -@@ -293,7 +293,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 libcxx-libc-static -- PRIVATE ${LIBCXX_LIBRARIES} -+ PRIVATE ${LIBCXX_LIBRARIES} "$$($$CC --print-libgcc-file-name)" - PRIVATE libcxx-abi-static) - set_target_properties(cxx_static - PROPERTIES diff --git a/recipes-devtools/clang/clang/0015-clang-Fix-resource-dir-location-for-cross-toolchains.patch b/recipes-devtools/clang/clang/0015-clang-Fix-resource-dir-location-for-cross-toolchains.patch new file mode 100644 index 0000000..74ddbef --- /dev/null +++ b/recipes-devtools/clang/clang/0015-clang-Fix-resource-dir-location-for-cross-toolchains.patch @@ -0,0 +1,42 @@ +From 11fce59f48e7d15d9b16509146484d60a04f25e9 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. + +Upstream-Status: Pending +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 ecae475f75da..ca6c8c98961f 100644 +--- a/clang/lib/Driver/Driver.cpp ++++ b/clang/lib/Driver/Driver.cpp +@@ -189,9 +189,15 @@ 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)); + // This search path is also created in the COFF driver of lld, so any + // changes here also needs to happen in lld/COFF/Driver.cpp ++ ++ // 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, CLANG_INSTALL_LIBDIR_BASENAME, "clang", + CLANG_VERSION_MAJOR_STRING); + } diff --git a/recipes-devtools/clang/clang/0015-cmake-Fix-configure-for-packages-using-find_package.patch b/recipes-devtools/clang/clang/0015-cmake-Fix-configure-for-packages-using-find_package.patch deleted file mode 100644 index 51fde02..0000000 --- a/recipes-devtools/clang/clang/0015-cmake-Fix-configure-for-packages-using-find_package.patch +++ /dev/null @@ -1,115 +0,0 @@ -From e741dc89b9322dbdb7c2cb1cd1ea1d4819c1c3d5 Mon Sep 17 00:00:00 2001 -From: Ovidiu Panait -Date: Fri, 31 Jan 2020 10:56:11 +0200 -Subject: [PATCH] cmake: Fix configure for packages using find_package() - -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: Inappropriate [oe-specific] - -Signed-off-by: Ovidiu Panait ---- - clang/cmake/modules/AddClang.cmake | 2 -- - llvm/cmake/modules/AddLLVM.cmake | 7 +------ - llvm/cmake/modules/TableGen.cmake | 6 ------ - 3 files changed, 1 insertion(+), 14 deletions(-) - -diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake -index 9d09be193684..d6123b834337 100644 ---- a/clang/cmake/modules/AddClang.cmake -+++ b/clang/cmake/modules/AddClang.cmake -@@ -169,7 +169,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}) - -@@ -178,7 +177,6 @@ macro(add_clang_tool name) - DEPENDS ${name} - COMPONENT ${name}) - endif() -- set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS ${name}) - endif() - endif() - endmacro() -diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake -index 03f4e1f190fd..6335ab262d19 100644 ---- a/llvm/cmake/modules/AddLLVM.cmake -+++ b/llvm/cmake/modules/AddLLVM.cmake -@@ -1435,7 +1435,6 @@ macro(llvm_add_tool project name) - if( LLVM_BUILD_TOOLS ) - get_target_export_arg(${name} LLVM export_to_llvmexports) - install(TARGETS ${name} -- ${export_to_llvmexports} - RUNTIME DESTINATION ${${project}_TOOLS_INSTALL_DIR} - COMPONENT ${name}) - -@@ -1446,9 +1445,7 @@ macro(llvm_add_tool project name) - endif() - endif() - endif() -- if( LLVM_BUILD_TOOLS ) -- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) -- endif() -+ set_target_properties(${name} PROPERTIES FOLDER "Tools") - endif() - get_subproject_title(subproject_title) - set_target_properties(${name} PROPERTIES FOLDER "${subproject_title}/Tools") -@@ -1497,7 +1494,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}) - -@@ -1506,7 +1502,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 ffcc718b4777..a76f28e74b86 100644 ---- a/llvm/cmake/modules/TableGen.cmake -+++ b/llvm/cmake/modules/TableGen.cmake -@@ -232,12 +232,7 @@ macro(add_tablegen target project) - - if (ADD_TABLEGEN_DESTINATION AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND - (LLVM_BUILD_UTILS OR ${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS)) -- set(export_arg) -- if(ADD_TABLEGEN_EXPORT) -- get_target_export_arg(${target} ${ADD_TABLEGEN_EXPORT} export_arg) -- endif() - install(TARGETS ${target} -- ${export_arg} - COMPONENT ${target} - RUNTIME DESTINATION "${ADD_TABLEGEN_DESTINATION}") - if(NOT LLVM_ENABLE_IDE) -@@ -248,6 +243,5 @@ macro(add_tablegen target project) - endif() - if(ADD_TABLEGEN_EXPORT) - string(TOUPPER ${ADD_TABLEGEN_EXPORT} export_upper) -- set_property(GLOBAL APPEND PROPERTY ${export_upper}_EXPORTS ${target}) - endif() - endmacro() 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 deleted file mode 100644 index 5e5fcad..0000000 --- a/recipes-devtools/clang/clang/0016-clang-Fix-resource-dir-location-for-cross-toolchains.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 0550bd3df8005a96da53eb5d746b8ef0001618bd 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. - -Upstream-Status: Pending -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 8e44d5afa40e..b3eaf45fded9 100644 ---- a/clang/lib/Driver/Driver.cpp -+++ b/clang/lib/Driver/Driver.cpp -@@ -189,9 +189,15 @@ 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)); - // This search path is also created in the COFF driver of lld, so any - // changes here also needs to happen in lld/COFF/Driver.cpp -+ -+ // 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, CLANG_INSTALL_LIBDIR_BASENAME, "clang", - CLANG_VERSION_MAJOR_STRING); - } diff --git a/recipes-devtools/clang/clang/0016-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch b/recipes-devtools/clang/clang/0016-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch new file mode 100644 index 0000000..7b130e9 --- /dev/null +++ b/recipes-devtools/clang/clang/0016-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch @@ -0,0 +1,79 @@ +From ed293c1fb5888f6ffe091f7276a7897e1a239c01 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. + +Upstream-Status: Pending +Signed-off-by: Oleksandr Ocheretnyi +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Linux.cpp | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index 720bc136528b..b3a399187ec3 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -512,8 +512,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + tools::arm::getARMFloatABI(*this, Args) == tools::arm::FloatABI::Hard; + + LibDir = "lib32"; +- 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"; + } + Loader = HF ? "ld-linux-armhf.so.3" : "ld-linux.so.3"; +@@ -570,8 +570,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; +@@ -579,8 +579,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; +@@ -600,8 +600,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; +@@ -618,8 +618,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/0017-clang-Use-python3-in-python-scripts.patch b/recipes-devtools/clang/clang/0017-clang-Use-python3-in-python-scripts.patch new file mode 100644 index 0000000..2631ba7 --- /dev/null +++ b/recipes-devtools/clang/clang/0017-clang-Use-python3-in-python-scripts.patch @@ -0,0 +1,35 @@ +From 42acc8d6b252851b3f3cdae08bd9e1ed5a9c8935 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/scan-view/bin/scan-view | 2 +- + 2 files changed, 2 insertions(+), 2 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 471dbf8c110b..f98385dc6651 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/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view +index d01aebb4029a..f3375804654d 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/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 deleted file mode 100644 index 814e380..0000000 --- a/recipes-devtools/clang/clang/0017-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 8ca37b3df79ebba94e028f6f665fd938d458e4d8 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. - -Upstream-Status: Pending -Signed-off-by: Oleksandr Ocheretnyi -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Linux.cpp | 20 ++++++++++---------- - 1 file changed, 10 insertions(+), 10 deletions(-) - -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index d4b26fc986d9..9149a4baa564 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -511,8 +511,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { - tools::arm::getARMFloatABI(*this, Args) == tools::arm::FloatABI::Hard; - - LibDir = "lib32"; -- 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"; - } - Loader = HF ? "ld-linux-armhf.so.3" : "ld-linux.so.3"; -@@ -569,8 +569,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; -@@ -578,8 +578,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; -@@ -599,8 +599,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; -@@ -617,8 +617,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-For-x86_64-set-Yocto-based-GCC-install-search-path.patch b/recipes-devtools/clang/clang/0018-For-x86_64-set-Yocto-based-GCC-install-search-path.patch new file mode 100644 index 0000000..5970565 --- /dev/null +++ b/recipes-devtools/clang/clang/0018-For-x86_64-set-Yocto-based-GCC-install-search-path.patch @@ -0,0 +1,70 @@ +From 1acea10c68785c42d625618d5cf120e4f19138f2 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_distro_vendor() + +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 89ffc429d059..e05dd30c3f89 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2498,6 +2498,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( + "x86_64-pc-linux-gnu", "x86_64-redhat-linux6E", + "x86_64-redhat-linux", "x86_64-suse-linux", + "x86_64-manbo-linux-gnu", "x86_64-slackware-linux", ++ "x86_64-oe-linux",//CLANG_EXTRA_OE_VENDORS_TRIPLES + "x86_64-unknown-linux", "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/0018-clang-Use-python3-in-python-scripts.patch b/recipes-devtools/clang/clang/0018-clang-Use-python3-in-python-scripts.patch deleted file mode 100644 index 8932c33..0000000 --- a/recipes-devtools/clang/clang/0018-clang-Use-python3-in-python-scripts.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 288b38525494bd975ae408f178803be1a482f4b5 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/scan-view/bin/scan-view | 2 +- - 2 files changed, 2 insertions(+), 2 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 471dbf8c110b..f98385dc6651 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/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view -index d01aebb4029a..f3375804654d 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/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 deleted file mode 100644 index 8a96504..0000000 --- a/recipes-devtools/clang/clang/0019-For-x86_64-set-Yocto-based-GCC-install-search-path.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 2f718eb848503fb74e9ef403346d79240300fb43 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_distro_vendor() - -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 e6961b023b5a..aa7bf4a2455f 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2498,6 +2498,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( - "x86_64-pc-linux-gnu", "x86_64-redhat-linux6E", - "x86_64-redhat-linux", "x86_64-suse-linux", - "x86_64-manbo-linux-gnu", "x86_64-slackware-linux", -+ "x86_64-oe-linux",//CLANG_EXTRA_OE_VENDORS_TRIPLES - "x86_64-unknown-linux", "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-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch b/recipes-devtools/clang/clang/0019-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch new file mode 100644 index 0000000..06b8ffd --- /dev/null +++ b/recipes-devtools/clang/clang/0019-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch @@ -0,0 +1,32 @@ +From a1ae883e90cb9554e10d24277a955fb0660e85a1 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_distro_vendor() + +Upstream-Status: Inappropriate [OE-specific] + +Signed-off-by: Khem Raj +Signed-off-by: Martin Jansa +--- + llvm/lib/TargetParser/Triple.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/llvm/lib/TargetParser/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp +index 21d6c74b5956..32adf92c47bf 100644 +--- a/llvm/lib/TargetParser/Triple.cpp ++++ b/llvm/lib/TargetParser/Triple.cpp +@@ -639,7 +639,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/0020-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch b/recipes-devtools/clang/clang/0020-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch new file mode 100644 index 0000000..5b17a7a --- /dev/null +++ b/recipes-devtools/clang/clang/0020-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch @@ -0,0 +1,68 @@ +From 11ef637da77e0fd115211f42665c2ed533f921a5 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/0020-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch b/recipes-devtools/clang/clang/0020-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch deleted file mode 100644 index 5dc1caf..0000000 --- a/recipes-devtools/clang/clang/0020-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch +++ /dev/null @@ -1,32 +0,0 @@ -From b6c5146b473da03699ca79c170828f706508d3c0 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_distro_vendor() - -Upstream-Status: Inappropriate [OE-specific] - -Signed-off-by: Khem Raj -Signed-off-by: Martin Jansa ---- - llvm/lib/TargetParser/Triple.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/llvm/lib/TargetParser/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp -index bf89aace65e5..fb9cbeb30351 100644 ---- a/llvm/lib/TargetParser/Triple.cpp -+++ b/llvm/lib/TargetParser/Triple.cpp -@@ -636,7 +636,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/0021-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch b/recipes-devtools/clang/clang/0021-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch new file mode 100644 index 0000000..b33a9f4 --- /dev/null +++ b/recipes-devtools/clang/clang/0021-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch @@ -0,0 +1,28 @@ +From 9a336eeaa8f8d62057802a98e249df695befa6b6 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 + +Upstream-Status: Pending +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 b3a399187ec3..f39c771798a8 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -715,6 +715,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/0021-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch b/recipes-devtools/clang/clang/0021-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch deleted file mode 100644 index c75bb39..0000000 --- a/recipes-devtools/clang/clang/0021-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch +++ /dev/null @@ -1,68 +0,0 @@ -From e273afe387d91a3710117bf3e8f0132cfd2ec3a1 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/0022-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch b/recipes-devtools/clang/clang/0022-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch deleted file mode 100644 index 63ac9f8..0000000 --- a/recipes-devtools/clang/clang/0022-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 717710718d5b87551f3662d7e5e534599c1c0d87 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 - -Upstream-Status: Pending -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 9149a4baa564..cdea589eb226 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -714,6 +714,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/0022-libunwind-Added-unw_backtrace-method.patch b/recipes-devtools/clang/clang/0022-libunwind-Added-unw_backtrace-method.patch new file mode 100644 index 0000000..77cbc1c --- /dev/null +++ b/recipes-devtools/clang/clang/0022-libunwind-Added-unw_backtrace-method.patch @@ -0,0 +1,56 @@ +From 01500348e14ae9fa8272f00c2a99ac6e153f5f8e 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 | 20 ++++++++++++++++++++ + 2 files changed, 21 insertions(+) + +diff --git a/libunwind/include/libunwind.h b/libunwind/include/libunwind.h +index b2dae8feed9a..0ab974c9bfa4 100644 +--- a/libunwind/include/libunwind.h ++++ b/libunwind/include/libunwind.h +@@ -130,6 +130,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 cf39ec5f7dbd..1896f20d57f8 100644 +--- a/libunwind/src/libunwind.cpp ++++ b/libunwind/src/libunwind.cpp +@@ -431,6 +431,26 @@ int __unw_remove_find_dynamic_unwind_sections( + + #endif // __APPLE__ + ++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 + #include diff --git a/recipes-devtools/clang/clang/0023-clang-Do-not-use-install-relative-libc-headers.patch b/recipes-devtools/clang/clang/0023-clang-Do-not-use-install-relative-libc-headers.patch new file mode 100644 index 0000000..bac9d10 --- /dev/null +++ b/recipes-devtools/clang/clang/0023-clang-Do-not-use-install-relative-libc-headers.patch @@ -0,0 +1,34 @@ +From 081655795d08178e20bcfbaef5dab4a97230f095 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 | 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 e05dd30c3f89..d9efd09d9da6 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -3316,8 +3316,11 @@ Generic_GCC::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, + // incompatible with the NDK libraries. + SmallString<128> DriverIncludeDir(getDriver().Dir); + llvm::sys::path::append(DriverIncludeDir, "..", "include"); ++ ++ // do not add it when --sysroot is specified, since it would expect ++ // libc++ headers from sysroot and not relative to compiler install location + if (AddIncludePath(DriverIncludeDir, +- /*TargetDirRequired=*/getTriple().isAndroid())) ++ /*TargetDirRequired=*/getTriple().isAndroid() | !computeSysRoot().empty())) + return; + // If this is a development, non-installed, clang, libcxx will + // not be found at ../include/c++ but it likely to be found at diff --git a/recipes-devtools/clang/clang/0023-libunwind-Added-unw_backtrace-method.patch b/recipes-devtools/clang/clang/0023-libunwind-Added-unw_backtrace-method.patch deleted file mode 100644 index 95a3e9b..0000000 --- a/recipes-devtools/clang/clang/0023-libunwind-Added-unw_backtrace-method.patch +++ /dev/null @@ -1,56 +0,0 @@ -From e1c5aa4cf7f4816d8c91d665ec536a3da039288d 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 | 20 ++++++++++++++++++++ - 2 files changed, 21 insertions(+) - -diff --git a/libunwind/include/libunwind.h b/libunwind/include/libunwind.h -index b2dae8feed9a..0ab974c9bfa4 100644 ---- a/libunwind/include/libunwind.h -+++ b/libunwind/include/libunwind.h -@@ -130,6 +130,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 cf39ec5f7dbd..1896f20d57f8 100644 ---- a/libunwind/src/libunwind.cpp -+++ b/libunwind/src/libunwind.cpp -@@ -431,6 +431,26 @@ int __unw_remove_find_dynamic_unwind_sections( - - #endif // __APPLE__ - -+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 - #include diff --git a/recipes-devtools/clang/clang/0024-Fix-lib-paths-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0024-Fix-lib-paths-for-OpenEmbedded-Host.patch new file mode 100644 index 0000000..617113d --- /dev/null +++ b/recipes-devtools/clang/clang/0024-Fix-lib-paths-for-OpenEmbedded-Host.patch @@ -0,0 +1,79 @@ +From 68007800df2e080d799670378c7ec9d667c7e782 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 d9efd09d9da6..4ec4976a6a0c 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -19,6 +19,7 @@ + #include "Linux.h" + #include "clang/Config/config.h" // for GCC_INSTALL_PREFIX + #include "clang/Driver/Compilation.h" ++#include "clang/Driver/Distro.h" + #include "clang/Driver/Driver.h" + #include "clang/Driver/DriverDiagnostic.h" + #include "clang/Driver/MultilibBuilder.h" +@@ -2908,6 +2909,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 { +@@ -2925,7 +2927,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/0024-clang-Do-not-use-install-relative-libc-headers.patch b/recipes-devtools/clang/clang/0024-clang-Do-not-use-install-relative-libc-headers.patch deleted file mode 100644 index b6943d1..0000000 --- a/recipes-devtools/clang/clang/0024-clang-Do-not-use-install-relative-libc-headers.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 87678f207e6619d0d810124104f548fe18fb64e2 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 | 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 aa7bf4a2455f..822a550de2a5 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -3314,8 +3314,11 @@ Generic_GCC::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, - // incompatible with the NDK libraries. - SmallString<128> DriverIncludeDir(getDriver().Dir); - llvm::sys::path::append(DriverIncludeDir, "..", "include"); -+ -+ // do not add it when --sysroot is specified, since it would expect -+ // libc++ headers from sysroot and not relative to compiler install location - if (AddIncludePath(DriverIncludeDir, -- /*TargetDirRequired=*/getTriple().isAndroid())) -+ /*TargetDirRequired=*/getTriple().isAndroid() | !computeSysRoot().empty())) - return; - // If this is a development, non-installed, clang, libcxx will - // not be found at ../include/c++ but it likely to be found at diff --git a/recipes-devtools/clang/clang/0025-Correct-library-search-path-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0025-Correct-library-search-path-for-OpenEmbedded-Host.patch new file mode 100644 index 0000000..11dc196 --- /dev/null +++ b/recipes-devtools/clang/clang/0025-Correct-library-search-path-for-OpenEmbedded-Host.patch @@ -0,0 +1,84 @@ +From 65e12e7671888531d657e0484aa0397e7e98b134 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 1404e1686848..90940e4a0bac 100644 +--- a/clang/include/clang/Driver/Distro.h ++++ b/clang/include/clang/Driver/Distro.h +@@ -45,6 +45,7 @@ public: + RHEL7, + Fedora, + Gentoo, ++ //CLANG_EXTRA_OE_DISTRO_NAME + OpenSUSE, + UbuntuHardy, + UbuntuIntrepid, +@@ -138,6 +139,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 6f49e641104c..63b9ff30f0b6 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 f39c771798a8..9af52769b09a 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -82,6 +82,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/0025-Fix-lib-paths-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0025-Fix-lib-paths-for-OpenEmbedded-Host.patch deleted file mode 100644 index 4b2f0ce..0000000 --- a/recipes-devtools/clang/clang/0025-Fix-lib-paths-for-OpenEmbedded-Host.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 9fb0dd90e8b840117f7639ba1f0d5e0d99c12c89 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 822a550de2a5..f081a778cfe9 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -19,6 +19,7 @@ - #include "Linux.h" - #include "clang/Config/config.h" // for GCC_INSTALL_PREFIX - #include "clang/Driver/Compilation.h" -+#include "clang/Driver/Distro.h" - #include "clang/Driver/Driver.h" - #include "clang/Driver/DriverDiagnostic.h" - #include "clang/Driver/MultilibBuilder.h" -@@ -2906,6 +2907,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 { -@@ -2923,7 +2925,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/0026-Correct-library-search-path-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0026-Correct-library-search-path-for-OpenEmbedded-Host.patch deleted file mode 100644 index 6fdb5f9..0000000 --- a/recipes-devtools/clang/clang/0026-Correct-library-search-path-for-OpenEmbedded-Host.patch +++ /dev/null @@ -1,84 +0,0 @@ -From e15c555d55efa0732adf97c3e858441296b4e83c 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 1404e1686848..90940e4a0bac 100644 ---- a/clang/include/clang/Driver/Distro.h -+++ b/clang/include/clang/Driver/Distro.h -@@ -45,6 +45,7 @@ public: - RHEL7, - Fedora, - Gentoo, -+ //CLANG_EXTRA_OE_DISTRO_NAME - OpenSUSE, - UbuntuHardy, - UbuntuIntrepid, -@@ -138,6 +139,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 6f49e641104c..63b9ff30f0b6 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 cdea589eb226..41818470cf85 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -82,6 +82,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/0026-lldb-Link-with-libatomic-on-x86.patch b/recipes-devtools/clang/clang/0026-lldb-Link-with-libatomic-on-x86.patch new file mode 100644 index 0000000..275a7c6 --- /dev/null +++ b/recipes-devtools/clang/clang/0026-lldb-Link-with-libatomic-on-x86.patch @@ -0,0 +1,33 @@ +From d395cc2696d62d7d3448bc9a90f7697cf60e6273 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 e9954d66cd1a..f36f1c9e9d28 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/0027-compiler-rt-Enable-__int128-for-ppc32.patch b/recipes-devtools/clang/clang/0027-compiler-rt-Enable-__int128-for-ppc32.patch new file mode 100644 index 0000000..bbccb8a --- /dev/null +++ b/recipes-devtools/clang/clang/0027-compiler-rt-Enable-__int128-for-ppc32.patch @@ -0,0 +1,73 @@ +From a92ea48f1959a20ab58b88091127f80a90d5870a 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 | 15 +++++++-------- + compiler-rt/lib/builtins/int_types.h | 2 +- + 2 files changed, 8 insertions(+), 9 deletions(-) + +diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt +index e0b2d08c2077..1b245fd5deeb 100644 +--- a/compiler-rt/lib/builtins/CMakeLists.txt ++++ b/compiler-rt/lib/builtins/CMakeLists.txt +@@ -710,11 +710,9 @@ set(mips64el_SOURCES ${GENERIC_TF_SOURCES} + + set(nvptx64_SOURCES ${GENERIC_SOURCES}) + +-set(powerpc_SOURCES ${GENERIC_SOURCES}) +- + set(powerpcspe_SOURCES ${GENERIC_SOURCES}) + +-set(powerpc64_SOURCES ++set(powerpc_SOURCES + ppc/divtc3.c + ppc/fixtfdi.c + ppc/fixunstfdi.c +@@ -729,14 +727,15 @@ set(powerpc64_SOURCES + ) + # These routines require __int128, which isn't supported on AIX. + if (NOT OS_NAME MATCHES "AIX") +- set(powerpc64_SOURCES ++ set(powerpc_SOURCES + ppc/floattitf.c + ppc/fixtfti.c + ppc/fixunstfti.c +- ${powerpc64_SOURCES} ++ ${powerpc_SOURCES} + ) + endif() +-set(powerpc64le_SOURCES ${powerpc64_SOURCES}) ++set(powerpc64le_SOURCES ${powerpc_SOURCES}) ++set(powerpc64_SOURCES ${powerpc_SOURCES}) + + set(riscv_SOURCES + riscv/fp_mode.c +@@ -888,9 +887,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(COMPILER_RT_ENABLE_SOFTWARE_INT128 OR "${arch}" STREQUAL "riscv32") ++ if(COMPILER_RT_ENABLE_SOFTWARE_INT128 OR "${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 48862f364217..cc47d3e33f67 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(__SIZEOF_INT128__) || defined(_WIN64) ++ defined(__SIZEOF_INT128__) || defined(_WIN64) || defined(__powerpc__) + #define CRT_HAS_128BIT + #endif + diff --git a/recipes-devtools/clang/clang/0027-lldb-Link-with-libatomic-on-x86.patch b/recipes-devtools/clang/clang/0027-lldb-Link-with-libatomic-on-x86.patch deleted file mode 100644 index d54ec3f..0000000 --- a/recipes-devtools/clang/clang/0027-lldb-Link-with-libatomic-on-x86.patch +++ /dev/null @@ -1,33 +0,0 @@ -From eb56f061bd5cf95bc7b65da7a51da4ffbf450351 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 e9954d66cd1a..f36f1c9e9d28 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/0028-compiler-rt-Enable-__int128-for-ppc32.patch b/recipes-devtools/clang/clang/0028-compiler-rt-Enable-__int128-for-ppc32.patch deleted file mode 100644 index 90a1f1c..0000000 --- a/recipes-devtools/clang/clang/0028-compiler-rt-Enable-__int128-for-ppc32.patch +++ /dev/null @@ -1,73 +0,0 @@ -From fd20943309512af40d5f1b9b94220bcfa085c6a1 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 | 15 +++++++-------- - compiler-rt/lib/builtins/int_types.h | 2 +- - 2 files changed, 8 insertions(+), 9 deletions(-) - -diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt -index e0b2d08c2077..1b245fd5deeb 100644 ---- a/compiler-rt/lib/builtins/CMakeLists.txt -+++ b/compiler-rt/lib/builtins/CMakeLists.txt -@@ -710,11 +710,9 @@ set(mips64el_SOURCES ${GENERIC_TF_SOURCES} - - set(nvptx64_SOURCES ${GENERIC_SOURCES}) - --set(powerpc_SOURCES ${GENERIC_SOURCES}) -- - set(powerpcspe_SOURCES ${GENERIC_SOURCES}) - --set(powerpc64_SOURCES -+set(powerpc_SOURCES - ppc/divtc3.c - ppc/fixtfdi.c - ppc/fixunstfdi.c -@@ -729,14 +727,15 @@ set(powerpc64_SOURCES - ) - # These routines require __int128, which isn't supported on AIX. - if (NOT OS_NAME MATCHES "AIX") -- set(powerpc64_SOURCES -+ set(powerpc_SOURCES - ppc/floattitf.c - ppc/fixtfti.c - ppc/fixunstfti.c -- ${powerpc64_SOURCES} -+ ${powerpc_SOURCES} - ) - endif() --set(powerpc64le_SOURCES ${powerpc64_SOURCES}) -+set(powerpc64le_SOURCES ${powerpc_SOURCES}) -+set(powerpc64_SOURCES ${powerpc_SOURCES}) - - set(riscv_SOURCES - riscv/fp_mode.c -@@ -888,9 +887,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(COMPILER_RT_ENABLE_SOFTWARE_INT128 OR "${arch}" STREQUAL "riscv32") -+ if(COMPILER_RT_ENABLE_SOFTWARE_INT128 OR "${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 48862f364217..cc47d3e33f67 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(__SIZEOF_INT128__) || defined(_WIN64) -+ defined(__SIZEOF_INT128__) || defined(_WIN64) || defined(__powerpc__) - #define CRT_HAS_128BIT - #endif - diff --git a/recipes-devtools/clang/clang/0028-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch b/recipes-devtools/clang/clang/0028-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch new file mode 100644 index 0000000..8c56c1d --- /dev/null +++ b/recipes-devtools/clang/clang/0028-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch @@ -0,0 +1,62 @@ +From e06415c9d95a4830b61a21d2a9b159145c0a46f3 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 12 Aug 2022 11:50:57 -0700 +Subject: [PATCH] llvm: Do not use cmake infra to detect libzstd + +OE's version is build using plain make not cmake as a result we do not +have the cmake support files and this probing method can get this info +from build host and force linking with libzstd from /usr/lib which is +not what we want when cross building. + +Fixes errors building llvm-config like +/usr/lib/libzstd.so.1.5.2: error adding symbols: file in wrong +format +| clang-15: error: linker command failed with exit code 1 (use -v to see invocation) +| ninja: build stopped: subcommand failed. + +Upstream-Status: Inappropriate [OE-Specific] +Signed-off-by: Khem Raj +--- + llvm/lib/Support/CMakeLists.txt | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt +index f653379e3033..6456caff9dff 100644 +--- a/llvm/lib/Support/CMakeLists.txt ++++ b/llvm/lib/Support/CMakeLists.txt +@@ -22,7 +22,7 @@ if (HAS_WERROR_GLOBAL_CTORS) + endif() + + if(LLVM_ENABLE_ZLIB) +- list(APPEND imported_libs ZLIB::ZLIB) ++ list(APPEND imported_libs z) + endif() + + if(LLVM_ENABLE_ZSTD) +@@ -34,7 +34,7 @@ if(LLVM_ENABLE_ZSTD) + endif() + + if(LLVM_ENABLE_ZSTD) +- list(APPEND imported_libs ${zstd_target}) ++ list(APPEND imported_libs zstd) + endif() + + if( WIN32 ) +@@ -310,7 +310,7 @@ if(LLVM_ENABLE_ZLIB) + get_property(zlib_library TARGET ZLIB::ZLIB PROPERTY LOCATION) + endif() + get_library_name(${zlib_library} zlib_library) +- set(llvm_system_libs ${llvm_system_libs} "${zlib_library}") ++ set(llvm_system_libs ${llvm_system_libs} z) + endif() + + if(LLVM_ENABLE_ZSTD) +@@ -324,7 +324,7 @@ if(LLVM_ENABLE_ZSTD) + endif() + if (zstd_target STREQUAL zstd::libzstd_shared) + get_library_name(${zstd_library} zstd_library) +- set(llvm_system_libs ${llvm_system_libs} "${zstd_library}") ++ set(llvm_system_libs ${llvm_system_libs} zstd) + else() + set(llvm_system_libs ${llvm_system_libs} "${zstd_STATIC_LIBRARY}") + endif() diff --git a/recipes-devtools/clang/clang/0029-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch b/recipes-devtools/clang/clang/0029-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch new file mode 100644 index 0000000..674cbe5 --- /dev/null +++ b/recipes-devtools/clang/clang/0029-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch @@ -0,0 +1,44 @@ +From a1729e842b825919a8efe0389aa2b0f0c16a2924 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 3 Jan 2023 18:44:34 -0800 +Subject: [PATCH] compiler-rt: Fix stat struct's size for O32 ABI + +stat struct size differs on glibc based on ABI choices e.g. 64bit off_t +and/or 64bit time_t will make this size different. Therefore separate +out the O32 case out, makes it more readable. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + .../sanitizer_platform_limits_posix.h | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h +index 34bfef1f7ef4..0ba5451c1ccf 100644 +--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h ++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h +@@ -98,11 +98,24 @@ const unsigned struct_kernel_stat64_sz = 104; + const unsigned struct_kernel_stat_sz = 144; + const unsigned struct_kernel_stat64_sz = 104; + #elif defined(__mips__) ++#if defined(__mips_o32) // O32 ABI ++#if _TIME_BITS == 64 ++const unsigned struct_kernel_stat_sz = 112; ++const unsigned struct_kernel_stat64_sz = 112; ++#elif _FILE_OFFSET_BITS == 64 ++const unsigned struct_kernel_stat_sz = 160; ++const unsigned struct_kernel_stat64_sz = 160; ++#else ++const unsigned struct_kernel_stat_sz = 144; ++const unsigned struct_kernel_stat64_sz = 160; ++#endif ++#else // __mips_o32 + const unsigned struct_kernel_stat_sz = + SANITIZER_ANDROID + ? FIRST_32_SECOND_64(104, 128) + : FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 176 : 160, 216); + const unsigned struct_kernel_stat64_sz = 104; ++#endif + #elif defined(__s390__) && !defined(__s390x__) + const unsigned struct_kernel_stat_sz = 64; + const unsigned struct_kernel_stat64_sz = 104; diff --git a/recipes-devtools/clang/clang/0029-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch b/recipes-devtools/clang/clang/0029-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch deleted file mode 100644 index 5105705..0000000 --- a/recipes-devtools/clang/clang/0029-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch +++ /dev/null @@ -1,62 +0,0 @@ -From dfc9116514bd85660f658bdb3e4d44215d33c566 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Fri, 12 Aug 2022 11:50:57 -0700 -Subject: [PATCH] llvm: Do not use cmake infra to detect libzstd - -OE's version is build using plain make not cmake as a result we do not -have the cmake support files and this probing method can get this info -from build host and force linking with libzstd from /usr/lib which is -not what we want when cross building. - -Fixes errors building llvm-config like -/usr/lib/libzstd.so.1.5.2: error adding symbols: file in wrong -format -| clang-15: error: linker command failed with exit code 1 (use -v to see invocation) -| ninja: build stopped: subcommand failed. - -Upstream-Status: Inappropriate [OE-Specific] -Signed-off-by: Khem Raj ---- - llvm/lib/Support/CMakeLists.txt | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt -index f653379e3033..6456caff9dff 100644 ---- a/llvm/lib/Support/CMakeLists.txt -+++ b/llvm/lib/Support/CMakeLists.txt -@@ -22,7 +22,7 @@ if (HAS_WERROR_GLOBAL_CTORS) - endif() - - if(LLVM_ENABLE_ZLIB) -- list(APPEND imported_libs ZLIB::ZLIB) -+ list(APPEND imported_libs z) - endif() - - if(LLVM_ENABLE_ZSTD) -@@ -34,7 +34,7 @@ if(LLVM_ENABLE_ZSTD) - endif() - - if(LLVM_ENABLE_ZSTD) -- list(APPEND imported_libs ${zstd_target}) -+ list(APPEND imported_libs zstd) - endif() - - if( WIN32 ) -@@ -310,7 +310,7 @@ if(LLVM_ENABLE_ZLIB) - get_property(zlib_library TARGET ZLIB::ZLIB PROPERTY LOCATION) - endif() - get_library_name(${zlib_library} zlib_library) -- set(llvm_system_libs ${llvm_system_libs} "${zlib_library}") -+ set(llvm_system_libs ${llvm_system_libs} z) - endif() - - if(LLVM_ENABLE_ZSTD) -@@ -324,7 +324,7 @@ if(LLVM_ENABLE_ZSTD) - endif() - if (zstd_target STREQUAL zstd::libzstd_shared) - get_library_name(${zstd_library} zstd_library) -- set(llvm_system_libs ${llvm_system_libs} "${zstd_library}") -+ set(llvm_system_libs ${llvm_system_libs} zstd) - else() - set(llvm_system_libs ${llvm_system_libs} "${zstd_STATIC_LIBRARY}") - endif() diff --git a/recipes-devtools/clang/clang/0030-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch b/recipes-devtools/clang/clang/0030-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch deleted file mode 100644 index 5020adc..0000000 --- a/recipes-devtools/clang/clang/0030-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch +++ /dev/null @@ -1,44 +0,0 @@ -From b1641882908052dc4f66c3967b8c3e3f0b1e54bb Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Tue, 3 Jan 2023 18:44:34 -0800 -Subject: [PATCH] compiler-rt: Fix stat struct's size for O32 ABI - -stat struct size differs on glibc based on ABI choices e.g. 64bit off_t -and/or 64bit time_t will make this size different. Therefore separate -out the O32 case out, makes it more readable. - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - .../sanitizer_platform_limits_posix.h | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - -diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h -index 34bfef1f7ef4..0ba5451c1ccf 100644 ---- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h -+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h -@@ -98,11 +98,24 @@ const unsigned struct_kernel_stat64_sz = 104; - const unsigned struct_kernel_stat_sz = 144; - const unsigned struct_kernel_stat64_sz = 104; - #elif defined(__mips__) -+#if defined(__mips_o32) // O32 ABI -+#if _TIME_BITS == 64 -+const unsigned struct_kernel_stat_sz = 112; -+const unsigned struct_kernel_stat64_sz = 112; -+#elif _FILE_OFFSET_BITS == 64 -+const unsigned struct_kernel_stat_sz = 160; -+const unsigned struct_kernel_stat64_sz = 160; -+#else -+const unsigned struct_kernel_stat_sz = 144; -+const unsigned struct_kernel_stat64_sz = 160; -+#endif -+#else // __mips_o32 - const unsigned struct_kernel_stat_sz = - SANITIZER_ANDROID - ? FIRST_32_SECOND_64(104, 128) - : FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 176 : 160, 216); - const unsigned struct_kernel_stat64_sz = 104; -+#endif - #elif defined(__s390__) && !defined(__s390x__) - const unsigned struct_kernel_stat_sz = 64; - const unsigned struct_kernel_stat64_sz = 104; diff --git a/recipes-devtools/clang/clang/0030-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch b/recipes-devtools/clang/clang/0030-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch new file mode 100644 index 0000000..1c5e1ad --- /dev/null +++ b/recipes-devtools/clang/clang/0030-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch @@ -0,0 +1,43 @@ +From dbf32edb06caeed5324edfb13bc42bf8fc1406a5 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 21 Feb 2023 12:46:10 -0800 +Subject: [PATCH] compiler-rt: Undef _TIME_BITS along with _FILE_OFFSET_BITS in + sanitizers + +On 32bit systems using 64bit time_t build fails because +_FILE_OFFSET_BITS is undefined here but _TIME_BITS is still set to 64 + +Fixes +In file included from compiler-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp:17: +In file included from compiler-rt/lib/sanitizer_common/sanitizer_platform.h:25: +In file included from /usr/include/features.h:393: +/usr/include/features-time64.h:26:5: error: "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64" + ^ +1 error generated. + +Upstream-Status: Submitted [https://reviews.llvm.org/D144514] +Signed-off-by: Khem Raj +--- + compiler-rt/lib/sanitizer_common/sanitizer_platform.h | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h +index 57966403c92a..efa83f30eca0 100644 +--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h ++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h +@@ -22,6 +22,15 @@ + // function declarations into a .S file which doesn't compile. + // https://crbug.com/1162741 + #if __has_include() && !defined(__ANDROID__) ++// Some sources undefine _FILE_OFFSET_BITS deliberately e.g. ++// sanitizer_procmaps_solaris.cpp. This is problematic on glibc systems with ++// 32-bit architectures using 64-bit time_t and users passing _TIME_BITS=64 ++// from build environment, therefore both _FILE_OFFSET_BITS and _TIME_BITS ++// need to be undefined together since features.h will check for both being 64 ++// if one is set to 64. ++# if !defined(_FILE_OFFSET_BITS) ++# undef _TIME_BITS ++# endif + # include + #endif + diff --git a/recipes-devtools/clang/clang/0031-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch b/recipes-devtools/clang/clang/0031-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch new file mode 100644 index 0000000..48e3d7a --- /dev/null +++ b/recipes-devtools/clang/clang/0031-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch @@ -0,0 +1,81 @@ +From ac240fbfa07115791271abdbfde256ea0f0c64c6 Mon Sep 17 00:00:00 2001 +From: Martin Jansa +Date: Thu, 31 Aug 2023 18:14:47 +0200 +Subject: [PATCH] ToolChains/Gnu.cpp: ARMLibDirs search also in lib32 + +* in some strange multilib configs we build lib32-image where + 32bit libs are in /usr/lib32 and 64bit in /usr/lib64 but in such + setup the clang search for GCC candidate installation doesn't + check lib32 directory in sysroot and fails to find the installation + + X86LibDirs was already searching in lib32 for very long time: + https://github.com/llvm/llvm-project/commit/621fed5f5a051a0333415aaed75b8f2ed2350dbd + but ARMLibDirs didn't include it for some reason. + +* if we don't add lib32 for arm in getOSLibDir(), then it will + find -lgcc, crtbeginS.o, crtendS.o, but still fail to find + -lgcc_s, -lc, Scrt1.o, crti.o, crtn.o + +* fixes lib32-compiler-rt build failure: + +-- Configuring incomplete, errors occurred! +CMake Error at TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/share/cmake-3.26/Modules/CMakeTestCCompiler.cmake:67 (message): + The C compiler + + "TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang" + + is not able to compile a simple test program. + + It fails with the following output: + + Change Dir: TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build/CMakeFiles/CMakeScratch/TryCompile-rWXyQZ + + Run Build Command(s):ninja -v cmTC_84d18 && [1/2] TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang --target=arm-oemllib32-linux-gnueabi --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -fPIE -MD -MT CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o -c TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build/CMakeFiles/CMakeScratch/TryCompile-rWXyQZ/testCCompiler.c + [2/2] : && TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang --target=arm-oemllib32-linux-gnueabi --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -Wl,-z,relro,-z,now -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ -fuse-ld=lld -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -Wl,-z,relro,-z,now -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ -fuse-ld=lld CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o -o cmTC_84d18 && : + FAILED: cmTC_84d18 + : && TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang --target=arm-oemllib32-linux-gnueabi --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -Wl,-z,relro,-z,now -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ -fuse-ld=lld -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -Wl,-z,relro,-z,now -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ -fuse-ld=lld CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o -o cmTC_84d18 && : + arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open Scrt1.o: No such file or directory + arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open crti.o: No such file or directory + arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open crtbeginS.o: No such file or directory + arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lgcc + arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lgcc_s + arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lc + arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lgcc + arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lgcc_s + arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open crtendS.o: No such file or directory + arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open crtn.o: No such file or directory + clang-16: error: linker command failed with exit code 1 (use -v to see invocation) + ninja: build stopped: subcommand failed. + +Upstream-Status: Pending +Signed-off-by: Martin Jansa +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 2 +- + clang/lib/Driver/ToolChains/Linux.cpp | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 4ec4976a6a0c..d5cfb99686d1 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2475,7 +2475,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( + static const char *const AArch64beLibDirs[] = {"/lib"}; + static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu"}; + +- static const char *const ARMLibDirs[] = {"/lib"}; ++ static const char *const ARMLibDirs[] = {"/lib", "/lib32"}; + static const char *const ARMTriples[] = {"arm-linux-gnueabi"}; + static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf", + "armv7hl-redhat-linux-gnueabi", +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index 9af52769b09a..33e8ae99ba1d 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -205,6 +205,7 @@ static StringRef getOSLibDir(const llvm::Triple &Triple, const ArgList &Args) { + // reasoning about oslibdir spellings with the lib dir spellings in the + // GCCInstallationDetector, but that is a more significant refactoring. + if (Triple.getArch() == llvm::Triple::x86 || Triple.isPPC32() || ++ Triple.getArch() == llvm::Triple::arm || Triple.getArch() == llvm::Triple::thumb || + Triple.getArch() == llvm::Triple::sparc) + return "lib32"; + diff --git a/recipes-devtools/clang/clang/0031-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch b/recipes-devtools/clang/clang/0031-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch deleted file mode 100644 index 6cc7d75..0000000 --- a/recipes-devtools/clang/clang/0031-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 5a2154c24ef0e9f2d5a5aabafa3e019707c16552 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Tue, 21 Feb 2023 12:46:10 -0800 -Subject: [PATCH] compiler-rt: Undef _TIME_BITS along with _FILE_OFFSET_BITS in - sanitizers - -On 32bit systems using 64bit time_t build fails because -_FILE_OFFSET_BITS is undefined here but _TIME_BITS is still set to 64 - -Fixes -In file included from compiler-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp:17: -In file included from compiler-rt/lib/sanitizer_common/sanitizer_platform.h:25: -In file included from /usr/include/features.h:393: -/usr/include/features-time64.h:26:5: error: "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64" - ^ -1 error generated. - -Upstream-Status: Submitted [https://reviews.llvm.org/D144514] -Signed-off-by: Khem Raj ---- - compiler-rt/lib/sanitizer_common/sanitizer_platform.h | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h -index 57966403c92a..efa83f30eca0 100644 ---- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h -+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h -@@ -22,6 +22,15 @@ - // function declarations into a .S file which doesn't compile. - // https://crbug.com/1162741 - #if __has_include() && !defined(__ANDROID__) -+// Some sources undefine _FILE_OFFSET_BITS deliberately e.g. -+// sanitizer_procmaps_solaris.cpp. This is problematic on glibc systems with -+// 32-bit architectures using 64-bit time_t and users passing _TIME_BITS=64 -+// from build environment, therefore both _FILE_OFFSET_BITS and _TIME_BITS -+// need to be undefined together since features.h will check for both being 64 -+// if one is set to 64. -+# if !defined(_FILE_OFFSET_BITS) -+# undef _TIME_BITS -+# endif - # include - #endif - diff --git a/recipes-devtools/clang/clang/0032-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch b/recipes-devtools/clang/clang/0032-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch deleted file mode 100644 index 1dbf292..0000000 --- a/recipes-devtools/clang/clang/0032-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch +++ /dev/null @@ -1,81 +0,0 @@ -From fe32a4031f8fa3cd33685121acee6d3afd3695a6 Mon Sep 17 00:00:00 2001 -From: Martin Jansa -Date: Thu, 31 Aug 2023 18:14:47 +0200 -Subject: [PATCH] ToolChains/Gnu.cpp: ARMLibDirs search also in lib32 - -* in some strange multilib configs we build lib32-image where - 32bit libs are in /usr/lib32 and 64bit in /usr/lib64 but in such - setup the clang search for GCC candidate installation doesn't - check lib32 directory in sysroot and fails to find the installation - - X86LibDirs was already searching in lib32 for very long time: - https://github.com/llvm/llvm-project/commit/621fed5f5a051a0333415aaed75b8f2ed2350dbd - but ARMLibDirs didn't include it for some reason. - -* if we don't add lib32 for arm in getOSLibDir(), then it will - find -lgcc, crtbeginS.o, crtendS.o, but still fail to find - -lgcc_s, -lc, Scrt1.o, crti.o, crtn.o - -* fixes lib32-compiler-rt build failure: - --- Configuring incomplete, errors occurred! -CMake Error at TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/share/cmake-3.26/Modules/CMakeTestCCompiler.cmake:67 (message): - The C compiler - - "TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang" - - is not able to compile a simple test program. - - It fails with the following output: - - Change Dir: TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build/CMakeFiles/CMakeScratch/TryCompile-rWXyQZ - - Run Build Command(s):ninja -v cmTC_84d18 && [1/2] TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang --target=arm-oemllib32-linux-gnueabi --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -fPIE -MD -MT CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o -c TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build/CMakeFiles/CMakeScratch/TryCompile-rWXyQZ/testCCompiler.c - [2/2] : && TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang --target=arm-oemllib32-linux-gnueabi --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -Wl,-z,relro,-z,now -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ -fuse-ld=lld -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -Wl,-z,relro,-z,now -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ -fuse-ld=lld CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o -o cmTC_84d18 && : - FAILED: cmTC_84d18 - : && TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang --target=arm-oemllib32-linux-gnueabi --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -target arm-oemllib32-linux-gnueabi -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -Wl,-z,relro,-z,now -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ -fuse-ld=lld -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fmacro-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -Wl,-z,relro,-z,now -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++ -fuse-ld=lld CMakeFiles/cmTC_84d18.dir/testCCompiler.c.o -o cmTC_84d18 && : - arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open Scrt1.o: No such file or directory - arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open crti.o: No such file or directory - arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open crtbeginS.o: No such file or directory - arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lgcc - arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lgcc_s - arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lc - arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lgcc - arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lgcc_s - arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open crtendS.o: No such file or directory - arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open crtn.o: No such file or directory - clang-16: error: linker command failed with exit code 1 (use -v to see invocation) - ninja: build stopped: subcommand failed. - -Upstream-Status: Pending -Signed-off-by: Martin Jansa ---- - clang/lib/Driver/ToolChains/Gnu.cpp | 2 +- - clang/lib/Driver/ToolChains/Linux.cpp | 1 + - 2 files changed, 2 insertions(+), 1 deletion(-) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index f081a778cfe9..b3d656d30a78 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2475,7 +2475,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( - static const char *const AArch64beLibDirs[] = {"/lib"}; - static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu"}; - -- static const char *const ARMLibDirs[] = {"/lib"}; -+ static const char *const ARMLibDirs[] = {"/lib", "/lib32"}; - static const char *const ARMTriples[] = {"arm-linux-gnueabi"}; - static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf", - "armv7hl-redhat-linux-gnueabi", -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 41818470cf85..3224acee8710 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -205,6 +205,7 @@ static StringRef getOSLibDir(const llvm::Triple &Triple, const ArgList &Args) { - // reasoning about oslibdir spellings with the lib dir spellings in the - // GCCInstallationDetector, but that is a more significant refactoring. - if (Triple.getArch() == llvm::Triple::x86 || Triple.isPPC32() || -+ Triple.getArch() == llvm::Triple::arm || Triple.getArch() == llvm::Triple::thumb || - Triple.getArch() == llvm::Triple::sparc) - return "lib32"; - diff --git a/recipes-devtools/clang/clang/0032-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch b/recipes-devtools/clang/clang/0032-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch new file mode 100644 index 0000000..019ed3d --- /dev/null +++ b/recipes-devtools/clang/clang/0032-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch @@ -0,0 +1,78 @@ +From 05d5bc0e32b8275f91421b24fc86494b9e81815d Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 3 Feb 2024 16:47:10 -0800 +Subject: [PATCH] clang/llvm: Add OE specific ABI triple for N32 ABI + +Its gnun32 when using OE + +Upstream-Status: Inappropriate [OE-Specific] +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 1 + + clang/lib/Driver/ToolChains/Linux.cpp | 4 ++-- + llvm/lib/TargetParser/Triple.cpp | 4 +++- + 3 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index d5cfb99686d1..926455ac6680 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2538,6 +2538,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( + + static const char *const MIPSN32LibDirs[] = {"/lib32"}; + static const char *const MIPSN32Triples[] = {"mips64-linux-gnuabin32", ++ "mips64-linux-gnun32", + "mipsisa64r6-linux-gnuabin32"}; + static const char *const MIPSN32ELLibDirs[] = {"/lib32"}; + static const char *const MIPSN32ELTriples[] = { +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index 33e8ae99ba1d..58badf20d1b3 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -136,7 +136,7 @@ std::string Linux::getMultiarchTriple(const Driver &D, + return IsMipsR6 ? "mipsisa32r6el-linux-gnu" : "mipsel-linux-gnu"; + case llvm::Triple::mips64: { + std::string MT = std::string(IsMipsR6 ? "mipsisa64r6" : "mips64") + +- "-linux-" + (IsMipsN32Abi ? "gnuabin32" : "gnuabi64"); ++ "-linux-" + (IsMipsN32Abi ? "gnun32" : "gnu"); + if (D.getVFS().exists(concat(SysRoot, "/lib", MT))) + return MT; + if (D.getVFS().exists(concat(SysRoot, "/lib/mips64-linux-gnu"))) +@@ -145,7 +145,7 @@ std::string Linux::getMultiarchTriple(const Driver &D, + } + case llvm::Triple::mips64el: { + std::string MT = std::string(IsMipsR6 ? "mipsisa64r6el" : "mips64el") + +- "-linux-" + (IsMipsN32Abi ? "gnuabin32" : "gnuabi64"); ++ "-linux-" + (IsMipsN32Abi ? "gnun32" : "gnu"); + if (D.getVFS().exists(concat(SysRoot, "/lib", MT))) + return MT; + if (D.getVFS().exists(concat(SysRoot, "/lib/mips64el-linux-gnu"))) +diff --git a/llvm/lib/TargetParser/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp +index 32adf92c47bf..3411e3c968a2 100644 +--- a/llvm/lib/TargetParser/Triple.cpp ++++ b/llvm/lib/TargetParser/Triple.cpp +@@ -319,7 +319,7 @@ StringRef Triple::getEnvironmentTypeName(EnvironmentType Kind) { + case GNU: return "gnu"; + case GNUT64: return "gnut64"; + case GNUABI64: return "gnuabi64"; +- case GNUABIN32: return "gnuabin32"; ++ case GNUABIN32: return "gnun32"; + case GNUEABI: return "gnueabi"; + case GNUEABIT64: return "gnueabit64"; + case GNUEABIHF: return "gnueabihf"; +@@ -695,6 +695,7 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) { + .StartsWith("eabihf", Triple::EABIHF) + .StartsWith("eabi", Triple::EABI) + .StartsWith("gnuabin32", Triple::GNUABIN32) ++ .StartsWith("gnun32", Triple::GNUABIN32) + .StartsWith("gnuabi64", Triple::GNUABI64) + .StartsWith("gnueabihft64", Triple::GNUEABIHFT64) + .StartsWith("gnueabihf", Triple::GNUEABIHF) +@@ -1002,6 +1003,7 @@ Triple::Triple(const Twine &Str) + Environment = + StringSwitch(Components[0]) + .StartsWith("mipsn32", Triple::GNUABIN32) ++ .StartsWith("mips64-n32", Triple::GNUABIN32) + .StartsWith("mips64", Triple::GNUABI64) + .StartsWith("mipsisa64", Triple::GNUABI64) + .StartsWith("mipsisa32", Triple::GNU) diff --git a/recipes-devtools/clang/clang/0033-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch b/recipes-devtools/clang/clang/0033-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch deleted file mode 100644 index 112724a..0000000 --- a/recipes-devtools/clang/clang/0033-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 8ba03ec78308efe868d7c97f6b2c11caf0beb4e2 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 3 Feb 2024 16:47:10 -0800 -Subject: [PATCH] clang/llvm: Add OE specific ABI triple for N32 ABI - -Its gnun32 when using OE - -Upstream-Status: Inappropriate [OE-Specific] -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Gnu.cpp | 1 + - clang/lib/Driver/ToolChains/Linux.cpp | 4 ++-- - llvm/lib/TargetParser/Triple.cpp | 4 +++- - 3 files changed, 6 insertions(+), 3 deletions(-) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index b3d656d30a78..f94606180099 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2538,6 +2538,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( - - static const char *const MIPSN32LibDirs[] = {"/lib32"}; - static const char *const MIPSN32Triples[] = {"mips64-linux-gnuabin32", -+ "mips64-linux-gnun32", - "mipsisa64r6-linux-gnuabin32"}; - static const char *const MIPSN32ELLibDirs[] = {"/lib32"}; - static const char *const MIPSN32ELTriples[] = { -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 3224acee8710..5302e870d30d 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -136,7 +136,7 @@ std::string Linux::getMultiarchTriple(const Driver &D, - return IsMipsR6 ? "mipsisa32r6el-linux-gnu" : "mipsel-linux-gnu"; - case llvm::Triple::mips64: { - std::string MT = std::string(IsMipsR6 ? "mipsisa64r6" : "mips64") + -- "-linux-" + (IsMipsN32Abi ? "gnuabin32" : "gnuabi64"); -+ "-linux-" + (IsMipsN32Abi ? "gnun32" : "gnu"); - if (D.getVFS().exists(concat(SysRoot, "/lib", MT))) - return MT; - if (D.getVFS().exists(concat(SysRoot, "/lib/mips64-linux-gnu"))) -@@ -145,7 +145,7 @@ std::string Linux::getMultiarchTriple(const Driver &D, - } - case llvm::Triple::mips64el: { - std::string MT = std::string(IsMipsR6 ? "mipsisa64r6el" : "mips64el") + -- "-linux-" + (IsMipsN32Abi ? "gnuabin32" : "gnuabi64"); -+ "-linux-" + (IsMipsN32Abi ? "gnun32" : "gnu"); - if (D.getVFS().exists(concat(SysRoot, "/lib", MT))) - return MT; - if (D.getVFS().exists(concat(SysRoot, "/lib/mips64el-linux-gnu"))) -diff --git a/llvm/lib/TargetParser/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp -index fb9cbeb30351..4fa949a47791 100644 ---- a/llvm/lib/TargetParser/Triple.cpp -+++ b/llvm/lib/TargetParser/Triple.cpp -@@ -318,7 +318,7 @@ StringRef Triple::getEnvironmentTypeName(EnvironmentType Kind) { - case EABIHF: return "eabihf"; - case GNU: return "gnu"; - case GNUABI64: return "gnuabi64"; -- case GNUABIN32: return "gnuabin32"; -+ case GNUABIN32: return "gnun32"; - case GNUEABI: return "gnueabi"; - case GNUEABIHF: return "gnueabihf"; - case GNUF32: return "gnuf32"; -@@ -692,6 +692,7 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) { - .StartsWith("eabihf", Triple::EABIHF) - .StartsWith("eabi", Triple::EABI) - .StartsWith("gnuabin32", Triple::GNUABIN32) -+ .StartsWith("gnun32", Triple::GNUABIN32) - .StartsWith("gnuabi64", Triple::GNUABI64) - .StartsWith("gnueabihf", Triple::GNUEABIHF) - .StartsWith("gnueabi", Triple::GNUEABI) -@@ -996,6 +997,7 @@ Triple::Triple(const Twine &Str) - Environment = - StringSwitch(Components[0]) - .StartsWith("mipsn32", Triple::GNUABIN32) -+ .StartsWith("mips64-n32", Triple::GNUABIN32) - .StartsWith("mips64", Triple::GNUABI64) - .StartsWith("mipsisa64", Triple::GNUABI64) - .StartsWith("mipsisa32", Triple::GNU) diff --git a/recipes-devtools/clang/clang/0033-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch b/recipes-devtools/clang/clang/0033-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch new file mode 100644 index 0000000..97554cb --- /dev/null +++ b/recipes-devtools/clang/clang/0033-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch @@ -0,0 +1,90 @@ +From a1b090d189ebc5ccda088f222a927fb6e225588d Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 14 May 2024 22:04:43 -0700 +Subject: [PATCH] llvm: Add libunwind.pc.in and llvm-config scripts + +These are added by OE project + +Upstream-Status: Inappropriate [ OE-Specific ] + +Signed-off-by: Khem Raj +--- + libunwind/libunwind.pc.in | 9 ++++++ + llvm/tools/llvm-config/llvm-config | 52 ++++++++++++++++++++++++++++++ + 2 files changed, 61 insertions(+) + create mode 100644 libunwind/libunwind.pc.in + create mode 100644 llvm/tools/llvm-config/llvm-config + +diff --git a/libunwind/libunwind.pc.in b/libunwind/libunwind.pc.in +new file mode 100644 +index 000000000000..a93d676604f9 +--- /dev/null ++++ b/libunwind/libunwind.pc.in +@@ -0,0 +1,9 @@ ++prefix=/usr ++exec_prefix=/usr ++libdir=@LIBDIR@ ++includedir=/usr/include ++ ++Name: libunwind ++Description: libunwind base library ++Version: @VERSION@ ++Libs: -lunwind +diff --git a/llvm/tools/llvm-config/llvm-config b/llvm/tools/llvm-config/llvm-config +new file mode 100644 +index 000000000000..6a0dd54b8eab +--- /dev/null ++++ b/llvm/tools/llvm-config/llvm-config +@@ -0,0 +1,52 @@ ++#!/bin/bash ++# ++# Wrapper script for llvm-config. Supplies the right environment variables ++# for the target and delegates to the native llvm-config for anything else. This ++# is needed because arguments like --ldflags, --cxxflags, etc. are set by the ++# native compile rather than the target compile. ++# ++SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" ++NEXT_LLVM_CONFIG="$(which -a llvm-config | sed -n 2p)" ++export YOCTO_ALTERNATE_EXE_PATH="${YOCTO_ALTERNATE_EXE_PATH:="$(readlink -f "$SCRIPT_DIR/../llvm-config")"}" ++if [ -n "$( echo $base_libdir | sed -n '/lib64/p')" ]; then ++ export YOCTO_ALTERNATE_LIBDIR="${YOCTO_ALTERNATE_LIBDIR:="/lib64"}" ++else ++ export YOCTO_ALTERNATE_LIBDIR="${YOCTO_ALTERNATE_LIBDIR:="/lib"}" ++fi ++if [[ $# == 0 ]]; then ++ exec "$NEXT_LLVM_CONFIG" ++fi ++ ++remain="" ++output="" ++for arg in "$@"; do ++ case "$arg" in ++ --cppflags) ++ output="${output} ${CPPFLAGS}" ++ ;; ++ --cflags) ++ output="${output} ${CFLAGS}" ++ ;; ++ --cxxflags) ++ output="${output} ${CXXFLAGS}" ++ ;; ++ --ldflags) ++ output="${output} ${LDFLAGS}" ++ ;; ++ --shared-mode) ++ output="${output} shared" ++ ;; ++ --link-shared) ++ break ++ ;; ++ *) ++ remain="${remain} ${arg}" ++ ;; ++ esac ++done ++ ++if [ "${remain}" != "" ]; then ++ output="${output} "$("$NEXT_LLVM_CONFIG" ${remain}) ++fi ++ ++echo "${output}" diff --git a/recipes-devtools/clang/clang/0034-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch b/recipes-devtools/clang/clang/0034-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch deleted file mode 100644 index 9f70bf2..0000000 --- a/recipes-devtools/clang/clang/0034-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 1532564c3d7c025432caefc17480cf89eed696b8 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Tue, 14 May 2024 22:04:43 -0700 -Subject: [PATCH] llvm: Add libunwind.pc.in and llvm-config scripts - -These are added by OE project - -Upstream-Status: Inappropriate [ OE-Specific ] - -Signed-off-by: Khem Raj ---- - libunwind/libunwind.pc.in | 9 ++++++ - llvm/tools/llvm-config/llvm-config | 52 ++++++++++++++++++++++++++++++ - 2 files changed, 61 insertions(+) - create mode 100644 libunwind/libunwind.pc.in - create mode 100644 llvm/tools/llvm-config/llvm-config - -diff --git a/libunwind/libunwind.pc.in b/libunwind/libunwind.pc.in -new file mode 100644 -index 000000000000..a93d676604f9 ---- /dev/null -+++ b/libunwind/libunwind.pc.in -@@ -0,0 +1,9 @@ -+prefix=/usr -+exec_prefix=/usr -+libdir=@LIBDIR@ -+includedir=/usr/include -+ -+Name: libunwind -+Description: libunwind base library -+Version: @VERSION@ -+Libs: -lunwind -diff --git a/llvm/tools/llvm-config/llvm-config b/llvm/tools/llvm-config/llvm-config -new file mode 100644 -index 000000000000..6a0dd54b8eab ---- /dev/null -+++ b/llvm/tools/llvm-config/llvm-config -@@ -0,0 +1,52 @@ -+#!/bin/bash -+# -+# Wrapper script for llvm-config. Supplies the right environment variables -+# for the target and delegates to the native llvm-config for anything else. This -+# is needed because arguments like --ldflags, --cxxflags, etc. are set by the -+# native compile rather than the target compile. -+# -+SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" -+NEXT_LLVM_CONFIG="$(which -a llvm-config | sed -n 2p)" -+export YOCTO_ALTERNATE_EXE_PATH="${YOCTO_ALTERNATE_EXE_PATH:="$(readlink -f "$SCRIPT_DIR/../llvm-config")"}" -+if [ -n "$( echo $base_libdir | sed -n '/lib64/p')" ]; then -+ export YOCTO_ALTERNATE_LIBDIR="${YOCTO_ALTERNATE_LIBDIR:="/lib64"}" -+else -+ export YOCTO_ALTERNATE_LIBDIR="${YOCTO_ALTERNATE_LIBDIR:="/lib"}" -+fi -+if [[ $# == 0 ]]; then -+ exec "$NEXT_LLVM_CONFIG" -+fi -+ -+remain="" -+output="" -+for arg in "$@"; do -+ case "$arg" in -+ --cppflags) -+ output="${output} ${CPPFLAGS}" -+ ;; -+ --cflags) -+ output="${output} ${CFLAGS}" -+ ;; -+ --cxxflags) -+ output="${output} ${CXXFLAGS}" -+ ;; -+ --ldflags) -+ output="${output} ${LDFLAGS}" -+ ;; -+ --shared-mode) -+ output="${output} shared" -+ ;; -+ --link-shared) -+ break -+ ;; -+ *) -+ remain="${remain} ${arg}" -+ ;; -+ esac -+done -+ -+if [ "${remain}" != "" ]; then -+ output="${output} "$("$NEXT_LLVM_CONFIG" ${remain}) -+fi -+ -+echo "${output}" diff --git a/recipes-devtools/clang/clang/0034-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch b/recipes-devtools/clang/clang/0034-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch new file mode 100644 index 0000000..0eebe63 --- /dev/null +++ b/recipes-devtools/clang/clang/0034-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch @@ -0,0 +1,92 @@ +From 47a9749e0dcd1c7dd85922610434ce63d5fe8bd6 Mon Sep 17 00:00:00 2001 +From: Martin Jansa +Date: Fri, 13 Sep 2024 13:38:08 +0200 +Subject: [PATCH] scan-build-py: respect LLVM_LIBDIR_SUFFIX like other tools do + +* other libraries are installed in 'lib64' or 'lib32' based on + LLVM_LIBDIR_SUFFIX value, but libscanbuild files were always + installed in 'lib' + +Upstream-Status: Submitted [https://github.com/llvm/llvm-project/pull/108549] + +Signed-off-by: Martin Jansa +--- + clang/tools/scan-build-py/CMakeLists.txt | 38 ++++++++++++------------ + 1 file changed, 19 insertions(+), 19 deletions(-) + +diff --git a/clang/tools/scan-build-py/CMakeLists.txt b/clang/tools/scan-build-py/CMakeLists.txt +index 9273eb5ed977..9033786d2da5 100644 +--- a/clang/tools/scan-build-py/CMakeLists.txt ++++ b/clang/tools/scan-build-py/CMakeLists.txt +@@ -77,52 +77,52 @@ foreach(lib ${LibExecs}) + endforeach() + + foreach(lib ${LibScanbuild}) +- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib} ++ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/${lib} + COMMAND ${CMAKE_COMMAND} -E make_directory +- ${CMAKE_BINARY_DIR}/lib ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} + COMMAND ${CMAKE_COMMAND} -E make_directory +- ${CMAKE_BINARY_DIR}/lib/libscanbuild ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib} +- ${CMAKE_BINARY_DIR}/lib/libscanbuild/ ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib}) +- list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib}) ++ list(APPEND Depends ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/${lib}) + install(FILES lib/libscanbuild/${lib} +- DESTINATION lib/libscanbuild ++ DESTINATION lib${LLVM_LIBDIR_SUFFIX}/libscanbuild + COMPONENT scan-build-py) + endforeach() + + foreach(resource ${LibScanbuildResources}) +- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource} ++ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources/${resource} + COMMAND ${CMAKE_COMMAND} -E make_directory +- ${CMAKE_BINARY_DIR}/lib ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} + COMMAND ${CMAKE_COMMAND} -E make_directory +- ${CMAKE_BINARY_DIR}/lib/libscanbuild ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild + COMMAND ${CMAKE_COMMAND} -E make_directory +- ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource} +- ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource}) +- list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource}) ++ list(APPEND Depends ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources/${resource}) + install(FILES lib/libscanbuild/resources/${resource} +- DESTINATION lib/libscanbuild/resources ++ DESTINATION lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources + COMPONENT scan-build-py) + endforeach() + + foreach(lib ${LibEar}) +- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libear/${lib} ++ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear/${lib} + COMMAND ${CMAKE_COMMAND} -E make_directory +- ${CMAKE_BINARY_DIR}/lib ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} + COMMAND ${CMAKE_COMMAND} -E make_directory +- ${CMAKE_BINARY_DIR}/lib/libear ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib} +- ${CMAKE_BINARY_DIR}/lib/libear/ ++ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib}) +- list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libear/${lib}) ++ list(APPEND Depends ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear/${lib}) + install(FILES lib/libear/${lib} +- DESTINATION lib/libear ++ DESTINATION lib${LLVM_LIBDIR_SUFFIX}/libear + COMPONENT scan-build-py) + endforeach() + diff --git a/recipes-devtools/clang/clang/0035-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch b/recipes-devtools/clang/clang/0035-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch deleted file mode 100644 index 7af34b5..0000000 --- a/recipes-devtools/clang/clang/0035-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch +++ /dev/null @@ -1,92 +0,0 @@ -From cb6f0fa134a9bb1dcf2b7f5f2f683410853b5cde Mon Sep 17 00:00:00 2001 -From: Martin Jansa -Date: Fri, 13 Sep 2024 13:38:08 +0200 -Subject: [PATCH] scan-build-py: respect LLVM_LIBDIR_SUFFIX like other tools do - -* other libraries are installed in 'lib64' or 'lib32' based on - LLVM_LIBDIR_SUFFIX value, but libscanbuild files were always - installed in 'lib' - -Upstream-Status: Submitted [https://github.com/llvm/llvm-project/pull/108549] - -Signed-off-by: Martin Jansa ---- - clang/tools/scan-build-py/CMakeLists.txt | 38 ++++++++++++------------ - 1 file changed, 19 insertions(+), 19 deletions(-) - -diff --git a/clang/tools/scan-build-py/CMakeLists.txt b/clang/tools/scan-build-py/CMakeLists.txt -index 9273eb5ed977..9033786d2da5 100644 ---- a/clang/tools/scan-build-py/CMakeLists.txt -+++ b/clang/tools/scan-build-py/CMakeLists.txt -@@ -77,52 +77,52 @@ foreach(lib ${LibExecs}) - endforeach() - - foreach(lib ${LibScanbuild}) -- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib} -+ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/${lib} - COMMAND ${CMAKE_COMMAND} -E make_directory -- ${CMAKE_BINARY_DIR}/lib -+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} - COMMAND ${CMAKE_COMMAND} -E make_directory -- ${CMAKE_BINARY_DIR}/lib/libscanbuild -+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild - COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib} -- ${CMAKE_BINARY_DIR}/lib/libscanbuild/ -+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/ - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib}) -- list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib}) -+ list(APPEND Depends ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/${lib}) - install(FILES lib/libscanbuild/${lib} -- DESTINATION lib/libscanbuild -+ DESTINATION lib${LLVM_LIBDIR_SUFFIX}/libscanbuild - COMPONENT scan-build-py) - endforeach() - - foreach(resource ${LibScanbuildResources}) -- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource} -+ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources/${resource} - COMMAND ${CMAKE_COMMAND} -E make_directory -- ${CMAKE_BINARY_DIR}/lib -+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} - COMMAND ${CMAKE_COMMAND} -E make_directory -- ${CMAKE_BINARY_DIR}/lib/libscanbuild -+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild - COMMAND ${CMAKE_COMMAND} -E make_directory -- ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources -+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources - COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource} -- ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources -+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource}) -- list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource}) -+ list(APPEND Depends ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources/${resource}) - install(FILES lib/libscanbuild/resources/${resource} -- DESTINATION lib/libscanbuild/resources -+ DESTINATION lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources - COMPONENT scan-build-py) - endforeach() - - foreach(lib ${LibEar}) -- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libear/${lib} -+ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear/${lib} - COMMAND ${CMAKE_COMMAND} -E make_directory -- ${CMAKE_BINARY_DIR}/lib -+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} - COMMAND ${CMAKE_COMMAND} -E make_directory -- ${CMAKE_BINARY_DIR}/lib/libear -+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear - COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib} -- ${CMAKE_BINARY_DIR}/lib/libear/ -+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear/ - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib}) -- list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libear/${lib}) -+ list(APPEND Depends ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear/${lib}) - install(FILES lib/libear/${lib} -- DESTINATION lib/libear -+ DESTINATION lib${LLVM_LIBDIR_SUFFIX}/libear - COMPONENT scan-build-py) - endforeach() - diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index 0079d0f..56b569f 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb @@ -1,7 +1,16 @@ # Copyright (C) 2014 Khem Raj # Released under the MIT license (see COPYING.MIT for the terms) -DESCRIPTION = "LLVM based C/C++ compiler" +SUMMARY = "LLVM based C/C++ compiler" +DESCRIPTION = "Clang is an LLVM based C/C++/Objective-C compiler, \ + which aims to deliver amazingly fast compiles, \ + extremely useful error and warning messages and \ + to provide a platform for building great source \ + level tools. The Clang Static Analyzer and \ + clang-tidy are tools that automatically find bugs \ + in your code, and are great examples of the sort \ + of tools that can be built using the Clang frontend \ + as a library to parse C/C++ code" HOMEPAGE = "http://clang.llvm.org/" SECTION = "devel" @@ -197,7 +206,7 @@ EXTRA_OECMAKE:append:class-target = "\ " DEPENDS = "binutils zlib zstd libffi libxml2 libxml2-native ninja-native swig-native" -DEPENDS:append:class-nativesdk = " clang-crosssdk-${SDK_ARCH} virtual/${TARGET_PREFIX}binutils nativesdk-python3" +DEPENDS:append:class-nativesdk = " clang-crosssdk-${SDK_SYS} virtual/${TARGET_PREFIX}binutils nativesdk-python3" DEPENDS:append:class-target = " clang-cross-${TARGET_ARCH} python3 compiler-rt libcxx" RRECOMMENDS:${PN} = "binutils" @@ -294,6 +303,9 @@ do_install:append:class-nativesdk () { sed -i -e 's,${B},,g' ${D}${libdir}/cmake/llvm/LLVMConfig.cmake } +PROVIDES:append:class-native = " llvm-native" +PROVIDES:append:class-target = " llvm" + PACKAGES =+ "${PN}-libllvm ${PN}-lldb-python ${PN}-libclang-cpp ${PN}-tidy ${PN}-format ${PN}-tools \ libclang lldb lldb-server liblldb llvm-linker-tools" diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index 9246147..eb8d4ef 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -15,7 +15,7 @@ LICENSE = "Apache-2.0-with-LLVM-exception" RELEASE ?= "${PV}" BASEURI ?= "${LLVM_HTTP}/llvm-project/releases/download/llvmorg-${PV}/llvm-project-${PV}.src.tar.xz" SOURCEDIR ?= "llvm-project-${PV}.src" -SRC_URI[sha256sum] = "3666f01fc52d8a0b0da83e107d74f208f001717824be0b80007f529453aa1e19" +SRC_URI[sha256sum] = "3aa2d2d2c7553164ad5c6f3b932b31816e422635e18620c9349a7da95b98d811" SRC_URI = "\ ${BASEURI} \ @@ -32,28 +32,27 @@ SRC_URI = "\ 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-cmake-Fix-configure-for-packages-using-find_package.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-Insert-anchor-for-adding-OE-distro-vendor-names.patch \ - file://0021-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch \ - file://0022-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch \ - file://0023-libunwind-Added-unw_backtrace-method.patch \ - file://0024-clang-Do-not-use-install-relative-libc-headers.patch \ - file://0025-Fix-lib-paths-for-OpenEmbedded-Host.patch \ - file://0026-Correct-library-search-path-for-OpenEmbedded-Host.patch \ - file://0027-lldb-Link-with-libatomic-on-x86.patch \ - file://0028-compiler-rt-Enable-__int128-for-ppc32.patch \ - file://0029-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch \ - file://0030-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch \ - file://0031-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch \ - file://0032-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch \ - file://0033-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch \ - file://0034-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch \ - file://0035-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch \ + file://0014-cmake-Fix-configure-for-packages-using-find_package.patch \ + file://0015-clang-Fix-resource-dir-location-for-cross-toolchains.patch \ + file://0016-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch \ + file://0017-clang-Use-python3-in-python-scripts.patch \ + file://0018-For-x86_64-set-Yocto-based-GCC-install-search-path.patch \ + file://0019-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch \ + file://0020-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch \ + file://0021-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch \ + file://0022-libunwind-Added-unw_backtrace-method.patch \ + file://0023-clang-Do-not-use-install-relative-libc-headers.patch \ + file://0024-Fix-lib-paths-for-OpenEmbedded-Host.patch \ + file://0025-Correct-library-search-path-for-OpenEmbedded-Host.patch \ + file://0026-lldb-Link-with-libatomic-on-x86.patch \ + file://0027-compiler-rt-Enable-__int128-for-ppc32.patch \ + file://0028-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch \ + file://0029-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch \ + file://0030-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch \ + file://0031-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch \ + file://0032-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch \ + file://0033-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch \ + file://0034-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch \ " # Fallback to no-PIE if not set GCCPIE ??= "" diff --git a/recipes-devtools/clang/compiler-rt-sanitizers_git.bb b/recipes-devtools/clang/compiler-rt-sanitizers_git.bb index 2ad9a6d..acd5516 100644 --- a/recipes-devtools/clang/compiler-rt-sanitizers_git.bb +++ b/recipes-devtools/clang/compiler-rt-sanitizers_git.bb @@ -1,7 +1,9 @@ # Copyright (C) 2021 Khem Raj # Released under the MIT license (see COPYING.MIT for the terms) -DESCRIPTION = "LLVM based C/C++ compiler Runtime" +SUMMARY = "LLVM based C/C++ compiler Sanitizers Runtime" +DESCRIPTION = "Runtime libraries that are required \ + to run the code with sanitizer instrumentation" HOMEPAGE = "http://compiler-rt.llvm.org/" SECTION = "base" @@ -17,7 +19,7 @@ TUNE_CCARGS:remove = "-no-integrated-as" DEPENDS += "ninja-native virtual/crypt compiler-rt" DEPENDS:append:class-native = " clang-native libxcrypt-native" -DEPENDS:append:class-nativesdk = " clang-native clang-crosssdk-${SDK_ARCH} nativesdk-libxcrypt" +DEPENDS:append:class-nativesdk = " clang-native clang-crosssdk-${SDK_SYS} nativesdk-libxcrypt" PACKAGECONFIG ??= "" PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF" @@ -74,10 +76,11 @@ EXTRA_OECMAKE:append:powerpc = " -DCOMPILER_RT_DEFAULT_TARGET_ARCH=powerpc " do_install:append () { if [ -n "${LLVM_LIBDIR_SUFFIX}" ]; then mkdir -p ${D}${nonarch_libdir}/clang - mv ${D}${libdir}/clang/${MAJOR_VER} ${D}${nonarch_libdir}/clang/${MAJOR_VER} - rmdir --ignore-fail-on-non-empty ${D}${libdir} + mv ${D}${libdir}/clang/${MAJOR_VER} ${D}${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER} + rmdir --ignore-fail-on-non-empty ${D}${libdir}/clang ${D}${libdir} + else + mv ${D}${libdir}/clang/${MAJOR_VER} ${D}${libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER} fi - ln -sf ${MAJOR_VER} ${D}${libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER} # Already shipped with compile-rt Orc support rm -rf ${D}${nonarch_libdir}/clang/${MAJOR_VER}/lib/linux/liborc_rt-*.a rm -rf ${D}${nonarch_libdir}/clang/${MAJOR_VER}/include/orc/ @@ -88,7 +91,7 @@ FILES:${PN} += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER} \ ${nonarch_libdir}/clang/${MAJOR_VER}/lib/linux/lib*${SOLIBSDEV} \ ${nonarch_libdir}/clang/${MAJOR_VER}/*.txt \ ${nonarch_libdir}/clang/${MAJOR_VER}/share/*.txt" -FILES:${PN}-staticdev += "${nonarch_libdir}/clang/${MAJOR_VER}/lib/linux/*.a" +FILES:${PN}-staticdev += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.a" FILES:${PN}-dev += "${datadir} ${nonarch_libdir}/clang/${MAJOR_VER}/lib/linux/*.syms \ ${nonarch_libdir}/clang/${MAJOR_VER}/include \ ${nonarch_libdir}/clang/${MAJOR_VER}/lib/linux/clang_rt.crt*.o \ diff --git a/recipes-devtools/clang/compiler-rt_git.bb b/recipes-devtools/clang/compiler-rt_git.bb index 84878aa..080e53b 100644 --- a/recipes-devtools/clang/compiler-rt_git.bb +++ b/recipes-devtools/clang/compiler-rt_git.bb @@ -1,7 +1,11 @@ # Copyright (C) 2015 Khem Raj # Released under the MIT license (see COPYING.MIT for the terms) -DESCRIPTION = "LLVM based C/C++ compiler Runtime" +SUMMARY = "LLVM based C/C++ compiler Runtime" +DESCRIPTIOM = "Simple builtin library that provides an \ + implementation of the low-level target-specific \ + hooks required by code generation and other runtime \ + components" HOMEPAGE = "http://compiler-rt.llvm.org/" SECTION = "base" @@ -22,28 +26,19 @@ INHIBIT_DEFAULT_DEPS = "1" DEPENDS += "ninja-native libgcc" DEPENDS:append:class-target = " clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc gcc-runtime" -DEPENDS:append:class-nativesdk = " clang-native clang-crosssdk-${SDK_ARCH} nativesdk-gcc-runtime" +DEPENDS:append:class-nativesdk = " clang-native clang-crosssdk-${SDK_SYS} nativesdk-gcc-runtime" DEPENDS:append:class-native = " clang-native" # Trick clang.bbclass into not creating circular dependencies -UNWINDLIB:class-nativesdk = "--unwindlib=libgcc" -COMPILER_RT:class-nativesdk:toolchain-clang:runtime-llvm = "-rtlib=libgcc --unwindlib=libgcc" -LIBCPLUSPLUS:class-nativesdk:toolchain-clang:runtime-llvm = "-stdlib=libstdc++" - -CXXFLAGS += "-stdlib=libstdc++" -LDFLAGS += "-unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++" -BUILD_CXXFLAGS += "-stdlib=libstdc++" -BUILD_LDFLAGS += "-unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++" -BUILD_CPPFLAGS:remove = "-stdlib=libc++" -BUILD_LDFLAGS:remove = "-stdlib=libc++ -lc++abi" - -BUILD_CC:toolchain-clang = "${CCACHE}clang" -BUILD_CXX:toolchain-clang = "${CCACHE}clang++" -BUILD_CPP:toolchain-clang = "${CCACHE}clang -E" -BUILD_CCLD:toolchain-clang = "${CCACHE}clang" -BUILD_RANLIB:toolchain-clang = "llvm-ranlib" -BUILD_AR:toolchain-clang = "llvm-ar" -BUILD_NM:toolchain-clang = "llvm-nm" +UNWINDLIB:class-nativesdk:toolchain-clang = "--unwindlib=libgcc" +COMPILER_RT:class-nativesdk:toolchain-clang = "-rtlib=libgcc --unwindlib=libgcc" +LIBCPLUSPLUS:class-nativesdk:toolchain-clang = "-stdlib=libstdc++" +UNWINDLIB:class-native:toolchain-clang = "--unwindlib=libgcc" +COMPILER_RT:class-native:toolchain-clang = "-rtlib=libgcc --unwindlib=libgcc" +LIBCPLUSPLUS:class-native:toolchain-clang = "-stdlib=libstdc++" +UNWINDLIB:class-target:toolchain-clang = "--unwindlib=libgcc" +COMPILER_RT:class-target:toolchain-clang = "-rtlib=libgcc --unwindlib=libgcc" +LIBCPLUSPLUS:class-target:toolchain-clang = "-stdlib=libstdc++" PACKAGECONFIG ??= "" PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF" @@ -128,5 +123,8 @@ BBCLASSEXTEND = "native nativesdk" ALLOW_EMPTY:${PN} = "1" ALLOW_EMPTY:${PN}-dev = "1" -TOOLCHAIN:forcevariable = "clang" +TOOLCHAIN = "clang" +# Overrides defaults from clang.bbclass +TOOLCHAIN:class-nativesdk = "clang" +TOOLCHAIN:class-native = "clang" SYSROOT_DIRS:append:class-target = " ${nonarch_libdir}" diff --git a/recipes-devtools/clang/libclc_git.bb b/recipes-devtools/clang/libclc_git.bb index 16ab833..0d43133 100644 --- a/recipes-devtools/clang/libclc_git.bb +++ b/recipes-devtools/clang/libclc_git.bb @@ -1,4 +1,4 @@ -DESCRIPTION = "LLVM based OpenCL runtime support library" +SUMMARY = "Implementation of the library requirements of the OpenCL 1.1+ C programming language" HOMEPAGE = "http://libclc.llvm.org/" SECTION = "libs" diff --git a/recipes-devtools/clang/libcxx_git.bb b/recipes-devtools/clang/libcxx_git.bb index 3f2f6bb..c7f3a77 100644 --- a/recipes-devtools/clang/libcxx_git.bb +++ b/recipes-devtools/clang/libcxx_git.bb @@ -1,7 +1,7 @@ # Copyright (C) 2015 Khem Raj # Released under the MIT license (see COPYING.MIT for the terms) -DESCRIPTION = "libc++ is a new implementation of the C++ standard library, targeting C++11" +SUMMARY = "libc++ is a new implementation of the C++ standard library, targeting C++11 and above" HOMEPAGE = "http://libcxx.llvm.org/" SECTION = "base" @@ -21,26 +21,19 @@ PACKAGECONFIG[unwind-shared] = "-DLIBUNWIND_ENABLE_SHARED=ON,-DLIBUNWIND_ENABLE_ DEPENDS += "ninja-native" DEPENDS:append:class-target = " clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc virtual/${TARGET_PREFIX}compilerlibs" -DEPENDS:append:class-nativesdk = " clang-crosssdk-${SDK_ARCH} nativesdk-compiler-rt" -DEPENDS:append:class-native = " clang-native" - -LIBCPLUSPLUS = "" -COMPILER_RT ?= "-rtlib=compiler-rt" +DEPENDS:append:class-nativesdk = " clang-crosssdk-${SDK_SYS} nativesdk-compiler-rt" +DEPENDS:append:class-native = " clang-native compiler-rt-native" +COMPILER_RT ?= "${@bb.utils.contains("PACKAGECONFIG", "compiler-rt", "-rtlib=compiler-rt", "-rtlib=libgcc", d)}" +UNWINDLIB ?= "${@bb.utils.contains("PACKAGECONFIG", "unwind", "-unwindlib=none", "-unwindlib=libgcc", d)}" +LIBCPLUSPLUS ?= "-stdlib=libstdc++" # Trick clang.bbclass into not creating circular dependencies -UNWINDLIB:class-nativesdk = "--unwindlib=libgcc" -COMPILER_RT:class-nativesdk = "-rtlib=libgcc --unwindlib=libgcc" +UNWINDLIB:class-nativesdk = "-unwindlib=libgcc" LIBCPLUSPLUS:class-nativesdk = "-stdlib=libstdc++" +UNWINDLIB:class-native = "-unwindlib=libgcc" +LIBCPLUSPLUS:class-native = "-stdlib=libstdc++" -CC:append:toolchain-clang:class-native = " -unwindlib=libgcc -rtlib=libgcc" -CC:append:toolchain-clang:class-nativesdk = " -unwindlib=libgcc -rtlib=libgcc" - -CXXFLAGS += "-stdlib=libstdc++" -LDFLAGS += "-unwindlib=libgcc -stdlib=libstdc++" -BUILD_CXXFLAGS += "-stdlib=libstdc++" -BUILD_LDFLAGS += "-unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++" -BUILD_CPPFLAGS:remove = "-stdlib=libc++" -BUILD_LDFLAGS:remove = "-stdlib=libc++ -lc++abi" +LDFLAGS:append = " ${UNWINDLIB}" INHIBIT_DEFAULT_DEPS = "1" @@ -49,8 +42,8 @@ LIC_FILES_CHKSUM = "file://libcxx/LICENSE.TXT;md5=55d89dd7eec8d3b4204b680e27da39 file://libunwind/LICENSE.TXT;md5=f66970035d12f196030658b11725e1a1 \ " -OECMAKE_TARGET_COMPILE = "cxxabi cxx" -OECMAKE_TARGET_INSTALL = "install-cxx install-cxxabi ${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "install-unwind", "", d)}" +OECMAKE_TARGET_COMPILE = "${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "unwind", "", d)} cxxabi cxx" +OECMAKE_TARGET_INSTALL = "${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "install-unwind", "", d)} install-cxxabi install-cxx" OECMAKE_SOURCEPATH = "${S}/llvm" EXTRA_OECMAKE += "\ @@ -116,4 +109,7 @@ FILES:libunwind:runtime-llvm = "${libdir}/libunwind.so.*" FILES:${PN}-dev += "${datadir}/libc++/v1/ ${libdir}/libc++.modules.json" BBCLASSEXTEND = "native nativesdk" -TOOLCHAIN:forcevariable = "clang" +TOOLCHAIN = "clang" +# Overrides defaults from clang.bbclass +TOOLCHAIN:class-nativesdk = "clang" +TOOLCHAIN:class-native = "clang" diff --git a/recipes-devtools/clang/nativesdk-clang-glue.bb b/recipes-devtools/clang/nativesdk-clang-glue.bb index a0b9374..8e5622f 100644 --- a/recipes-devtools/clang/nativesdk-clang-glue.bb +++ b/recipes-devtools/clang/nativesdk-clang-glue.bb @@ -1,7 +1,7 @@ # Copyright (C) 2014 Khem Raj # Released under the MIT license (see COPYING.MIT for the terms) -DESCRIPTION = "SDK Cross compiler wrappers for LLVM based C/C++ compiler" +SUMMARY = "SDK Cross compiler wrappers for LLVM based C/C++ compiler" HOMEPAGE = "http://clang.llvm.org/" LICENSE = "Apache-2.0-with-LLVM-exception" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab" diff --git a/recipes-devtools/clang/openmp_git.bb b/recipes-devtools/clang/openmp_git.bb index 34f6e4a..549df0e 100644 --- a/recipes-devtools/clang/openmp_git.bb +++ b/recipes-devtools/clang/openmp_git.bb @@ -1,7 +1,7 @@ # Copyright (C) 2017 Khem Raj # Released under the MIT license (see COPYING.MIT for the terms) -DESCRIPTION = "LLVM based C/C++ compiler Runtime" +SUMMARY = "LLVM OpenMP compiler Runtime" HOMEPAGE = "https://openmp.llvm.org/" SECTION = "libs" -- cgit v1.2.3-54-g00ecf