From adf4557a2be7d8acc3fbab95ed9d202b0d623880 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 15 Jun 2021 12:07:30 -0700 Subject: clang: Update to latest master/13.0 Drop 0024-compiler-rt-Include-stddef.h.patch its accepted upstream Signed-off-by: Khem Raj (cherry picked from commit 2b5f122e57697b972bc1b65ea7dbb015a9303d11) --- recipes-devtools/clang/clang.inc | 2 +- ...d-lxml2-to-linker-cmdline-of-xml-is-found.patch | 2 +- ...ind-libunwind-headers-when-LIBCXXABI_LIBU.patch | 2 +- ...er-rt-support-a-new-embedded-linux-target.patch | 18 +----- ...-Simplify-cross-compilation.-Don-t-use-na.patch | 2 +- ...LibraryInfo-Undefine-libc-functions-if-th.patch | 2 +- .../0006-llvm-allow-env-override-of-exe-path.patch | 2 +- ...-clang-driver-Check-sysroot-for-ldso-path.patch | 2 +- ...iver-tools.cpp-Add-lssp_nonshared-on-musl.patch | 2 +- ...-ppc-does-not-support-128-bit-long-double.patch | 2 +- .../0010-clang-Prepend-trailing-to-sysroot.patch | 2 +- ...inside-the-target-sysroot-for-compiler-ru.patch | 2 +- ...ang-Define-releative-gcc-installation-dir.patch | 2 +- ...pthread-and-ldl-along-with-lunwind-for-st.patch | 6 +- ..._EXECUTABLE-when-cross-compiling-for-nati.patch | 2 +- .../0015-Check-for-atomic-double-intrinsics.patch | 2 +- .../0016-clang-Enable-SSP-and-PIE-by-default.patch | 2 +- ...compiler-runtime-library-to-link-step-for.patch | 2 +- ...cmake-Fix-configure-for-packages-using-fi.patch | 2 +- ...esource-dir-location-for-cross-toolchains.patch | 2 +- .../clang/clang/0020-fix-path-to-libffi.patch | 2 +- ...r-Add-dyld-prefix-when-checking-sysroot-f.patch | 2 +- .../0022-clang-Use-python3-in-python-scripts.patch | 2 +- ...4-set-Yocto-based-GCC-install-search-path.patch | 2 +- .../clang/0024-compiler-rt-Include-stddef.h.patch | 27 -------- ...-llvm-Do-not-use-find_library-for-ncurses.patch | 44 ++++++++++++++ ...-llvm-Do-not-use-find_library-for-ncurses.patch | 44 -------------- ...-anchor-for-adding-OE-distro-vendor-names.patch | 32 ++++++++++ ...ompiler-rt-Use-mcr-based-barrier-on-armv6.patch | 71 ++++++++++++++++++++++ ...-anchor-for-adding-OE-distro-vendor-names.patch | 32 ---------- ...h-defaults-to-dwarf-5-debug-info-on-Linux.patch | 28 +++++++++ ...ompiler-rt-Use-mcr-based-barrier-on-armv6.patch | 71 ---------------------- ...h-defaults-to-dwarf-5-debug-info-on-Linux.patch | 28 --------- ...-Do-not-use-backtrace-APIs-on-non-glibc-l.patch | 68 +++++++++++++++++++++ ...86-triple-for-non-debian-multiarch-linux-.patch | 27 ++++++++ ...-Do-not-use-backtrace-APIs-on-non-glibc-l.patch | 68 --------------------- ...86-triple-for-non-debian-multiarch-linux-.patch | 27 -------- ...-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch | 28 +++++++++ ...-Link-scudo-standalone-with-libatomic-on-.patch | 29 +++++++++ ...-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch | 28 --------- ...-Link-scudo-standalone-with-libatomic-on-.patch | 29 --------- ...0032-libunwind-Added-unw_backtrace-method.patch | 55 +++++++++++++++++ ...-rt-Use-uintptr_t-instead-of-_Unwind_Word.patch | 35 +++++++++++ ...0033-libunwind-Added-unw_backtrace-method.patch | 55 ----------------- ...iler-rt-Do-not-force-thumb-mode-directive.patch | 46 ++++++++++++++ ...-rt-Use-uintptr_t-instead-of-_Unwind_Word.patch | 35 ----------- ...iler-rt-Do-not-force-thumb-mode-directive.patch | 46 -------------- recipes-devtools/clang/common.inc | 23 ++++--- 48 files changed, 501 insertions(+), 543 deletions(-) delete mode 100644 recipes-devtools/clang/clang/0024-compiler-rt-Include-stddef.h.patch create mode 100644 recipes-devtools/clang/clang/0024-llvm-Do-not-use-find_library-for-ncurses.patch delete mode 100644 recipes-devtools/clang/clang/0025-llvm-Do-not-use-find_library-for-ncurses.patch create mode 100644 recipes-devtools/clang/clang/0025-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch create mode 100644 recipes-devtools/clang/clang/0026-compiler-rt-Use-mcr-based-barrier-on-armv6.patch delete mode 100644 recipes-devtools/clang/clang/0026-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch create mode 100644 recipes-devtools/clang/clang/0027-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch delete mode 100644 recipes-devtools/clang/clang/0027-compiler-rt-Use-mcr-based-barrier-on-armv6.patch delete mode 100644 recipes-devtools/clang/clang/0028-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch create mode 100644 recipes-devtools/clang/clang/0028-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch create mode 100644 recipes-devtools/clang/clang/0029-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch delete mode 100644 recipes-devtools/clang/clang/0029-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch delete mode 100644 recipes-devtools/clang/clang/0030-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch create mode 100644 recipes-devtools/clang/clang/0030-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch create mode 100644 recipes-devtools/clang/clang/0031-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch delete mode 100644 recipes-devtools/clang/clang/0031-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch delete mode 100644 recipes-devtools/clang/clang/0032-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch create mode 100644 recipes-devtools/clang/clang/0032-libunwind-Added-unw_backtrace-method.patch create mode 100644 recipes-devtools/clang/clang/0033-compiler-rt-Use-uintptr_t-instead-of-_Unwind_Word.patch delete mode 100644 recipes-devtools/clang/clang/0033-libunwind-Added-unw_backtrace-method.patch create mode 100644 recipes-devtools/clang/clang/0034-compiler-rt-Do-not-force-thumb-mode-directive.patch delete mode 100644 recipes-devtools/clang/clang/0034-compiler-rt-Use-uintptr_t-instead-of-_Unwind_Word.patch delete mode 100644 recipes-devtools/clang/clang/0035-compiler-rt-Do-not-force-thumb-mode-directive.patch diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc index b2c6ab3..610c8b9 100644 --- a/recipes-devtools/clang/clang.inc +++ b/recipes-devtools/clang/clang.inc @@ -8,7 +8,7 @@ MAJOR_VER = "13" MINOR_VER = "0" PATCH_VER = "0" -SRCREV ?= "1e50c3d785f4563873ab1ce86559f2a1285b5678" +SRCREV ?= "3bc899b4de74d395b03d3969d700aac71f89bc12" PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}" BRANCH = "main" diff --git a/recipes-devtools/clang/clang/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch b/recipes-devtools/clang/clang/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch index 84811a5..19c19ff 100644 --- a/recipes-devtools/clang/clang/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch +++ b/recipes-devtools/clang/clang/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch @@ -1,4 +1,4 @@ -From 3f5e7342d5f2490728e5971d9e709b3be736d633 Mon Sep 17 00:00:00 2001 +From 8bbe4129627506374e857cae7d8ce86f08725cd7 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 22 May 2017 17:36:16 -0700 Subject: [PATCH] lldb: Add -lxml2 to linker cmdline of xml is found diff --git a/recipes-devtools/clang/clang/0002-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch b/recipes-devtools/clang/clang/0002-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch index 8c32702..00eee52 100644 --- a/recipes-devtools/clang/clang/0002-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch +++ b/recipes-devtools/clang/clang/0002-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch @@ -1,4 +1,4 @@ -From 9052bcd92350fe8ede577fe876e59951478e1949 Mon Sep 17 00:00:00 2001 +From 3c3aa3d7c09f50ebbece24434d8fe12fc2ce7114 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 27 Aug 2017 10:37:49 -0700 Subject: [PATCH] libcxxabi: Find libunwind headers when diff --git a/recipes-devtools/clang/clang/0003-compiler-rt-support-a-new-embedded-linux-target.patch b/recipes-devtools/clang/clang/0003-compiler-rt-support-a-new-embedded-linux-target.patch index 04f02ae..2558fe5 100644 --- a/recipes-devtools/clang/clang/0003-compiler-rt-support-a-new-embedded-linux-target.patch +++ b/recipes-devtools/clang/clang/0003-compiler-rt-support-a-new-embedded-linux-target.patch @@ -1,30 +1,16 @@ -From adf258f2809c719a3a52b1d832f0139d8e668a34 Mon Sep 17 00:00:00 2001 +From ddb0abe6cd8e28d744f6f911388bbc5ed67a169c 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 Signed-off-by: Khem Raj --- - compiler-rt/lib/builtins/int_util.c | 2 +- .../make/platform/clang_linux_embedded.mk | 286 ++++++++++++++++++ .../clang_linux_embedded_test_input.c | 0 - 3 files changed, 287 insertions(+), 1 deletion(-) + 2 files changed, 286 insertions(+) create mode 100644 compiler-rt/make/platform/clang_linux_embedded.mk create mode 100644 compiler-rt/make/platform/clang_linux_embedded_test_input.c -diff --git a/compiler-rt/lib/builtins/int_util.c b/compiler-rt/lib/builtins/int_util.c -index 226a6e93440d..efc977acbb39 100644 ---- a/compiler-rt/lib/builtins/int_util.c -+++ b/compiler-rt/lib/builtins/int_util.c -@@ -54,7 +54,7 @@ void __compilerrt_abort_impl(const char *file, int line, const char *function) { - #else - - // Get the system definition of abort() --#include -+extern void abort (void) __attribute__ ((__noreturn__)); - - #ifndef _WIN32 - __attribute__((weak)) diff --git a/compiler-rt/make/platform/clang_linux_embedded.mk b/compiler-rt/make/platform/clang_linux_embedded.mk new file mode 100644 index 000000000000..d0a890075a1c diff --git a/recipes-devtools/clang/clang/0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch b/recipes-devtools/clang/clang/0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch index e00b318..73dad7c 100644 --- a/recipes-devtools/clang/clang/0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch +++ b/recipes-devtools/clang/clang/0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch @@ -1,4 +1,4 @@ -From 08dabaabc28efd55ba1b77830fc8b92f1ad28894 Mon Sep 17 00:00:00 2001 +From ec6de16258fb4eb031dbb502082ee63722b11286 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 19 May 2016 23:11:45 -0700 Subject: [PATCH] compiler-rt: Simplify cross-compilation. Don't use diff --git a/recipes-devtools/clang/clang/0005-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch b/recipes-devtools/clang/clang/0005-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch index 1c773c7..f2c9a79 100644 --- a/recipes-devtools/clang/clang/0005-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch +++ b/recipes-devtools/clang/clang/0005-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch @@ -1,4 +1,4 @@ -From d3adf3b2a689fe006b6b24430b3f52ecd6807efa Mon Sep 17 00:00:00 2001 +From 6b27010179b4ca52616a4416ee974145628dbf00 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/0006-llvm-allow-env-override-of-exe-path.patch b/recipes-devtools/clang/clang/0006-llvm-allow-env-override-of-exe-path.patch index 33d07b6..cda2641 100644 --- a/recipes-devtools/clang/clang/0006-llvm-allow-env-override-of-exe-path.patch +++ b/recipes-devtools/clang/clang/0006-llvm-allow-env-override-of-exe-path.patch @@ -1,4 +1,4 @@ -From 693007ba2f20c6ef45114d73166fb0273d1fdacb Mon Sep 17 00:00:00 2001 +From 02f3ffb65786b68550bbe97ed31fbe0cfc525552 Mon Sep 17 00:00:00 2001 From: Martin Kelly Date: Fri, 19 May 2017 00:22:57 -0700 Subject: [PATCH] llvm: allow env override of exe path diff --git a/recipes-devtools/clang/clang/0007-clang-driver-Check-sysroot-for-ldso-path.patch b/recipes-devtools/clang/clang/0007-clang-driver-Check-sysroot-for-ldso-path.patch index 3b68a2d..5213f80 100644 --- a/recipes-devtools/clang/clang/0007-clang-driver-Check-sysroot-for-ldso-path.patch +++ b/recipes-devtools/clang/clang/0007-clang-driver-Check-sysroot-for-ldso-path.patch @@ -1,4 +1,4 @@ -From a81fe1f4e85bfb616b914f894c767488ee230792 Mon Sep 17 00:00:00 2001 +From 661d95171fbb0c62166299ac22d75f302b089444 Mon Sep 17 00:00:00 2001 From: Dan McGregor Date: Wed, 26 Apr 2017 20:29:41 -0600 Subject: [PATCH] clang: driver: Check sysroot for ldso path diff --git a/recipes-devtools/clang/clang/0008-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch b/recipes-devtools/clang/clang/0008-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch index 9e881c6..5c02abb 100644 --- a/recipes-devtools/clang/clang/0008-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch +++ b/recipes-devtools/clang/clang/0008-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch @@ -1,4 +1,4 @@ -From 1d8c23ef1e70a1404224918dd2090c6a2828c7ef Mon Sep 17 00:00:00 2001 +From 3cf88452ed0fe187741b8973135fb97e0a7055e7 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 19 May 2016 21:11:06 -0700 Subject: [PATCH] clang: Driver/tools.cpp: Add -lssp_nonshared on musl diff --git a/recipes-devtools/clang/clang/0009-clang-musl-ppc-does-not-support-128-bit-long-double.patch b/recipes-devtools/clang/clang/0009-clang-musl-ppc-does-not-support-128-bit-long-double.patch index 227a5f1..968ff37 100644 --- a/recipes-devtools/clang/clang/0009-clang-musl-ppc-does-not-support-128-bit-long-double.patch +++ b/recipes-devtools/clang/clang/0009-clang-musl-ppc-does-not-support-128-bit-long-double.patch @@ -1,4 +1,4 @@ -From 082dd1f20b838510dca1481e9479c57ce8d03dff Mon Sep 17 00:00:00 2001 +From bb49fa5b1ced3ae610cc796d72319df8f69630d0 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 10 May 2016 02:00:11 -0700 Subject: [PATCH] clang: musl/ppc does not support 128-bit long double diff --git a/recipes-devtools/clang/clang/0010-clang-Prepend-trailing-to-sysroot.patch b/recipes-devtools/clang/clang/0010-clang-Prepend-trailing-to-sysroot.patch index e7ff5f3..baba6e6 100644 --- a/recipes-devtools/clang/clang/0010-clang-Prepend-trailing-to-sysroot.patch +++ b/recipes-devtools/clang/clang/0010-clang-Prepend-trailing-to-sysroot.patch @@ -1,4 +1,4 @@ -From 0c0f10bfe6d0b51080b81c73fae52ddb2a768e5d Mon Sep 17 00:00:00 2001 +From 0c0f1e5f1099ec4fea52cb18a9dc0b31c301a0fb 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 diff --git a/recipes-devtools/clang/clang/0011-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch b/recipes-devtools/clang/clang/0011-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch index d2fc933..866f680 100644 --- a/recipes-devtools/clang/clang/0011-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch +++ b/recipes-devtools/clang/clang/0011-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch @@ -1,4 +1,4 @@ -From 1c4f99104db0a5d2504fb9f1d4a5cd57a94aaaef Mon Sep 17 00:00:00 2001 +From a0de10cdb0d21d7cfed431586b54832e929f99a6 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 16 Mar 2017 19:06:26 -0700 Subject: [PATCH] clang: Look inside the target sysroot for compiler runtime diff --git a/recipes-devtools/clang/clang/0012-clang-Define-releative-gcc-installation-dir.patch b/recipes-devtools/clang/clang/0012-clang-Define-releative-gcc-installation-dir.patch index 1bd3413..3c8f102 100644 --- a/recipes-devtools/clang/clang/0012-clang-Define-releative-gcc-installation-dir.patch +++ b/recipes-devtools/clang/clang/0012-clang-Define-releative-gcc-installation-dir.patch @@ -1,4 +1,4 @@ -From 9be197ac1d1a80f4f8ec81bb7ea41a393869cab1 Mon Sep 17 00:00:00 2001 +From 37ac2d6586a22407ace1cd8cf24ddbf7810f0e9a 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 diff --git a/recipes-devtools/clang/clang/0013-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch b/recipes-devtools/clang/clang/0013-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch index ebf4696..c5008ae 100644 --- a/recipes-devtools/clang/clang/0013-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch +++ b/recipes-devtools/clang/clang/0013-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch @@ -1,4 +1,4 @@ -From 14c7eb733c03a775de7e828a11af6d43170620e8 Mon Sep 17 00:00:00 2001 +From 5f14a644ff02256d067c706f77ed045d113f7efc 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,10 +20,10 @@ Signed-off-by: Khem Raj 1 file changed, 2 insertions(+) diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp -index a1aab21c944b..3338cf6fdad9 100644 +index c123625bb817..7fa84e86045e 100644 --- a/clang/lib/Driver/ToolChains/CommonArgs.cpp +++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp -@@ -1451,6 +1451,8 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D, +@@ -1450,6 +1450,8 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D, CmdArgs.push_back("-lunwind"); } else if (LGT == LibGccType::StaticLibGcc) { CmdArgs.push_back("-l:libunwind.a"); diff --git a/recipes-devtools/clang/clang/0014-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch b/recipes-devtools/clang/clang/0014-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch index 3ad5e3c..55e8d90 100644 --- a/recipes-devtools/clang/clang/0014-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch +++ b/recipes-devtools/clang/clang/0014-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch @@ -1,4 +1,4 @@ -From 1ea29b33aebd027faf22bf9a0bf1c83c8b7c6571 Mon Sep 17 00:00:00 2001 +From 547ad6e37f4fa53e6267cb5cfafaac37192304df Mon Sep 17 00:00:00 2001 From: Anuj Mittal Date: Thu, 26 Dec 2019 12:56:16 -0800 Subject: [PATCH] Pass PYTHON_EXECUTABLE when cross compiling for native build diff --git a/recipes-devtools/clang/clang/0015-Check-for-atomic-double-intrinsics.patch b/recipes-devtools/clang/clang/0015-Check-for-atomic-double-intrinsics.patch index f528540..4a71996 100644 --- a/recipes-devtools/clang/clang/0015-Check-for-atomic-double-intrinsics.patch +++ b/recipes-devtools/clang/clang/0015-Check-for-atomic-double-intrinsics.patch @@ -1,4 +1,4 @@ -From e8f619fae05f543455ec8e1e61e255ac5cbd5f39 Mon Sep 17 00:00:00 2001 +From 71e2cd6ff51f0f4212c231db9a6626b3a248dfd7 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/0016-clang-Enable-SSP-and-PIE-by-default.patch b/recipes-devtools/clang/clang/0016-clang-Enable-SSP-and-PIE-by-default.patch index 317ebc2..b1097a3 100644 --- a/recipes-devtools/clang/clang/0016-clang-Enable-SSP-and-PIE-by-default.patch +++ b/recipes-devtools/clang/clang/0016-clang-Enable-SSP-and-PIE-by-default.patch @@ -1,4 +1,4 @@ -From 24701aa638b8e111d7c93cf129959b63403d2327 Mon Sep 17 00:00:00 2001 +From 816a9eedc5c031667d495b9ebb1b623773bcdcf4 Mon Sep 17 00:00:00 2001 From: Evangelos Foutras Date: Thu, 26 Dec 2019 15:46:19 -0800 Subject: [PATCH] clang: Enable SSP and PIE by default diff --git a/recipes-devtools/clang/clang/0017-libcxx-Add-compiler-runtime-library-to-link-step-for.patch b/recipes-devtools/clang/clang/0017-libcxx-Add-compiler-runtime-library-to-link-step-for.patch index d11bf2a..832d83b 100644 --- a/recipes-devtools/clang/clang/0017-libcxx-Add-compiler-runtime-library-to-link-step-for.patch +++ b/recipes-devtools/clang/clang/0017-libcxx-Add-compiler-runtime-library-to-link-step-for.patch @@ -1,4 +1,4 @@ -From 91c7a0a31acf1ab7475b85144d923f70541fae7c Mon Sep 17 00:00:00 2001 +From d362483cf317d224a27c3a1147c4ed50a120aa6e 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 diff --git a/recipes-devtools/clang/clang/0018-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch b/recipes-devtools/clang/clang/0018-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch index 35da3eb..2ed324a 100644 --- a/recipes-devtools/clang/clang/0018-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch +++ b/recipes-devtools/clang/clang/0018-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch @@ -1,4 +1,4 @@ -From 2682484fb5365d5bfbe4c343f74298e155d20645 Mon Sep 17 00:00:00 2001 +From a55cd03900022a08172d85268ee5630099f68278 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 diff --git a/recipes-devtools/clang/clang/0019-clang-Fix-resource-dir-location-for-cross-toolchains.patch b/recipes-devtools/clang/clang/0019-clang-Fix-resource-dir-location-for-cross-toolchains.patch index a7c3410..4d52d1b 100644 --- a/recipes-devtools/clang/clang/0019-clang-Fix-resource-dir-location-for-cross-toolchains.patch +++ b/recipes-devtools/clang/clang/0019-clang-Fix-resource-dir-location-for-cross-toolchains.patch @@ -1,4 +1,4 @@ -From f59f431174b876e1fb64e982f1b4f3848376a840 Mon Sep 17 00:00:00 2001 +From 9ce38d7cbf9bc38520410da3595d9e18ffcba49f 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 diff --git a/recipes-devtools/clang/clang/0020-fix-path-to-libffi.patch b/recipes-devtools/clang/clang/0020-fix-path-to-libffi.patch index 126b83e..5a1917b 100644 --- a/recipes-devtools/clang/clang/0020-fix-path-to-libffi.patch +++ b/recipes-devtools/clang/clang/0020-fix-path-to-libffi.patch @@ -1,4 +1,4 @@ -From 199b980b8aa03a9d102d33f1353b5e94fb255ea8 Mon Sep 17 00:00:00 2001 +From e8a30d3d8f2e9b62e9022fab86210e45c3395400 Mon Sep 17 00:00:00 2001 From: Anuj Mittal Date: Fri, 3 Apr 2020 15:10:37 +0800 Subject: [PATCH] fix path to libffi diff --git a/recipes-devtools/clang/clang/0021-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch b/recipes-devtools/clang/clang/0021-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch index 769dd45..4b5ff3e 100644 --- a/recipes-devtools/clang/clang/0021-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch +++ b/recipes-devtools/clang/clang/0021-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch @@ -1,4 +1,4 @@ -From 9b0acc4e9fb202a4d224fbf5eba54576fdb95ea3 Mon Sep 17 00:00:00 2001 +From e2140a10a80e737b42408e7847502f1a7723388f 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 diff --git a/recipes-devtools/clang/clang/0022-clang-Use-python3-in-python-scripts.patch b/recipes-devtools/clang/clang/0022-clang-Use-python3-in-python-scripts.patch index 84948b2..b771a80 100644 --- a/recipes-devtools/clang/clang/0022-clang-Use-python3-in-python-scripts.patch +++ b/recipes-devtools/clang/clang/0022-clang-Use-python3-in-python-scripts.patch @@ -1,4 +1,4 @@ -From 90d69c23d95ae59ddbc6c2383ea30f622f09f4eb Mon Sep 17 00:00:00 2001 +From 35659b7324baa809ff04e52e8f0d55584a0e4033 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 14 Oct 2020 22:19:57 -0700 Subject: [PATCH] clang: Use python3 in python scripts diff --git a/recipes-devtools/clang/clang/0023-For-x86_64-set-Yocto-based-GCC-install-search-path.patch b/recipes-devtools/clang/clang/0023-For-x86_64-set-Yocto-based-GCC-install-search-path.patch index 0e23e87..1c364db 100644 --- a/recipes-devtools/clang/clang/0023-For-x86_64-set-Yocto-based-GCC-install-search-path.patch +++ b/recipes-devtools/clang/clang/0023-For-x86_64-set-Yocto-based-GCC-install-search-path.patch @@ -1,4 +1,4 @@ -From 5c6b926de61fb1c7f2bf425fe09bab0bf59ac101 Mon Sep 17 00:00:00 2001 +From bac45d7406d40b0ced2841e23bc19e8a641d35be 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 diff --git a/recipes-devtools/clang/clang/0024-compiler-rt-Include-stddef.h.patch b/recipes-devtools/clang/clang/0024-compiler-rt-Include-stddef.h.patch deleted file mode 100644 index 8a61621..0000000 --- a/recipes-devtools/clang/clang/0024-compiler-rt-Include-stddef.h.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 83c73d91b61f989a8e3d4b96ada4f10c5c426c73 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 6 Feb 2021 12:44:30 -0800 -Subject: [PATCH] compiler-rt: Include stddef.h - -size_t is use in the source needs relevant header to include the -definition, fixes build on musl - -compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp:82:61: error: unknown type name 'size_t'; did you mean 'std::size_t'? - -Signed-off-by: Khem Raj ---- - compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp b/compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp -index b87798603fda..d5b0a42fd3fb 100644 ---- a/compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp -+++ b/compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp -@@ -25,6 +25,7 @@ - } - - #include -+#include // for size_t - #include - #include // for dlsym() - diff --git a/recipes-devtools/clang/clang/0024-llvm-Do-not-use-find_library-for-ncurses.patch b/recipes-devtools/clang/clang/0024-llvm-Do-not-use-find_library-for-ncurses.patch new file mode 100644 index 0000000..0ef5ea3 --- /dev/null +++ b/recipes-devtools/clang/clang/0024-llvm-Do-not-use-find_library-for-ncurses.patch @@ -0,0 +1,44 @@ +From 3b8cefb2e85d29da9935e6c8ec2ff7f6d99d7809 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 7 Feb 2021 23:58:41 -0800 +Subject: [PATCH] llvm: Do not use find_library for ncurses + +This ensures that it lets OE to decide which lib to link +otherwise it adds absolute paths to linker cmdline and confuses it +horribly with native and target libs when build clang for target + +TOPDIR/build/tmp/work/cortexa57-yoe-linux-musl/clang/12.0.0-r0/recipe-sysroot-native/usr/lib/libtinfo.so: error adding symbols: file in wrong format +clang-12: error: linker command failed with exit code 1 (use -v to see invocation) + +Signed-off-by: Khem Raj +--- + compiler-rt/cmake/config-ix.cmake | 2 +- + llvm/cmake/config-ix.cmake | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake +index 39e0a4b662c7..a186ac60986d 100644 +--- a/compiler-rt/cmake/config-ix.cmake ++++ b/compiler-rt/cmake/config-ix.cmake +@@ -140,7 +140,7 @@ else() + set(MAYBE_REQUIRED) + endif() + if(LLVM_ENABLE_TERMINFO) +- find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED}) ++ set(TERMINFO_LIB tinfo curses ncurses ncursesw) + endif() + if(COMPILER_RT_TERMINFO_LIB) + set(LLVM_ENABLE_TERMINFO 1) +diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake +index d4cbf37d19a2..a320cf97b306 100644 +--- a/llvm/cmake/config-ix.cmake ++++ b/llvm/cmake/config-ix.cmake +@@ -175,7 +175,7 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*") + set(MAYBE_REQUIRED) + endif() + if(LLVM_ENABLE_TERMINFO) +- find_library(TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED}) ++ set(TERMINFO_LIB tinfo curses ncurses ncursesw) + endif() + if(TERMINFO_LIB) + set(LLVM_ENABLE_TERMINFO 1) diff --git a/recipes-devtools/clang/clang/0025-llvm-Do-not-use-find_library-for-ncurses.patch b/recipes-devtools/clang/clang/0025-llvm-Do-not-use-find_library-for-ncurses.patch deleted file mode 100644 index 2e08284..0000000 --- a/recipes-devtools/clang/clang/0025-llvm-Do-not-use-find_library-for-ncurses.patch +++ /dev/null @@ -1,44 +0,0 @@ -From e3f5f4346d0faeca424ce0494fbc2b1f75373e5f Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sun, 7 Feb 2021 23:58:41 -0800 -Subject: [PATCH] llvm: Do not use find_library for ncurses - -This ensures that it lets OE to decide which lib to link -otherwise it adds absolute paths to linker cmdline and confuses it -horribly with native and target libs when build clang for target - -TOPDIR/build/tmp/work/cortexa57-yoe-linux-musl/clang/12.0.0-r0/recipe-sysroot-native/usr/lib/libtinfo.so: error adding symbols: file in wrong format -clang-12: error: linker command failed with exit code 1 (use -v to see invocation) - -Signed-off-by: Khem Raj ---- - compiler-rt/cmake/config-ix.cmake | 2 +- - llvm/cmake/config-ix.cmake | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake -index 39e0a4b662c7..a186ac60986d 100644 ---- a/compiler-rt/cmake/config-ix.cmake -+++ b/compiler-rt/cmake/config-ix.cmake -@@ -140,7 +140,7 @@ else() - set(MAYBE_REQUIRED) - endif() - if(LLVM_ENABLE_TERMINFO) -- find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED}) -+ set(TERMINFO_LIB tinfo curses ncurses ncursesw) - endif() - if(COMPILER_RT_TERMINFO_LIB) - set(LLVM_ENABLE_TERMINFO 1) -diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake -index d4cbf37d19a2..a320cf97b306 100644 ---- a/llvm/cmake/config-ix.cmake -+++ b/llvm/cmake/config-ix.cmake -@@ -175,7 +175,7 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*") - set(MAYBE_REQUIRED) - endif() - if(LLVM_ENABLE_TERMINFO) -- find_library(TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED}) -+ set(TERMINFO_LIB tinfo curses ncurses ncursesw) - endif() - if(TERMINFO_LIB) - set(LLVM_ENABLE_TERMINFO 1) diff --git a/recipes-devtools/clang/clang/0025-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch b/recipes-devtools/clang/clang/0025-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch new file mode 100644 index 0000000..a1d5535 --- /dev/null +++ b/recipes-devtools/clang/clang/0025-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch @@ -0,0 +1,32 @@ +From aef271e12ce0bdf1d19548b4031cadea88d316d1 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 11 Feb 2021 16:42:49 -0800 +Subject: [PATCH] llvm: Insert anchor for adding OE distro vendor names + +This helps in making right detection for OE built gcc toolchains + +The //CLANG_EXTRA_OE_VENDORS_CASES string is replaced with list of +additional Ceses based on CLANG_EXTRA_OE_VENDORS variable in +recipes-devtools/clang/llvm-project-source.inc:add_more_target_vendors() + +Upstream-Status: Inappropriate [OE-specific] + +Signed-off-by: Khem Raj +Signed-off-by: Martin Jansa +--- + llvm/lib/Support/Triple.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp +index 88311546354b..8b2745deae88 100644 +--- a/llvm/lib/Support/Triple.cpp ++++ b/llvm/lib/Support/Triple.cpp +@@ -496,7 +496,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) { + .Case("amd", Triple::AMD) + .Case("mesa", Triple::Mesa) + .Case("suse", Triple::SUSE) +- .Case("oe", Triple::OpenEmbedded) ++ .Case("oe", Triple::OpenEmbedded)//CLANG_EXTRA_OE_VENDORS_CASES + .Default(Triple::UnknownVendor); + } + diff --git a/recipes-devtools/clang/clang/0026-compiler-rt-Use-mcr-based-barrier-on-armv6.patch b/recipes-devtools/clang/clang/0026-compiler-rt-Use-mcr-based-barrier-on-armv6.patch new file mode 100644 index 0000000..adb64d1 --- /dev/null +++ b/recipes-devtools/clang/clang/0026-compiler-rt-Use-mcr-based-barrier-on-armv6.patch @@ -0,0 +1,71 @@ +From 1385f46939352191af3a61e0c924da58eee11a25 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 9c015059af5a..aec4ff59beb7 100644 +--- a/compiler-rt/lib/builtins/assembly.h ++++ b/compiler-rt/lib/builtins/assembly.h +@@ -183,6 +183,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/0026-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch b/recipes-devtools/clang/clang/0026-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch deleted file mode 100644 index bf4f475..0000000 --- a/recipes-devtools/clang/clang/0026-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch +++ /dev/null @@ -1,32 +0,0 @@ -From d008023e9fcd2615ca21d74c85e197570ba24502 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 11 Feb 2021 16:42:49 -0800 -Subject: [PATCH] llvm: Insert anchor for adding OE distro vendor names - -This helps in making right detection for OE built gcc toolchains - -The //CLANG_EXTRA_OE_VENDORS_CASES string is replaced with list of -additional Ceses based on CLANG_EXTRA_OE_VENDORS variable in -recipes-devtools/clang/llvm-project-source.inc:add_more_target_vendors() - -Upstream-Status: Inappropriate [OE-specific] - -Signed-off-by: Khem Raj -Signed-off-by: Martin Jansa ---- - llvm/lib/Support/Triple.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp -index 88311546354b..8b2745deae88 100644 ---- a/llvm/lib/Support/Triple.cpp -+++ b/llvm/lib/Support/Triple.cpp -@@ -496,7 +496,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) { - .Case("amd", Triple::AMD) - .Case("mesa", Triple::Mesa) - .Case("suse", Triple::SUSE) -- .Case("oe", Triple::OpenEmbedded) -+ .Case("oe", Triple::OpenEmbedded)//CLANG_EXTRA_OE_VENDORS_CASES - .Default(Triple::UnknownVendor); - } - diff --git a/recipes-devtools/clang/clang/0027-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch b/recipes-devtools/clang/clang/0027-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch new file mode 100644 index 0000000..05b003a --- /dev/null +++ b/recipes-devtools/clang/clang/0027-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch @@ -0,0 +1,28 @@ +From b03d3a24cd49083a2f8e9cbbc9b66ec72b690d6d Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 15 Apr 2021 18:58:07 -0700 +Subject: [PATCH] clang: Switch defaults to dwarf-5 debug info on Linux + +GCC 11 has defaulted to DWARF-5 as well, this matches +debug info formats, so mix and match of components with GCC 11 +works. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Linux.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/Linux.h b/clang/lib/Driver/ToolChains/Linux.h +index b3544a0c7681..ae421580a017 100644 +--- a/clang/lib/Driver/ToolChains/Linux.h ++++ b/clang/lib/Driver/ToolChains/Linux.h +@@ -65,6 +65,8 @@ public: + const llvm::opt::ArgList &DriverArgs, const JobAction &JA, + const llvm::fltSemantics *FPType = nullptr) const override; + ++ unsigned GetDefaultDwarfVersion() const override { return 5; } ++ + protected: + Tool *buildAssembler() const override; + Tool *buildLinker() const override; diff --git a/recipes-devtools/clang/clang/0027-compiler-rt-Use-mcr-based-barrier-on-armv6.patch b/recipes-devtools/clang/clang/0027-compiler-rt-Use-mcr-based-barrier-on-armv6.patch deleted file mode 100644 index 0f7d0df..0000000 --- a/recipes-devtools/clang/clang/0027-compiler-rt-Use-mcr-based-barrier-on-armv6.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 656ce3eec5ca681fdbcc137f86cbf48de920f3cc 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 9c015059af5a..aec4ff59beb7 100644 ---- a/compiler-rt/lib/builtins/assembly.h -+++ b/compiler-rt/lib/builtins/assembly.h -@@ -183,6 +183,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/0028-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch b/recipes-devtools/clang/clang/0028-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch deleted file mode 100644 index 4418904..0000000 --- a/recipes-devtools/clang/clang/0028-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch +++ /dev/null @@ -1,28 +0,0 @@ -From b85085aee33ceeee4aee46b8b7c293f1b0de5f6a Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 15 Apr 2021 18:58:07 -0700 -Subject: [PATCH] clang: Switch defaults to dwarf-5 debug info on Linux - -GCC 11 has defaulted to DWARF-5 as well, this matches -debug info formats, so mix and match of components with GCC 11 -works. - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Linux.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/clang/lib/Driver/ToolChains/Linux.h b/clang/lib/Driver/ToolChains/Linux.h -index b3544a0c7681..ae421580a017 100644 ---- a/clang/lib/Driver/ToolChains/Linux.h -+++ b/clang/lib/Driver/ToolChains/Linux.h -@@ -65,6 +65,8 @@ public: - const llvm::opt::ArgList &DriverArgs, const JobAction &JA, - const llvm::fltSemantics *FPType = nullptr) const override; - -+ unsigned GetDefaultDwarfVersion() const override { return 5; } -+ - protected: - Tool *buildAssembler() const override; - Tool *buildLinker() const override; diff --git a/recipes-devtools/clang/clang/0028-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch b/recipes-devtools/clang/clang/0028-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch new file mode 100644 index 0000000..eb13118 --- /dev/null +++ b/recipes-devtools/clang/clang/0028-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch @@ -0,0 +1,68 @@ +From 24544a16a6a6cf4d37d9277b183eb44514dbebde 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/0029-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch b/recipes-devtools/clang/clang/0029-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch new file mode 100644 index 0000000..e8ec962 --- /dev/null +++ b/recipes-devtools/clang/clang/0029-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch @@ -0,0 +1,27 @@ +From 856a1ba88befb17cf65c2f8e8ac068a9a2736cea 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 0b3bbdeab5f3..b73644df5641 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -619,6 +619,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/0029-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch b/recipes-devtools/clang/clang/0029-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch deleted file mode 100644 index fa86857..0000000 --- a/recipes-devtools/clang/clang/0029-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 8a2e12e1d4054b989018d31c28ec843300001739 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/0030-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch b/recipes-devtools/clang/clang/0030-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch deleted file mode 100644 index 57ae8bf..0000000 --- a/recipes-devtools/clang/clang/0030-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 329d1ae9d9c5f4b7453865dc6fbb9c5341a4d02d 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 0b3bbdeab5f3..b73644df5641 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -619,6 +619,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/0030-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch b/recipes-devtools/clang/clang/0030-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch new file mode 100644 index 0000000..4459916 --- /dev/null +++ b/recipes-devtools/clang/clang/0030-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch @@ -0,0 +1,28 @@ +From 959fef3b3acc0e9df4e9849828fc1097bbf2bf45 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 e580d6d1408b..c14d7636e291 100644 +--- a/compiler-rt/lib/scudo/CMakeLists.txt ++++ b/compiler-rt/lib/scudo/CMakeLists.txt +@@ -12,6 +12,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/0031-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch b/recipes-devtools/clang/clang/0031-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch new file mode 100644 index 0000000..1aeeaa3 --- /dev/null +++ b/recipes-devtools/clang/clang/0031-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch @@ -0,0 +1,29 @@ +From 0d7941cf793b25319c773067d40e4235576dc630 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 8c3708d3a45f..f6687db1a663 100644 +--- a/compiler-rt/lib/scudo/standalone/CMakeLists.txt ++++ b/compiler-rt/lib/scudo/standalone/CMakeLists.txt +@@ -134,6 +134,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/0031-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch b/recipes-devtools/clang/clang/0031-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch deleted file mode 100644 index 0d05abc..0000000 --- a/recipes-devtools/clang/clang/0031-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 3b4033d5a25f03ec9496151ae868cf0f0e63a6ae 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 e580d6d1408b..c14d7636e291 100644 ---- a/compiler-rt/lib/scudo/CMakeLists.txt -+++ b/compiler-rt/lib/scudo/CMakeLists.txt -@@ -12,6 +12,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/0032-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch b/recipes-devtools/clang/clang/0032-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch deleted file mode 100644 index 79fef6d..0000000 --- a/recipes-devtools/clang/clang/0032-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 1e5dfaf08426f235a92081aadda5ae2a149ff871 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 8c3708d3a45f..f6687db1a663 100644 ---- a/compiler-rt/lib/scudo/standalone/CMakeLists.txt -+++ b/compiler-rt/lib/scudo/standalone/CMakeLists.txt -@@ -134,6 +134,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/0032-libunwind-Added-unw_backtrace-method.patch b/recipes-devtools/clang/clang/0032-libunwind-Added-unw_backtrace-method.patch new file mode 100644 index 0000000..45b2338 --- /dev/null +++ b/recipes-devtools/clang/clang/0032-libunwind-Added-unw_backtrace-method.patch @@ -0,0 +1,55 @@ +From 84bf553c54b6c1ec19623f0564dde3fb671df612 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 0feecd7bd6fc..670cfa3ed71d 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 1faf000ce44a..1edbdea6a19e 100644 +--- a/libunwind/src/libunwind.cpp ++++ b/libunwind/src/libunwind.cpp +@@ -295,7 +295,25 @@ void __unw_remove_dynamic_fde(unw_word_t fde) { + #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/0033-compiler-rt-Use-uintptr_t-instead-of-_Unwind_Word.patch b/recipes-devtools/clang/clang/0033-compiler-rt-Use-uintptr_t-instead-of-_Unwind_Word.patch new file mode 100644 index 0000000..c6a5ccc --- /dev/null +++ b/recipes-devtools/clang/clang/0033-compiler-rt-Use-uintptr_t-instead-of-_Unwind_Word.patch @@ -0,0 +1,35 @@ +From 2c73193c66359ea0506e4f9ebf69d534ca1aa0fd Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 29 May 2021 13:42:25 -0700 +Subject: [PATCH] compiler-rt: Use uintptr_t instead of _Unwind_Word + +_Unwind_Word is defined in compiler specific unwind.h but not in +libunwind provided unwind.h header, it works in most cases because +compilers search compiler headers ahead of system headers but for some +systems e.g. musl bases systems the compiler provided versions are not +preferred over system headers and therefore relying on _Unwind_Word +means its expecting this define in all unwind.h headers which is not the +case, using uintptr_t means we don't need this from unwind.h + +See https://reviews.llvm.org/D65699 + +Signed-off-by: Khem Raj +--- + compiler-rt/lib/hwasan/hwasan_exceptions.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/compiler-rt/lib/hwasan/hwasan_exceptions.cpp b/compiler-rt/lib/hwasan/hwasan_exceptions.cpp +index 169e7876cb58..6ed1da335428 100644 +--- a/compiler-rt/lib/hwasan/hwasan_exceptions.cpp ++++ b/compiler-rt/lib/hwasan/hwasan_exceptions.cpp +@@ -29,8 +29,8 @@ typedef _Unwind_Reason_Code PersonalityFn(int version, _Unwind_Action actions, + // is statically linked and the sanitizer runtime and the program are linked + // against different unwinders. The _Unwind_Context data structure is opaque so + // it may be incompatible between unwinders. +-typedef _Unwind_Word GetGRFn(_Unwind_Context* context, int index); +-typedef _Unwind_Word GetCFAFn(_Unwind_Context* context); ++typedef uintptr_t GetGRFn(_Unwind_Context* context, int index); ++typedef uintptr_t GetCFAFn(_Unwind_Context* context); + + extern "C" SANITIZER_INTERFACE_ATTRIBUTE _Unwind_Reason_Code + __hwasan_personality_wrapper(int version, _Unwind_Action actions, diff --git a/recipes-devtools/clang/clang/0033-libunwind-Added-unw_backtrace-method.patch b/recipes-devtools/clang/clang/0033-libunwind-Added-unw_backtrace-method.patch deleted file mode 100644 index ef2a7f3..0000000 --- a/recipes-devtools/clang/clang/0033-libunwind-Added-unw_backtrace-method.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 049cffbdf0e6e19037a5bc49483e6d68b18d6a0e 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 0feecd7bd6fc..670cfa3ed71d 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 9b3b92bdff09..986ef62f9231 100644 ---- a/libunwind/src/libunwind.cpp -+++ b/libunwind/src/libunwind.cpp -@@ -289,7 +289,25 @@ void __unw_remove_dynamic_fde(unw_word_t fde) { - #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/0034-compiler-rt-Do-not-force-thumb-mode-directive.patch b/recipes-devtools/clang/clang/0034-compiler-rt-Do-not-force-thumb-mode-directive.patch new file mode 100644 index 0000000..26ca048 --- /dev/null +++ b/recipes-devtools/clang/clang/0034-compiler-rt-Do-not-force-thumb-mode-directive.patch @@ -0,0 +1,46 @@ +From 127d2d9a234809ba2c76bc3f64b0902cc7b24ba3 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 12 Jun 2021 08:42:36 -0700 +Subject: [PATCH] [compiler-rt] 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/0034-compiler-rt-Use-uintptr_t-instead-of-_Unwind_Word.patch b/recipes-devtools/clang/clang/0034-compiler-rt-Use-uintptr_t-instead-of-_Unwind_Word.patch deleted file mode 100644 index ea40098..0000000 --- a/recipes-devtools/clang/clang/0034-compiler-rt-Use-uintptr_t-instead-of-_Unwind_Word.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 54593b1564c12f55da088f3d6c68d4a55e411083 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 29 May 2021 13:42:25 -0700 -Subject: [PATCH] compiler-rt: Use uintptr_t instead of _Unwind_Word - -_Unwind_Word is defined in compiler specific unwind.h but not in -libunwind provided unwind.h header, it works in most cases because -compilers search compiler headers ahead of system headers but for some -systems e.g. musl bases systems the compiler provided versions are not -preferred over system headers and therefore relying on _Unwind_Word -means its expecting this define in all unwind.h headers which is not the -case, using uintptr_t means we don't need this from unwind.h - -See https://reviews.llvm.org/D65699 - -Signed-off-by: Khem Raj ---- - compiler-rt/lib/hwasan/hwasan_exceptions.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/compiler-rt/lib/hwasan/hwasan_exceptions.cpp b/compiler-rt/lib/hwasan/hwasan_exceptions.cpp -index 169e7876cb58..6ed1da335428 100644 ---- a/compiler-rt/lib/hwasan/hwasan_exceptions.cpp -+++ b/compiler-rt/lib/hwasan/hwasan_exceptions.cpp -@@ -29,8 +29,8 @@ typedef _Unwind_Reason_Code PersonalityFn(int version, _Unwind_Action actions, - // is statically linked and the sanitizer runtime and the program are linked - // against different unwinders. The _Unwind_Context data structure is opaque so - // it may be incompatible between unwinders. --typedef _Unwind_Word GetGRFn(_Unwind_Context* context, int index); --typedef _Unwind_Word GetCFAFn(_Unwind_Context* context); -+typedef uintptr_t GetGRFn(_Unwind_Context* context, int index); -+typedef uintptr_t GetCFAFn(_Unwind_Context* context); - - extern "C" SANITIZER_INTERFACE_ATTRIBUTE _Unwind_Reason_Code - __hwasan_personality_wrapper(int version, _Unwind_Action actions, diff --git a/recipes-devtools/clang/clang/0035-compiler-rt-Do-not-force-thumb-mode-directive.patch b/recipes-devtools/clang/clang/0035-compiler-rt-Do-not-force-thumb-mode-directive.patch deleted file mode 100644 index 2597926..0000000 --- a/recipes-devtools/clang/clang/0035-compiler-rt-Do-not-force-thumb-mode-directive.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 69a653669e6cdad91803143aca02706e7f7228d3 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 12 Jun 2021 08:42:36 -0700 -Subject: [PATCH] [compiler-rt] 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/common.inc b/recipes-devtools/clang/common.inc index 45f8082..324e7e8 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -33,18 +33,17 @@ SRC_URI = "\ file://0021-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch \ file://0022-clang-Use-python3-in-python-scripts.patch \ file://0023-For-x86_64-set-Yocto-based-GCC-install-search-path.patch \ - file://0024-compiler-rt-Include-stddef.h.patch \ - file://0025-llvm-Do-not-use-find_library-for-ncurses.patch \ - file://0026-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch \ - file://0027-compiler-rt-Use-mcr-based-barrier-on-armv6.patch \ - file://0028-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch \ - file://0029-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch \ - file://0030-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch \ - file://0031-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch \ - file://0032-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch \ - file://0033-libunwind-Added-unw_backtrace-method.patch \ - file://0034-compiler-rt-Use-uintptr_t-instead-of-_Unwind_Word.patch \ - file://0035-compiler-rt-Do-not-force-thumb-mode-directive.patch \ + file://0024-llvm-Do-not-use-find_library-for-ncurses.patch \ + file://0025-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch \ + file://0026-compiler-rt-Use-mcr-based-barrier-on-armv6.patch \ + file://0027-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch \ + file://0028-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch \ + file://0029-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch \ + file://0030-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch \ + file://0031-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch \ + file://0032-libunwind-Added-unw_backtrace-method.patch \ + file://0033-compiler-rt-Use-uintptr_t-instead-of-_Unwind_Word.patch \ + file://0034-compiler-rt-Do-not-force-thumb-mode-directive.patch \ file://0034-CMake-Installable-find-modules-for-terminfo-and-libf.patch \ file://0035-llvm-Do-not-use-standard-search-paths-in-find_librar.patch \ " -- cgit v1.2.3-54-g00ecf