From 3aa8c9f3919fc7cf029d1aee7faf2cc0fad95179 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 24 Jul 2024 17:52:06 -0700 Subject: [PATCH] clang: Upgrade to 19.x release Signed-off-by: Khem Raj --- conf/layer.conf | 2 +- recipes-devtools/clang/clang.inc | 4 +- ...ibunwind-headers-when-LIBCXXABI_LIBU.patch | 16 +-- ...-support-a-new-embedded-linux-target.patch | 2 +- ...lify-cross-compilation.-Don-t-use-na.patch | 6 +- ...ryInfo-Undefine-libc-functions-if-th.patch | 18 +-- ...-env-override-of-exe-and-libdir-path.patch | 2 +- ...g-driver-Check-sysroot-for-ldso-path.patch | 16 +-- ...tools.cpp-Add-lssp_nonshared-on-musl.patch | 6 +- ...08-clang-Prepend-trailing-to-sysroot.patch | 6 +- ...e-the-target-sysroot-for-compiler-ru.patch | 6 +- ...efine-releative-gcc-installation-dir.patch | 6 +- ...ad-and-ldl-along-with-lunwind-for-st.patch | 6 +- ...UTABLE-when-cross-compiling-for-nati.patch | 6 +- ...3-Check-for-atomic-double-intrinsics.patch | 2 +- ...ler-runtime-library-to-link-step-for.patch | 12 +- ...ure-for-packages-using-find_package.patch} | 36 +++--- ...ce-dir-location-for-cross-toolchains.patch | 6 +- ...-dyld-prefix-when-checking-sysroot-f.patch | 14 +-- ...-clang-Use-python3-in-python-scripts.patch | 2 +- ...-Yocto-based-GCC-install-search-path.patch | 12 +- ...-Do-not-use-find_library-for-ncurses.patch | 45 ------- ...r-for-adding-OE-distro-vendor-names.patch} | 6 +- ...t-use-backtrace-APIs-on-non-glibc-l.patch} | 2 +- ...ple-for-non-debian-multiarch-linux-.patch} | 6 +- ...ibunwind-Added-unw_backtrace-method.patch} | 6 +- ...t-use-install-relative-libc-headers.patch} | 6 +- ...Fix-lib-paths-for-OpenEmbedded-Host.patch} | 8 +- ...y-search-path-for-OpenEmbedded-Host.patch} | 10 +- ...iver-finds-GCC-installation-path-on-.patch | 113 ------------------ ...027-lldb-Link-with-libatomic-on-x86.patch} | 4 +- ...mpiler-rt-Enable-__int128-for-ppc32.patch} | 16 +-- ...t-use-cmake-infra-to-detect-libzstd.patch} | 24 ++-- ...-Fix-stat-struct-s-size-for-O32-ABI.patch} | 2 +- ...-_TIME_BITS-along-with-_FILE_OFFSET.patch} | 4 +- ...cpp-ARMLibDirs-search-also-in-lib32.patch} | 14 +-- ...d-OE-specific-ABI-triple-for-N32-ABI.patch | 78 ++++++++++++ ...nwind.pc.in-and-llvm-config-scripts.patch} | 2 +- ...-cmake-check-for-_Float16-and-__bf16.patch | 42 ------- recipes-devtools/clang/common.inc | 50 ++++---- 40 files changed, 256 insertions(+), 368 deletions(-) rename recipes-devtools/clang/clang/{0015-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch => 0015-cmake-Fix-configure-for-packages-using-find_package.patch} (79%) delete mode 100644 recipes-devtools/clang/clang/0020-llvm-Do-not-use-find_library-for-ncurses.patch rename recipes-devtools/clang/clang/{0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch => 0020-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch} (86%) rename recipes-devtools/clang/clang/{0022-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch => 0021-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch} (97%) rename recipes-devtools/clang/clang/{0023-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch => 0022-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch} (86%) rename recipes-devtools/clang/clang/{0024-libunwind-Added-unw_backtrace-method.patch => 0023-libunwind-Added-unw_backtrace-method.patch} (91%) rename recipes-devtools/clang/clang/{0025-clang-Do-not-use-install-relative-libc-headers.patch => 0024-clang-Do-not-use-install-relative-libc-headers.patch} (89%) rename recipes-devtools/clang/clang/{0027-Fix-lib-paths-for-OpenEmbedded-Host.patch => 0025-Fix-lib-paths-for-OpenEmbedded-Host.patch} (93%) rename recipes-devtools/clang/clang/{0028-Correct-library-search-path-for-OpenEmbedded-Host.patch => 0026-Correct-library-search-path-for-OpenEmbedded-Host.patch} (94%) delete mode 100644 recipes-devtools/clang/clang/0026-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch rename recipes-devtools/clang/clang/{0029-lldb-Link-with-libatomic-on-x86.patch => 0027-lldb-Link-with-libatomic-on-x86.patch} (92%) rename recipes-devtools/clang/clang/{0030-compiler-rt-Enable-__int128-for-ppc32.patch => 0028-compiler-rt-Enable-__int128-for-ppc32.patch} (85%) rename recipes-devtools/clang/clang/{0031-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch => 0029-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch} (75%) rename recipes-devtools/clang/clang/{0032-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch => 0030-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch} (96%) rename recipes-devtools/clang/clang/{0033-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch => 0031-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch} (94%) rename recipes-devtools/clang/clang/{0034-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch => 0032-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch} (97%) create mode 100644 recipes-devtools/clang/clang/0033-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch rename recipes-devtools/clang/clang/{0036-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch => 0034-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch} (97%) delete mode 100644 recipes-devtools/clang/clang/0035-compiler-rt-Fix-cmake-check-for-_Float16-and-__bf16.patch diff --git a/conf/layer.conf b/conf/layer.conf index 2fe079b8..19b8c8f8 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -33,7 +33,7 @@ INHERIT += "clang" # Do not include clang in SDK unless user wants to CLANGSDK ??= "0" -LLVMVERSION = "18.1.8" +LLVMVERSION = "19.1.0" require conf/nonclangable.conf require conf/nonscanable.conf diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc index 468d039d..a7c93779 100644 --- a/recipes-devtools/clang/clang.inc +++ b/recipes-devtools/clang/clang.inc @@ -3,9 +3,9 @@ LLVM_DIR = "llvm${LLVM_RELEASE}" LLVM_HTTP ?= "https://github.com/llvm" -MAJOR_VER = "18" +MAJOR_VER = "19" MINOR_VER = "1" -PATCH_VER = "8" +PATCH_VER = "0" # 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 d4afeed9..2acf7e80 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 ec5bd3bfc9f682c90ceba06f2d76aa5234a9c846 Mon Sep 17 00:00:00 2001 +From 7fd51899fc67b4020ea058f059215e6785a881cc 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 @@ -14,14 +14,14 @@ LIBCXXABI_LIBUNWIND_INCLUDES if its there in environment Upstream-Status: Pending Signed-off-by: Khem Raj --- - libcxxabi/CMakeLists.txt | 16 +++++++++++----- - 1 file changed, 11 insertions(+), 5 deletions(-) + libcxxabi/CMakeLists.txt | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt -index da998d2221dc..936b78e4d6dd 100644 +index 43400c6e8d9a..cc0841112c0c 100644 --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt -@@ -422,7 +422,7 @@ set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH +@@ -423,7 +423,7 @@ set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH "Specify path to libunwind source." FORCE) if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) @@ -30,7 +30,7 @@ index da998d2221dc..936b78e4d6dd 100644 PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES} ${LIBCXXABI_LIBUNWIND_PATH}/include ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES} -@@ -433,15 +433,21 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) +@@ -434,18 +434,23 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) NO_CMAKE_FIND_ROOT_PATH ) @@ -47,11 +47,13 @@ index da998d2221dc..936b78e4d6dd 100644 + include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES}") endif() + add_custom_target(cxxabi-test-depends + COMMENT "Build dependencies required to run the libc++abi test suite.") + +set(LIBCXXABI_LIBUNWIND_INCLUDES "${LIBCXXABI_LIBUNWIND_INCLUDES}" CACHE PATH + "Specify path to libunwind includes." FORCE) +set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH + "Specify path to libunwind source." FORCE) -+ + # Add source code. This also contains all of the logic for deciding linker flags # soname, etc... 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 6c5c0de5..f64e8ee0 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 ac1643e6e68697e6ee374535dd98413c92224076 Mon Sep 17 00:00:00 2001 +From da0d22b4a5f896e8d2b8b99328691a358c43b220 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 c5c809bb..f85ba702 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 3d969ae73698da3518f3230f9e40cb7bd6f2e6c3 Mon Sep 17 00:00:00 2001 +From a6e2fb830456df179534a928aa2e1a1548b92d22 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 @@ -21,10 +21,10 @@ Signed-off-by: Khem Raj 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt -index bbb4e8d7c333..583e5630b03c 100644 +index 2207555b03a0..c28106378bdd 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt -@@ -82,7 +82,16 @@ if (COMPILER_RT_STANDALONE_BUILD) +@@ -86,7 +86,16 @@ if (COMPILER_RT_STANDALONE_BUILD) set(CMAKE_CXX_EXTENSIONS NO) if (NOT LLVM_RUNTIMES_BUILD) 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 505a5bac..d8b508e2 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 df831369b91c38565d73b56d452186eff0a63dd4 Mon Sep 17 00:00:00 2001 +From 697e9a29f75e1496040fbb6ed1805fefc335e036 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 @@ -14,10 +14,10 @@ Signed-off-by: Khem Raj 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.def b/llvm/include/llvm/Analysis/TargetLibraryInfo.def -index 6bd922eed89e..9e15466f963a 100644 +index 623cdb4b6e0b..18bb48beb702 100644 --- a/llvm/include/llvm/Analysis/TargetLibraryInfo.def +++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.def -@@ -1348,6 +1348,9 @@ TLI_DEFINE_STRING_INTERNAL("fopen") +@@ -1368,6 +1368,9 @@ TLI_DEFINE_STRING_INTERNAL("fopen") TLI_DEFINE_SIG_INTERNAL(Ptr, Ptr, Ptr) /// FILE *fopen64(const char *filename, const char *opentype) @@ -27,7 +27,7 @@ index 6bd922eed89e..9e15466f963a 100644 TLI_DEFINE_ENUM_INTERNAL(fopen64) TLI_DEFINE_STRING_INTERNAL("fopen64") TLI_DEFINE_SIG_INTERNAL(Ptr, Ptr, Ptr) -@@ -1426,7 +1429,9 @@ TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Long, Int) +@@ -1446,7 +1449,9 @@ TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Long, Int) TLI_DEFINE_ENUM_INTERNAL(fseeko) TLI_DEFINE_STRING_INTERNAL("fseeko") TLI_DEFINE_SIG_INTERNAL(Int, Ptr, IntX, Int) @@ -38,7 +38,7 @@ index 6bd922eed89e..9e15466f963a 100644 /// int fseeko64(FILE *stream, off64_t offset, int whence) TLI_DEFINE_ENUM_INTERNAL(fseeko64) TLI_DEFINE_STRING_INTERNAL("fseeko64") -@@ -1443,6 +1448,9 @@ TLI_DEFINE_STRING_INTERNAL("fstat") +@@ -1463,6 +1468,9 @@ TLI_DEFINE_STRING_INTERNAL("fstat") TLI_DEFINE_SIG_INTERNAL(Int, Int, Ptr) /// int fstat64(int filedes, struct stat64 *buf) @@ -48,7 +48,7 @@ index 6bd922eed89e..9e15466f963a 100644 TLI_DEFINE_ENUM_INTERNAL(fstat64) TLI_DEFINE_STRING_INTERNAL("fstat64") TLI_DEFINE_SIG_INTERNAL(Int, Int, Ptr) -@@ -1468,6 +1476,9 @@ TLI_DEFINE_STRING_INTERNAL("ftello") +@@ -1488,6 +1496,9 @@ TLI_DEFINE_STRING_INTERNAL("ftello") TLI_DEFINE_SIG_INTERNAL(IntPlus, Ptr) /// off64_t ftello64(FILE *stream) @@ -58,7 +58,7 @@ index 6bd922eed89e..9e15466f963a 100644 TLI_DEFINE_ENUM_INTERNAL(ftello64) TLI_DEFINE_STRING_INTERNAL("ftello64") TLI_DEFINE_SIG_INTERNAL(Int64, Ptr) -@@ -1678,6 +1689,9 @@ TLI_DEFINE_STRING_INTERNAL("lstat") +@@ -1698,6 +1709,9 @@ TLI_DEFINE_STRING_INTERNAL("lstat") TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Ptr) /// int lstat64(const char *path, struct stat64 *buf); @@ -68,7 +68,7 @@ index 6bd922eed89e..9e15466f963a 100644 TLI_DEFINE_ENUM_INTERNAL(lstat64) TLI_DEFINE_STRING_INTERNAL("lstat64") TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Ptr) -@@ -2090,6 +2104,9 @@ TLI_DEFINE_STRING_INTERNAL("stat") +@@ -2125,6 +2139,9 @@ TLI_DEFINE_STRING_INTERNAL("stat") TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Ptr) /// int stat64(const char *path, struct stat64 *buf); @@ -78,7 +78,7 @@ index 6bd922eed89e..9e15466f963a 100644 TLI_DEFINE_ENUM_INTERNAL(stat64) TLI_DEFINE_STRING_INTERNAL("stat64") TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Ptr) -@@ -2315,6 +2332,9 @@ TLI_DEFINE_STRING_INTERNAL("tmpfile") +@@ -2350,6 +2367,9 @@ TLI_DEFINE_STRING_INTERNAL("tmpfile") TLI_DEFINE_SIG_INTERNAL(Ptr) /// FILE *tmpfile64(void) 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 249027a8..cb71abdb 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 a160c086ee25bb5db31bc497e910c3615681e948 Mon Sep 17 00:00:00 2001 +From fa0e640f6f97a0864bc2a6a6b6c1820aaa6fd524 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 1175ec72..eeec6cff 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 af511db3b78d27f21af09877c1c188b1c0c2ce0a Mon Sep 17 00:00:00 2001 +From 28c9b02b5c3068fdfe22b413a0a74a0e13979ab0 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,10 +15,10 @@ 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 4300a2bdff17..fe1bea2bde9d 100644 +index 2265138edbff..4067f7560140 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -499,7 +499,11 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -510,7 +510,11 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { Triple.getEnvironment() == llvm::Triple::GNUEABIHF || tools::arm::getARMFloatABI(*this, Args) == tools::arm::FloatABI::Hard; @@ -31,7 +31,7 @@ index 4300a2bdff17..fe1bea2bde9d 100644 Loader = HF ? "ld-linux-armhf.so.3" : "ld-linux.so.3"; break; } -@@ -554,11 +558,19 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -565,11 +569,19 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { LibDir = "lib64"; Loader = (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1"; @@ -49,9 +49,9 @@ index 4300a2bdff17..fe1bea2bde9d 100644 + LibDir = "lib"; + } break; - case llvm::Triple::riscv32: { - StringRef ABIName = tools::riscv::getRISCVABI(Args, Triple); -@@ -580,6 +592,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + case llvm::Triple::riscv32: + case llvm::Triple::riscv64: { +@@ -587,6 +599,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 4300a2bdff17..fe1bea2bde9d 100644 break; case llvm::Triple::systemz: LibDir = "lib"; -@@ -594,6 +610,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -601,6 +617,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 9d174a7d..1669e569 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 a842a494f82f68c92a562aa40e6861f792d5b703 Mon Sep 17 00:00:00 2001 +From 2400cd00df64124442f9fde28577a597f5e00c77 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,10 +14,10 @@ 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 e5e1b1d77269..7b43cde6b884 100644 +index 543f3965dfd4..668b56db37c6 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -628,6 +628,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, +@@ -632,6 +632,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, if (IsIAMCU) CmdArgs.push_back("-lgloss"); 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 c43219f9..057c4f40 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 53b47e96f7c69bea46d16489dd6887561245c23f Mon Sep 17 00:00:00 2001 +From 020c2f08971ff8a94b93f40c4bd3228215866b4c 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,10 +25,10 @@ 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 fe1bea2bde9d..9cfc135ed2c0 100644 +index 4067f7560140..d4b26fc986d9 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -219,7 +219,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) +@@ -222,7 +222,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) Multilibs = GCCInstallation.getMultilibs(); SelectedMultilibs.assign({GCCInstallation.getMultilib()}); llvm::Triple::ArchType Arch = Triple.getArch(); 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 31491594..cb715b77 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 fd99d9521a7f9ce8c8de7c05a9636efa5a5c34e2 Mon Sep 17 00:00:00 2001 +From dbd76c8eb129e94dfeb5c3c19555807fcbf8a29e 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 @@ -16,7 +16,7 @@ Signed-off-by: Khem Raj 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp -index 388030592b48..c59700b4a7ab 100644 +index 20a555afb809..e6d285795337 100644 --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/lib/Driver/ToolChain.cpp @@ -15,6 +15,7 @@ @@ -27,7 +27,7 @@ index 388030592b48..c59700b4a7ab 100644 #include "clang/Config/config.h" #include "clang/Driver/Action.h" #include "clang/Driver/Driver.h" -@@ -595,7 +596,10 @@ StringRef ToolChain::getOSLibName() const { +@@ -619,7 +620,10 @@ StringRef ToolChain::getOSLibName() const { } std::string ToolChain::getCompilerRTPath() const { 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 7d56623d..157baf1c 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 a310e5638205777893228a1c0853bd5494e7d02c Mon Sep 17 00:00:00 2001 +From f86e17b1d61f35748a5df5061738223f249576e5 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 7b43cde6b884..1ea6927d06f3 100644 +index 668b56db37c6..e6961b023b5a 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2913,19 +2913,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( +@@ -2916,19 +2916,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 4e9360ca..43158ffd 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 bc21d17ff434af5efdb2fac86392862230c6f9e6 Mon Sep 17 00:00:00 2001 +From 848f75da471a901ec56f42a6d5363e1d9e0ea438 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 @@ -21,10 +21,10 @@ Signed-off-by: Khem Raj 1 file changed, 2 insertions(+) diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp -index 2b916f000336..de823347a527 100644 +index 019df16a909f..00d608c0c095 100644 --- a/clang/lib/Driver/ToolChains/CommonArgs.cpp +++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp -@@ -2179,6 +2179,8 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D, +@@ -2183,6 +2183,8 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D, CmdArgs.push_back("-lunwind"); } else if (LGT == LibGccType::StaticLibGcc) { CmdArgs.push_back("-l:libunwind.a"); 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 b6efd2bc..86d6bf06 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 a48c97d8a0f5eee9729cad03eac5be677c9963e8 Mon Sep 17 00:00:00 2001 +From 8892206ca4f2103ecd65e374e79a3435120fab84 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 @@ -11,10 +11,10 @@ Signed-off-by: Khem Raj 1 file changed, 1 insertion(+) diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake -index 55bf3be75642..71b09ec05b68 100644 +index 39b4abaa0d93..a47afde7f85d 100644 --- a/llvm/cmake/modules/CrossCompile.cmake +++ b/llvm/cmake/modules/CrossCompile.cmake -@@ -90,6 +90,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype) +@@ -92,6 +92,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype) -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN="${LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN}" -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_TESTS=OFF 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 5a942e60..e8e01595 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 4e96e75d77d0d59399f0b8ad7aa0555e39e7b5cc Mon Sep 17 00:00:00 2001 +From 856c8e77d2e9492b1a38972ca39c3d529cf3997b 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-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 index 757917f9..c7575c33 100644 --- 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 @@ -1,4 +1,4 @@ -From c0a66d4f358b24bf3acd89910e0f7fc780d16a11 Mon Sep 17 00:00:00 2001 +From 71b6f486b7de7f7d19005aa8b0a2a60527616cc0 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 @@ -14,22 +14,22 @@ Signed-off-by: Khem Raj 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt -index 1b80625304a4..fe706c9e920f 100644 +index 0dfc9647558d..08ddad95a42e 100644 --- a/libcxx/src/CMakeLists.txt +++ b/libcxx/src/CMakeLists.txt -@@ -198,7 +198,7 @@ if (LIBCXX_ENABLE_SHARED) +@@ -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 + 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}" -@@ -291,7 +291,7 @@ if (LIBCXX_ENABLE_STATIC) +@@ -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 + 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) diff --git a/recipes-devtools/clang/clang/0015-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch b/recipes-devtools/clang/clang/0015-cmake-Fix-configure-for-packages-using-find_package.patch similarity index 79% rename from recipes-devtools/clang/clang/0015-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch rename to recipes-devtools/clang/clang/0015-cmake-Fix-configure-for-packages-using-find_package.patch index d42836de..fce813d9 100644 --- a/recipes-devtools/clang/clang/0015-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch +++ b/recipes-devtools/clang/clang/0015-cmake-Fix-configure-for-packages-using-find_package.patch @@ -1,8 +1,7 @@ -From aab6a666bf1094d9750a10e547ebd6fe093af513 Mon Sep 17 00:00:00 2001 +From 180a111f65187224596f8cd227f1a6f78142b14d Mon Sep 17 00:00:00 2001 From: Ovidiu Panait Date: Fri, 31 Jan 2020 10:56:11 +0200 -Subject: [PATCH] clang,llvm: cmake: Fix configure for packages using - find_package() +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 @@ -27,15 +26,15 @@ Upstream-Status: Inappropriate [oe-specific] Signed-off-by: Ovidiu Panait --- clang/cmake/modules/AddClang.cmake | 2 -- - llvm/cmake/modules/AddLLVM.cmake | 6 ------ + llvm/cmake/modules/AddLLVM.cmake | 7 +------ llvm/cmake/modules/TableGen.cmake | 6 ------ - 3 files changed, 14 deletions(-) + 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake -index 75b0080f6715..ddf446a13eca 100644 +index 9d09be193684..d6123b834337 100644 --- a/clang/cmake/modules/AddClang.cmake +++ b/clang/cmake/modules/AddClang.cmake -@@ -168,7 +168,6 @@ macro(add_clang_tool name) +@@ -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} @@ -43,7 +42,7 @@ index 75b0080f6715..ddf446a13eca 100644 RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${name}) -@@ -177,7 +176,6 @@ macro(add_clang_tool name) +@@ -178,7 +177,6 @@ macro(add_clang_tool name) DEPENDS ${name} COMPONENT ${name}) endif() @@ -52,10 +51,10 @@ index 75b0080f6715..ddf446a13eca 100644 endif() endmacro() diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake -index 3bc78b0dc935..bc492ceb90db 100644 +index 03f4e1f190fd..6335ab262d19 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake -@@ -1368,7 +1368,6 @@ macro(llvm_add_tool project name) +@@ -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} @@ -63,17 +62,18 @@ index 3bc78b0dc935..bc492ceb90db 100644 RUNTIME DESTINATION ${${project}_TOOLS_INSTALL_DIR} COMPONENT ${name}) -@@ -1379,9 +1378,6 @@ macro(llvm_add_tool project 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") ++ set_target_properties(${name} PROPERTIES FOLDER "Tools") endif() - endmacro(llvm_add_tool project name) -@@ -1426,7 +1422,6 @@ macro(add_llvm_utility name) + 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} @@ -81,7 +81,7 @@ index 3bc78b0dc935..bc492ceb90db 100644 RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR} COMPONENT ${name}) -@@ -1435,7 +1430,6 @@ macro(add_llvm_utility name) +@@ -1506,7 +1502,6 @@ macro(add_llvm_utility name) DEPENDS ${name} COMPONENT ${name}) endif() @@ -90,10 +90,10 @@ index 3bc78b0dc935..bc492ceb90db 100644 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 1d18fdde2bb9..c9363ffb3376 100644 +index ffcc718b4777..a76f28e74b86 100644 --- a/llvm/cmake/modules/TableGen.cmake +++ b/llvm/cmake/modules/TableGen.cmake -@@ -222,12 +222,7 @@ macro(add_tablegen target project) +@@ -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)) @@ -106,7 +106,7 @@ index 1d18fdde2bb9..c9363ffb3376 100644 COMPONENT ${target} RUNTIME DESTINATION "${ADD_TABLEGEN_DESTINATION}") if(NOT LLVM_ENABLE_IDE) -@@ -238,6 +233,5 @@ macro(add_tablegen target project) +@@ -248,6 +243,5 @@ macro(add_tablegen target project) endif() if(ADD_TABLEGEN_EXPORT) string(TOUPPER ${ADD_TABLEGEN_EXPORT} export_upper) 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 index b7aeb2b0..fa025153 100644 --- 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 @@ -1,4 +1,4 @@ -From 58cae5f6f4df0e6fd8529f99f940984e770f4c84 Mon Sep 17 00:00:00 2001 +From 6c963eaa281c23b321495de2cd1c965aae800440 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 @@ -20,10 +20,10 @@ Signed-off-by: Khem Raj 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp -index 93cddf742d52..88291dd125d3 100644 +index 8e44d5afa40e..b3eaf45fded9 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp -@@ -179,9 +179,15 @@ std::string Driver::GetResourcesPath(StringRef BinaryPath, +@@ -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. 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 index fca46f4a..a2e3e6db 100644 --- 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 @@ -1,4 +1,4 @@ -From 6c83a2e75b42eff98975bebacd446455d60cb128 Mon Sep 17 00:00:00 2001 +From cde2b2959e53a10986208aa8c289ffd0bce602d8 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 @@ -19,10 +19,10 @@ Signed-off-by: Khem Raj 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 9cfc135ed2c0..6df8c58076c9 100644 +index d4b26fc986d9..9149a4baa564 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -500,8 +500,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -511,8 +511,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { tools::arm::getARMFloatABI(*this, Args) == tools::arm::FloatABI::Hard; LibDir = "lib32"; @@ -33,7 +33,7 @@ index 9cfc135ed2c0..6df8c58076c9 100644 LibDir = "lib"; } Loader = HF ? "ld-linux-armhf.so.3" : "ld-linux.so.3"; -@@ -558,8 +558,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -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"; @@ -44,7 +44,7 @@ index 9cfc135ed2c0..6df8c58076c9 100644 LibDir = "lib"; } break; -@@ -567,8 +567,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -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"; @@ -55,7 +55,7 @@ index 9cfc135ed2c0..6df8c58076c9 100644 LibDir = "lib"; } break; -@@ -592,8 +592,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -599,8 +599,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { case llvm::Triple::sparcv9: LibDir = "lib64"; Loader = "ld-linux.so.2"; @@ -66,7 +66,7 @@ index 9cfc135ed2c0..6df8c58076c9 100644 LibDir = "lib"; } break; -@@ -610,8 +610,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -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"; 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 index d72a623c..978f2979 100644 --- 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 @@ -1,4 +1,4 @@ -From 5a572d401005fb992b421d65628267e49d70ee74 Mon Sep 17 00:00:00 2001 +From 03a9fb513c1f30b962b01eff3fb6b0a358ba09c4 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 14 Oct 2020 22:19:57 -0700 Subject: [PATCH] clang: Use python3 in python scripts diff --git a/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 index 32708727..b36ea691 100644 --- 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 @@ -1,4 +1,4 @@ -From b928740f3def5353a779859c0454666cae1f7d61 Mon Sep 17 00:00:00 2001 +From 25340c4da1217d2d74aa48556077740e11d097f4 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 @@ -57,14 +57,14 @@ Signed-off-by: Khem Raj 1 file changed, 1 insertion(+) diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 1ea6927d06f3..185ea3df16f5 100644 +index e6961b023b5a..aa7bf4a2455f 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2488,6 +2488,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( +@@ -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-linux-gnu", - "x86_64-slackware-linux", "x86_64-unknown-linux", + "x86_64-manbo-linux-gnu", "x86_64-slackware-linux", + "x86_64-oe-linux",//CLANG_EXTRA_OE_VENDORS_TRIPLES - "x86_64-amazon-linux"}; + "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/0020-llvm-Do-not-use-find_library-for-ncurses.patch b/recipes-devtools/clang/clang/0020-llvm-Do-not-use-find_library-for-ncurses.patch deleted file mode 100644 index e14bc9d4..00000000 --- a/recipes-devtools/clang/clang/0020-llvm-Do-not-use-find_library-for-ncurses.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 07e74b7f5147d5da67b46067df5d26090a3bb96b Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sun, 7 Feb 2021 23:58:41 -0800 -Subject: [PATCH] llvm: Do not use find_library for ncurses - -This ensures that it lets OE to decide which lib to link -otherwise it adds absolute paths to linker cmdline and confuses it -horribly with native and target libs when build clang for target - -TOPDIR/build/tmp/work/cortexa57-yoe-linux-musl/clang/12.0.0-r0/recipe-sysroot-native/usr/lib/libtinfo.so: error adding symbols: file in wrong format -clang-12: error: linker command failed with exit code 1 (use -v to see invocation) - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - compiler-rt/cmake/config-ix.cmake | 2 +- - llvm/cmake/modules/FindTerminfo.cmake | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake -index 2ca18ebb4ad4..51c56f1e0b8b 100644 ---- a/compiler-rt/cmake/config-ix.cmake -+++ b/compiler-rt/cmake/config-ix.cmake -@@ -188,7 +188,7 @@ else() - set(MAYBE_REQUIRED) - endif() - if(LLVM_ENABLE_TERMINFO) -- find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED}) -+ find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - endif() - if(COMPILER_RT_TERMINFO_LIB) - set(LLVM_ENABLE_TERMINFO 1) -diff --git a/llvm/cmake/modules/FindTerminfo.cmake b/llvm/cmake/modules/FindTerminfo.cmake -index 163af6697067..bf2e760bed8a 100644 ---- a/llvm/cmake/modules/FindTerminfo.cmake -+++ b/llvm/cmake/modules/FindTerminfo.cmake -@@ -11,7 +11,7 @@ - # Additionally, the following import target will be defined: - # Terminfo::terminfo - --find_library(Terminfo_LIBRARIES NAMES terminfo tinfo curses ncurses ncursesw) -+find_library(Terminfo_LIBRARIES NAMES terminfo tinfo curses ncurses ncursesw NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - - if(Terminfo_LIBRARIES) - include(CMakePushCheckState) diff --git a/recipes-devtools/clang/clang/0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch b/recipes-devtools/clang/clang/0020-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch similarity index 86% rename from recipes-devtools/clang/clang/0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch rename to recipes-devtools/clang/clang/0020-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch index 4feca045..9e0a319b 100644 --- a/recipes-devtools/clang/clang/0021-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 @@ -1,4 +1,4 @@ -From a3dbd6b6c8bfab6877632ec7a1e981aaa2883d90 Mon Sep 17 00:00:00 2001 +From 5c45732fc4753d502302df62c44ee5e455362ad4 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 @@ -18,10 +18,10 @@ Signed-off-by: Martin Jansa 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/TargetParser/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp -index 0bbe8a3cedfd..dbc1240703a0 100644 +index bf89aace65e5..fb9cbeb30351 100644 --- a/llvm/lib/TargetParser/Triple.cpp +++ b/llvm/lib/TargetParser/Triple.cpp -@@ -601,7 +601,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) { +@@ -636,7 +636,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) { .Case("amd", Triple::AMD) .Case("mesa", Triple::Mesa) .Case("suse", Triple::SUSE) diff --git a/recipes-devtools/clang/clang/0022-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 similarity index 97% rename from recipes-devtools/clang/clang/0022-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch rename to recipes-devtools/clang/clang/0021-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch index 5498c707..bdc7f2e2 100644 --- a/recipes-devtools/clang/clang/0022-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 @@ -1,4 +1,4 @@ -From afed95c05037559e53d9a60b8520b372d54b467d Mon Sep 17 00:00:00 2001 +From 54879f9e7fe747fd2d14eb7d566531763d723b2b Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 19 May 2021 17:32:13 -0700 Subject: [PATCH] compiler-rt: Do not use backtrace APIs on non-glibc linux diff --git a/recipes-devtools/clang/clang/0023-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 similarity index 86% rename from recipes-devtools/clang/clang/0023-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch rename to recipes-devtools/clang/clang/0022-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch index 6f982e94..cbc7b832 100644 --- a/recipes-devtools/clang/clang/0023-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 @@ -1,4 +1,4 @@ -From 25434c45f0c7079e9171b5ef4027626a64d3e50b Mon Sep 17 00:00:00 2001 +From 84e563ac4e962028e7a6f3a67d42199967edb4f3 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 @@ -13,10 +13,10 @@ Signed-off-by: Khem Raj 1 file changed, 3 insertions(+) diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 6df8c58076c9..cf549331d255 100644 +index 9149a4baa564..cdea589eb226 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -707,6 +707,9 @@ void Linux::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, +@@ -714,6 +714,9 @@ void Linux::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, GCCInstallation.getTriple().getArch() == llvm::Triple::x86 ? "i386-linux-gnu" : TripleStr; diff --git a/recipes-devtools/clang/clang/0024-libunwind-Added-unw_backtrace-method.patch b/recipes-devtools/clang/clang/0023-libunwind-Added-unw_backtrace-method.patch similarity index 91% rename from recipes-devtools/clang/clang/0024-libunwind-Added-unw_backtrace-method.patch rename to recipes-devtools/clang/clang/0023-libunwind-Added-unw_backtrace-method.patch index 887fcd5a..d001d83b 100644 --- a/recipes-devtools/clang/clang/0024-libunwind-Added-unw_backtrace-method.patch +++ b/recipes-devtools/clang/clang/0023-libunwind-Added-unw_backtrace-method.patch @@ -1,4 +1,4 @@ -From c4ec538a1e00eb60ad890df51401f27484b349d9 Mon Sep 17 00:00:00 2001 +From 5ceffa8a108432716da568d3a5fcb69ccf40fa53 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 @@ -24,10 +24,10 @@ index b2dae8feed9a..0ab974c9bfa4 100644 extern unw_addr_space_t unw_local_addr_space; diff --git a/libunwind/src/libunwind.cpp b/libunwind/src/libunwind.cpp -index 217dde909863..5797c806c084 100644 +index cf39ec5f7dbd..1896f20d57f8 100644 --- a/libunwind/src/libunwind.cpp +++ b/libunwind/src/libunwind.cpp -@@ -432,6 +432,26 @@ int __unw_remove_find_dynamic_unwind_sections( +@@ -431,6 +431,26 @@ int __unw_remove_find_dynamic_unwind_sections( #endif // __APPLE__ diff --git a/recipes-devtools/clang/clang/0025-clang-Do-not-use-install-relative-libc-headers.patch b/recipes-devtools/clang/clang/0024-clang-Do-not-use-install-relative-libc-headers.patch similarity index 89% rename from recipes-devtools/clang/clang/0025-clang-Do-not-use-install-relative-libc-headers.patch rename to recipes-devtools/clang/clang/0024-clang-Do-not-use-install-relative-libc-headers.patch index 0e4a3b32..b1043c72 100644 --- a/recipes-devtools/clang/clang/0025-clang-Do-not-use-install-relative-libc-headers.patch +++ b/recipes-devtools/clang/clang/0024-clang-Do-not-use-install-relative-libc-headers.patch @@ -1,4 +1,4 @@ -From b759741be82cc87406f5b7ece236617ad5450e78 Mon Sep 17 00:00:00 2001 +From 38354e7364a41c8657f2ffbeb3d5ac3a89f84eb7 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 @@ -16,10 +16,10 @@ Signed-off-by: Khem Raj 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 185ea3df16f5..d883dc3e7558 100644 +index aa7bf4a2455f..822a550de2a5 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -3313,8 +3313,11 @@ Generic_GCC::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, +@@ -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"); diff --git a/recipes-devtools/clang/clang/0027-Fix-lib-paths-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0025-Fix-lib-paths-for-OpenEmbedded-Host.patch similarity index 93% rename from recipes-devtools/clang/clang/0027-Fix-lib-paths-for-OpenEmbedded-Host.patch rename to recipes-devtools/clang/clang/0025-Fix-lib-paths-for-OpenEmbedded-Host.patch index 20ce2780..d16a64d8 100644 --- a/recipes-devtools/clang/clang/0027-Fix-lib-paths-for-OpenEmbedded-Host.patch +++ b/recipes-devtools/clang/clang/0025-Fix-lib-paths-for-OpenEmbedded-Host.patch @@ -1,4 +1,4 @@ -From 93855bad691059a81906ab632830239039527c6c Mon Sep 17 00:00:00 2001 +From b4a08b047af15549f720c408c8c3eb7441b52233 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 @@ -48,7 +48,7 @@ Signed-off-by: Khem Raj 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index c627602827c3..98d979ace17b 100644 +index 822a550de2a5..f081a778cfe9 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp @@ -19,6 +19,7 @@ @@ -59,7 +59,7 @@ index c627602827c3..98d979ace17b 100644 #include "clang/Driver/Driver.h" #include "clang/Driver/DriverDiagnostic.h" #include "clang/Driver/MultilibBuilder.h" -@@ -2918,6 +2919,7 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( +@@ -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) { @@ -67,7 +67,7 @@ index c627602827c3..98d979ace17b 100644 // Locations relative to the system lib directory where GCC's triple-specific // directories might reside. struct GCCLibSuffix { -@@ -2935,7 +2937,8 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( +@@ -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 || diff --git a/recipes-devtools/clang/clang/0028-Correct-library-search-path-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0026-Correct-library-search-path-for-OpenEmbedded-Host.patch similarity index 94% rename from recipes-devtools/clang/clang/0028-Correct-library-search-path-for-OpenEmbedded-Host.patch rename to recipes-devtools/clang/clang/0026-Correct-library-search-path-for-OpenEmbedded-Host.patch index 554f966f..e7dcb2f3 100644 --- a/recipes-devtools/clang/clang/0028-Correct-library-search-path-for-OpenEmbedded-Host.patch +++ b/recipes-devtools/clang/clang/0026-Correct-library-search-path-for-OpenEmbedded-Host.patch @@ -1,4 +1,4 @@ -From 42bf038560a9b0bf688b0a85cbd444445e1c26dc Mon Sep 17 00:00:00 2001 +From 72b1f313e6b14413e84f25bbcde8f4d05f5ec786 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 @@ -39,7 +39,7 @@ Signed-off-by: Khem Raj 3 files changed, 4 insertions(+) diff --git a/clang/include/clang/Driver/Distro.h b/clang/include/clang/Driver/Distro.h -index a8de94163e8b..847d6a3f9d1a 100644 +index 1404e1686848..90940e4a0bac 100644 --- a/clang/include/clang/Driver/Distro.h +++ b/clang/include/clang/Driver/Distro.h @@ -45,6 +45,7 @@ public: @@ -50,7 +50,7 @@ index a8de94163e8b..847d6a3f9d1a 100644 OpenSUSE, UbuntuHardy, UbuntuIntrepid, -@@ -137,6 +138,7 @@ public: +@@ -138,6 +139,7 @@ public: bool IsGentoo() const { return DistroVal == Gentoo; } @@ -59,7 +59,7 @@ index a8de94163e8b..847d6a3f9d1a 100644 }; diff --git a/clang/lib/Driver/Distro.cpp b/clang/lib/Driver/Distro.cpp -index a7e7f169dc14..48d4e15196da 100644 +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) { @@ -71,7 +71,7 @@ index a7e7f169dc14..48d4e15196da 100644 return Version; } diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index cf549331d255..699ff18b1240 100644 +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, diff --git a/recipes-devtools/clang/clang/0026-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch b/recipes-devtools/clang/clang/0026-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch deleted file mode 100644 index 7ceccd56..00000000 --- a/recipes-devtools/clang/clang/0026-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch +++ /dev/null @@ -1,113 +0,0 @@ -From c95b551389ae1622faf630be3ddaf0dc62892595 Mon Sep 17 00:00:00 2001 -From: David Abdurachmanov -Date: Wed, 20 Oct 2021 17:30:36 -0700 -Subject: [PATCH] clang: Fix how driver finds GCC installation path on - OpenEmbedded - -Fix how Clang Driver finds GCC installation path on OpenEmbedded - -- For RISCV (riscv{32,64}) we define new two multi-lib options without any - subdirectories (e.g., lib32/ilp32d or lib64/lp64d). OpenEmbedded GCC - builds don't use them. -- Modify how Clang Driver finds GCC installation path. This is important - because GCC files on OpenEmbedded are in two different directories: - (1) /usr/bin/../lib/gcc/riscv64-oe-linux/9.2.0 - (2) /usr/lib/riscv64-oe-linux/9.2.0 - -Clang Driver will check (1) first. The directory exist, but will produce -no valid multi-libs and there will be no multi-lib selected. (2) contains -actual GCC run-time objects/libraries, but because the path has exact -same GCC version (9.2.0) it will be skipped. - -We modify the approach by allowing to check other directories with the same -GCC version. We also avoid picking GCC installation path if it results in -an empty multi-lib list. - -Upstream-Status: Pending -Signed-off-by: David Abdurachmanov -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Gnu.cpp | 57 ++++++++++++++++++++--------- - 1 file changed, 39 insertions(+), 18 deletions(-) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index d883dc3e7558..c627602827c3 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -1909,23 +1909,38 @@ static void findRISCVMultilibs(const Driver &D, - return findRISCVBareMetalMultilibs(D, TargetTriple, Path, Args, Result); - - FilterNonExistent NonExistent(Path, "/crtbegin.o", D.getVFS()); -- MultilibBuilder Ilp32 = -- MultilibBuilder("lib32/ilp32").flag("-m32").flag("-mabi=ilp32"); -- MultilibBuilder Ilp32f = -- MultilibBuilder("lib32/ilp32f").flag("-m32").flag("-mabi=ilp32f"); -- MultilibBuilder Ilp32d = -- MultilibBuilder("lib32/ilp32d").flag("-m32").flag("-mabi=ilp32d"); -- MultilibBuilder Lp64 = -- MultilibBuilder("lib64/lp64").flag("-m64").flag("-mabi=lp64"); -- MultilibBuilder Lp64f = -- MultilibBuilder("lib64/lp64f").flag("-m64").flag("-mabi=lp64f"); -- MultilibBuilder Lp64d = -- MultilibBuilder("lib64/lp64d").flag("-m64").flag("-mabi=lp64d"); -- MultilibSet RISCVMultilibs = -- MultilibSetBuilder() -- .Either({Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d}) -- .makeMultilibSet() -- .FilterOut(NonExistent); -+ -+ MultilibSet RISCVMultilibs; -+ -+ if (TargetTriple.getVendor() == llvm::Triple::OpenEmbedded) { -+ MultilibBuilder OpenEmbeddedIlp32d = -+ MultilibBuilder("").flag("+m32").flag("+mabi=ilp32d"); -+ MultilibBuilder OpenEmbeddedLp64d = -+ MultilibBuilder("").flag("+m64").flag("+mabi=lp64d"); -+ RISCVMultilibs = -+ MultilibSetBuilder() -+ .Either({OpenEmbeddedIlp32d, OpenEmbeddedLp64d}) -+ .makeMultilibSet() -+ .FilterOut(NonExistent); -+ } else { -+ MultilibBuilder Ilp32 = -+ MultilibBuilder("lib32/ilp32").flag("-m32").flag("-mabi=ilp32"); -+ MultilibBuilder Ilp32f = -+ MultilibBuilder("lib32/ilp32f").flag("-m32").flag("-mabi=ilp32f"); -+ MultilibBuilder Ilp32d = -+ MultilibBuilder("lib32/ilp32d").flag("-m32").flag("-mabi=ilp32d"); -+ MultilibBuilder Lp64 = -+ MultilibBuilder("lib64/lp64").flag("-m64").flag("-mabi=lp64"); -+ MultilibBuilder Lp64f = -+ MultilibBuilder("lib64/lp64f").flag("-m64").flag("-mabi=lp64f"); -+ MultilibBuilder Lp64d = -+ MultilibBuilder("lib64/lp64d").flag("-m64").flag("-mabi=lp64d"); -+ RISCVMultilibs = -+ MultilibSetBuilder() -+ .Either({Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d}) -+ .makeMultilibSet() -+ .FilterOut(NonExistent); -+ } - - Multilib::flags_list Flags; - bool IsRV64 = TargetTriple.getArch() == llvm::Triple::riscv64; -@@ -2945,13 +2960,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( - continue; // Saw this path before; no need to look at it again. - if (CandidateVersion.isOlderThan(4, 1, 1)) - continue; -- if (CandidateVersion <= Version) -+ if (CandidateVersion < Version) - continue; - - if (!ScanGCCForMultilibs(TargetTriple, Args, LI->path(), - NeedsBiarchSuffix)) - continue; - -+ // We might have found existing directory with GCCVersion, but it -+ // might not have GCC libraries we are looking for (i.e. return an -+ // empty Mulilibs) -+ if (Multilibs.size() == 0) -+ continue; -+ - Version = CandidateVersion; - GCCTriple.setTriple(CandidateTriple); - // FIXME: We hack together the directory name here instead of diff --git a/recipes-devtools/clang/clang/0029-lldb-Link-with-libatomic-on-x86.patch b/recipes-devtools/clang/clang/0027-lldb-Link-with-libatomic-on-x86.patch similarity index 92% rename from recipes-devtools/clang/clang/0029-lldb-Link-with-libatomic-on-x86.patch rename to recipes-devtools/clang/clang/0027-lldb-Link-with-libatomic-on-x86.patch index cbc05493..0ff3250e 100644 --- a/recipes-devtools/clang/clang/0029-lldb-Link-with-libatomic-on-x86.patch +++ b/recipes-devtools/clang/clang/0027-lldb-Link-with-libatomic-on-x86.patch @@ -1,4 +1,4 @@ -From 0e9dd56bafb1273c784d357fca86a09f9ce02af2 Mon Sep 17 00:00:00 2001 +From 5896757d953923bae54991273b4255915d2a3d3b 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 @@ -17,7 +17,7 @@ Signed-off-by: Khem Raj 1 file changed, 4 insertions(+) diff --git a/lldb/source/Utility/CMakeLists.txt b/lldb/source/Utility/CMakeLists.txt -index a3b0a405b413..a68cfb503dfa 100644 +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") diff --git a/recipes-devtools/clang/clang/0030-compiler-rt-Enable-__int128-for-ppc32.patch b/recipes-devtools/clang/clang/0028-compiler-rt-Enable-__int128-for-ppc32.patch similarity index 85% rename from recipes-devtools/clang/clang/0030-compiler-rt-Enable-__int128-for-ppc32.patch rename to recipes-devtools/clang/clang/0028-compiler-rt-Enable-__int128-for-ppc32.patch index 8619465b..ddb0be4e 100644 --- a/recipes-devtools/clang/clang/0030-compiler-rt-Enable-__int128-for-ppc32.patch +++ b/recipes-devtools/clang/clang/0028-compiler-rt-Enable-__int128-for-ppc32.patch @@ -1,4 +1,4 @@ -From 8ff4e362a824257f89cb77119fe8206667dd88ff Mon Sep 17 00:00:00 2001 +From 0d56b168c64c8714f2b1c431bdb3becb6b7d06e7 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 @@ -11,12 +11,12 @@ Signed-off-by: Khem Raj 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt -index 28ded8766f25..08495c491f08 100644 +index e0b2d08c2077..1b245fd5deeb 100644 --- a/compiler-rt/lib/builtins/CMakeLists.txt +++ b/compiler-rt/lib/builtins/CMakeLists.txt -@@ -686,11 +686,9 @@ set(mips64_SOURCES ${GENERIC_TF_SOURCES} - set(mips64el_SOURCES ${GENERIC_TF_SOURCES} - ${mips_SOURCES}) +@@ -710,11 +710,9 @@ set(mips64el_SOURCES ${GENERIC_TF_SOURCES} + + set(nvptx64_SOURCES ${GENERIC_SOURCES}) -set(powerpc_SOURCES ${GENERIC_SOURCES}) - @@ -27,7 +27,7 @@ index 28ded8766f25..08495c491f08 100644 ppc/divtc3.c ppc/fixtfdi.c ppc/fixunstfdi.c -@@ -705,14 +703,15 @@ set(powerpc64_SOURCES +@@ -729,14 +727,15 @@ set(powerpc64_SOURCES ) # These routines require __int128, which isn't supported on AIX. if (NOT OS_NAME MATCHES "AIX") @@ -46,7 +46,7 @@ index 28ded8766f25..08495c491f08 100644 set(riscv_SOURCES riscv/fp_mode.c -@@ -847,9 +846,9 @@ else () +@@ -888,9 +887,9 @@ else () list(APPEND BUILTIN_CFLAGS_${arch} -fomit-frame-pointer -DCOMPILER_RT_ARMHF_TARGET) endif() @@ -59,7 +59,7 @@ index 28ded8766f25..08495c491f08 100644 endif() diff --git a/compiler-rt/lib/builtins/int_types.h b/compiler-rt/lib/builtins/int_types.h -index ca97391fc284..6fa1dac2325f 100644 +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 { diff --git a/recipes-devtools/clang/clang/0031-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 similarity index 75% rename from recipes-devtools/clang/clang/0031-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch rename to recipes-devtools/clang/clang/0029-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch index c51326f4..0c126e29 100644 --- a/recipes-devtools/clang/clang/0031-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 @@ -1,4 +1,4 @@ -From 39e87eabd251d5086ef14305a36134053af09ae5 Mon Sep 17 00:00:00 2001 +From 8df33f322b4dcb79aabf98b5f7e44aa3164bc7a7 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 @@ -21,7 +21,7 @@ Signed-off-by: Khem Raj 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt -index e19223fdef4f..9c8af2404545 100644 +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) @@ -41,8 +41,8 @@ index e19223fdef4f..9c8af2404545 100644 + list(APPEND imported_libs zstd) endif() - if( MSVC OR MINGW ) -@@ -306,7 +306,7 @@ if(LLVM_ENABLE_ZLIB) + 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) @@ -51,12 +51,12 @@ index e19223fdef4f..9c8af2404545 100644 endif() if(LLVM_ENABLE_ZSTD) -@@ -319,7 +319,7 @@ if(LLVM_ENABLE_ZSTD) - get_property(zstd_library TARGET ${zstd_target} PROPERTY LOCATION) +@@ -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() - get_library_name(${zstd_library} zstd_library) -- set(llvm_system_libs ${llvm_system_libs} "${zstd_library}") -+ set(llvm_system_libs ${llvm_system_libs} zstd) - endif() - - if(LLVM_ENABLE_TERMINFO) diff --git a/recipes-devtools/clang/clang/0032-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 similarity index 96% rename from recipes-devtools/clang/clang/0032-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch rename to recipes-devtools/clang/clang/0030-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch index ec59ffa9..2b6452c0 100644 --- a/recipes-devtools/clang/clang/0032-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 @@ -1,4 +1,4 @@ -From 7e735f7b956eca38c2d882f3630af9bfd215f652 Mon Sep 17 00:00:00 2001 +From 31a406487f96f327eacff698c9697a6c4483377e Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 3 Jan 2023 18:44:34 -0800 Subject: [PATCH] compiler-rt: Fix stat struct's size for O32 ABI diff --git a/recipes-devtools/clang/clang/0033-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 similarity index 94% rename from recipes-devtools/clang/clang/0033-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch rename to recipes-devtools/clang/clang/0031-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch index 43cd05be..51f367a5 100644 --- a/recipes-devtools/clang/clang/0033-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 @@ -1,4 +1,4 @@ -From cfeae6f76bbfc62bffca278aa8d58db3981ca100 Mon Sep 17 00:00:00 2001 +From 5f1f46a0240a0949d59dde63add6b74424c03fbd 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 @@ -22,7 +22,7 @@ Signed-off-by: Khem Raj 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 596528155505..8f54ad70999c 100644 +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 @@ diff --git a/recipes-devtools/clang/clang/0034-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch b/recipes-devtools/clang/clang/0032-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch similarity index 97% rename from recipes-devtools/clang/clang/0034-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch rename to recipes-devtools/clang/clang/0032-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch index 90a6671e..c2c78772 100644 --- a/recipes-devtools/clang/clang/0034-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch +++ b/recipes-devtools/clang/clang/0032-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch @@ -1,4 +1,4 @@ -From 3d2fdb0ab98f479679231435cb3247cfbf9dfaab Mon Sep 17 00:00:00 2001 +From d20e67486eab3d77fc3608fca08318466fa167b7 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 @@ -55,12 +55,12 @@ Signed-off-by: Martin Jansa 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 98d979ace17b..c5aed9b47123 100644 +index f081a778cfe9..b3d656d30a78 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2479,7 +2479,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( - static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu", - "aarch64_be-linux-gnu"}; +@@ -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"}; @@ -68,10 +68,10 @@ index 98d979ace17b..c5aed9b47123 100644 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 699ff18b1240..4ed91b852562 100644 +index 41818470cf85..3224acee8710 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -202,6 +202,7 @@ static StringRef getOSLibDir(const llvm::Triple &Triple, const ArgList &Args) { +@@ -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() || 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 new file mode 100644 index 00000000..fb3500c3 --- /dev/null +++ b/recipes-devtools/clang/clang/0033-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch @@ -0,0 +1,78 @@ +From 4f79cdf737f7a2812be7f374df65bd5e94e1e808 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/0036-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 similarity index 97% rename from recipes-devtools/clang/clang/0036-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch rename to recipes-devtools/clang/clang/0034-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch index 84a0d2bc..d5f76bab 100644 --- a/recipes-devtools/clang/clang/0036-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 @@ -1,4 +1,4 @@ -From e54d4a15f31b8f84dc24ae14efc65713b1a6d6d7 Mon Sep 17 00:00:00 2001 +From 437aef696fac0d12f5174b668d89681951d48b7d 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 diff --git a/recipes-devtools/clang/clang/0035-compiler-rt-Fix-cmake-check-for-_Float16-and-__bf16.patch b/recipes-devtools/clang/clang/0035-compiler-rt-Fix-cmake-check-for-_Float16-and-__bf16.patch deleted file mode 100644 index c6115a0b..00000000 --- a/recipes-devtools/clang/clang/0035-compiler-rt-Fix-cmake-check-for-_Float16-and-__bf16.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 34a65a1f0ff8bb2d41f32c229dc6b309a7566ecd Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Fri, 1 Mar 2024 16:47:46 -0800 -Subject: [PATCH] compiler-rt: Fix cmake check for _Float16 and __bf16 - -When using check_c_source_compiles cmake function, main has to be -provided, otherwise while compile step will be fine but linking step -will fail as there will be no main function and test will fail and -disable building HF builtins into compiler-rt - -Fixes configure errors like below - -aarch64-yoe-linux-ld.lld: error: undefined symbol: main - referenced by start.S:81 (../sysdeps/aarch64/start.S:81) - /mnt/b/yoe/master/build/tmp/work/cortexa72-cortexa53-crypto-yoe-linux/compiler-rt/18.1.0/recipe-sysroot/usr/lib/Scrt1.o:(_start) - referenced by start.S:82 (../sysdeps/aarch64/start.S:82) - /mnt/b/yoe/master/build/tmp/work/cortexa72-cortexa53-crypto-yoe-linux/compiler-rt/18.1.0/recipe-sysroot/usr/lib/Scrt1.o:(_start) - aarch64-yoe-linux-clang: error: linker command failed with exit code 1 (use -v to see invocation) - -Upstream-Status: Submitted [https://github.com/kraj/llvm-project/pull/new/kraj/compiler-rt-float16] -Signed-off-by: Khem Raj ---- - compiler-rt/lib/builtins/CMakeLists.txt | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt -index 08495c491f08..bff96ba10bcd 100644 ---- a/compiler-rt/lib/builtins/CMakeLists.txt -+++ b/compiler-rt/lib/builtins/CMakeLists.txt -@@ -827,10 +827,10 @@ else () - endif() - endif() - endif() -- check_c_source_compiles("_Float16 foo(_Float16 x) { return x; }" -+ check_c_source_compiles("_Float16 foo(_Float16 x) { return x; } int main(void) { return foo(1.0); }" - COMPILER_RT_HAS_${arch}_FLOAT16) - append_list_if(COMPILER_RT_HAS_${arch}_FLOAT16 -DCOMPILER_RT_HAS_FLOAT16 BUILTIN_CFLAGS_${arch}) -- check_c_source_compiles("__bf16 foo(__bf16 x) { return x; }" -+ check_c_source_compiles("__bf16 foo(__bf16 x) { return x; } int main(void) { return foo(1.0); }" - COMPILER_RT_HAS_${arch}_BFLOAT16) - # Build BF16 files only when "__bf16" is available. - if(COMPILER_RT_HAS_${arch}_BFLOAT16) diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index c0d7684c..25028a0f 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -5,8 +5,17 @@ LIC_FILES_CHKSUM = "file://llvm/LICENSE.TXT;md5=${LLVMMD5SUM} \ " LICENSE = "Apache-2.0-with-LLVM-exception" -BASEURI = "${LLVM_HTTP}/llvm-project/releases/download/llvmorg-${PV}/llvm-project-${PV}.src.tar.xz" -SRC_URI[sha256sum] = "0b58557a6d32ceee97c8d533a59b9212d87e0fc4d2833924eb6c611247db2f2a" +# Snapshot +RELEASE ?= "0c641568515a797473394694f05937e1f1913d87" +BASEURI ?= "https://api.github.com/repos/llvm/llvm-project/tarball/${RELEASE};downloadfilename=llvm-${PV}-${RELEASE}.tar.gz" +SOURCEDIR ?= "llvm-llvm-project-${@'${RELEASE}'[0:7]}" +SRC_URI[sha256sum] = "b8d580ba8fb4415bfa16c5095d158c43503cf37c79da1bb43b526852eafbcde4" + +# GA Release +#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] = "0b58557a6d32ceee97c8d533a59b9212d87e0fc4d2833924eb6c611247db2f2a" SRC_URI = "\ ${BASEURI} \ @@ -24,32 +33,31 @@ SRC_URI = "\ file://0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch \ file://0013-Check-for-atomic-double-intrinsics.patch \ file://0014-libcxx-Add-compiler-runtime-library-to-link-step-for.patch \ - file://0015-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch \ + file://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-Do-not-use-find_library-for-ncurses.patch \ - file://0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch \ - file://0022-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch \ - file://0023-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch \ - file://0024-libunwind-Added-unw_backtrace-method.patch \ - file://0025-clang-Do-not-use-install-relative-libc-headers.patch \ - file://0027-Fix-lib-paths-for-OpenEmbedded-Host.patch \ - file://0028-Correct-library-search-path-for-OpenEmbedded-Host.patch \ - file://0029-lldb-Link-with-libatomic-on-x86.patch \ - file://0030-compiler-rt-Enable-__int128-for-ppc32.patch \ - file://0031-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch \ - file://0032-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch \ - file://0033-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch \ - file://0034-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch \ - file://0035-compiler-rt-Fix-cmake-check-for-_Float16-and-__bf16.patch \ - file://0036-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.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 \ +" # Fallback to no-PIE if not set GCCPIE ??= "" -S = "${TMPDIR}/work-shared/llvm-project-source-${PV}-${PR}/llvm-project-${PV}.src" +S = "${TMPDIR}/work-shared/llvm-project-source-${PV}-${PR}/${SOURCEDIR}" B ?= "${WORKDIR}/llvm-project-source-${PV}/build.${HOST_SYS}.${TARGET_SYS}" # We need to ensure that for the shared work directory, the do_patch signatures match