From 5820cb9e32c84a45591ecd2d7879fe8d0e5fe75e Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 24 Jul 2024 17:52:06 -0700 Subject: clang: Upgrade to 19.1.0 release Release Notes below llvm - https://releases.llvm.org/19.1.0/docs/ReleaseNotes.html clang - https://releases.llvm.org/19.1.0/tools/clang/docs/ReleaseNotes.html lld - https://releases.llvm.org/19.1.0/tools/lld/docs/ReleaseNotes.html libc++ - https://releases.llvm.org/19.1.0/projects/libcxx/docs/ReleaseNotes.html clang-extra - https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/ReleaseNotes.html Signed-off-by: Khem Raj --- recipes-devtools/clang/clang.inc | 4 +- ...ind-libunwind-headers-when-LIBCXXABI_LIBU.patch | 16 +-- ...er-rt-support-a-new-embedded-linux-target.patch | 2 +- ...-Simplify-cross-compilation.-Don-t-use-na.patch | 6 +- ...LibraryInfo-Undefine-libc-functions-if-th.patch | 18 ++-- ...allow-env-override-of-exe-and-libdir-path.patch | 2 +- ...-clang-driver-Check-sysroot-for-ldso-path.patch | 16 +-- ...iver-tools.cpp-Add-lssp_nonshared-on-musl.patch | 6 +- .../0008-clang-Prepend-trailing-to-sysroot.patch | 6 +- ...inside-the-target-sysroot-for-compiler-ru.patch | 6 +- ...ang-Define-releative-gcc-installation-dir.patch | 6 +- ...pthread-and-ldl-along-with-lunwind-for-st.patch | 6 +- ..._EXECUTABLE-when-cross-compiling-for-nati.patch | 6 +- .../0013-Check-for-atomic-double-intrinsics.patch | 2 +- ...compiler-runtime-library-to-link-step-for.patch | 12 +-- ...cmake-Fix-configure-for-packages-using-fi.patch | 115 --------------------- ...configure-for-packages-using-find_package.patch | 115 +++++++++++++++++++++ ...esource-dir-location-for-cross-toolchains.patch | 6 +- ...r-Add-dyld-prefix-when-checking-sysroot-f.patch | 14 +-- .../0018-clang-Use-python3-in-python-scripts.patch | 2 +- ...4-set-Yocto-based-GCC-install-search-path.patch | 12 +-- ...-llvm-Do-not-use-find_library-for-ncurses.patch | 45 -------- ...-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 ----- ...0023-libunwind-Added-unw_backtrace-method.patch | 56 ++++++++++ ...-Do-not-use-install-relative-libc-headers.patch | 34 ++++++ ...0024-libunwind-Added-unw_backtrace-method.patch | 56 ---------- .../0025-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 +++++++++++++++ ...ow-driver-finds-GCC-installation-path-on-.patch | 113 -------------------- .../0027-Fix-lib-paths-for-OpenEmbedded-Host.patch | 79 -------------- .../0027-lldb-Link-with-libatomic-on-x86.patch | 33 ++++++ ...library-search-path-for-OpenEmbedded-Host.patch | 84 --------------- ...028-compiler-rt-Enable-__int128-for-ppc32.patch | 73 +++++++++++++ .../0029-lldb-Link-with-libatomic-on-x86.patch | 33 ------ ...-Do-not-use-cmake-infra-to-detect-libzstd.patch | 62 +++++++++++ ...030-compiler-rt-Enable-__int128-for-ppc32.patch | 73 ------------- ...ler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch | 44 ++++++++ ...-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch | 43 ++++++++ ...-Do-not-use-cmake-infra-to-detect-libzstd.patch | 62 ----------- ...s-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch | 81 +++++++++++++++ ...ler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch | 44 -------- ...vm-Add-OE-specific-ABI-triple-for-N32-ABI.patch | 78 ++++++++++++++ ...-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch | 43 -------- ...s-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch | 81 --------------- ...d-libunwind.pc.in-and-llvm-config-scripts.patch | 90 ++++++++++++++++ ...t-Fix-cmake-check-for-_Float16-and-__bf16.patch | 42 -------- ...d-libunwind.pc.in-and-llvm-config-scripts.patch | 90 ---------------- recipes-devtools/clang/common.inc | 50 +++++---- 54 files changed, 1104 insertions(+), 1216 deletions(-) delete mode 100644 recipes-devtools/clang/clang/0015-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch create mode 100644 recipes-devtools/clang/clang/0015-cmake-Fix-configure-for-packages-using-find_package.patch delete mode 100644 recipes-devtools/clang/clang/0020-llvm-Do-not-use-find_library-for-ncurses.patch create 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-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch delete mode 100644 recipes-devtools/clang/clang/0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch create mode 100644 recipes-devtools/clang/clang/0022-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch delete mode 100644 recipes-devtools/clang/clang/0022-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch delete mode 100644 recipes-devtools/clang/clang/0023-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch create mode 100644 recipes-devtools/clang/clang/0023-libunwind-Added-unw_backtrace-method.patch create mode 100644 recipes-devtools/clang/clang/0024-clang-Do-not-use-install-relative-libc-headers.patch delete mode 100644 recipes-devtools/clang/clang/0024-libunwind-Added-unw_backtrace-method.patch create mode 100644 recipes-devtools/clang/clang/0025-Fix-lib-paths-for-OpenEmbedded-Host.patch delete mode 100644 recipes-devtools/clang/clang/0025-clang-Do-not-use-install-relative-libc-headers.patch create mode 100644 recipes-devtools/clang/clang/0026-Correct-library-search-path-for-OpenEmbedded-Host.patch delete mode 100644 recipes-devtools/clang/clang/0026-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch delete mode 100644 recipes-devtools/clang/clang/0027-Fix-lib-paths-for-OpenEmbedded-Host.patch create mode 100644 recipes-devtools/clang/clang/0027-lldb-Link-with-libatomic-on-x86.patch delete mode 100644 recipes-devtools/clang/clang/0028-Correct-library-search-path-for-OpenEmbedded-Host.patch create mode 100644 recipes-devtools/clang/clang/0028-compiler-rt-Enable-__int128-for-ppc32.patch delete mode 100644 recipes-devtools/clang/clang/0029-lldb-Link-with-libatomic-on-x86.patch create 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-Enable-__int128-for-ppc32.patch create 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/0031-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch delete mode 100644 recipes-devtools/clang/clang/0031-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch create mode 100644 recipes-devtools/clang/clang/0032-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch delete mode 100644 recipes-devtools/clang/clang/0032-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch create mode 100644 recipes-devtools/clang/clang/0033-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch delete mode 100644 recipes-devtools/clang/clang/0033-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch delete mode 100644 recipes-devtools/clang/clang/0034-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch create mode 100644 recipes-devtools/clang/clang/0034-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch delete mode 100644 recipes-devtools/clang/clang/0035-compiler-rt-Fix-cmake-check-for-_Float16-and-__bf16.patch delete mode 100644 recipes-devtools/clang/clang/0036-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch (limited to 'recipes-devtools') diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc index 468d039..a7c9377 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 d4afeed..97397d9 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 78c27664e7ffee1bc7a8beff604860ea194e27a5 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 6c5c0de..95bee5b 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 1b0fd972d7cd2d78061bcf874c177969b19eeaab 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 c5c809b..37321a9 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 11d8cadd76aaf434556eeb9f42ee794ca72802a4 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 505a5ba..ac4edbb 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 7791c1c014b5d2f86142a87a0ede3ad1dc9aea46 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 249027a..c5f4147 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 347fa4394fc2f70ce199ef6edee17d19d64bf74a 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 1175ec7..24e64b0 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 ff55b613cb917ba96e30ff5c0a09942e52beea7e 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 9d174a7..bf5a101 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 db1a59d2537f4d843d51e0a628b8d9596fa3e1d1 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 c43219f..8f6779f 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 58b2cb10360b5188be51c1f535412d7fef3c1fef 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 3149159..d24d807 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 b54a26dfbdef65bc829779cc84e937fe850e777e 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 7d56623..1b902d8 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 faf6d96205dad549a7d8214774927f320e3689b0 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 4e9360c..d4d6b23 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 7c8bd8b6aeb817bd313517b00a2a54ed187986cf 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 b6efd2b..acf6921 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 4af5f0a010f3a7c3af40110b8d049486baa8b647 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 5a942e6..43665bd 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 23cf856d4896656d1625f7ed96c3b33aabc91cdc 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 757917f..f57f459 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 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 @@ -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-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch deleted file mode 100644 index d42836d..0000000 --- a/recipes-devtools/clang/clang/0015-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch +++ /dev/null @@ -1,115 +0,0 @@ -From aab6a666bf1094d9750a10e547ebd6fe093af513 Mon Sep 17 00:00:00 2001 -From: Ovidiu Panait -Date: Fri, 31 Jan 2020 10:56:11 +0200 -Subject: [PATCH] clang,llvm: cmake: Fix configure for packages using - find_package() - -Currently, when a package (i.e. bcc [https://github.com/iovisor/bcc.git]) -that depends on LLVM/Clang tries to run cmake find_package() during -do_configure, it will fail with a similar error: - -| The imported target "llvm-tblgen" references the file -| ".../recipe-sysroot/usr/bin/llvm-tblgen" -| -| but this file does not exist. Possible reasons include: -| * The file was deleted, renamed, or moved to another location. -| * An install or uninstall procedure did not complete successfully. -| * The installation package was faulty and contained -| ".../recipe-sysroot/usr/lib/cmake/LLVMExports.cmake" -| but not all the files it references. - -This is due to the fact that currently the cmake scripts look for target -binaries in sysroot. Work around this by not exporting the target binaries in -Exports-* cmake files. - -Upstream-Status: Inappropriate [oe-specific] - -Signed-off-by: Ovidiu Panait ---- - clang/cmake/modules/AddClang.cmake | 2 -- - llvm/cmake/modules/AddLLVM.cmake | 6 ------ - llvm/cmake/modules/TableGen.cmake | 6 ------ - 3 files changed, 14 deletions(-) - -diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake -index 75b0080f6715..ddf446a13eca 100644 ---- a/clang/cmake/modules/AddClang.cmake -+++ b/clang/cmake/modules/AddClang.cmake -@@ -168,7 +168,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}) - -@@ -177,7 +176,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 3bc78b0dc935..bc492ceb90db 100644 ---- a/llvm/cmake/modules/AddLLVM.cmake -+++ b/llvm/cmake/modules/AddLLVM.cmake -@@ -1368,7 +1368,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}) - -@@ -1379,9 +1378,6 @@ 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() - endmacro(llvm_add_tool project name) -@@ -1426,7 +1422,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}) - -@@ -1435,7 +1430,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 1d18fdde2bb9..c9363ffb3376 100644 ---- a/llvm/cmake/modules/TableGen.cmake -+++ b/llvm/cmake/modules/TableGen.cmake -@@ -222,12 +222,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) -@@ -238,6 +233,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/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 new file mode 100644 index 0000000..51fde02 --- /dev/null +++ b/recipes-devtools/clang/clang/0015-cmake-Fix-configure-for-packages-using-find_package.patch @@ -0,0 +1,115 @@ +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 index b7aeb2b..5e5fcad 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 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 @@ -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 fca46f4..814e380 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 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 @@ -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 d72a623..8932c33 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 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 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 3270872..8a96504 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 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 @@ -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 e14bc9d..0000000 --- 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/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 new file mode 100644 index 0000000..5dc1caf --- /dev/null +++ b/recipes-devtools/clang/clang/0020-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch @@ -0,0 +1,32 @@ +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-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 new file mode 100644 index 0000000..c75bb39 --- /dev/null +++ b/recipes-devtools/clang/clang/0021-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch @@ -0,0 +1,68 @@ +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/0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch b/recipes-devtools/clang/clang/0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch deleted file mode 100644 index 4feca04..0000000 --- a/recipes-devtools/clang/clang/0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch +++ /dev/null @@ -1,32 +0,0 @@ -From a3dbd6b6c8bfab6877632ec7a1e981aaa2883d90 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 0bbe8a3cedfd..dbc1240703a0 100644 ---- a/llvm/lib/TargetParser/Triple.cpp -+++ b/llvm/lib/TargetParser/Triple.cpp -@@ -601,7 +601,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) { - .Case("amd", Triple::AMD) - .Case("mesa", Triple::Mesa) - .Case("suse", Triple::SUSE) -- .Case("oe", Triple::OpenEmbedded) -+ .Case("oe", Triple::OpenEmbedded)//CLANG_EXTRA_OE_VENDORS_CASES - .Default(Triple::UnknownVendor); - } - diff --git a/recipes-devtools/clang/clang/0022-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 new file mode 100644 index 0000000..63ac9f8 --- /dev/null +++ b/recipes-devtools/clang/clang/0022-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch @@ -0,0 +1,28 @@ +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-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch b/recipes-devtools/clang/clang/0022-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch deleted file mode 100644 index 5498c70..0000000 --- a/recipes-devtools/clang/clang/0022-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch +++ /dev/null @@ -1,68 +0,0 @@ -From afed95c05037559e53d9a60b8520b372d54b467d Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 19 May 2021 17:32:13 -0700 -Subject: [PATCH] compiler-rt: Do not use backtrace APIs on non-glibc linux - -musl e.g. does not provide backtrace APIs - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - .../lib/gwp_asan/optional/backtrace_linux_libc.cpp | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) - -diff --git a/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp b/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp -index ea8e72be287d..0344074dd254 100644 ---- a/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp -+++ b/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp -@@ -7,7 +7,9 @@ - //===----------------------------------------------------------------------===// - - #include -+#ifdef __GLIBC__ - #include -+#endif - #include - #include - #include -@@ -21,8 +23,11 @@ - namespace { - size_t Backtrace(uintptr_t *TraceBuffer, size_t Size) { - static_assert(sizeof(uintptr_t) == sizeof(void *), "uintptr_t is not void*"); -- -+#ifdef __GLIBC__ - return backtrace(reinterpret_cast(TraceBuffer), Size); -+#else -+ return -1; -+#endif - } - - // We don't need any custom handling for the Segv backtrace - the libc unwinder -@@ -30,7 +35,11 @@ size_t Backtrace(uintptr_t *TraceBuffer, size_t Size) { - // to avoid the additional frame. - GWP_ASAN_ALWAYS_INLINE size_t SegvBacktrace(uintptr_t *TraceBuffer, size_t Size, - void * /*Context*/) { -+#ifdef __GLIBC__ - return Backtrace(TraceBuffer, Size); -+#else -+ return -1; -+#endif - } - - static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, -@@ -40,6 +49,7 @@ static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, - return; - } - -+#ifdef __GLIBC__ - char **BacktraceSymbols = - backtrace_symbols(reinterpret_cast(Trace), TraceLength); - -@@ -53,6 +63,7 @@ static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, - Printf("\n"); - if (BacktraceSymbols) - free(BacktraceSymbols); -+#endif - } - } // anonymous namespace - diff --git a/recipes-devtools/clang/clang/0023-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch b/recipes-devtools/clang/clang/0023-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch deleted file mode 100644 index 6f982e9..0000000 --- a/recipes-devtools/clang/clang/0023-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 25434c45f0c7079e9171b5ef4027626a64d3e50b 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 6df8c58076c9..cf549331d255 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, - 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/0023-libunwind-Added-unw_backtrace-method.patch b/recipes-devtools/clang/clang/0023-libunwind-Added-unw_backtrace-method.patch new file mode 100644 index 0000000..95a3e9b --- /dev/null +++ b/recipes-devtools/clang/clang/0023-libunwind-Added-unw_backtrace-method.patch @@ -0,0 +1,56 @@ +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-clang-Do-not-use-install-relative-libc-headers.patch b/recipes-devtools/clang/clang/0024-clang-Do-not-use-install-relative-libc-headers.patch new file mode 100644 index 0000000..b6943d1 --- /dev/null +++ b/recipes-devtools/clang/clang/0024-clang-Do-not-use-install-relative-libc-headers.patch @@ -0,0 +1,34 @@ +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/0024-libunwind-Added-unw_backtrace-method.patch b/recipes-devtools/clang/clang/0024-libunwind-Added-unw_backtrace-method.patch deleted file mode 100644 index 887fcd5..0000000 --- a/recipes-devtools/clang/clang/0024-libunwind-Added-unw_backtrace-method.patch +++ /dev/null @@ -1,56 +0,0 @@ -From c4ec538a1e00eb60ad890df51401f27484b349d9 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 217dde909863..5797c806c084 100644 ---- a/libunwind/src/libunwind.cpp -+++ b/libunwind/src/libunwind.cpp -@@ -432,6 +432,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/0025-Fix-lib-paths-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0025-Fix-lib-paths-for-OpenEmbedded-Host.patch new file mode 100644 index 0000000..4b2f0ce --- /dev/null +++ b/recipes-devtools/clang/clang/0025-Fix-lib-paths-for-OpenEmbedded-Host.patch @@ -0,0 +1,79 @@ +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/0025-clang-Do-not-use-install-relative-libc-headers.patch b/recipes-devtools/clang/clang/0025-clang-Do-not-use-install-relative-libc-headers.patch deleted file mode 100644 index 0e4a3b3..0000000 --- a/recipes-devtools/clang/clang/0025-clang-Do-not-use-install-relative-libc-headers.patch +++ /dev/null @@ -1,34 +0,0 @@ -From b759741be82cc87406f5b7ece236617ad5450e78 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 185ea3df16f5..d883dc3e7558 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, - // 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/0026-Correct-library-search-path-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0026-Correct-library-search-path-for-OpenEmbedded-Host.patch new file mode 100644 index 0000000..6fdb5f9 --- /dev/null +++ b/recipes-devtools/clang/clang/0026-Correct-library-search-path-for-OpenEmbedded-Host.patch @@ -0,0 +1,84 @@ +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-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 7ceccd5..0000000 --- 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/0027-Fix-lib-paths-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0027-Fix-lib-paths-for-OpenEmbedded-Host.patch deleted file mode 100644 index 20ce278..0000000 --- a/recipes-devtools/clang/clang/0027-Fix-lib-paths-for-OpenEmbedded-Host.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 93855bad691059a81906ab632830239039527c6c 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 c627602827c3..98d979ace17b 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" -@@ -2918,6 +2919,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 { -@@ -2935,7 +2937,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/0027-lldb-Link-with-libatomic-on-x86.patch b/recipes-devtools/clang/clang/0027-lldb-Link-with-libatomic-on-x86.patch new file mode 100644 index 0000000..d54ec3f --- /dev/null +++ b/recipes-devtools/clang/clang/0027-lldb-Link-with-libatomic-on-x86.patch @@ -0,0 +1,33 @@ +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-Correct-library-search-path-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0028-Correct-library-search-path-for-OpenEmbedded-Host.patch deleted file mode 100644 index 554f966..0000000 --- a/recipes-devtools/clang/clang/0028-Correct-library-search-path-for-OpenEmbedded-Host.patch +++ /dev/null @@ -1,84 +0,0 @@ -From 42bf038560a9b0bf688b0a85cbd444445e1c26dc 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 a8de94163e8b..847d6a3f9d1a 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, -@@ -137,6 +138,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 a7e7f169dc14..48d4e15196da 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 cf549331d255..699ff18b1240 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/0028-compiler-rt-Enable-__int128-for-ppc32.patch b/recipes-devtools/clang/clang/0028-compiler-rt-Enable-__int128-for-ppc32.patch new file mode 100644 index 0000000..90a1f1c --- /dev/null +++ b/recipes-devtools/clang/clang/0028-compiler-rt-Enable-__int128-for-ppc32.patch @@ -0,0 +1,73 @@ +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/0029-lldb-Link-with-libatomic-on-x86.patch b/recipes-devtools/clang/clang/0029-lldb-Link-with-libatomic-on-x86.patch deleted file mode 100644 index cbc0549..0000000 --- a/recipes-devtools/clang/clang/0029-lldb-Link-with-libatomic-on-x86.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 0e9dd56bafb1273c784d357fca86a09f9ce02af2 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 a3b0a405b413..a68cfb503dfa 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/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 new file mode 100644 index 0000000..5105705 --- /dev/null +++ b/recipes-devtools/clang/clang/0029-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch @@ -0,0 +1,62 @@ +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-Enable-__int128-for-ppc32.patch b/recipes-devtools/clang/clang/0030-compiler-rt-Enable-__int128-for-ppc32.patch deleted file mode 100644 index 8619465..0000000 --- a/recipes-devtools/clang/clang/0030-compiler-rt-Enable-__int128-for-ppc32.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 8ff4e362a824257f89cb77119fe8206667dd88ff 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 28ded8766f25..08495c491f08 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}) - --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 -@@ -705,14 +703,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 -@@ -847,9 +846,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 ca97391fc284..6fa1dac2325f 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/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 new file mode 100644 index 0000000..5020adc --- /dev/null +++ b/recipes-devtools/clang/clang/0030-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch @@ -0,0 +1,44 @@ +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/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 new file mode 100644 index 0000000..6cc7d75 --- /dev/null +++ b/recipes-devtools/clang/clang/0031-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch @@ -0,0 +1,43 @@ +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/0031-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch b/recipes-devtools/clang/clang/0031-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch deleted file mode 100644 index c51326f..0000000 --- a/recipes-devtools/clang/clang/0031-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 39e87eabd251d5086ef14305a36134053af09ae5 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 e19223fdef4f..9c8af2404545 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( MSVC OR MINGW ) -@@ -306,7 +306,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) -@@ -319,7 +319,7 @@ if(LLVM_ENABLE_ZSTD) - get_property(zstd_library TARGET ${zstd_target} PROPERTY LOCATION) - 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-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch b/recipes-devtools/clang/clang/0032-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch new file mode 100644 index 0000000..1dbf292 --- /dev/null +++ b/recipes-devtools/clang/clang/0032-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch @@ -0,0 +1,81 @@ +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-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch b/recipes-devtools/clang/clang/0032-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch deleted file mode 100644 index ec59ffa..0000000 --- a/recipes-devtools/clang/clang/0032-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 7e735f7b956eca38c2d882f3630af9bfd215f652 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/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 0000000..112724a --- /dev/null +++ b/recipes-devtools/clang/clang/0033-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch @@ -0,0 +1,78 @@ +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-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch b/recipes-devtools/clang/clang/0033-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch deleted file mode 100644 index 43cd05b..0000000 --- a/recipes-devtools/clang/clang/0033-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch +++ /dev/null @@ -1,43 +0,0 @@ -From cfeae6f76bbfc62bffca278aa8d58db3981ca100 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 596528155505..8f54ad70999c 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/0034-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch b/recipes-devtools/clang/clang/0034-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch deleted file mode 100644 index 90a6671..0000000 --- a/recipes-devtools/clang/clang/0034-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 3d2fdb0ab98f479679231435cb3247cfbf9dfaab 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 98d979ace17b..c5aed9b47123 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"}; - -- 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 699ff18b1240..4ed91b852562 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) { - // 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/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 new file mode 100644 index 0000000..9f70bf2 --- /dev/null +++ b/recipes-devtools/clang/clang/0034-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch @@ -0,0 +1,90 @@ +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/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 c6115a0..0000000 --- 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/clang/0036-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch b/recipes-devtools/clang/clang/0036-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch deleted file mode 100644 index 84a0d2b..0000000 --- a/recipes-devtools/clang/clang/0036-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch +++ /dev/null @@ -1,90 +0,0 @@ -From e54d4a15f31b8f84dc24ae14efc65713b1a6d6d7 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/common.inc b/recipes-devtools/clang/common.inc index c0d7684..bab85bd 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 ?= "a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4" +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] = "2e1dcf85294ca09862b9247355716b9928d100b9cd140f54737c1058733d1c6e" + +# 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 -- cgit v1.2.3-54-g00ecf