From 0f38186ae93400b870f7f92938bbf8643e7da958 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 28 Jul 2022 09:17:35 -0700 Subject: clang: Upgrade to clang 15.0.0 release Drop upstreamed patches and forward port the remaining to latest sourcess llvm: Fix libzstd detection with zstd cmake files Release Notes [1] [2] [3] [4] [5] [6] [1] https://github.com/llvm/llvm-project/blob/release/15.x/clang/docs/ReleaseNotes.rst [2] https://releases.llvm.org/15.0.0/docs/ReleaseNotes.html [3] https://releases.llvm.org/15.0.0/tools/clang/docs/ReleaseNotes.html [4] https://releases.llvm.org/15.0.0/tools/lld/docs/ReleaseNotes.html [5] https://releases.llvm.org/15.0.0/projects/libcxx/docs/ReleaseNotes.html [6] https://releases.llvm.org/15.0.0/tools/clang/tools/extra/docs/ReleaseNotes.html Signed-off-by: Khem Raj --- recipes-devtools/clang/clang.inc | 8 +- ...ind-libunwind-headers-when-LIBCXXABI_LIBU.patch | 23 ++--- ...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 | 2 +- ...allow-env-override-of-exe-and-libdir-path.patch | 23 +++-- ...-clang-driver-Check-sysroot-for-ldso-path.patch | 10 +-- ...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 | 10 +-- ..._EXECUTABLE-when-cross-compiling-for-nati.patch | 4 +- .../0013-Check-for-atomic-double-intrinsics.patch | 2 +- ...compiler-runtime-library-to-link-step-for.patch | 14 ++-- ...cmake-Fix-configure-for-packages-using-fi.patch | 70 ++++++++-------- ...esource-dir-location-for-cross-toolchains.patch | 6 +- ...r-Add-dyld-prefix-when-checking-sysroot-f.patch | 12 +-- .../0018-clang-Use-python3-in-python-scripts.patch | 30 +------ ...4-set-Yocto-based-GCC-install-search-path.patch | 6 +- ...-llvm-Do-not-use-find_library-for-ncurses.patch | 6 +- ...-anchor-for-adding-OE-distro-vendor-names.patch | 6 +- ...-Do-not-use-backtrace-APIs-on-non-glibc-l.patch | 68 +++++++++++++++ ...ompiler-rt-Use-mcr-based-barrier-on-armv6.patch | 71 ---------------- ...86-triple-for-non-debian-multiarch-linux-.patch | 27 ++++++ ...-Do-not-use-backtrace-APIs-on-non-glibc-l.patch | 68 --------------- ...86-triple-for-non-debian-multiarch-linux-.patch | 27 ------ ...-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch | 28 +++++++ ...-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch | 28 ------- ...0025-libunwind-Added-unw_backtrace-method.patch | 55 ++++++++++++ ...git-suffix-from-various-version-variables.patch | 26 ++++++ ...-Link-scudo-standalone-with-libatomic-on-.patch | 29 ------- ...-Do-not-use-install-relative-libc-headers.patch | 32 +++++++ ...0027-libunwind-Added-unw_backtrace-method.patch | 55 ------------ .../0028-Do-not-force-thumb-mode-directive.patch | 46 ---------- ...ow-driver-finds-GCC-installation-path-on-.patch | 97 ++++++++++++++++++++++ .../0029-Fix-lib-paths-for-OpenEmbedded-Host.patch | 79 ++++++++++++++++++ ...-Do-not-use-install-relative-libc-headers.patch | 32 ------- ...library-search-path-for-OpenEmbedded-Host.patch | 84 +++++++++++++++++++ ...ow-driver-finds-GCC-installation-path-on-.patch | 97 ---------------------- .../0031-Fix-lib-paths-for-OpenEmbedded-Host.patch | 79 ------------------ .../0031-lldb-Link-with-libatomic-on-x86.patch | 33 ++++++++ ...library-search-path-for-OpenEmbedded-Host.patch | 84 ------------------- ...de-openembedded-distributions-from-settin.patch | 35 ++++++++ ...033-compiler-rt-Enable-__int128-for-ppc32.patch | 73 ++++++++++++++++ .../0033-lldb-Link-with-libatomic-on-x86.patch | 33 -------- ...de-openembedded-distributions-from-settin.patch | 35 -------- ...-Do-not-use-cmake-infra-to-detect-libzstd.patch | 44 ++++++++++ ...035-compiler-rt-Enable-__int128-for-ppc32.patch | 58 ------------- ...-builtins-Move-DMB-definition-to-syn-opsh.patch | 65 --------------- ...emove-include-linux-fs.h-to-resolve-fscon.patch | 62 -------------- recipes-devtools/clang/clang_git.bb | 1 + recipes-devtools/clang/common.inc | 29 +++---- 53 files changed, 815 insertions(+), 1029 deletions(-) create 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/0022-compiler-rt-Use-mcr-based-barrier-on-armv6.patch create mode 100644 recipes-devtools/clang/clang/0023-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch delete mode 100644 recipes-devtools/clang/clang/0023-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch delete mode 100644 recipes-devtools/clang/clang/0024-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch create mode 100644 recipes-devtools/clang/clang/0024-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch delete mode 100644 recipes-devtools/clang/clang/0025-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch create mode 100644 recipes-devtools/clang/clang/0025-libunwind-Added-unw_backtrace-method.patch create mode 100644 recipes-devtools/clang/clang/0026-Drop-the-git-suffix-from-various-version-variables.patch delete mode 100644 recipes-devtools/clang/clang/0026-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch create mode 100644 recipes-devtools/clang/clang/0027-clang-Do-not-use-install-relative-libc-headers.patch delete mode 100644 recipes-devtools/clang/clang/0027-libunwind-Added-unw_backtrace-method.patch delete mode 100644 recipes-devtools/clang/clang/0028-Do-not-force-thumb-mode-directive.patch create mode 100644 recipes-devtools/clang/clang/0028-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch create mode 100644 recipes-devtools/clang/clang/0029-Fix-lib-paths-for-OpenEmbedded-Host.patch delete mode 100644 recipes-devtools/clang/clang/0029-clang-Do-not-use-install-relative-libc-headers.patch create mode 100644 recipes-devtools/clang/clang/0030-Correct-library-search-path-for-OpenEmbedded-Host.patch delete mode 100644 recipes-devtools/clang/clang/0030-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch delete mode 100644 recipes-devtools/clang/clang/0031-Fix-lib-paths-for-OpenEmbedded-Host.patch create mode 100644 recipes-devtools/clang/clang/0031-lldb-Link-with-libatomic-on-x86.patch delete mode 100644 recipes-devtools/clang/clang/0032-Correct-library-search-path-for-OpenEmbedded-Host.patch create mode 100644 recipes-devtools/clang/clang/0032-clang-exclude-openembedded-distributions-from-settin.patch create mode 100644 recipes-devtools/clang/clang/0033-compiler-rt-Enable-__int128-for-ppc32.patch delete mode 100644 recipes-devtools/clang/clang/0033-lldb-Link-with-libatomic-on-x86.patch delete mode 100644 recipes-devtools/clang/clang/0034-clang-exclude-openembedded-distributions-from-settin.patch create mode 100644 recipes-devtools/clang/clang/0034-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch delete mode 100644 recipes-devtools/clang/clang/0035-compiler-rt-Enable-__int128-for-ppc32.patch delete mode 100644 recipes-devtools/clang/clang/0036-compiler-rt-builtins-Move-DMB-definition-to-syn-opsh.patch delete mode 100644 recipes-devtools/clang/clang/0037-sanitizer-Remove-include-linux-fs.h-to-resolve-fscon.patch (limited to 'recipes-devtools/clang') diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc index 253c128..d431e72 100644 --- a/recipes-devtools/clang/clang.inc +++ b/recipes-devtools/clang/clang.inc @@ -4,14 +4,14 @@ LLVM_DIR = "llvm${LLVM_RELEASE}" LLVM_GIT ?= "git://github.com/llvm" LLVM_GIT_PROTOCOL ?= "https" -MAJOR_VER = "14" +MAJOR_VER = "15" MINOR_VER = "0" -PATCH_VER = "6" +PATCH_VER = "0" -SRCREV ?= "f28c006a5895fc0e329fe15fead81e37457cb1d1" +SRCREV ?= "1c73596d345481de957e5ccc0bedf1fb9d9f643a" PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}" -BRANCH = "release/14.x" +BRANCH = "release/15.x" LLVMMD5SUM = "8a15a0759ef07f2682d2ba4b893c9afe" CLANGMD5SUM = "ff42885ed2ab98f1ecb8c1fc41205343" 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 f81f714..33e53ca 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 655270f8c4caa717e10d97013ffd9ed88e06699b Mon Sep 17 00:00:00 2001 +From a597109434ba7ddc7750fac0b677f89a5f65fb86 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 @@ -13,30 +13,23 @@ LIBCXXABI_LIBUNWIND_INCLUDES if its there in environment Signed-off-by: Khem Raj --- - libcxxabi/CMakeLists.txt | 21 +++++++++++---------- - 1 file changed, 11 insertions(+), 10 deletions(-) + libcxxabi/CMakeLists.txt | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt -index 5ef85c9cfc40..1afdb5a17970 100644 +index b8326d08d23a..cb16b5d4238b 100644 --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt -@@ -535,14 +535,9 @@ endif() - # Setup Source Code - #=============================================================================== +@@ -474,7 +474,7 @@ set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH + "Specify path to libunwind source." FORCE) --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) -- - include_directories(include) if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) - find_path(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL libunwind.h + find_path(LIBCXXABI_LIBUNWIND_INCLUDES libunwind.h PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES} ${LIBCXXABI_LIBUNWIND_PATH}/include ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES} -@@ -553,15 +548,21 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) +@@ -485,15 +485,21 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) NO_CMAKE_FIND_ROOT_PATH ) @@ -61,4 +54,4 @@ index 5ef85c9cfc40..1afdb5a17970 100644 + # Add source code. This also contains all of the logic for deciding linker flags # soname, etc... - add_subdirectory(src) + add_subdirectory(include) 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 74d0c1e..5722035 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 5a1cf5bd6eb5b7ee299c11b7a39ada74fd60be1d Mon Sep 17 00:00:00 2001 +From 7f8dee01de2d4b100bb0639c78aba0fac887db30 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 b93f68a..651ad29 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 3bc3328f89915cde33c26cec91a57b79109420f0 Mon Sep 17 00:00:00 2001 +From c240bc35ac49a2165495771574ee46ffe06d222d 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 @@ -20,10 +20,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 3a41aa43e406..3bbfbca1f645 100644 +index 62737735695f..a2c7c3a786ab 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt -@@ -67,7 +67,16 @@ set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOL +@@ -68,7 +68,16 @@ set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOL "Build for a bare-metal target.") if (COMPILER_RT_STANDALONE_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 8da23bd..9f496d1 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 2da0422b45b2b9842a2ceb6840beba05356057d2 Mon Sep 17 00:00:00 2001 +From 91624fded194e4e612a24ab820f7146cdff8b381 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 21 May 2016 00:33:20 +0000 Subject: [PATCH] llvm: TargetLibraryInfo: Undefine libc functions if they are diff --git a/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch b/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch index 8521d7f..05bf2b7 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 affcd7f14bca2d9ee95352cd979f66f55901272a Mon Sep 17 00:00:00 2001 +From c76c80d752ce177327d6bb2d966afa673233a81c 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 @@ -15,14 +15,14 @@ Upstream-Status: Inappropriate [OE-specific] Signed-off-by: Martin Kelly Signed-off-by: Khem Raj --- - llvm/tools/llvm-config/llvm-config.cpp | 21 +++++++++++++++++++-- - 1 file changed, 19 insertions(+), 2 deletions(-) + llvm/tools/llvm-config/llvm-config.cpp | 25 +++++++++++++++++++------ + 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp -index 8ed88f33ead4..9e26a2b41409 100644 +index 2c6c55f89d38..77da3d7827dd 100644 --- a/llvm/tools/llvm-config/llvm-config.cpp +++ b/llvm/tools/llvm-config/llvm-config.cpp -@@ -247,6 +247,13 @@ Typical components:\n\ +@@ -249,6 +249,13 @@ Typical components:\n\ /// Compute the path to the main executable. std::string GetExecutablePath(const char *Argv0) { @@ -36,7 +36,7 @@ index 8ed88f33ead4..9e26a2b41409 100644 // This just needs to be some symbol in the binary; C++ doesn't // allow taking the address of ::main however. void *P = (void *)(intptr_t)GetExecutablePath; -@@ -326,7 +333,7 @@ int main(int argc, char **argv) { +@@ -328,7 +335,7 @@ int main(int argc, char **argv) { // Compute various directory locations based on the derived location // information. std::string ActivePrefix, ActiveBinDir, ActiveIncludeDir, ActiveLibDir, @@ -45,11 +45,15 @@ index 8ed88f33ead4..9e26a2b41409 100644 std::string ActiveIncludeOption; if (IsInDevelopmentTree) { ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include"; -@@ -367,7 +374,17 @@ int main(int argc, char **argv) { +@@ -369,12 +376,18 @@ int main(int argc, char **argv) { sys::fs::make_absolute(ActivePrefix, Path); ActiveBinDir = std::string(Path.str()); } - ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; +- { +- SmallString<256> Path(LLVM_INSTALL_PACKAGE_DIR); +- sys::fs::make_absolute(ActivePrefix, Path); +- ActiveCMakeDir = std::string(Path.str()); + // Hack for Yocto: we need to override the lib path when we are using + // llvm-config from within a target sysroot since LLVM_LIBDIR_SUFFIX + // maybe different for host llvm vs target e.g. ppc64 Libdir=lib64 but @@ -59,8 +63,9 @@ index 8ed88f33ead4..9e26a2b41409 100644 + BaseLibDir = std::string(YoctoLibDir); + } else { + BaseLibDir = std::string("/lib") + LLVM_LIBDIR_SUFFIX; -+ } + } + ActiveLibDir = ActivePrefix + BaseLibDir; - ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; ++ ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; ActiveIncludeOption = "-I" + ActiveIncludeDir; } + 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 d08c50a..0a3ffa9 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 7ff4f134a5e5e1f6ffe31637a474cf118ae0079b Mon Sep 17 00:00:00 2001 +From f91bea3f1be69123f7c5583568c1c2b35395af92 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 @@ -14,10 +14,10 @@ Signed-off-by: Khem Raj 1 file changed, 16 insertions(+) diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index f85c04df4f6c..97e987c37e4a 100644 +index ceb1a982c3a4..69f5a4662732 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -493,11 +493,19 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -508,11 +508,19 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { LibDir = "lib64"; Loader = (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1"; @@ -37,7 +37,7 @@ index f85c04df4f6c..97e987c37e4a 100644 break; case llvm::Triple::riscv32: { StringRef ABIName = tools::riscv::getRISCVABI(Args, Triple); -@@ -519,6 +527,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -534,6 +542,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { case llvm::Triple::sparcv9: LibDir = "lib64"; Loader = "ld-linux.so.2"; @@ -48,7 +48,7 @@ index f85c04df4f6c..97e987c37e4a 100644 break; case llvm::Triple::systemz: LibDir = "lib"; -@@ -533,6 +545,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -548,6 +560,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 1c3f9aa..0861ccb 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 12b2de3db9a53a25610f3c61fef10fe877e765c4 Mon Sep 17 00:00:00 2001 +From 47060cd9744a21fb646ad9253ba79048d1055560 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 @@ -13,10 +13,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 7a9570a686f4..633daa58590d 100644 +index f203cae1d329..0b5255a10404 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -622,6 +622,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, +@@ -654,6 +654,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 4752daf..c3246de 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 610d6a7c8c9d21f10b225f971a377be49bbaea4f Mon Sep 17 00:00:00 2001 +From 7cda368aa585872c0add06604215d39f2e7cb1b2 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 @@ -24,10 +24,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 97e987c37e4a..f9e233f15dfc 100644 +index 69f5a4662732..7555466e7e2b 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -181,7 +181,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) +@@ -183,7 +183,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) Multilibs = GCCInstallation.getMultilibs(); SelectedMultilib = GCCInstallation.getMultilib(); llvm::Triple::ArchType Arch = Triple.getArch(); 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 02d702c..04742be 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 da2647d56a98cc708a6b13e3586e7fb364ef77a0 Mon Sep 17 00:00:00 2001 +From f0a90c18f6f07b2f9c5b4c8178e48ab000f3be62 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 @@ -15,7 +15,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 d657d21bfcdb..e83a556b708c 100644 +index 7a4319ea680f..3068d25dab75 100644 --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/lib/Driver/ToolChain.cpp @@ -13,6 +13,7 @@ @@ -26,7 +26,7 @@ index d657d21bfcdb..e83a556b708c 100644 #include "clang/Config/config.h" #include "clang/Driver/Action.h" #include "clang/Driver/Driver.h" -@@ -419,7 +420,10 @@ StringRef ToolChain::getOSLibName() const { +@@ -458,7 +459,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 55924c9..fa4643c 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 6e17f402773f9408a62c8d03a39db5af6f637653 Mon Sep 17 00:00:00 2001 +From 9f62d38e65d80909484bbe2f2bd8e8c6443a8fb0 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 @@ -14,10 +14,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 633daa58590d..d22eaf698eb8 100644 +index 0b5255a10404..bddc77cde2d6 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2517,19 +2517,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( +@@ -2642,19 +2642,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 b2539f1..5334237 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 718bc533b5d621ee5eb24a87ed882bf82360807c Mon Sep 17 00:00:00 2001 +From 7cd7eb2c942027a1c2ea1a26d30dcd524504a865 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 @@ -20,15 +20,15 @@ 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 dfcef2304040..dbc91e427dfb 100644 +index 443725f7d8a8..c8eabfac21dc 100644 --- a/clang/lib/Driver/ToolChains/CommonArgs.cpp +++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp -@@ -1472,6 +1472,8 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D, +@@ -1537,6 +1537,8 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D, CmdArgs.push_back("-lunwind"); } else if (LGT == LibGccType::StaticLibGcc) { CmdArgs.push_back("-l:libunwind.a"); + CmdArgs.push_back("-lpthread"); + CmdArgs.push_back("-ldl"); - } else if (TC.getTriple().isOSCygMing()) { - if (LGT == LibGccType::SharedLibGcc) + } else if (LGT == LibGccType::SharedLibGcc) { + if (TC.getTriple().isOSCygMing()) CmdArgs.push_back("-l:libunwind.dll.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 c873830..0563e9d 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 d26acd3f09d6796c35b29a70480142e70ec74d51 Mon Sep 17 00:00:00 2001 +From 9085bf817fc4d70a93838ea9350920c1e3f26295 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 @@ -10,7 +10,7 @@ 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 2a39b6a40a28..8a441729c943 100644 +index 52b893dd0214..4399cec3e19a 100644 --- a/llvm/cmake/modules/CrossCompile.cmake +++ b/llvm/cmake/modules/CrossCompile.cmake @@ -84,6 +84,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype) 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 c592021..3b8d878 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 8bee07de2d0078373f0f1a72e924d7808ddf03e0 Mon Sep 17 00:00:00 2001 +From 94e6043e68865806ecbde1d895d5ea724adcc7dc 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 55875f2..210e309 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 3d7469e6d46dd19a20500fdb56f21a0cc7198e9d Mon Sep 17 00:00:00 2001 +From b04023195b8649e6f51a7fcc09fe39736e494afb 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,10 +14,10 @@ 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 12dcdf954405..54e446e2aecd 100644 +index 9abf548abbb9..a16c529781c6 100644 --- a/libcxx/src/CMakeLists.txt +++ b/libcxx/src/CMakeLists.txt -@@ -212,7 +212,7 @@ if (LIBCXX_ENABLE_SHARED) +@@ -199,7 +199,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 @@ -26,12 +26,12 @@ index 12dcdf954405..54e446e2aecd 100644 set_target_properties(cxx_shared PROPERTIES COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}" -@@ -290,7 +290,7 @@ if (LIBCXX_ENABLE_STATIC) +@@ -283,7 +283,7 @@ if (LIBCXX_ENABLE_STATIC) add_library(cxx_static STATIC ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS}) target_include_directories(cxx_static PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(cxx_static PUBLIC cxx-headers -- PRIVATE ${LIBCXX_LIBRARIES}) -+ PRIVATE ${LIBCXX_LIBRARIES} "$$($$CC --print-libgcc-file-name)") +- PRIVATE ${LIBCXX_LIBRARIES} ++ PRIVATE ${LIBCXX_LIBRARIES} "$$($$CC --print-libgcc-file-name)" + PRIVATE libcxx-abi-static) set_target_properties(cxx_static PROPERTIES - COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}" diff --git a/recipes-devtools/clang/clang/0015-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch b/recipes-devtools/clang/clang/0015-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch index 30deb5b..be0d088 100644 --- 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 @@ -1,4 +1,4 @@ -From 728e023a8d2dc85402fbe1295e87023fdb7c4c1b Mon Sep 17 00:00:00 2001 +From 9e1259310fdad1feebc5a0e80fb18afbea0fb49c 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 @@ -32,48 +32,48 @@ Signed-off-by: Ovidiu Panait 3 files changed, 15 deletions(-) diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake -index 9bbbfc032b7d..7ee5170bbc71 100644 +index 21ac332e4f5f..86c93cfec59d 100644 --- a/clang/cmake/modules/AddClang.cmake +++ b/clang/cmake/modules/AddClang.cmake -@@ -159,7 +159,6 @@ macro(add_clang_tool name) - if (CLANG_BUILD_TOOLS) - get_target_export_arg(${name} Clang export_to_clangtargets) - install(TARGETS ${name} -- ${export_to_clangtargets} - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" - COMPONENT ${name}) +@@ -165,7 +165,6 @@ macro(add_clang_tool name) + if (CLANG_BUILD_TOOLS) + get_target_export_arg(${name} Clang export_to_clangtargets) + install(TARGETS ${name} +- ${export_to_clangtargets} + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + COMPONENT ${name}) -@@ -168,7 +167,6 @@ macro(add_clang_tool name) - DEPENDS ${name} - COMPONENT ${name}) +@@ -174,7 +173,6 @@ macro(add_clang_tool name) + DEPENDS ${name} + COMPONENT ${name}) + endif() +- set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS ${name}) endif() -- set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS ${name}) endif() endmacro() - diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake -index 37bc98f9e021..d34083fa52ec 100644 +index 057431208322..e7c77e824d58 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake -@@ -1251,7 +1251,6 @@ macro(add_llvm_tool name) - if( LLVM_BUILD_TOOLS ) - get_target_export_arg(${name} LLVM export_to_llvmexports) - install(TARGETS ${name} -- ${export_to_llvmexports} - RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR} - COMPONENT ${name}) +@@ -1299,7 +1299,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}) -@@ -1262,9 +1261,6 @@ macro(add_llvm_tool name) +@@ -1310,9 +1309,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() -- if( LLVM_BUILD_TOOLS ) -- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) -- endif() - set_target_properties(${name} PROPERTIES FOLDER "Tools") - endmacro(add_llvm_tool name) - -@@ -1304,7 +1300,6 @@ macro(add_llvm_utility name) + endmacro(llvm_add_tool project name) +@@ -1357,7 +1353,6 @@ macro(add_llvm_utility name) if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS) get_target_export_arg(${name} LLVM export_to_llvmexports) install(TARGETS ${name} @@ -81,7 +81,7 @@ index 37bc98f9e021..d34083fa52ec 100644 RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR} COMPONENT ${name}) -@@ -1313,7 +1308,6 @@ macro(add_llvm_utility name) +@@ -1366,7 +1361,6 @@ macro(add_llvm_utility name) DEPENDS ${name} COMPONENT ${name}) endif() @@ -90,10 +90,10 @@ index 37bc98f9e021..d34083fa52ec 100644 set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name}) endif() diff --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake -index 59fd0d3b0733..3b9ac56ed37f 100644 +index 4711456776c8..857392499525 100644 --- a/llvm/cmake/modules/TableGen.cmake +++ b/llvm/cmake/modules/TableGen.cmake -@@ -183,14 +183,8 @@ macro(add_tablegen target project) +@@ -187,14 +187,8 @@ macro(add_tablegen target project) endif() if ((${project} STREQUAL LLVM OR ${project} STREQUAL MLIR) AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_UTILS) @@ -106,9 +106,9 @@ index 59fd0d3b0733..3b9ac56ed37f 100644 install(TARGETS ${target} - ${export_to_llvmexports} COMPONENT ${target} - RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR}) + RUNTIME DESTINATION "${${project}_TOOLS_INSTALL_DIR}") if(NOT LLVM_ENABLE_IDE) -@@ -199,5 +193,4 @@ macro(add_tablegen target project) +@@ -203,5 +197,4 @@ macro(add_tablegen target project) COMPONENT ${target}) endif() endif() 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 aca23d2..164f64b 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 e12e426d3c67b17d74879d7dec434eb64310881e Mon Sep 17 00:00:00 2001 +From 9b847a7301907c040ad1a276386bf03245452ac1 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 @@ -19,10 +19,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 3bfddeefc7b2..8a806efb292b 100644 +index 3f29afd35971..45f2e0bede97 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp -@@ -176,7 +176,13 @@ std::string Driver::GetResourcesPath(StringRef BinaryPath, +@@ -179,7 +179,13 @@ std::string Driver::GetResourcesPath(StringRef BinaryPath, // With a static-library build of libclang, LibClangPath will contain the // path of the embedding binary, which for LLVM binaries will be in bin/. // ../lib gets us to lib/ in both cases. 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 ddd52dd..4f69f61 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 554002679332300b789cf44384c2274840ed24d9 Mon Sep 17 00:00:00 2001 +From ddac3e45e06789d6d525e72782110f66334dadd5 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 @@ -18,10 +18,10 @@ Signed-off-by: Khem Raj 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index f9e233f15dfc..bf73b1ef27db 100644 +index 7555466e7e2b..27951858fb5d 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -493,8 +493,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -508,8 +508,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { LibDir = "lib64"; Loader = (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1"; @@ -32,7 +32,7 @@ index f9e233f15dfc..bf73b1ef27db 100644 LibDir = "lib"; } break; -@@ -502,8 +502,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -517,8 +517,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { LibDir = "lib64"; Loader = (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2"; @@ -43,7 +43,7 @@ index f9e233f15dfc..bf73b1ef27db 100644 LibDir = "lib"; } break; -@@ -527,8 +527,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -542,8 +542,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { case llvm::Triple::sparcv9: LibDir = "lib64"; Loader = "ld-linux.so.2"; @@ -54,7 +54,7 @@ index f9e233f15dfc..bf73b1ef27db 100644 LibDir = "lib"; } break; -@@ -545,8 +545,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -560,8 +560,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 f54cffd..b969630 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 5ce5ec34d618d694a862d345c89eaa2d12e2bfc6 Mon Sep 17 00:00:00 2001 +From 4d5f0c87833256ac810b0702d3e3e128bd465bbe 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 @@ -13,10 +13,8 @@ Signed-off-by: Khem Raj clang-tools-extra/clang-tidy/add_new_check.py | 2 +- clang-tools-extra/clang-tidy/rename_check.py | 2 +- clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py | 2 +- - clang-tools-extra/clang-tidy/tool/run-clang-tidy.py | 2 +- - clang/tools/clang-format/git-clang-format | 2 +- clang/tools/scan-view/bin/scan-view | 2 +- - 7 files changed, 7 insertions(+), 7 deletions(-) + 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py index 8655af137bb2..e95ba59a421c 100755 @@ -29,7 +27,7 @@ index 8655af137bb2..e95ba59a421c 100755 #=- run-find-all-symbols.py - Parallel find-all-symbols runner -*- python -*-=# # diff --git a/clang-tools-extra/clang-tidy/add_new_check.py b/clang-tools-extra/clang-tidy/add_new_check.py -index 50a220b3f975..ea40cbc48dd2 100755 +index 19b6896e508f..a85767acdce9 100644 --- a/clang-tools-extra/clang-tidy/add_new_check.py +++ b/clang-tools-extra/clang-tidy/add_new_check.py @@ -1,4 +1,4 @@ @@ -49,7 +47,7 @@ index 9c2021751e0e..4bb9af8cbe0a 100755 #===- rename_check.py - clang-tidy check renamer ------------*- python -*--===# # diff --git a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py -index 6bd05531333b..9e134123ef44 100755 +index a26d2144b7f9..396a201b667e 100755 --- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py +++ b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py @@ -1,4 +1,4 @@ @@ -58,26 +56,6 @@ index 6bd05531333b..9e134123ef44 100755 # #===- clang-tidy-diff.py - ClangTidy Diff Checker -----------*- python -*--===# # -diff --git a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py -index e6cff6a7414d..582c113fb173 100755 ---- a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py -+++ b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # - #===- run-clang-tidy.py - Parallel clang-tidy runner --------*- python -*--===# - # -diff --git a/clang/tools/clang-format/git-clang-format b/clang/tools/clang-format/git-clang-format -index 7968c4387574..268e4dd14782 100755 ---- a/clang/tools/clang-format/git-clang-format -+++ b/clang/tools/clang-format/git-clang-format -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # - #===- git-clang-format - ClangFormat Git Integration ---------*- python -*--===# - # diff --git a/clang/tools/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view index 6165432e7af8..07effbca5969 100755 --- a/clang/tools/scan-view/bin/scan-view 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 44b4828..a8186c4 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 d720595723c92fe8e2d17887bab85c6fd154825e Mon Sep 17 00:00:00 2001 +From 85a70f8d590a0f6b2257257b7c494846870b3466 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,10 +57,10 @@ 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 d22eaf698eb8..6fcd5abe7211 100644 +index bddc77cde2d6..5b4271b58337 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2105,6 +2105,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( +@@ -2224,6 +2224,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( "x86_64-redhat-linux", "x86_64-suse-linux", "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", "x86_64-slackware-linux", "x86_64-unknown-linux", 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 index 46f151a..60e533b 100644 --- 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 @@ -1,4 +1,4 @@ -From fd5760df7696cd9c6ec9ef38ed6cbab19d70e3ac Mon Sep 17 00:00:00 2001 +From 7572a3983fd02d37e67559af75a520056fbd2906 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 @@ -17,10 +17,10 @@ Signed-off-by: Khem Raj 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake -index 4299a0589a7b..cb53b6fd14bd 100644 +index cd45176cf2ba..73948a0274cd 100644 --- a/compiler-rt/cmake/config-ix.cmake +++ b/compiler-rt/cmake/config-ix.cmake -@@ -149,7 +149,7 @@ else() +@@ -160,7 +160,7 @@ else() set(MAYBE_REQUIRED) endif() if(LLVM_ENABLE_TERMINFO) 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 index 33a351d..983fe38 100644 --- 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 @@ -1,4 +1,4 @@ -From ef4ee8181adc48116a563adafae014409e9432d0 Mon Sep 17 00:00:00 2001 +From 126a93150c81c675d8a93c4f240e231bf1feeaf7 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 11 Feb 2021 16:42:49 -0800 Subject: [PATCH] llvm: Insert anchor for adding OE distro vendor names @@ -18,10 +18,10 @@ Signed-off-by: Martin Jansa 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp -index a9afcc9db96a..dc48caf02616 100644 +index 6696d158b2c1..c5aea898ab24 100644 --- a/llvm/lib/Support/Triple.cpp +++ b/llvm/lib/Support/Triple.cpp -@@ -506,7 +506,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) { +@@ -542,7 +542,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) { .Case("amd", Triple::AMD) .Case("mesa", Triple::Mesa) .Case("suse", Triple::SUSE) diff --git a/recipes-devtools/clang/clang/0022-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch b/recipes-devtools/clang/clang/0022-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch new file mode 100644 index 0000000..67537be --- /dev/null +++ b/recipes-devtools/clang/clang/0022-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch @@ -0,0 +1,68 @@ +From e3833b5a620d1e8743c53ebc724fd6cb6775b4a8 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 19 May 2021 17:32:13 -0700 +Subject: [PATCH] compiler-rt: Do not use backtrace APIs on non-glibc linux + +musl e.g. does not provide backtrace APIs + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + .../lib/gwp_asan/optional/backtrace_linux_libc.cpp | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp b/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp +index ea8e72be287d..0344074dd254 100644 +--- a/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp ++++ b/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp +@@ -7,7 +7,9 @@ + //===----------------------------------------------------------------------===// + + #include ++#ifdef __GLIBC__ + #include ++#endif + #include + #include + #include +@@ -21,8 +23,11 @@ + namespace { + size_t Backtrace(uintptr_t *TraceBuffer, size_t Size) { + static_assert(sizeof(uintptr_t) == sizeof(void *), "uintptr_t is not void*"); +- ++#ifdef __GLIBC__ + return backtrace(reinterpret_cast(TraceBuffer), Size); ++#else ++ return -1; ++#endif + } + + // We don't need any custom handling for the Segv backtrace - the libc unwinder +@@ -30,7 +35,11 @@ size_t Backtrace(uintptr_t *TraceBuffer, size_t Size) { + // to avoid the additional frame. + GWP_ASAN_ALWAYS_INLINE size_t SegvBacktrace(uintptr_t *TraceBuffer, size_t Size, + void * /*Context*/) { ++#ifdef __GLIBC__ + return Backtrace(TraceBuffer, Size); ++#else ++ return -1; ++#endif + } + + static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, +@@ -40,6 +49,7 @@ static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, + return; + } + ++#ifdef __GLIBC__ + char **BacktraceSymbols = + backtrace_symbols(reinterpret_cast(Trace), TraceLength); + +@@ -53,6 +63,7 @@ static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, + Printf("\n"); + if (BacktraceSymbols) + free(BacktraceSymbols); ++#endif + } + } // anonymous namespace + diff --git a/recipes-devtools/clang/clang/0022-compiler-rt-Use-mcr-based-barrier-on-armv6.patch b/recipes-devtools/clang/clang/0022-compiler-rt-Use-mcr-based-barrier-on-armv6.patch deleted file mode 100644 index a407a4b..0000000 --- a/recipes-devtools/clang/clang/0022-compiler-rt-Use-mcr-based-barrier-on-armv6.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 759dff74b297c8bf35d222b17cee3047c0df10b8 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 24 Mar 2021 00:32:09 -0700 -Subject: [PATCH] compiler-rt: Use mcr based barrier on armv6 - -dsb is an armv7 instruction and wont work when we are building for armv6. - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - compiler-rt/lib/builtins/arm/sync-ops.h | 8 ++++---- - compiler-rt/lib/builtins/assembly.h | 8 ++++++++ - 2 files changed, 12 insertions(+), 4 deletions(-) - -diff --git a/compiler-rt/lib/builtins/arm/sync-ops.h b/compiler-rt/lib/builtins/arm/sync-ops.h -index c9623249e5d2..7a26170741ad 100644 ---- a/compiler-rt/lib/builtins/arm/sync-ops.h -+++ b/compiler-rt/lib/builtins/arm/sync-ops.h -@@ -19,14 +19,14 @@ - .thumb; \ - .syntax unified; \ - DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ -- dmb; \ -+ DMB; \ - mov r12, r0; \ - LOCAL_LABEL(tryatomic_##op) : ldrex r0, [r12]; \ - op(r2, r0, r1); \ - strex r3, r2, [r12]; \ - cmp r3, #0; \ - bne LOCAL_LABEL(tryatomic_##op); \ -- dmb; \ -+ DMB; \ - bx lr - - #define SYNC_OP_8(op) \ -@@ -35,14 +35,14 @@ - .syntax unified; \ - DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ - push {r4, r5, r6, lr}; \ -- dmb; \ -+ DMB; \ - mov r12, r0; \ - LOCAL_LABEL(tryatomic_##op) : ldrexd r0, r1, [r12]; \ - op(r4, r5, r0, r1, r2, r3); \ - strexd r6, r4, r5, [r12]; \ - cmp r6, #0; \ - bne LOCAL_LABEL(tryatomic_##op); \ -- dmb; \ -+ DMB; \ - pop { r4, r5, r6, pc } - - #define MINMAX_4(rD, rN, rM, cmp_kind) \ -diff --git a/compiler-rt/lib/builtins/assembly.h b/compiler-rt/lib/builtins/assembly.h -index 69a3d8620f92..60bac86df218 100644 ---- a/compiler-rt/lib/builtins/assembly.h -+++ b/compiler-rt/lib/builtins/assembly.h -@@ -189,6 +189,14 @@ - JMP(ip) - #endif - -+#if __ARM_ARCH >= 7 -+#define DMB dmb -+#elif __ARM_ARCH >= 6 -+#define DMB mcr p15, #0, r0, c7, c10, #5 -+#else -+#error Only use this with ARMv6+ -+#endif -+ - #if defined(USE_THUMB_2) - #define WIDE(op) op.w - #else diff --git a/recipes-devtools/clang/clang/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 new file mode 100644 index 0000000..484c62a --- /dev/null +++ b/recipes-devtools/clang/clang/0023-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch @@ -0,0 +1,27 @@ +From a9a28d1133089b29761a8a77910f5c5326be054c Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 19 May 2021 17:56:03 -0700 +Subject: [PATCH] clang: Fix x86 triple for non-debian multiarch linux distros + +OpenEmbedded does not hardcode mutli-arch like debian therefore ensure +that it still uses the proper tuple + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Linux.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index 27951858fb5d..aac45650f97b 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -657,6 +657,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-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch b/recipes-devtools/clang/clang/0023-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch deleted file mode 100644 index bb247c9..0000000 --- a/recipes-devtools/clang/clang/0023-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch +++ /dev/null @@ -1,68 +0,0 @@ -From e350e74522f03ed6d202b8130cf615e58a2ea714 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/0024-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch b/recipes-devtools/clang/clang/0024-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch deleted file mode 100644 index 880f500..0000000 --- a/recipes-devtools/clang/clang/0024-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch +++ /dev/null @@ -1,27 +0,0 @@ -From a310ecc416f38d81c13af43cdecaaf001cf06274 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 19 May 2021 17:56:03 -0700 -Subject: [PATCH] clang: Fix x86 triple for non-debian multiarch linux distros - -OpenEmbedded does not hardcode mutli-arch like debian therefore ensure -that it still uses the proper tuple - -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Linux.cpp | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index bf73b1ef27db..eb92a037c930 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -636,6 +636,9 @@ void Linux::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, - GCCInstallation.getTriple().getArch() == llvm::Triple::x86 - ? "i386-linux-gnu" - : TripleStr; -+ // OpenEmbedded does not hardcode the triple to i386-linux-gnu like debian -+ if (GCCInstallation.getTriple().getVendor() == llvm::Triple::OpenEmbedded) -+ DebianMultiarch = TripleStr; - - // Try generic GCC detection first. - if (Generic_GCC::addGCCLibStdCxxIncludePaths(DriverArgs, CC1Args, diff --git a/recipes-devtools/clang/clang/0024-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch b/recipes-devtools/clang/clang/0024-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch new file mode 100644 index 0000000..9170b39 --- /dev/null +++ b/recipes-devtools/clang/clang/0024-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch @@ -0,0 +1,28 @@ +From 071147ea1fa0f8cd9997b8ade9b33ae48831e9dd Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 19 May 2021 21:49:18 -0700 +Subject: [PATCH] compiler-rt: Link scudo with SANITIZER_CXX_ABI_LIBRARIES + +If SANITIZER_CXX_ABI_LIBRARIES is set then link scudo with it, this +fixes build time errors like + +projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.armhf.dir/sanitizer_posix_libcdep.cpp.o: in function `__sanitizer::UnsetAlternateSignalStack()': +| sanitizer_posix_libcdep.cpp:(.text+0x3d2): undefined reference to `__cxa_guard_acquire' + +Signed-off-by: Khem Raj +--- + compiler-rt/lib/scudo/CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/compiler-rt/lib/scudo/CMakeLists.txt b/compiler-rt/lib/scudo/CMakeLists.txt +index 31a6976960f7..8f3e291960b0 100644 +--- a/compiler-rt/lib/scudo/CMakeLists.txt ++++ b/compiler-rt/lib/scudo/CMakeLists.txt +@@ -15,6 +15,7 @@ append_list_if(COMPILER_RT_HAS_LIBDL dl SCUDO_MINIMAL_DYNAMIC_LIBS) + append_list_if(COMPILER_RT_HAS_LIBRT rt SCUDO_MINIMAL_DYNAMIC_LIBS) + append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread SCUDO_MINIMAL_DYNAMIC_LIBS) + append_list_if(COMPILER_RT_HAS_LIBLOG log SCUDO_MINIMAL_DYNAMIC_LIBS) ++append_list_if(SANITIZER_CXX_ABI_LIBRARIES ${SANITIZER_CXX_ABI_LIBRARIES} SCUDO_MINIMAL_DYNAMIC_LIBS) + append_list_if(COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG -fno-omit-frame-pointer + SCUDO_CFLAGS) + diff --git a/recipes-devtools/clang/clang/0025-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch b/recipes-devtools/clang/clang/0025-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch deleted file mode 100644 index cce7b61..0000000 --- a/recipes-devtools/clang/clang/0025-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 4bbb4ab9d4cd3ff1424bed6346dd8e47cd4bcb24 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 19 May 2021 21:49:18 -0700 -Subject: [PATCH] compiler-rt: Link scudo with SANITIZER_CXX_ABI_LIBRARIES - -If SANITIZER_CXX_ABI_LIBRARIES is set then link scudo with it, this -fixes build time errors like - -projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.armhf.dir/sanitizer_posix_libcdep.cpp.o: in function `__sanitizer::UnsetAlternateSignalStack()': -| sanitizer_posix_libcdep.cpp:(.text+0x3d2): undefined reference to `__cxa_guard_acquire' - -Signed-off-by: Khem Raj ---- - compiler-rt/lib/scudo/CMakeLists.txt | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/compiler-rt/lib/scudo/CMakeLists.txt b/compiler-rt/lib/scudo/CMakeLists.txt -index 995e853e2a4d..25b79a8d17e8 100644 ---- a/compiler-rt/lib/scudo/CMakeLists.txt -+++ b/compiler-rt/lib/scudo/CMakeLists.txt -@@ -15,6 +15,7 @@ append_list_if(COMPILER_RT_HAS_LIBDL dl SCUDO_MINIMAL_DYNAMIC_LIBS) - append_list_if(COMPILER_RT_HAS_LIBRT rt SCUDO_MINIMAL_DYNAMIC_LIBS) - append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread SCUDO_MINIMAL_DYNAMIC_LIBS) - append_list_if(COMPILER_RT_HAS_LIBLOG log SCUDO_MINIMAL_DYNAMIC_LIBS) -+append_list_if(SANITIZER_CXX_ABI_LIBRARIES ${SANITIZER_CXX_ABI_LIBRARIES} SCUDO_MINIMAL_DYNAMIC_LIBS) - append_list_if(COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG -fno-omit-frame-pointer - SCUDO_CFLAGS) - diff --git a/recipes-devtools/clang/clang/0025-libunwind-Added-unw_backtrace-method.patch b/recipes-devtools/clang/clang/0025-libunwind-Added-unw_backtrace-method.patch new file mode 100644 index 0000000..430f336 --- /dev/null +++ b/recipes-devtools/clang/clang/0025-libunwind-Added-unw_backtrace-method.patch @@ -0,0 +1,55 @@ +From d8ac6d8eb8fdf5c89d008cb082961920ad15201f Mon Sep 17 00:00:00 2001 +From: Maksim Kita +Date: Sun, 23 May 2021 10:27:29 +0000 +Subject: [PATCH] libunwind: Added unw_backtrace method + +Source: https://github.com/ClickHouse-Extras/libunwind/commit/52f0f7861926cbfaef7e6c97d8a6d7ba2a1f6747#diff-a82fc885e2e4facf4b92d26171c13aa4aa5db296f77e1158ba2f8664e3bd1f5c +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + libunwind/include/libunwind.h | 1 + + libunwind/src/libunwind.cpp | 18 ++++++++++++++++++ + 2 files changed, 19 insertions(+) + +diff --git a/libunwind/include/libunwind.h b/libunwind/include/libunwind.h +index f878b46f0348..d922f84011ee 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 b8b41ff25e54..ca7d9a01e631 100644 +--- a/libunwind/src/libunwind.cpp ++++ b/libunwind/src/libunwind.cpp +@@ -338,7 +338,25 @@ void __unw_remove_dynamic_eh_frame_section(unw_word_t eh_frame_start) { + #endif // defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) + #endif // !defined(__USING_SJLJ_EXCEPTIONS__) + ++int unw_backtrace(void **buffer, int size) { ++ unw_context_t context; ++ unw_cursor_t cursor; ++ if (unw_getcontext(&context) || unw_init_local(&cursor, &context)) { ++ return 0; ++ } ++ ++ unw_word_t ip; ++ int current = 0; ++ while (unw_step(&cursor) > 0) { ++ if (current >= size || unw_get_reg(&cursor, UNW_REG_IP, &ip)) { ++ break; ++ } + ++ buffer[current++] = reinterpret_cast(static_cast(ip)); ++ } ++ ++ return current; ++} + + // Add logging hooks in Debug builds only + #ifndef NDEBUG diff --git a/recipes-devtools/clang/clang/0026-Drop-the-git-suffix-from-various-version-variables.patch b/recipes-devtools/clang/clang/0026-Drop-the-git-suffix-from-various-version-variables.patch new file mode 100644 index 0000000..27d49de --- /dev/null +++ b/recipes-devtools/clang/clang/0026-Drop-the-git-suffix-from-various-version-variables.patch @@ -0,0 +1,26 @@ +From 3201dca689e5e3637501cacf9d01ec5a775207c5 Mon Sep 17 00:00:00 2001 +From: Changqing Li +Date: Wed, 23 Jun 2021 16:25:06 +0800 +Subject: [PATCH] Drop the 'git' suffix from various version variables + +Upstream-Status: Backport [cherry-picked from branch 12.0.0] + +Signed-off-by: Changqing Li +Signed-off-by: Khem Raj +--- + .../llvm-project-overlay/llvm/include/llvm/Config/llvm-config.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/llvm-config.h b/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/llvm-config.h +index e63369a56928..92162bddf9f1 100644 +--- a/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/llvm-config.h ++++ b/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/llvm-config.h +@@ -83,7 +83,7 @@ + #define LLVM_VERSION_PATCH 0 + + /* LLVM version string */ +-#define LLVM_VERSION_STRING "15.0.0git" ++#define LLVM_VERSION_STRING "15.0.0" + + /* Whether LLVM records statistics for use with GetStatistics(), + * PrintStatistics() or PrintStatisticsJSON() diff --git a/recipes-devtools/clang/clang/0026-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch b/recipes-devtools/clang/clang/0026-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch deleted file mode 100644 index 4eac4e3..0000000 --- a/recipes-devtools/clang/clang/0026-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 0806d2c4a56116b99413c506e8ff5ebe11bf270f Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Fri, 21 May 2021 08:14:29 -0700 -Subject: [PATCH] compiler-rt: Link scudo standalone with libatomic on mips - -clang on mips generate atomic built-ins which should be provided by -libatomic - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - compiler-rt/lib/scudo/standalone/CMakeLists.txt | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/compiler-rt/lib/scudo/standalone/CMakeLists.txt b/compiler-rt/lib/scudo/standalone/CMakeLists.txt -index 739f131bdefd..5862545b842b 100644 ---- a/compiler-rt/lib/scudo/standalone/CMakeLists.txt -+++ b/compiler-rt/lib/scudo/standalone/CMakeLists.txt -@@ -137,6 +137,10 @@ append_list_if(COMPILER_RT_HAS_LIBPTHREAD -pthread SCUDO_LINK_FLAGS) - - append_list_if(FUCHSIA zircon SCUDO_LINK_LIBS) - -+if (CMAKE_SYSTEM_PROCESSOR MATCHES "mips" AND CMAKE_SYSTEM_NAME MATCHES "Linux") -+ list(APPEND SCUDO_LINK_LIBS atomic) -+endif() -+ - if(COMPILER_RT_HAS_SCUDO_STANDALONE) - add_compiler_rt_object_libraries(RTScudoStandalone - ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH} diff --git a/recipes-devtools/clang/clang/0027-clang-Do-not-use-install-relative-libc-headers.patch b/recipes-devtools/clang/clang/0027-clang-Do-not-use-install-relative-libc-headers.patch new file mode 100644 index 0000000..d162084 --- /dev/null +++ b/recipes-devtools/clang/clang/0027-clang-Do-not-use-install-relative-libc-headers.patch @@ -0,0 +1,32 @@ +From 3b9c88e521e47f71ae888094537e7c6a039c9355 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 11 Aug 2021 18:37:11 -0700 +Subject: [PATCH] clang: Do not use install relative libc++ headers + +In OE we use same clang for native and cross builds, therefore we need +to ensure that native sysroot install of libc++ is not searched for +headers when doing cross compile instead it searches the target sysroot +this is especially troublesome when libcxx-native is staged along with +libcxx e.g. chromium + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 5b4271b58337..107ab8d78598 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -3049,7 +3049,9 @@ Generic_GCC::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, + + // Android never uses the libc++ headers installed alongside the toolchain, + // which are generally incompatible with the NDK libraries anyway. +- if (!getTriple().isAndroid()) ++ // And also do not add it when --sysroot is specified, since it would expect ++ // libc++ headers from sysroot ++ if (!getTriple().isAndroid() && SysRoot.empty()) + if (AddIncludePath(getDriver().Dir + "/../include")) + return; + // If this is a development, non-installed, clang, libcxx will diff --git a/recipes-devtools/clang/clang/0027-libunwind-Added-unw_backtrace-method.patch b/recipes-devtools/clang/clang/0027-libunwind-Added-unw_backtrace-method.patch deleted file mode 100644 index 6244cd2..0000000 --- a/recipes-devtools/clang/clang/0027-libunwind-Added-unw_backtrace-method.patch +++ /dev/null @@ -1,55 +0,0 @@ -From a71fda827da45c357d92d07ea491c208c1e044fe Mon Sep 17 00:00:00 2001 -From: Maksim Kita -Date: Sun, 23 May 2021 10:27:29 +0000 -Subject: [PATCH] libunwind: Added unw_backtrace method - -Source: https://github.com/ClickHouse-Extras/libunwind/commit/52f0f7861926cbfaef7e6c97d8a6d7ba2a1f6747#diff-a82fc885e2e4facf4b92d26171c13aa4aa5db296f77e1158ba2f8664e3bd1f5c -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - libunwind/include/libunwind.h | 1 + - libunwind/src/libunwind.cpp | 18 ++++++++++++++++++ - 2 files changed, 19 insertions(+) - -diff --git a/libunwind/include/libunwind.h b/libunwind/include/libunwind.h -index 9a74faa48d6f..f7480c9cf27a 100644 ---- a/libunwind/include/libunwind.h -+++ b/libunwind/include/libunwind.h -@@ -127,6 +127,7 @@ extern int unw_is_fpreg(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL; - extern int unw_is_signal_frame(unw_cursor_t *) LIBUNWIND_AVAIL; - extern int unw_get_proc_name(unw_cursor_t *, char *, size_t, unw_word_t *) LIBUNWIND_AVAIL; - //extern int unw_get_save_loc(unw_cursor_t*, int, unw_save_loc_t*); -+extern int unw_backtrace(void **, int) LIBUNWIND_AVAIL; - - extern unw_addr_space_t unw_local_addr_space; - -diff --git a/libunwind/src/libunwind.cpp b/libunwind/src/libunwind.cpp -index 03f8b75b5bba..730e2393a8f8 100644 ---- a/libunwind/src/libunwind.cpp -+++ b/libunwind/src/libunwind.cpp -@@ -326,7 +326,25 @@ void __unw_remove_dynamic_eh_frame_section(unw_word_t eh_frame_start) { - #endif // defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) - #endif // !defined(__USING_SJLJ_EXCEPTIONS__) - -+int unw_backtrace(void **buffer, int size) { -+ unw_context_t context; -+ unw_cursor_t cursor; -+ if (unw_getcontext(&context) || unw_init_local(&cursor, &context)) { -+ return 0; -+ } -+ -+ unw_word_t ip; -+ int current = 0; -+ while (unw_step(&cursor) > 0) { -+ if (current >= size || unw_get_reg(&cursor, UNW_REG_IP, &ip)) { -+ break; -+ } - -+ buffer[current++] = reinterpret_cast(static_cast(ip)); -+ } -+ -+ return current; -+} - - // Add logging hooks in Debug builds only - #ifndef NDEBUG diff --git a/recipes-devtools/clang/clang/0028-Do-not-force-thumb-mode-directive.patch b/recipes-devtools/clang/clang/0028-Do-not-force-thumb-mode-directive.patch deleted file mode 100644 index 6db1e87..0000000 --- a/recipes-devtools/clang/clang/0028-Do-not-force-thumb-mode-directive.patch +++ /dev/null @@ -1,46 +0,0 @@ -From f69f7529bc8b561ddc32a5057da6d74d90dd9c94 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 12 Jun 2021 08:42:36 -0700 -Subject: [PATCH] Do not force thumb mode directive - -.thumb_func was not switching mode until [1] -so it did not show up but now that .thumb_func (without argument) is -switching mode, its causing build failures on armv6 ( rpi0 ) even when -build is explicitly asking for this file to be built with -marm (ARM -mode), therefore use DEFINE_COMPILERRT_FUNCTION macro to add function -header which considers arch and mode from compiler cmdline to decide if -the function is built using thumb mode or arm mode. - -[1] https://reviews.llvm.org/D101975 - -Signed-off-by: Khem Raj ---- - compiler-rt/lib/builtins/arm/sync-ops.h | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - -diff --git a/compiler-rt/lib/builtins/arm/sync-ops.h b/compiler-rt/lib/builtins/arm/sync-ops.h -index 7a26170741ad..d914f9d3a109 100644 ---- a/compiler-rt/lib/builtins/arm/sync-ops.h -+++ b/compiler-rt/lib/builtins/arm/sync-ops.h -@@ -16,9 +16,8 @@ - - #define SYNC_OP_4(op) \ - .p2align 2; \ -- .thumb; \ - .syntax unified; \ -- DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ -+ DEFINE_COMPILERRT_FUNCTION(__sync_fetch_and_##op) \ - DMB; \ - mov r12, r0; \ - LOCAL_LABEL(tryatomic_##op) : ldrex r0, [r12]; \ -@@ -31,9 +30,8 @@ - - #define SYNC_OP_8(op) \ - .p2align 2; \ -- .thumb; \ - .syntax unified; \ -- DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ -+ DEFINE_COMPILERRT_FUNCTION(__sync_fetch_and_##op) \ - push {r4, r5, r6, lr}; \ - DMB; \ - mov r12, r0; \ diff --git a/recipes-devtools/clang/clang/0028-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch b/recipes-devtools/clang/clang/0028-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch new file mode 100644 index 0000000..1f50ec0 --- /dev/null +++ b/recipes-devtools/clang/clang/0028-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch @@ -0,0 +1,97 @@ +From fe9ef041f4a5885d4ce4caf6569cda2869ceb7a7 Mon Sep 17 00:00:00 2001 +From: David Abdurachmanov +Date: Wed, 20 Oct 2021 17:30:36 -0700 +Subject: [PATCH] clang: Fix how driver finds GCC installation path on + OpenEmbedded + +Fix how Clang Driver finds GCC installation path on OpenEmbedded + +- For RISCV (riscv{32,64}) we define new two multi-lib options without any + subdirectories (e.g., lib32/ilp32d or lib64/lp64d). OpenEmbedded GCC + builds don't use them. +- Modify how Clang Driver finds GCC installation path. This is important + because GCC files on OpenEmbedded are in two different directories: + (1) /usr/bin/../lib/gcc/riscv64-oe-linux/9.2.0 + (2) /usr/lib/riscv64-oe-linux/9.2.0 + +Clang Driver will check (1) first. The directory exist, but will produce +no valid multi-libs and there will be no multi-lib selected. (2) contains +actual GCC run-time objects/libraries, but because the path has exact +same GCC version (9.2.0) it will be skipped. + +We modify the approach by allowing to check other directories with the same +GCC version. We also avoid picking GCC installation path if it results in +an empty multi-lib list. + +Upstream-Status: Pending +Signed-off-by: David Abdurachmanov +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 39 +++++++++++++++++++++-------- + 1 file changed, 28 insertions(+), 11 deletions(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 107ab8d78598..b5ee01c566e3 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -1737,18 +1737,29 @@ static void findRISCVMultilibs(const Driver &D, + return findRISCVBareMetalMultilibs(D, TargetTriple, Path, Args, Result); + + FilterNonExistent NonExistent(Path, "/crtbegin.o", D.getVFS()); +- Multilib Ilp32 = makeMultilib("lib32/ilp32").flag("+m32").flag("+mabi=ilp32"); +- Multilib Ilp32f = ++ MultilibSet RISCVMultilibs; ++ ++ if (TargetTriple.getVendor() == llvm::Triple::OpenEmbedded) { ++ Multilib OpenEmbeddedIlp32d = makeMultilib("").flag("+m32").flag("+mabi=ilp32d"); ++ Multilib OpenEmbeddedLp64d = makeMultilib("").flag("+m64").flag("+mabi=lp64d"); ++ RISCVMultilibs = ++ MultilibSet() ++ .Either({OpenEmbeddedIlp32d, OpenEmbeddedLp64d}) ++ .FilterOut(NonExistent); ++ } else { ++ Multilib Ilp32 = makeMultilib("lib32/ilp32").flag("+m32").flag("+mabi=ilp32"); ++ Multilib Ilp32f = + makeMultilib("lib32/ilp32f").flag("+m32").flag("+mabi=ilp32f"); +- Multilib Ilp32d = ++ Multilib Ilp32d = + makeMultilib("lib32/ilp32d").flag("+m32").flag("+mabi=ilp32d"); +- Multilib Lp64 = makeMultilib("lib64/lp64").flag("+m64").flag("+mabi=lp64"); +- Multilib Lp64f = makeMultilib("lib64/lp64f").flag("+m64").flag("+mabi=lp64f"); +- Multilib Lp64d = makeMultilib("lib64/lp64d").flag("+m64").flag("+mabi=lp64d"); +- MultilibSet RISCVMultilibs = +- MultilibSet() +- .Either({Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d}) +- .FilterOut(NonExistent); ++ Multilib Lp64 = makeMultilib("lib64/lp64").flag("+m64").flag("+mabi=lp64"); ++ Multilib Lp64f = makeMultilib("lib64/lp64f").flag("+m64").flag("+mabi=lp64f"); ++ Multilib Lp64d = makeMultilib("lib64/lp64d").flag("+m64").flag("+mabi=lp64d"); ++ RISCVMultilibs = ++ MultilibSet() ++ .Either({Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d}) ++ .FilterOut(NonExistent); ++ } + + Multilib::flags_list Flags; + bool IsRV64 = TargetTriple.getArch() == llvm::Triple::riscv64; +@@ -2674,13 +2685,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + continue; // Saw this path before; no need to look at it again. + if (CandidateVersion.isOlderThan(4, 1, 1)) + continue; +- if (CandidateVersion <= Version) ++ if (CandidateVersion < Version) + continue; + + if (!ScanGCCForMultilibs(TargetTriple, Args, LI->path(), + NeedsBiarchSuffix)) + continue; + ++ // We might have found existing directory with GCCVersion, but it ++ // might not have GCC libraries we are looking for (i.e. return an ++ // empty Mulilibs) ++ if (Multilibs.size() == 0) ++ continue; ++ + Version = CandidateVersion; + GCCTriple.setTriple(CandidateTriple); + // FIXME: We hack together the directory name here instead of diff --git a/recipes-devtools/clang/clang/0029-Fix-lib-paths-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0029-Fix-lib-paths-for-OpenEmbedded-Host.patch new file mode 100644 index 0000000..4edcd97 --- /dev/null +++ b/recipes-devtools/clang/clang/0029-Fix-lib-paths-for-OpenEmbedded-Host.patch @@ -0,0 +1,79 @@ +From 4a5e70c334ceb5e83d971d1a00067281d42ebaff 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 b5ee01c566e3..f9dce01b579f 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -23,6 +23,7 @@ + #include "clang/Driver/Options.h" + #include "clang/Driver/Tool.h" + #include "clang/Driver/ToolChain.h" ++#include "clang/Driver/Distro.h" + #include "llvm/Option/ArgList.h" + #include "llvm/Support/CodeGen.h" + #include "llvm/Support/Path.h" +@@ -2643,6 +2644,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 { +@@ -2660,7 +2662,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/0029-clang-Do-not-use-install-relative-libc-headers.patch b/recipes-devtools/clang/clang/0029-clang-Do-not-use-install-relative-libc-headers.patch deleted file mode 100644 index 8bae1a3..0000000 --- a/recipes-devtools/clang/clang/0029-clang-Do-not-use-install-relative-libc-headers.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 71a195e5ed96e47a21fe3f55708046350ebabdfe Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 11 Aug 2021 18:37:11 -0700 -Subject: [PATCH] clang: Do not use install relative libc++ headers - -In OE we use same clang for native and cross builds, therefore we need -to ensure that native sysroot install of libc++ is not searched for -headers when doing cross compile instead it searches the target sysroot -this is especially troublesome when libcxx-native is staged along with -libcxx e.g. chromium - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Gnu.cpp | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 6fcd5abe7211..0d04a199a7af 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2919,7 +2919,9 @@ Generic_GCC::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, - - // Android never uses the libc++ headers installed alongside the toolchain, - // which are generally incompatible with the NDK libraries anyway. -- if (!getTriple().isAndroid()) -+ // And also do not add it when --sysroot is specified, since it would expect -+ // libc++ headers from sysroot -+ if (!getTriple().isAndroid() && SysRoot.empty()) - if (AddIncludePath(getDriver().Dir + "/../include")) - return; - // If this is a development, non-installed, clang, libcxx will diff --git a/recipes-devtools/clang/clang/0030-Correct-library-search-path-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0030-Correct-library-search-path-for-OpenEmbedded-Host.patch new file mode 100644 index 0000000..d286791 --- /dev/null +++ b/recipes-devtools/clang/clang/0030-Correct-library-search-path-for-OpenEmbedded-Host.patch @@ -0,0 +1,84 @@ +From f336b9d079e5576ce6d98bb1650002eb107b824a 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 01d66b30b038..4d5aa366a005 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, +@@ -134,6 +135,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 1898667279cc..ab7bc8d45ac1 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 aac45650f97b..3c4034ea4921 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -77,6 +77,7 @@ std::string Linux::getMultiarchTriple(const Driver &D, + return "x86_64-linux-android"; + if (TargetEnvironment == llvm::Triple::GNUX32) + return "x86_64-linux-gnux32"; ++ //CLANG_EXTRA_OE_DISTRO_TRIPLE + return "x86_64-linux-gnu"; + case llvm::Triple::aarch64: + if (IsAndroid) diff --git a/recipes-devtools/clang/clang/0030-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch b/recipes-devtools/clang/clang/0030-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch deleted file mode 100644 index b814803..0000000 --- a/recipes-devtools/clang/clang/0030-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch +++ /dev/null @@ -1,97 +0,0 @@ -From d7b262b22c16436c836de7f39591eaafd28a4e21 Mon Sep 17 00:00:00 2001 -From: David Abdurachmanov -Date: Wed, 20 Oct 2021 17:30:36 -0700 -Subject: [PATCH] clang: Fix how driver finds GCC installation path on - OpenEmbedded - -Fix how Clang Driver finds GCC installation path on OpenEmbedded - -- For RISCV (riscv{32,64}) we define new two multi-lib options without any - subdirectories (e.g., lib32/ilp32d or lib64/lp64d). OpenEmbedded GCC - builds don't use them. -- Modify how Clang Driver finds GCC installation path. This is important - because GCC files on OpenEmbedded are in two different directories: - (1) /usr/bin/../lib/gcc/riscv64-oe-linux/9.2.0 - (2) /usr/lib/riscv64-oe-linux/9.2.0 - -Clang Driver will check (1) first. The directory exist, but will produce -no valid multi-libs and there will be no multi-lib selected. (2) contains -actual GCC run-time objects/libraries, but because the path has exact -same GCC version (9.2.0) it will be skipped. - -We modify the approach by allowing to check other directories with the same -GCC version. We also avoid picking GCC installation path if it results in -an empty multi-lib list. - -Upstream-Status: Pending -Signed-off-by: David Abdurachmanov -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Gnu.cpp | 39 +++++++++++++++++++++-------- - 1 file changed, 28 insertions(+), 11 deletions(-) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 0d04a199a7af..1e5a3cc2c1f1 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -1641,18 +1641,29 @@ static void findRISCVMultilibs(const Driver &D, - return findRISCVBareMetalMultilibs(D, TargetTriple, Path, Args, Result); - - FilterNonExistent NonExistent(Path, "/crtbegin.o", D.getVFS()); -- Multilib Ilp32 = makeMultilib("lib32/ilp32").flag("+m32").flag("+mabi=ilp32"); -- Multilib Ilp32f = -+ MultilibSet RISCVMultilibs; -+ -+ if (TargetTriple.getVendor() == llvm::Triple::OpenEmbedded) { -+ Multilib OpenEmbeddedIlp32d = makeMultilib("").flag("+m32").flag("+mabi=ilp32d"); -+ Multilib OpenEmbeddedLp64d = makeMultilib("").flag("+m64").flag("+mabi=lp64d"); -+ RISCVMultilibs = -+ MultilibSet() -+ .Either({OpenEmbeddedIlp32d, OpenEmbeddedLp64d}) -+ .FilterOut(NonExistent); -+ } else { -+ Multilib Ilp32 = makeMultilib("lib32/ilp32").flag("+m32").flag("+mabi=ilp32"); -+ Multilib Ilp32f = - makeMultilib("lib32/ilp32f").flag("+m32").flag("+mabi=ilp32f"); -- Multilib Ilp32d = -+ Multilib Ilp32d = - makeMultilib("lib32/ilp32d").flag("+m32").flag("+mabi=ilp32d"); -- Multilib Lp64 = makeMultilib("lib64/lp64").flag("+m64").flag("+mabi=lp64"); -- Multilib Lp64f = makeMultilib("lib64/lp64f").flag("+m64").flag("+mabi=lp64f"); -- Multilib Lp64d = makeMultilib("lib64/lp64d").flag("+m64").flag("+mabi=lp64d"); -- MultilibSet RISCVMultilibs = -- MultilibSet() -- .Either({Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d}) -- .FilterOut(NonExistent); -+ Multilib Lp64 = makeMultilib("lib64/lp64").flag("+m64").flag("+mabi=lp64"); -+ Multilib Lp64f = makeMultilib("lib64/lp64f").flag("+m64").flag("+mabi=lp64f"); -+ Multilib Lp64d = makeMultilib("lib64/lp64d").flag("+m64").flag("+mabi=lp64d"); -+ RISCVMultilibs = -+ MultilibSet() -+ .Either({Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d}) -+ .FilterOut(NonExistent); -+ } - - Multilib::flags_list Flags; - bool IsRV64 = TargetTriple.getArch() == llvm::Triple::riscv64; -@@ -2549,13 +2560,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( - continue; // Saw this path before; no need to look at it again. - if (CandidateVersion.isOlderThan(4, 1, 1)) - continue; -- if (CandidateVersion <= Version) -+ if (CandidateVersion < Version) - continue; - - if (!ScanGCCForMultilibs(TargetTriple, Args, LI->path(), - NeedsBiarchSuffix)) - continue; - -+ // We might have found existing directory with GCCVersion, but it -+ // might not have GCC libraries we are looking for (i.e. return an -+ // empty Mulilibs) -+ if (Multilibs.size() == 0) -+ continue; -+ - Version = CandidateVersion; - GCCTriple.setTriple(CandidateTriple); - // FIXME: We hack together the directory name here instead of diff --git a/recipes-devtools/clang/clang/0031-Fix-lib-paths-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0031-Fix-lib-paths-for-OpenEmbedded-Host.patch deleted file mode 100644 index c5eb168..0000000 --- a/recipes-devtools/clang/clang/0031-Fix-lib-paths-for-OpenEmbedded-Host.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 4dab11c8abdd1a48cd0df4475ef2f82732c7f7e3 Mon Sep 17 00:00:00 2001 -From: Changqing Li -Date: Tue, 7 Dec 2021 04:08:22 +0000 -Subject: [PATCH] Fix lib paths for OpenEmbedded Host - -Under OpenEmbedded Host, while building with clang-native, it cannot find -the GCCInstallPath, which causing following error: -[snip] -compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --target x86_64-linux --isystem/path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/include --O2 -pipe -/path/to/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/share/cmake-3.21/Modules/CMakeCCompilerABI.c` -hosttools/ld: cannot find crtbeginS.o: No such file or directory -[snip] - -Before this patch: -compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang -clang version 13.0.1 (https://github.com/llvm/llvm-project 08e3a5ccd952edee36b3c002e3a29c6b1b5153de) -Target: x86_64-unknown-linux-gnu -Thread model: posix -InstalledDir: /build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin -Found candidate GCC installation: /usr/lib/gcc/x86_64-wrs-linux/10.2.0 - -After this patch: -compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang -clang version 13.0.1 (https://github.com/llvm/llvm-project 08e3a5ccd952edee36b3c002e3a29c6b1b5153de) -Thread model: posix -InstalledDir: /build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin -Found candidate GCC installation: /usr/lib/gcc/x86_64-wrs-linux/10.2.0 -Found candidate GCC installation: /usr/lib/x86_64-wrs-linux/10.2.0 -Selected GCC installation: /usr/lib/x86_64-wrs-linux/10.2.0 -Candidate multilib: .;@m64 -Selected multilib: .;@m64 - -Summary: -For OpenEmbedded Host, sysroots are of the form/usr/lib//x.y.z. -Take x86-64 as example, the default triple is x86_64-unknown-linux-gnu. -For clang-native, the target vendor is '-unknown', need to test current distro -to follow above form. - -Upstream-Status: Inappropriate [oe specific] - -Signed-off-by: Changqing Li -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Gnu.cpp | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 1e5a3cc2c1f1..d3574b86cb26 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -22,6 +22,7 @@ - #include "clang/Driver/Options.h" - #include "clang/Driver/Tool.h" - #include "clang/Driver/ToolChain.h" -+#include "clang/Driver/Distro.h" - #include "llvm/Option/ArgList.h" - #include "llvm/Support/CodeGen.h" - #include "llvm/Support/Path.h" -@@ -2518,6 +2519,7 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( - const llvm::Triple &TargetTriple, const ArgList &Args, - const std::string &LibDir, StringRef CandidateTriple, - bool NeedsBiarchSuffix, bool GCCDirExists, bool GCCCrossDirExists) { -+ Distro Distro(D.getVFS(), TargetTriple); - // Locations relative to the system lib directory where GCC's triple-specific - // directories might reside. - struct GCCLibSuffix { -@@ -2535,7 +2537,8 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( - // files in that location, not just GCC installation data. - {CandidateTriple.str(), "..", - TargetTriple.getVendor() == llvm::Triple::Freescale || -- TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}, -+ TargetTriple.getVendor() == llvm::Triple::OpenEmbedded || -+ Distro.IsOpenEmbedded()}, - - // This is the normal place. - {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists}, diff --git a/recipes-devtools/clang/clang/0031-lldb-Link-with-libatomic-on-x86.patch b/recipes-devtools/clang/clang/0031-lldb-Link-with-libatomic-on-x86.patch new file mode 100644 index 0000000..9f94c20 --- /dev/null +++ b/recipes-devtools/clang/clang/0031-lldb-Link-with-libatomic-on-x86.patch @@ -0,0 +1,33 @@ +From 27491fdfb14a3381800fbf2785a68e93363ff4da 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 1a92c033fac4..a0d8f3288c06 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/0032-Correct-library-search-path-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0032-Correct-library-search-path-for-OpenEmbedded-Host.patch deleted file mode 100644 index 7388f8e..0000000 --- a/recipes-devtools/clang/clang/0032-Correct-library-search-path-for-OpenEmbedded-Host.patch +++ /dev/null @@ -1,84 +0,0 @@ -From 12b439deed0381e603155a11f3aec5eb20cd6803 Mon Sep 17 00:00:00 2001 -From: Changqing Li -Date: Tue, 7 Dec 2021 04:55:48 +0000 -Subject: [PATCH] Correct library search path for OpenEmbedded Host - -For OpenEmbedded Host, the gcc install path is -/usr/lib/x86_64-[distroname]-linux/[gcc-version]. -So the library search path is not found with default triple -'x86_64-linux-gnu' for x86_64. Causing following error: -[snip] -compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --target x86_64-linux --isystem/path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/include --O2 -pipe -/path/to/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/share/cmake-3.21/Modules/CMakeCCompilerABI.c` -| /build/tmp-glibc/hosttools/ld: cannot find -lgcc -| /build/tmp-glibc/hosttools/ld: cannot find -lgcc -| clang-13: error: linker command failed with exit code 1 (use -v to see invocation) -[snip] - -before this patch: -b59da142f2b0:$ /path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --print-search-dirs -programs: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin -libraries: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/lib/clang/13.0.1:/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/../lib://lib://usr/lib - -after this patch: -b59da142f2b0:$ /path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --print-search-dirs -programs: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin -libraries: =/build/tmp-glibc/work/x84_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/lib/clang/13.0.1:/usr/lib/x86_64-wrs-linux/10.2.0://lib/x86_64-wrs-linux://usr/lib/x86_64-wrs-linux:/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/../lib://lib://usr/lib - -Upstream-Status: Inappropriate [oe specific] - -Signed-off-by: Changqing Li -Signed-off-by: Khem Raj ---- - clang/include/clang/Driver/Distro.h | 2 ++ - clang/lib/Driver/Distro.cpp | 1 + - clang/lib/Driver/ToolChains/Linux.cpp | 1 + - 3 files changed, 4 insertions(+) - -diff --git a/clang/include/clang/Driver/Distro.h b/clang/include/clang/Driver/Distro.h -index 2723f75e8945..cd43e8f11574 100644 ---- a/clang/include/clang/Driver/Distro.h -+++ b/clang/include/clang/Driver/Distro.h -@@ -44,6 +44,7 @@ public: - RHEL7, - Fedora, - Gentoo, -+ //CLANG_EXTRA_OE_DISTRO_NAME - OpenSUSE, - UbuntuHardy, - UbuntuIntrepid, -@@ -132,6 +133,7 @@ public: - - bool IsGentoo() const { return DistroVal == Gentoo; } - -+ //CLANG_EXTRA_OE_DISTRO_CHECK - /// @} - }; - -diff --git a/clang/lib/Driver/Distro.cpp b/clang/lib/Driver/Distro.cpp -index 5ac38c34d112..f20dd4b526e5 100644 ---- a/clang/lib/Driver/Distro.cpp -+++ b/clang/lib/Driver/Distro.cpp -@@ -44,6 +44,7 @@ static Distro::DistroType DetectOsRelease(llvm::vfs::FileSystem &VFS) { - .Case("sles", Distro::OpenSUSE) - .Case("opensuse", Distro::OpenSUSE) - .Case("exherbo", Distro::Exherbo) -+ //CLANG_EXTRA_OE_DISTRO_CASE - .Default(Distro::UnknownDistro); - return Version; - } -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index eb92a037c930..c92cef442005 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -77,6 +77,7 @@ std::string Linux::getMultiarchTriple(const Driver &D, - return "x86_64-linux-android"; - if (TargetEnvironment == llvm::Triple::GNUX32) - return "x86_64-linux-gnux32"; -+ //CLANG_EXTRA_OE_DISTRO_TRIPLE - return "x86_64-linux-gnu"; - case llvm::Triple::aarch64: - if (IsAndroid) diff --git a/recipes-devtools/clang/clang/0032-clang-exclude-openembedded-distributions-from-settin.patch b/recipes-devtools/clang/clang/0032-clang-exclude-openembedded-distributions-from-settin.patch new file mode 100644 index 0000000..5d04625 --- /dev/null +++ b/recipes-devtools/clang/clang/0032-clang-exclude-openembedded-distributions-from-settin.patch @@ -0,0 +1,35 @@ +From aa89fb818fd69fa1ae2021acd91c3fcc5692daa8 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 11 Feb 2022 12:29:14 -0800 +Subject: [PATCH] clang: exclude openembedded distributions from setting rpath + on openmp executables + +OpenEmbedded based SDKs stage toolchains outsides the target rootfs and +libomp.so is part of the target rootfs and not part of compiler +toolchain install or relative to it. It finds the libraries via +--sysroot during compile. This ensures that -rpath is not added for such +systems, since it is adding cross-compile paths to rpath which is not +correct when the binaries are run on real targets. + +Upstream-Status: Submitted [https://reviews.llvm.org/D119590] +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/CommonArgs.cpp | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp +index c8eabfac21dc..6e1e626a90ea 100644 +--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp ++++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp +@@ -649,6 +649,11 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args, + void tools::addOpenMPRuntimeSpecificRPath(const ToolChain &TC, + const ArgList &Args, + ArgStringList &CmdArgs) { ++ // OpenEmbedded/Yocto installs libomp.so into /usr/lib ++ // therefore using -rpath is not needed, on the contrary it adds ++ // paths from cross compiler install location which is not correct ++ if (TC.getTriple().getVendor() == llvm::Triple::OpenEmbedded) ++ return; + + if (Args.hasFlag(options::OPT_fopenmp_implicit_rpath, + options::OPT_fno_openmp_implicit_rpath, true)) { diff --git a/recipes-devtools/clang/clang/0033-compiler-rt-Enable-__int128-for-ppc32.patch b/recipes-devtools/clang/clang/0033-compiler-rt-Enable-__int128-for-ppc32.patch new file mode 100644 index 0000000..89f62fa --- /dev/null +++ b/recipes-devtools/clang/clang/0033-compiler-rt-Enable-__int128-for-ppc32.patch @@ -0,0 +1,73 @@ +From 640b23ccdd2e8605a2cfa940f93619f02e2616f7 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 ec668e294d6d..72556d2fc58e 100644 +--- a/compiler-rt/lib/builtins/CMakeLists.txt ++++ b/compiler-rt/lib/builtins/CMakeLists.txt +@@ -628,11 +628,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 +@@ -647,14 +645,15 @@ set(powerpc64_SOURCES + ) + # These routines require __int128, which isn't supported on AIX. + if (NOT ${CMAKE_SYSTEM_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/save.S +@@ -761,9 +760,9 @@ else () + list(APPEND BUILTIN_CFLAGS_${arch} -fomit-frame-pointer -DCOMPILER_RT_ARMHF_TARGET) + endif() + +- # For RISCV32, we must force enable int128 for compiling long ++ # For RISCV32/PPC32, we must force enable int128 for compiling long + # double routines. +- if("${arch}" STREQUAL "riscv32") ++ if("${arch}" STREQUAL "riscv32" OR "${arch}" STREQUAL "powerpc" ) + list(APPEND BUILTIN_CFLAGS_${arch} -fforce-enable-int128) + endif() + +diff --git a/compiler-rt/lib/builtins/int_types.h b/compiler-rt/lib/builtins/int_types.h +index 7a72de480676..9ee5a327b28a 100644 +--- a/compiler-rt/lib/builtins/int_types.h ++++ b/compiler-rt/lib/builtins/int_types.h +@@ -64,7 +64,7 @@ typedef union { + } udwords; + + #if defined(__LP64__) || defined(__wasm__) || defined(__mips64) || \ +- defined(__riscv) || defined(_WIN64) ++ defined(__riscv) || defined(_WIN64) || defined(__powerpc__) + #define CRT_HAS_128BIT + #endif + diff --git a/recipes-devtools/clang/clang/0033-lldb-Link-with-libatomic-on-x86.patch b/recipes-devtools/clang/clang/0033-lldb-Link-with-libatomic-on-x86.patch deleted file mode 100644 index 7539afc..0000000 --- a/recipes-devtools/clang/clang/0033-lldb-Link-with-libatomic-on-x86.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 17c7ad88f765bfbcfe25dd8f76ab9264250b9ea3 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Tue, 8 Feb 2022 01:31:26 -0800 -Subject: [PATCH] lldb: Link with libatomic on x86 - -cmake atomic check is not sufficient for i686 target where clang14 still -generates __atomic_store calls but the check does not entail this -function and happily thinks that compiler can resolve all atomic via intrinsics -on i686, but thats not the case, ideally the check for determining -atomic operation should be make more robust but until then lets ask to -link with libatomic on i686/linux - -Upstream-Status: Inappropriate [OE-Specific] -Signed-off-by: Khem Raj ---- - lldb/source/Utility/CMakeLists.txt | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/lldb/source/Utility/CMakeLists.txt b/lldb/source/Utility/CMakeLists.txt -index cc0bf5fdb61a..5228bf01c276 100644 ---- a/lldb/source/Utility/CMakeLists.txt -+++ b/lldb/source/Utility/CMakeLists.txt -@@ -19,6 +19,10 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows") - list(APPEND LLDB_SYSTEM_LIBS ws2_32 rpcrt4) - endif () - -+if (CMAKE_SYSTEM_PROCESSOR MATCHES "i686" AND CMAKE_SYSTEM_NAME MATCHES "Linux") -+ list(APPEND LLDB_SYSTEM_LIBS atomic) -+endif() -+ - if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB ) - list(APPEND LLDB_SYSTEM_LIBS atomic) - endif() diff --git a/recipes-devtools/clang/clang/0034-clang-exclude-openembedded-distributions-from-settin.patch b/recipes-devtools/clang/clang/0034-clang-exclude-openembedded-distributions-from-settin.patch deleted file mode 100644 index cbc3da1..0000000 --- a/recipes-devtools/clang/clang/0034-clang-exclude-openembedded-distributions-from-settin.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 5c0d026419a69d5b8722f1abb0000caa4c151885 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Fri, 11 Feb 2022 12:29:14 -0800 -Subject: [PATCH] clang: exclude openembedded distributions from setting rpath - on openmp executables - -OpenEmbedded based SDKs stage toolchains outsides the target rootfs and -libomp.so is part of the target rootfs and not part of compiler -toolchain install or relative to it. It finds the libraries via ---sysroot during compile. This ensures that -rpath is not added for such -systems, since it is adding cross-compile paths to rpath which is not -correct when the binaries are run on real targets. - -Upstream-Status: Submitted [https://reviews.llvm.org/D119590] -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/CommonArgs.cpp | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp -index dbc91e427dfb..b2cbfca9898c 100644 ---- a/clang/lib/Driver/ToolChains/CommonArgs.cpp -+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp -@@ -648,6 +648,11 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args, - void tools::addOpenMPRuntimeSpecificRPath(const ToolChain &TC, - const ArgList &Args, - ArgStringList &CmdArgs) { -+ // OpenEmbedded/Yocto installs libomp.so into /usr/lib -+ // therefore using -rpath is not needed, on the contrary it adds -+ // paths from cross compiler install location which is not correct -+ if (TC.getTriple().getVendor() == llvm::Triple::OpenEmbedded) -+ return; - - if (Args.hasFlag(options::OPT_fopenmp_implicit_rpath, - options::OPT_fno_openmp_implicit_rpath, true)) { diff --git a/recipes-devtools/clang/clang/0034-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch b/recipes-devtools/clang/clang/0034-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch new file mode 100644 index 0000000..88b0744 --- /dev/null +++ b/recipes-devtools/clang/clang/0034-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch @@ -0,0 +1,44 @@ +From dfff33f748b0335ccc2df25c45f3841d459b6345 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 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt +index 5044b2639a0f..9bdd35c4eae4 100644 +--- a/llvm/lib/Support/CMakeLists.txt ++++ b/llvm/lib/Support/CMakeLists.txt +@@ -26,7 +26,7 @@ if(LLVM_ENABLE_ZLIB) + endif() + + if(LLVM_ENABLE_ZSTD) +- list(APPEND imported_libs zstd::libzstd_shared) ++ list(APPEND imported_libs zstd) + endif() + + if( MSVC OR MINGW ) +@@ -305,7 +305,7 @@ if(LLVM_ENABLE_ZSTD) + if(NOT zstd_library) + get_property(zstd_library TARGET zstd::libzstd_shared PROPERTY LOCATION) + endif() +- 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/0035-compiler-rt-Enable-__int128-for-ppc32.patch b/recipes-devtools/clang/clang/0035-compiler-rt-Enable-__int128-for-ppc32.patch deleted file mode 100644 index bb1a26a..0000000 --- a/recipes-devtools/clang/clang/0035-compiler-rt-Enable-__int128-for-ppc32.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 734aaa66800b91abe42bdef1dd721c368fa17b07 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 9 Mar 2022 16:28:16 -0800 -Subject: [PATCH] compiler-rt: Enable __int128 for ppc32 - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - compiler-rt/lib/builtins/CMakeLists.txt | 7 +++---- - compiler-rt/lib/builtins/int_types.h | 2 +- - 2 files changed, 4 insertions(+), 5 deletions(-) - -diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt -index ea5ad9cdb864..4d1efc690d71 100644 ---- a/compiler-rt/lib/builtins/CMakeLists.txt -+++ b/compiler-rt/lib/builtins/CMakeLists.txt -@@ -607,8 +607,6 @@ set(mips64_SOURCES ${GENERIC_TF_SOURCES} - set(mips64el_SOURCES ${GENERIC_TF_SOURCES} - ${mips_SOURCES}) - --set(powerpc_SOURCES ${GENERIC_SOURCES}) -- - set(powerpcspe_SOURCES ${GENERIC_SOURCES}) - - set(powerpc64_SOURCES -@@ -634,6 +632,7 @@ if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "AIX") - ) - endif() - set(powerpc64le_SOURCES ${powerpc64_SOURCES}) -+set(powerpc_SOURCES ${powerpc64_SOURCES}) - - set(riscv_SOURCES - riscv/save.S -@@ -740,9 +739,9 @@ else () - list(APPEND BUILTIN_CFLAGS_${arch} -fomit-frame-pointer -DCOMPILER_RT_ARMHF_TARGET) - endif() - -- # For RISCV32, we must force enable int128 for compiling long -+ # For RISCV32/PPC32, we must force enable int128 for compiling long - # double routines. -- if("${arch}" STREQUAL "riscv32") -+ if("${arch}" STREQUAL "riscv32" OR "${arch}" STREQUAL "powerpc" ) - list(APPEND BUILTIN_CFLAGS_${arch} -fforce-enable-int128) - endif() - -diff --git a/compiler-rt/lib/builtins/int_types.h b/compiler-rt/lib/builtins/int_types.h -index 7a72de480676..9ee5a327b28a 100644 ---- a/compiler-rt/lib/builtins/int_types.h -+++ b/compiler-rt/lib/builtins/int_types.h -@@ -64,7 +64,7 @@ typedef union { - } udwords; - - #if defined(__LP64__) || defined(__wasm__) || defined(__mips64) || \ -- defined(__riscv) || defined(_WIN64) -+ defined(__riscv) || defined(_WIN64) || defined(__powerpc__) - #define CRT_HAS_128BIT - #endif - diff --git a/recipes-devtools/clang/clang/0036-compiler-rt-builtins-Move-DMB-definition-to-syn-opsh.patch b/recipes-devtools/clang/clang/0036-compiler-rt-builtins-Move-DMB-definition-to-syn-opsh.patch deleted file mode 100644 index 3616645..0000000 --- a/recipes-devtools/clang/clang/0036-compiler-rt-builtins-Move-DMB-definition-to-syn-opsh.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 1c9415806ba6d0d48a160637eea7d1b70efaae69 Mon Sep 17 00:00:00 2001 -From: Pengxuan Zheng -Date: Mon, 4 Apr 2022 18:17:03 -0700 -Subject: [PATCH] [compiler-rt][builtins] Move DMB definition to syn-ops.h - -Upstream-Status: Backported - -Compiler-rt cross-compile for ARMv5 fails because D99282 made it an error if DMB -is used for any pre-ARMv6 targets. More specifically, the "#error only supported -on ARMv6+" added in D99282 will cause compilation to fail when any source file -which includes assembly.h are compiled for pre-ARMv6 targets. Since the only -place where DMB is used is syn-ops.h (which is only included by -arm/sync_fetch_and_* and these files are excluded from being built for older -targets), this patch moves the definition there to avoid the issues described -above. - -Reviewed By: efriedma - -Differential Revision: https://reviews.llvm.org/D123105 ---- - compiler-rt/lib/builtins/arm/sync-ops.h | 8 ++++++++ - compiler-rt/lib/builtins/assembly.h | 8 -------- - 2 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/compiler-rt/lib/builtins/arm/sync-ops.h b/compiler-rt/lib/builtins/arm/sync-ops.h -index d914f9d3a109..dca201d8aef7 100644 ---- a/compiler-rt/lib/builtins/arm/sync-ops.h -+++ b/compiler-rt/lib/builtins/arm/sync-ops.h -@@ -14,6 +14,14 @@ - - #include "../assembly.h" - -+#if __ARM_ARCH >= 7 -+#define DMB dmb -+#elif __ARM_ARCH >= 6 -+#define DMB mcr p15, #0, r0, c7, c10, #5 -+#else -+#error DMB is only supported on ARMv6+ -+#endif -+ - #define SYNC_OP_4(op) \ - .p2align 2; \ - .syntax unified; \ -diff --git a/compiler-rt/lib/builtins/assembly.h b/compiler-rt/lib/builtins/assembly.h -index 06aa18162e3b..69a3d8620f92 100644 ---- a/compiler-rt/lib/builtins/assembly.h -+++ b/compiler-rt/lib/builtins/assembly.h -@@ -189,14 +189,6 @@ - JMP(ip) - #endif - --#if __ARM_ARCH >= 7 --#define DMB dmb --#elif __ARM_ARCH >= 6 --#define DMB mcr p15, #0, r0, c7, c10, #5 --#else --#error Only use this with ARMv6+ --#endif -- - #if defined(USE_THUMB_2) - #define WIDE(op) op.w - #else --- -2.25.1 - diff --git a/recipes-devtools/clang/clang/0037-sanitizer-Remove-include-linux-fs.h-to-resolve-fscon.patch b/recipes-devtools/clang/clang/0037-sanitizer-Remove-include-linux-fs.h-to-resolve-fscon.patch deleted file mode 100644 index fee7a95..0000000 --- a/recipes-devtools/clang/clang/0037-sanitizer-Remove-include-linux-fs.h-to-resolve-fscon.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 2095a89e5724866ae20d7f123b1c12b2758b58bd Mon Sep 17 00:00:00 2001 -From: Fangrui Song -Date: Mon, 11 Jul 2022 12:53:34 -0700 -Subject: [PATCH] [sanitizer] Remove #include to resolve - fsconfig_command/mount_attr conflict with glibc 2.36 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -It is generally not a good idea to mix usage of glibc headers and Linux UAPI -headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc -since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h -defines `fsconfig_command` which conflicts with linux/mount.h: - - .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’ - -Remove #include which pulls in linux/mount.h. Expand its 4 macros manually. -Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h. -In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp -but this commit is easy to cherry pick into older compiler-rt releases. - -Fix https://github.com/llvm/llvm-project/issues/56421 - -Reviewed By: #sanitizers, vitalybuka, zatrazz - -Differential Revision: https://reviews.llvm.org/D129471 - -Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/9cf13067cb5088626ba7ee1ec4c42ec59c7995a0] -Signed-off-by: Khem Raj ---- - .../sanitizer_platform_limits_posix.cpp | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - -diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp -index 32b8f47ed633..a29b31a432f0 100644 ---- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp -+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp -@@ -73,7 +73,9 @@ - #include - #include - #include -+#if SANITIZER_ANDROID - #include -+#endif - #include - #include - #include -@@ -857,10 +859,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr); - unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT; - unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT; - #endif -- unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS; -- unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION; -- unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS; -- unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION; -+ unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long); -+ unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long); -+ unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long); -+ unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long); - unsigned IOCTL_GIO_CMAP = GIO_CMAP; - unsigned IOCTL_GIO_FONT = GIO_FONT; - unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP; diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index 1ff8f81..77bf8f6 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb @@ -129,6 +129,7 @@ EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \ -DCLANG_DEFAULT_PIE_ON_LINUX=ON \ -DLLVM_BINDINGS_LIST='' \ -DLLVM_ENABLE_FFI=ON \ + -DLLVM_ENABLE_ZSTD=ON \ -DFFI_INCLUDE_DIR=$(pkg-config --variable=includedir libffi) \ -DLLVM_OPTIMIZED_TABLEGEN=ON \ -DLLVM_BUILD_EXTERNAL_COMPILER_RT=ON \ diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index 77d7142..cb705ef 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -31,22 +31,19 @@ SRC_URI = "\ file://0019-For-x86_64-set-Yocto-based-GCC-install-search-path.patch \ file://0020-llvm-Do-not-use-find_library-for-ncurses.patch \ file://0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch \ - file://0022-compiler-rt-Use-mcr-based-barrier-on-armv6.patch \ - file://0023-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch \ - file://0024-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch \ - file://0025-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch \ - file://0026-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch \ - file://0027-libunwind-Added-unw_backtrace-method.patch \ - file://0028-Do-not-force-thumb-mode-directive.patch \ - file://0029-clang-Do-not-use-install-relative-libc-headers.patch \ - file://0030-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch \ - file://0031-Fix-lib-paths-for-OpenEmbedded-Host.patch \ - file://0032-Correct-library-search-path-for-OpenEmbedded-Host.patch \ - file://0033-lldb-Link-with-libatomic-on-x86.patch \ - file://0034-clang-exclude-openembedded-distributions-from-settin.patch \ - file://0035-compiler-rt-Enable-__int128-for-ppc32.patch \ - file://0036-compiler-rt-builtins-Move-DMB-definition-to-syn-opsh.patch \ - file://0037-sanitizer-Remove-include-linux-fs.h-to-resolve-fscon.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-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch \ + file://0025-libunwind-Added-unw_backtrace-method.patch \ + file://0026-Drop-the-git-suffix-from-various-version-variables.patch \ + file://0027-clang-Do-not-use-install-relative-libc-headers.patch \ + file://0028-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch \ + file://0029-Fix-lib-paths-for-OpenEmbedded-Host.patch \ + file://0030-Correct-library-search-path-for-OpenEmbedded-Host.patch \ + file://0031-lldb-Link-with-libatomic-on-x86.patch \ + file://0032-clang-exclude-openembedded-distributions-from-settin.patch \ + file://0033-compiler-rt-Enable-__int128-for-ppc32.patch \ + file://0034-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch \ " # Fallback to no-PIE if not set GCCPIE ??= "" -- cgit v1.2.3-54-g00ecf