summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2023-06-22 17:15:54 -0700
committerKhem Raj <raj.khem@gmail.com>2023-09-19 19:59:21 -0700
commitd52f203a6bd9e8715cd6fff255e4d2a5a5f78b52 (patch)
tree162c9187e556c848f6dba53e72ffc8e9db01fe4d
parente12fa95bb0193fad9b62cbeafee687507763506c (diff)
downloadmeta-clang-d52f203a6bd9e8715cd6fff255e4d2a5a5f78b52.tar.gz
clang: Update to 17.0.1 release branch
Drop riscv multilib patch it does not work with clang 17.0 Release Notes are below https://releases.llvm.org/17.0.1/docs/ReleaseNotes.html https://releases.llvm.org/17.0.1/tools/clang/docs/ReleaseNotes.html https://releases.llvm.org/17.0.1/tools/lld/docs/ReleaseNotes.html https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/ReleaseNotes.html https://releases.llvm.org/17.0.1/projects/libcxx/docs/ReleaseNotes.html Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--conf/layer.conf2
-rw-r--r--recipes-devtools/clang/clang.inc9
-rw-r--r--recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch18
-rw-r--r--recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch2
-rw-r--r--recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch6
-rw-r--r--recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch18
-rw-r--r--recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch4
-rw-r--r--recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch12
-rw-r--r--recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch6
-rw-r--r--recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch8
-rw-r--r--recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch10
-rw-r--r--recipes-devtools/clang/clang/0010-clang-Define-releative-gcc-installation-dir.patch7
-rw-r--r--recipes-devtools/clang/clang/0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch6
-rw-r--r--recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch4
-rw-r--r--recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch2
-rw-r--r--recipes-devtools/clang/clang/0014-libcxx-Add-compiler-runtime-library-to-link-step-for.patch8
-rw-r--r--recipes-devtools/clang/clang/0015-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch18
-rw-r--r--recipes-devtools/clang/clang/0016-clang-Fix-resource-dir-location-for-cross-toolchains.patch8
-rw-r--r--recipes-devtools/clang/clang/0017-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch14
-rw-r--r--recipes-devtools/clang/clang/0018-clang-Use-python3-in-python-scripts.patch21
-rw-r--r--recipes-devtools/clang/clang/0019-For-x86_64-set-Yocto-based-GCC-install-search-path.patch8
-rw-r--r--recipes-devtools/clang/clang/0020-llvm-Do-not-use-find_library-for-ncurses.patch6
-rw-r--r--recipes-devtools/clang/clang/0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch8
-rw-r--r--recipes-devtools/clang/clang/0022-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch2
-rw-r--r--recipes-devtools/clang/clang/0023-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch6
-rw-r--r--recipes-devtools/clang/clang/0024-libunwind-Added-unw_backtrace-method.patch19
-rw-r--r--recipes-devtools/clang/clang/0025-clang-Do-not-use-install-relative-libc-headers.patch6
-rw-r--r--recipes-devtools/clang/clang/0026-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch72
-rw-r--r--recipes-devtools/clang/clang/0027-Fix-lib-paths-for-OpenEmbedded-Host.patch12
-rw-r--r--recipes-devtools/clang/clang/0028-Correct-library-search-path-for-OpenEmbedded-Host.patch10
-rw-r--r--recipes-devtools/clang/clang/0029-lldb-Link-with-libatomic-on-x86.patch4
-rw-r--r--recipes-devtools/clang/clang/0030-clang-exclude-openembedded-distributions-from-settin.patch35
-rw-r--r--recipes-devtools/clang/clang/0030-compiler-rt-Enable-__int128-for-ppc32.patch (renamed from recipes-devtools/clang/clang/0031-compiler-rt-Enable-__int128-for-ppc32.patch)16
-rw-r--r--recipes-devtools/clang/clang/0031-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch (renamed from recipes-devtools/clang/clang/0032-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch)4
-rw-r--r--recipes-devtools/clang/clang/0032-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch (renamed from recipes-devtools/clang/clang/0035-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch)6
-rw-r--r--recipes-devtools/clang/clang/0033-build-Enable-64bit-off_t-on-32bit-glibc-systems.patch53
-rw-r--r--recipes-devtools/clang/clang/0033-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch (renamed from recipes-devtools/clang/clang/0036-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch)6
-rw-r--r--recipes-devtools/clang/clang/0034-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch (renamed from recipes-devtools/clang/clang/0040-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch)15
-rw-r--r--recipes-devtools/clang/clang/0034-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch36
-rw-r--r--recipes-devtools/clang/clang/0037-Call-printName-to-get-name-of-Decl.patch71
-rw-r--r--recipes-devtools/clang/clang/0038-Apply-fmacro-prefix-map-to-anonymous-tags-in-templat.patch84
-rw-r--r--recipes-devtools/clang/clang/0039-lld-RISCV-Handle-relaxation-reductions-of-more-than-.patch78
-rw-r--r--recipes-devtools/clang/common.inc17
43 files changed, 200 insertions, 557 deletions
diff --git a/conf/layer.conf b/conf/layer.conf
index f1138b8..db08303 100644
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -33,7 +33,7 @@ INHERIT += "clang"
33# Do not include clang in SDK unless user wants to 33# Do not include clang in SDK unless user wants to
34CLANGSDK ??= "0" 34CLANGSDK ??= "0"
35 35
36LLVMVERSION = "16.0.6" 36LLVMVERSION = "17.0.1"
37 37
38require conf/nonclangable.conf 38require conf/nonclangable.conf
39require conf/nonscanable.conf 39require conf/nonscanable.conf
diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc
index 2340aec..ec0c22a 100644
--- a/recipes-devtools/clang/clang.inc
+++ b/recipes-devtools/clang/clang.inc
@@ -4,15 +4,14 @@ LLVM_DIR = "llvm${LLVM_RELEASE}"
4LLVM_GIT ?= "git://github.com/llvm" 4LLVM_GIT ?= "git://github.com/llvm"
5LLVM_GIT_PROTOCOL ?= "https" 5LLVM_GIT_PROTOCOL ?= "https"
6 6
7MAJOR_VER = "16" 7MAJOR_VER = "17"
8MINOR_VER = "0" 8MINOR_VER = "0"
9PATCH_VER = "6" 9PATCH_VER = "1"
10 10
11SRCREV ?= "7cbf1a2591520c2491aa35339f227775f4d3adf6" 11SRCREV ?= "e19b7dc36bc047b9eb72078d034596be766da350"
12 12
13PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}" 13PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}"
14#BRANCH = "release/15.x" 14BRANCH = "release/17.x"
15BRANCH = "release/16.x"
16 15
17LLVMMD5SUM = "8a15a0759ef07f2682d2ba4b893c9afe" 16LLVMMD5SUM = "8a15a0759ef07f2682d2ba4b893c9afe"
18CLANGMD5SUM = "ff42885ed2ab98f1ecb8c1fc41205343" 17CLANGMD5SUM = "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 cc62160..6721a2b 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 @@
1From bfea0b41ba225254c159194e911e2238103f70e4 Mon Sep 17 00:00:00 2001 1From 6a743f488230aa025016396208d1760835495264 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 27 Aug 2017 10:37:49 -0700 3Date: Sun, 27 Aug 2017 10:37:49 -0700
4Subject: [PATCH] libcxxabi: Find libunwind headers when 4Subject: [PATCH] libcxxabi: Find libunwind headers when
@@ -18,10 +18,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
18 1 file changed, 11 insertions(+), 5 deletions(-) 18 1 file changed, 11 insertions(+), 5 deletions(-)
19 19
20diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt 20diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
21index 8f48d402bc22..c2470267d8e3 100644 21index f380fe6b6b92..145cb9d7ee88 100644
22--- a/libcxxabi/CMakeLists.txt 22--- a/libcxxabi/CMakeLists.txt
23+++ b/libcxxabi/CMakeLists.txt 23+++ b/libcxxabi/CMakeLists.txt
24@@ -483,7 +483,7 @@ set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH 24@@ -426,7 +426,7 @@ set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH
25 "Specify path to libunwind source." FORCE) 25 "Specify path to libunwind source." FORCE)
26 26
27 if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) 27 if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
@@ -30,7 +30,7 @@ index 8f48d402bc22..c2470267d8e3 100644
30 PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES} 30 PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES}
31 ${LIBCXXABI_LIBUNWIND_PATH}/include 31 ${LIBCXXABI_LIBUNWIND_PATH}/include
32 ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES} 32 ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES}
33@@ -494,15 +494,21 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) 33@@ -437,15 +437,21 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
34 NO_CMAKE_FIND_ROOT_PATH 34 NO_CMAKE_FIND_ROOT_PATH
35 ) 35 )
36 36
@@ -39,12 +39,12 @@ index 8f48d402bc22..c2470267d8e3 100644
39+ if (LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES-NOTFOUND") 39+ if (LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES-NOTFOUND")
40+ set(LIBCXXABI_LIBUNWIND_INCLUDES "") 40+ set(LIBCXXABI_LIBUNWIND_INCLUDES "")
41 endif() 41 endif()
42 endif()
42 43
43- if (NOT LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "") 44-if (NOT "${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}" STREQUAL "")
44- include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}") 45- include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}")
45+ if (NOT LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "") 46+if (NOT "${LIBCXXABI_LIBUNWIND_INCLUDES}" STREQUAL "")
46+ include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES}") 47+ include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES}")
47 endif()
48 endif() 48 endif()
49 49
50+set(LIBCXXABI_LIBUNWIND_INCLUDES "${LIBCXXABI_LIBUNWIND_INCLUDES}" CACHE PATH 50+set(LIBCXXABI_LIBUNWIND_INCLUDES "${LIBCXXABI_LIBUNWIND_INCLUDES}" CACHE PATH
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 047280e..df4d620 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 @@
1From 4aa8c16b7caed1924e7ddafff7dd0c719cac3d7e Mon Sep 17 00:00:00 2001 1From 25b8166b829bc987832a7c7b41581f193a4fabe9 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 19 Apr 2015 15:16:23 -0700 3Date: Sun, 19 Apr 2015 15:16:23 -0700
4Subject: [PATCH] compiler-rt: support a new embedded linux target 4Subject: [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 12432d0..0262008 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 @@
1From 4c8897954c3a49fd215e7bb1b1777a814c911e60 Mon Sep 17 00:00:00 2001 1From fb844bcda4ed86c4f7246b4249d217dca534bc25 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 19 May 2016 23:11:45 -0700 3Date: Thu, 19 May 2016 23:11:45 -0700
4Subject: [PATCH] compiler-rt: Simplify cross-compilation. Don't use 4Subject: [PATCH] compiler-rt: Simplify cross-compilation. Don't use
@@ -21,10 +21,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
21 1 file changed, 10 insertions(+), 1 deletion(-) 21 1 file changed, 10 insertions(+), 1 deletion(-)
22 22
23diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt 23diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
24index 8a13508fcb98..2c2bda5befa5 100644 24index 1545340aa8a8..73fad3284810 100644
25--- a/compiler-rt/CMakeLists.txt 25--- a/compiler-rt/CMakeLists.txt
26+++ b/compiler-rt/CMakeLists.txt 26+++ b/compiler-rt/CMakeLists.txt
27@@ -89,7 +89,16 @@ if (COMPILER_RT_STANDALONE_BUILD) 27@@ -80,7 +80,16 @@ if (COMPILER_RT_STANDALONE_BUILD)
28 set(CMAKE_CXX_EXTENSIONS NO) 28 set(CMAKE_CXX_EXTENSIONS NO)
29 29
30 if (NOT LLVM_RUNTIMES_BUILD) 30 if (NOT LLVM_RUNTIMES_BUILD)
diff --git a/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch b/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch
index 6927ebd..4d13016 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 @@
1From d333a8f789767d1aad9288861dbde840fc9de14a Mon Sep 17 00:00:00 2001 1From f258983025dd6a1d8a72f244ac97893c895e5b21 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 21 May 2016 00:33:20 +0000 3Date: Sat, 21 May 2016 00:33:20 +0000
4Subject: [PATCH] llvm: TargetLibraryInfo: Undefine libc functions if they are 4Subject: [PATCH] llvm: TargetLibraryInfo: Undefine libc functions if they are
@@ -14,10 +14,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 1 file changed, 21 insertions(+), 1 deletion(-) 14 1 file changed, 21 insertions(+), 1 deletion(-)
15 15
16diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.def b/llvm/include/llvm/Analysis/TargetLibraryInfo.def 16diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.def b/llvm/include/llvm/Analysis/TargetLibraryInfo.def
17index 5f6af3514fc2..9ac2e912590f 100644 17index 03ac422d3e6b..3080b4758894 100644
18--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.def 18--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.def
19+++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.def 19+++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.def
20@@ -1303,6 +1303,9 @@ TLI_DEFINE_STRING_INTERNAL("fopen") 20@@ -1348,6 +1348,9 @@ TLI_DEFINE_STRING_INTERNAL("fopen")
21 TLI_DEFINE_SIG_INTERNAL(Ptr, Ptr, Ptr) 21 TLI_DEFINE_SIG_INTERNAL(Ptr, Ptr, Ptr)
22 22
23 /// FILE *fopen64(const char *filename, const char *opentype) 23 /// FILE *fopen64(const char *filename, const char *opentype)
@@ -27,7 +27,7 @@ index 5f6af3514fc2..9ac2e912590f 100644
27 TLI_DEFINE_ENUM_INTERNAL(fopen64) 27 TLI_DEFINE_ENUM_INTERNAL(fopen64)
28 TLI_DEFINE_STRING_INTERNAL("fopen64") 28 TLI_DEFINE_STRING_INTERNAL("fopen64")
29 TLI_DEFINE_SIG_INTERNAL(Ptr, Ptr, Ptr) 29 TLI_DEFINE_SIG_INTERNAL(Ptr, Ptr, Ptr)
30@@ -1381,7 +1384,9 @@ TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Long, Int) 30@@ -1426,7 +1429,9 @@ TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Long, Int)
31 TLI_DEFINE_ENUM_INTERNAL(fseeko) 31 TLI_DEFINE_ENUM_INTERNAL(fseeko)
32 TLI_DEFINE_STRING_INTERNAL("fseeko") 32 TLI_DEFINE_STRING_INTERNAL("fseeko")
33 TLI_DEFINE_SIG_INTERNAL(Int, Ptr, IntX, Int) 33 TLI_DEFINE_SIG_INTERNAL(Int, Ptr, IntX, Int)
@@ -38,7 +38,7 @@ index 5f6af3514fc2..9ac2e912590f 100644
38 /// int fseeko64(FILE *stream, off64_t offset, int whence) 38 /// int fseeko64(FILE *stream, off64_t offset, int whence)
39 TLI_DEFINE_ENUM_INTERNAL(fseeko64) 39 TLI_DEFINE_ENUM_INTERNAL(fseeko64)
40 TLI_DEFINE_STRING_INTERNAL("fseeko64") 40 TLI_DEFINE_STRING_INTERNAL("fseeko64")
41@@ -1398,6 +1403,9 @@ TLI_DEFINE_STRING_INTERNAL("fstat") 41@@ -1443,6 +1448,9 @@ TLI_DEFINE_STRING_INTERNAL("fstat")
42 TLI_DEFINE_SIG_INTERNAL(Int, Int, Ptr) 42 TLI_DEFINE_SIG_INTERNAL(Int, Int, Ptr)
43 43
44 /// int fstat64(int filedes, struct stat64 *buf) 44 /// int fstat64(int filedes, struct stat64 *buf)
@@ -48,7 +48,7 @@ index 5f6af3514fc2..9ac2e912590f 100644
48 TLI_DEFINE_ENUM_INTERNAL(fstat64) 48 TLI_DEFINE_ENUM_INTERNAL(fstat64)
49 TLI_DEFINE_STRING_INTERNAL("fstat64") 49 TLI_DEFINE_STRING_INTERNAL("fstat64")
50 TLI_DEFINE_SIG_INTERNAL(Int, Int, Ptr) 50 TLI_DEFINE_SIG_INTERNAL(Int, Int, Ptr)
51@@ -1423,6 +1431,9 @@ TLI_DEFINE_STRING_INTERNAL("ftello") 51@@ -1468,6 +1476,9 @@ TLI_DEFINE_STRING_INTERNAL("ftello")
52 TLI_DEFINE_SIG_INTERNAL(IntPlus, Ptr) 52 TLI_DEFINE_SIG_INTERNAL(IntPlus, Ptr)
53 53
54 /// off64_t ftello64(FILE *stream) 54 /// off64_t ftello64(FILE *stream)
@@ -58,7 +58,7 @@ index 5f6af3514fc2..9ac2e912590f 100644
58 TLI_DEFINE_ENUM_INTERNAL(ftello64) 58 TLI_DEFINE_ENUM_INTERNAL(ftello64)
59 TLI_DEFINE_STRING_INTERNAL("ftello64") 59 TLI_DEFINE_STRING_INTERNAL("ftello64")
60 TLI_DEFINE_SIG_INTERNAL(Int64, Ptr) 60 TLI_DEFINE_SIG_INTERNAL(Int64, Ptr)
61@@ -1633,6 +1644,9 @@ TLI_DEFINE_STRING_INTERNAL("lstat") 61@@ -1678,6 +1689,9 @@ TLI_DEFINE_STRING_INTERNAL("lstat")
62 TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Ptr) 62 TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Ptr)
63 63
64 /// int lstat64(const char *path, struct stat64 *buf); 64 /// int lstat64(const char *path, struct stat64 *buf);
@@ -68,7 +68,7 @@ index 5f6af3514fc2..9ac2e912590f 100644
68 TLI_DEFINE_ENUM_INTERNAL(lstat64) 68 TLI_DEFINE_ENUM_INTERNAL(lstat64)
69 TLI_DEFINE_STRING_INTERNAL("lstat64") 69 TLI_DEFINE_STRING_INTERNAL("lstat64")
70 TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Ptr) 70 TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Ptr)
71@@ -2045,6 +2059,9 @@ TLI_DEFINE_STRING_INTERNAL("stat") 71@@ -2090,6 +2104,9 @@ TLI_DEFINE_STRING_INTERNAL("stat")
72 TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Ptr) 72 TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Ptr)
73 73
74 /// int stat64(const char *path, struct stat64 *buf); 74 /// int stat64(const char *path, struct stat64 *buf);
@@ -78,7 +78,7 @@ index 5f6af3514fc2..9ac2e912590f 100644
78 TLI_DEFINE_ENUM_INTERNAL(stat64) 78 TLI_DEFINE_ENUM_INTERNAL(stat64)
79 TLI_DEFINE_STRING_INTERNAL("stat64") 79 TLI_DEFINE_STRING_INTERNAL("stat64")
80 TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Ptr) 80 TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Ptr)
81@@ -2270,6 +2287,9 @@ TLI_DEFINE_STRING_INTERNAL("tmpfile") 81@@ -2315,6 +2332,9 @@ TLI_DEFINE_STRING_INTERNAL("tmpfile")
82 TLI_DEFINE_SIG_INTERNAL(Ptr) 82 TLI_DEFINE_SIG_INTERNAL(Ptr)
83 83
84 /// FILE *tmpfile64(void) 84 /// FILE *tmpfile64(void)
diff --git a/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch b/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch
index b2cece8..4447c94 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 @@
1From 67c2f3e7f44144a98ce0fb09809d5759405874eb Mon Sep 17 00:00:00 2001 1From 588a8694c6540e31140c7e242bfb5e279d6ca08c Mon Sep 17 00:00:00 2001
2From: Martin Kelly <mkelly@xevo.com> 2From: Martin Kelly <mkelly@xevo.com>
3Date: Fri, 19 May 2017 00:22:57 -0700 3Date: Fri, 19 May 2017 00:22:57 -0700
4Subject: [PATCH] llvm: allow env override of exe and libdir path 4Subject: [PATCH] llvm: allow env override of exe and libdir path
@@ -19,7 +19,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
19 1 file changed, 19 insertions(+), 6 deletions(-) 19 1 file changed, 19 insertions(+), 6 deletions(-)
20 20
21diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp 21diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp
22index b1d795a0a349..dbeddeb2152e 100644 22index e86eb2b44b10..7b2abf318dbe 100644
23--- a/llvm/tools/llvm-config/llvm-config.cpp 23--- a/llvm/tools/llvm-config/llvm-config.cpp
24+++ b/llvm/tools/llvm-config/llvm-config.cpp 24+++ b/llvm/tools/llvm-config/llvm-config.cpp
25@@ -246,6 +246,13 @@ Typical components:\n\ 25@@ -246,6 +246,13 @@ Typical components:\n\
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 6f61a3c..c3e7086 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 @@
1From 4e8e066b60a00eb10c70ef9523c55cfc7ab536f8 Mon Sep 17 00:00:00 2001 1From f033c3e6da2f09e627cf8cf8fbd753e07e0ebacd Mon Sep 17 00:00:00 2001
2From: Dan McGregor <dan.mcgregor@usask.ca> 2From: Dan McGregor <dan.mcgregor@usask.ca>
3Date: Wed, 26 Apr 2017 20:29:41 -0600 3Date: Wed, 26 Apr 2017 20:29:41 -0600
4Subject: [PATCH] clang: driver: Check sysroot for ldso path 4Subject: [PATCH] clang: driver: Check sysroot for ldso path
@@ -15,10 +15,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
15 1 file changed, 21 insertions(+), 1 deletion(-) 15 1 file changed, 21 insertions(+), 1 deletion(-)
16 16
17diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp 17diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
18index c6fb290ffdb4..897a2da73d54 100644 18index 1ba222bf83b1..b2ed29621879 100644
19--- a/clang/lib/Driver/ToolChains/Linux.cpp 19--- a/clang/lib/Driver/ToolChains/Linux.cpp
20+++ b/clang/lib/Driver/ToolChains/Linux.cpp 20+++ b/clang/lib/Driver/ToolChains/Linux.cpp
21@@ -463,7 +463,11 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 21@@ -495,7 +495,11 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
22 Triple.getEnvironment() == llvm::Triple::GNUEABIHF || 22 Triple.getEnvironment() == llvm::Triple::GNUEABIHF ||
23 tools::arm::getARMFloatABI(*this, Args) == tools::arm::FloatABI::Hard; 23 tools::arm::getARMFloatABI(*this, Args) == tools::arm::FloatABI::Hard;
24 24
@@ -31,7 +31,7 @@ index c6fb290ffdb4..897a2da73d54 100644
31 Loader = HF ? "ld-linux-armhf.so.3" : "ld-linux.so.3"; 31 Loader = HF ? "ld-linux-armhf.so.3" : "ld-linux.so.3";
32 break; 32 break;
33 } 33 }
34@@ -518,11 +522,19 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 34@@ -550,11 +554,19 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
35 LibDir = "lib64"; 35 LibDir = "lib64";
36 Loader = 36 Loader =
37 (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1"; 37 (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
@@ -51,7 +51,7 @@ index c6fb290ffdb4..897a2da73d54 100644
51 break; 51 break;
52 case llvm::Triple::riscv32: { 52 case llvm::Triple::riscv32: {
53 StringRef ABIName = tools::riscv::getRISCVABI(Args, Triple); 53 StringRef ABIName = tools::riscv::getRISCVABI(Args, Triple);
54@@ -544,6 +556,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 54@@ -576,6 +588,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
55 case llvm::Triple::sparcv9: 55 case llvm::Triple::sparcv9:
56 LibDir = "lib64"; 56 LibDir = "lib64";
57 Loader = "ld-linux.so.2"; 57 Loader = "ld-linux.so.2";
@@ -62,7 +62,7 @@ index c6fb290ffdb4..897a2da73d54 100644
62 break; 62 break;
63 case llvm::Triple::systemz: 63 case llvm::Triple::systemz:
64 LibDir = "lib"; 64 LibDir = "lib";
65@@ -558,6 +574,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 65@@ -590,6 +606,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
66 66
67 LibDir = X32 ? "libx32" : "lib64"; 67 LibDir = X32 ? "libx32" : "lib64";
68 Loader = X32 ? "ld-linux-x32.so.2" : "ld-linux-x86-64.so.2"; 68 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 afbe3be..48af473 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 @@
1From c6e80e71adaddab21bccc15ff827078d58010a65 Mon Sep 17 00:00:00 2001 1From b497f95862cfe82aa2d581798182d2c2112796ae Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 19 May 2016 21:11:06 -0700 3Date: Thu, 19 May 2016 21:11:06 -0700
4Subject: [PATCH] clang: Driver/tools.cpp: Add -lssp_nonshared on musl 4Subject: [PATCH] clang: Driver/tools.cpp: Add -lssp_nonshared on musl
@@ -14,10 +14,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 1 file changed, 6 insertions(+) 14 1 file changed, 6 insertions(+)
15 15
16diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp 16diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
17index 4f2340316654..cc9ed4f6b8ac 100644 17index 40038dce47d8..c642946c5cfb 100644
18--- a/clang/lib/Driver/ToolChains/Gnu.cpp 18--- a/clang/lib/Driver/ToolChains/Gnu.cpp
19+++ b/clang/lib/Driver/ToolChains/Gnu.cpp 19+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
20@@ -653,6 +653,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, 20@@ -636,6 +636,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
21 if (IsIAMCU) 21 if (IsIAMCU)
22 CmdArgs.push_back("-lgloss"); 22 CmdArgs.push_back("-lgloss");
23 23
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 f0e54ff..ee75cbc 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 @@
1From 4cf32ee02831483cc999d1e60d401cb301f85bfc Mon Sep 17 00:00:00 2001 1From acfefc5462044827ba3b7d0ac7512a9d9461a833 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 16 Mar 2017 09:02:13 -0700 3Date: Thu, 16 Mar 2017 09:02:13 -0700
4Subject: [PATCH] clang: Prepend trailing '/' to sysroot 4Subject: [PATCH] clang: Prepend trailing '/' to sysroot
@@ -25,12 +25,12 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
25 1 file changed, 1 insertion(+), 1 deletion(-) 25 1 file changed, 1 insertion(+), 1 deletion(-)
26 26
27diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp 27diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
28index 2a58f876a68d..c68a842b45e0 100644 28index b2ed29621879..d2fa4b2f11cf 100644
29--- a/clang/lib/Driver/ToolChains/Linux.cpp 29--- a/clang/lib/Driver/ToolChains/Linux.cpp
30+++ b/clang/lib/Driver/ToolChains/Linux.cpp 30+++ b/clang/lib/Driver/ToolChains/Linux.cpp
31@@ -184,7 +184,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) 31@@ -215,7 +215,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
32 Multilibs = GCCInstallation.getMultilibs(); 32 Multilibs = GCCInstallation.getMultilibs();
33 SelectedMultilib = GCCInstallation.getMultilib(); 33 SelectedMultilibs.assign({GCCInstallation.getMultilib()});
34 llvm::Triple::ArchType Arch = Triple.getArch(); 34 llvm::Triple::ArchType Arch = Triple.getArch();
35- std::string SysRoot = computeSysRoot(); 35- std::string SysRoot = computeSysRoot();
36+ std::string SysRoot = computeSysRoot() + "/"; 36+ std::string SysRoot = computeSysRoot() + "/";
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 90b286a..2e83358 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 @@
1From c865d5064247bfc985bc92409869cd21ca5c74e9 Mon Sep 17 00:00:00 2001 1From 9069a7f709cdb5392c9e0ecd863d62176d080a91 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 16 Mar 2017 19:06:26 -0700 3Date: Thu, 16 Mar 2017 19:06:26 -0700
4Subject: [PATCH] clang: Look inside the target sysroot for compiler runtime 4Subject: [PATCH] clang: Look inside the target sysroot for compiler runtime
@@ -16,10 +16,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
16 1 file changed, 5 insertions(+), 1 deletion(-) 16 1 file changed, 5 insertions(+), 1 deletion(-)
17 17
18diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp 18diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp
19index bc70205a6c01..527efd421e01 100644 19index 8dafc3d481c2..3e0f7b64b0db 100644
20--- a/clang/lib/Driver/ToolChain.cpp 20--- a/clang/lib/Driver/ToolChain.cpp
21+++ b/clang/lib/Driver/ToolChain.cpp 21+++ b/clang/lib/Driver/ToolChain.cpp
22@@ -13,6 +13,7 @@ 22@@ -15,6 +15,7 @@
23 #include "ToolChains/InterfaceStubs.h" 23 #include "ToolChains/InterfaceStubs.h"
24 #include "clang/Basic/ObjCRuntime.h" 24 #include "clang/Basic/ObjCRuntime.h"
25 #include "clang/Basic/Sanitizers.h" 25 #include "clang/Basic/Sanitizers.h"
@@ -27,7 +27,7 @@ index bc70205a6c01..527efd421e01 100644
27 #include "clang/Config/config.h" 27 #include "clang/Config/config.h"
28 #include "clang/Driver/Action.h" 28 #include "clang/Driver/Action.h"
29 #include "clang/Driver/Driver.h" 29 #include "clang/Driver/Driver.h"
30@@ -488,7 +489,10 @@ StringRef ToolChain::getOSLibName() const { 30@@ -595,7 +596,10 @@ StringRef ToolChain::getOSLibName() const {
31 } 31 }
32 32
33 std::string ToolChain::getCompilerRTPath() const { 33 std::string ToolChain::getCompilerRTPath() const {
@@ -38,4 +38,4 @@ index bc70205a6c01..527efd421e01 100644
38+ CLANG_VERSION_STRING); 38+ CLANG_VERSION_STRING);
39 if (isBareMetal()) { 39 if (isBareMetal()) {
40 llvm::sys::path::append(Path, "lib", getOSLibName()); 40 llvm::sys::path::append(Path, "lib", getOSLibName());
41 Path += SelectedMultilib.gccSuffix(); 41 if (!SelectedMultilibs.empty()) {
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 761e1b1..39f4044 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 @@
1From cd12100c9acd1b9d57d6386d1e9d4b9baa775866 Mon Sep 17 00:00:00 2001 1From fcc667e02238ad83e5db2ecc1f060af6dcc618f1 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 20 Mar 2021 16:09:16 -0700 3Date: Sat, 20 Mar 2021 16:09:16 -0700
4Subject: [PATCH] clang: Define / releative gcc installation dir 4Subject: [PATCH] clang: Define / releative gcc installation dir
@@ -9,17 +9,16 @@ and other standard headers and libraries from gcc
9installation in OE 9installation in OE
10 10
11Upstream-Status: Pending 11Upstream-Status: Pending
12
13Signed-off-by: Khem Raj <raj.khem@gmail.com> 12Signed-off-by: Khem Raj <raj.khem@gmail.com>
14--- 13---
15 clang/lib/Driver/ToolChains/Gnu.cpp | 14 +++++++------- 14 clang/lib/Driver/ToolChains/Gnu.cpp | 14 +++++++-------
16 1 file changed, 7 insertions(+), 7 deletions(-) 15 1 file changed, 7 insertions(+), 7 deletions(-)
17 16
18diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp 17diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
19index cc9ed4f6b8ac..846163329d92 100644 18index c642946c5cfb..e1c2cdc0e93b 100644
20--- a/clang/lib/Driver/ToolChains/Gnu.cpp 19--- a/clang/lib/Driver/ToolChains/Gnu.cpp
21+++ b/clang/lib/Driver/ToolChains/Gnu.cpp 20+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
22@@ -2681,19 +2681,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( 21@@ -2744,19 +2744,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
23 // Whether this library suffix is relevant for the triple. 22 // Whether this library suffix is relevant for the triple.
24 bool Active; 23 bool Active;
25 } Suffixes[] = { 24 } 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 7e765fe..6ccc25d 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 @@
1From c16c0db65b24497a27fcc89012bfb37000a6e937 Mon Sep 17 00:00:00 2001 1From 85230d89fc000068097599df6c8750d75cf84c72 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 31 Jul 2019 22:51:39 -0700 3Date: Wed, 31 Jul 2019 22:51:39 -0700
4Subject: [PATCH] clang: Add -lpthread and -ldl along with -lunwind for static 4Subject: [PATCH] clang: Add -lpthread and -ldl along with -lunwind for static
@@ -21,10 +21,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
21 1 file changed, 2 insertions(+) 21 1 file changed, 2 insertions(+)
22 22
23diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp 23diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
24index 34640b3c450d..580d326935c0 100644 24index 0d6907b8e5c7..778da2b7b4a5 100644
25--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp 25--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
26+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp 26+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
27@@ -1725,6 +1725,8 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D, 27@@ -1820,6 +1820,8 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D,
28 CmdArgs.push_back("-lunwind"); 28 CmdArgs.push_back("-lunwind");
29 } else if (LGT == LibGccType::StaticLibGcc) { 29 } else if (LGT == LibGccType::StaticLibGcc) {
30 CmdArgs.push_back("-l:libunwind.a"); 30 CmdArgs.push_back("-l:libunwind.a");
diff --git a/recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch b/recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch
index 3f6c158..3f5c9ab 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 @@
1From 4cfb62329c5b2ef54b7e0db4597fbb188948be65 Mon Sep 17 00:00:00 2001 1From 84a2bee19c577eb56c381903959c77271a4368e5 Mon Sep 17 00:00:00 2001
2From: Anuj Mittal <anuj.mittal@intel.com> 2From: Anuj Mittal <anuj.mittal@intel.com>
3Date: Thu, 26 Dec 2019 12:56:16 -0800 3Date: Thu, 26 Dec 2019 12:56:16 -0800
4Subject: [PATCH] Pass PYTHON_EXECUTABLE when cross compiling for native build 4Subject: [PATCH] Pass PYTHON_EXECUTABLE when cross compiling for native build
@@ -11,7 +11,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
11 1 file changed, 1 insertion(+) 11 1 file changed, 1 insertion(+)
12 12
13diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake 13diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake
14index a46a0fd630b0..55f6dba2901a 100644 14index 6af47b51d4c6..bf9adea6814a 100644
15--- a/llvm/cmake/modules/CrossCompile.cmake 15--- a/llvm/cmake/modules/CrossCompile.cmake
16+++ b/llvm/cmake/modules/CrossCompile.cmake 16+++ b/llvm/cmake/modules/CrossCompile.cmake
17@@ -86,6 +86,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype) 17@@ -86,6 +86,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 ca539b3..855d544 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 @@
1From 9fc922e61ce39a12e99b4ff66475443b1dc61ab2 Mon Sep 17 00:00:00 2001 1From 129d994b584cab112d39916075eef8c833813677 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 18 Nov 2019 17:00:29 -0800 3Date: Mon, 18 Nov 2019 17:00:29 -0800
4Subject: [PATCH] Check for atomic<double> intrinsics 4Subject: [PATCH] Check for atomic<double> 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 8518c06..b9d88f8 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 @@
1From 4c2d34597815c045615725b185f2e08461a68432 Mon Sep 17 00:00:00 2001 1From c646fe1dd7b9fcb80de27c8b4da916bd9e0adb7f Mon Sep 17 00:00:00 2001
2From: Jeremy Puhlman <jpuhlman@mvista.com> 2From: Jeremy Puhlman <jpuhlman@mvista.com>
3Date: Thu, 16 Jan 2020 21:16:10 +0000 3Date: Thu, 16 Jan 2020 21:16:10 +0000
4Subject: [PATCH] libcxx: Add compiler runtime library to link step for libcxx 4Subject: [PATCH] libcxx: Add compiler runtime library to link step for libcxx
@@ -14,10 +14,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 1 file changed, 2 insertions(+), 2 deletions(-) 14 1 file changed, 2 insertions(+), 2 deletions(-)
15 15
16diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt 16diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
17index 9ff2a62e9394..e76625d5a5ac 100644 17index 35b466527096..f261c1def1ca 100644
18--- a/libcxx/src/CMakeLists.txt 18--- a/libcxx/src/CMakeLists.txt
19+++ b/libcxx/src/CMakeLists.txt 19+++ b/libcxx/src/CMakeLists.txt
20@@ -200,7 +200,7 @@ if (LIBCXX_ENABLE_SHARED) 20@@ -189,7 +189,7 @@ if (LIBCXX_ENABLE_SHARED)
21 add_library(cxx_shared SHARED ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS}) 21 add_library(cxx_shared SHARED ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
22 target_include_directories(cxx_shared PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) 22 target_include_directories(cxx_shared PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
23 target_link_libraries(cxx_shared PUBLIC cxx-headers 23 target_link_libraries(cxx_shared PUBLIC cxx-headers
@@ -26,7 +26,7 @@ index 9ff2a62e9394..e76625d5a5ac 100644
26 set_target_properties(cxx_shared 26 set_target_properties(cxx_shared
27 PROPERTIES 27 PROPERTIES
28 COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}" 28 COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
29@@ -294,7 +294,7 @@ if (LIBCXX_ENABLE_STATIC) 29@@ -282,7 +282,7 @@ if (LIBCXX_ENABLE_STATIC)
30 add_library(cxx_static STATIC ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS}) 30 add_library(cxx_static STATIC ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
31 target_include_directories(cxx_static PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) 31 target_include_directories(cxx_static PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
32 target_link_libraries(cxx_static PUBLIC cxx-headers 32 target_link_libraries(cxx_static PUBLIC cxx-headers
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 07c8935..a421c6c 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 @@
1From aafbba9f341d5e6d5293371fad130472bee85c5c Mon Sep 17 00:00:00 2001 1From ae428248f697ccf8b98c0da5a9983a1f0ff89bd5 Mon Sep 17 00:00:00 2001
2From: Ovidiu Panait <ovidiu.panait@windriver.com> 2From: Ovidiu Panait <ovidiu.panait@windriver.com>
3Date: Fri, 31 Jan 2020 10:56:11 +0200 3Date: Fri, 31 Jan 2020 10:56:11 +0200
4Subject: [PATCH] clang,llvm: cmake: Fix configure for packages using 4Subject: [PATCH] clang,llvm: cmake: Fix configure for packages using
@@ -52,10 +52,10 @@ index 75b0080f6715..ddf446a13eca 100644
52 endif() 52 endif()
53 endmacro() 53 endmacro()
54diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake 54diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
55index 93e6d67551de..d8123389957b 100644 55index 230620c37027..cb5a9bd41ee8 100644
56--- a/llvm/cmake/modules/AddLLVM.cmake 56--- a/llvm/cmake/modules/AddLLVM.cmake
57+++ b/llvm/cmake/modules/AddLLVM.cmake 57+++ b/llvm/cmake/modules/AddLLVM.cmake
58@@ -1335,7 +1335,6 @@ macro(llvm_add_tool project name) 58@@ -1353,7 +1353,6 @@ macro(llvm_add_tool project name)
59 if( LLVM_BUILD_TOOLS ) 59 if( LLVM_BUILD_TOOLS )
60 get_target_export_arg(${name} LLVM export_to_llvmexports) 60 get_target_export_arg(${name} LLVM export_to_llvmexports)
61 install(TARGETS ${name} 61 install(TARGETS ${name}
@@ -63,7 +63,7 @@ index 93e6d67551de..d8123389957b 100644
63 RUNTIME DESTINATION ${${project}_TOOLS_INSTALL_DIR} 63 RUNTIME DESTINATION ${${project}_TOOLS_INSTALL_DIR}
64 COMPONENT ${name}) 64 COMPONENT ${name})
65 65
66@@ -1346,9 +1345,6 @@ macro(llvm_add_tool project name) 66@@ -1364,9 +1363,6 @@ macro(llvm_add_tool project name)
67 endif() 67 endif()
68 endif() 68 endif()
69 endif() 69 endif()
@@ -73,7 +73,7 @@ index 93e6d67551de..d8123389957b 100644
73 set_target_properties(${name} PROPERTIES FOLDER "Tools") 73 set_target_properties(${name} PROPERTIES FOLDER "Tools")
74 endif() 74 endif()
75 endmacro(llvm_add_tool project name) 75 endmacro(llvm_add_tool project name)
76@@ -1393,7 +1389,6 @@ macro(add_llvm_utility name) 76@@ -1411,7 +1407,6 @@ macro(add_llvm_utility name)
77 if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS) 77 if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS)
78 get_target_export_arg(${name} LLVM export_to_llvmexports) 78 get_target_export_arg(${name} LLVM export_to_llvmexports)
79 install(TARGETS ${name} 79 install(TARGETS ${name}
@@ -81,7 +81,7 @@ index 93e6d67551de..d8123389957b 100644
81 RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR} 81 RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR}
82 COMPONENT ${name}) 82 COMPONENT ${name})
83 83
84@@ -1402,7 +1397,6 @@ macro(add_llvm_utility name) 84@@ -1420,7 +1415,6 @@ macro(add_llvm_utility name)
85 DEPENDS ${name} 85 DEPENDS ${name}
86 COMPONENT ${name}) 86 COMPONENT ${name})
87 endif() 87 endif()
@@ -90,10 +90,10 @@ index 93e6d67551de..d8123389957b 100644
90 set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name}) 90 set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name})
91 endif() 91 endif()
92diff --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake 92diff --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake
93index 70c2edb8c833..e012fea08982 100644 93index 7fd6628ef55d..57a996d03755 100644
94--- a/llvm/cmake/modules/TableGen.cmake 94--- a/llvm/cmake/modules/TableGen.cmake
95+++ b/llvm/cmake/modules/TableGen.cmake 95+++ b/llvm/cmake/modules/TableGen.cmake
96@@ -189,12 +189,7 @@ macro(add_tablegen target project) 96@@ -195,12 +195,7 @@ macro(add_tablegen target project)
97 97
98 if (ADD_TABLEGEN_DESTINATION AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND 98 if (ADD_TABLEGEN_DESTINATION AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND
99 (LLVM_BUILD_UTILS OR ${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS)) 99 (LLVM_BUILD_UTILS OR ${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS))
@@ -106,7 +106,7 @@ index 70c2edb8c833..e012fea08982 100644
106 COMPONENT ${target} 106 COMPONENT ${target}
107 RUNTIME DESTINATION "${ADD_TABLEGEN_DESTINATION}") 107 RUNTIME DESTINATION "${ADD_TABLEGEN_DESTINATION}")
108 if(NOT LLVM_ENABLE_IDE) 108 if(NOT LLVM_ENABLE_IDE)
109@@ -205,6 +200,5 @@ macro(add_tablegen target project) 109@@ -211,6 +206,5 @@ macro(add_tablegen target project)
110 endif() 110 endif()
111 if(ADD_TABLEGEN_EXPORT) 111 if(ADD_TABLEGEN_EXPORT)
112 string(TOUPPER ${ADD_TABLEGEN_EXPORT} export_upper) 112 string(TOUPPER ${ADD_TABLEGEN_EXPORT} export_upper)
diff --git a/recipes-devtools/clang/clang/0016-clang-Fix-resource-dir-location-for-cross-toolchains.patch b/recipes-devtools/clang/clang/0016-clang-Fix-resource-dir-location-for-cross-toolchains.patch
index ddfc76f..8e57922 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 @@
1From 4afad7aec9a18b35e934d50b2f99dc464d6ead0e Mon Sep 17 00:00:00 2001 1From f45ef34d9d5a3ff049c39dd2d3d6aed72eb5b0bc Mon Sep 17 00:00:00 2001
2From: Jim Broadus <jbroadus@xevo.com> 2From: Jim Broadus <jbroadus@xevo.com>
3Date: Thu, 26 Mar 2020 16:05:53 -0700 3Date: Thu, 26 Mar 2020 16:05:53 -0700
4Subject: [PATCH] clang: Fix resource dir location for cross toolchains 4Subject: [PATCH] clang: Fix resource dir location for cross toolchains
@@ -20,15 +20,17 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
20 1 file changed, 7 insertions(+), 1 deletion(-) 20 1 file changed, 7 insertions(+), 1 deletion(-)
21 21
22diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp 22diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
23index a268f2fa8fc5..ab813044dc8c 100644 23index bdbdad9362e1..a0d4a04b42bb 100644
24--- a/clang/lib/Driver/Driver.cpp 24--- a/clang/lib/Driver/Driver.cpp
25+++ b/clang/lib/Driver/Driver.cpp 25+++ b/clang/lib/Driver/Driver.cpp
26@@ -181,7 +181,13 @@ std::string Driver::GetResourcesPath(StringRef BinaryPath, 26@@ -183,9 +183,15 @@ std::string Driver::GetResourcesPath(StringRef BinaryPath,
27 // With a static-library build of libclang, LibClangPath will contain the 27 // With a static-library build of libclang, LibClangPath will contain the
28 // path of the embedding binary, which for LLVM binaries will be in bin/. 28 // path of the embedding binary, which for LLVM binaries will be in bin/.
29 // ../lib gets us to lib/ in both cases. 29 // ../lib gets us to lib/ in both cases.
30- P = llvm::sys::path::parent_path(Dir); 30- P = llvm::sys::path::parent_path(Dir);
31+ Dir = std::string(llvm::sys::path::parent_path(Dir)); 31+ Dir = std::string(llvm::sys::path::parent_path(Dir));
32 // This search path is also created in the COFF driver of lld, so any
33 // changes here also needs to happen in lld/COFF/Driver.cpp
32+ 34+
33+ // OE cross toolchains are installed, by default, in a subdir of bin. 35+ // OE cross toolchains are installed, by default, in a subdir of bin.
34+ if (llvm::sys::path::filename(Dir) == "bin") { 36+ if (llvm::sys::path::filename(Dir) == "bin") {
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 ac311a0..cd111bd 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 @@
1From a85573b9e7e939b0ab1738dd3b3cc999b7de1547 Mon Sep 17 00:00:00 2001 1From 53138d6a7fe341821a73719f776ee5535d759c3b Mon Sep 17 00:00:00 2001
2From: Oleksandr Ocheretnyi <oocheret@cisco.com> 2From: Oleksandr Ocheretnyi <oocheret@cisco.com>
3Date: Wed, 15 Apr 2020 00:08:39 +0300 3Date: Wed, 15 Apr 2020 00:08:39 +0300
4Subject: [PATCH] clang: driver: Add dyld-prefix when checking sysroot for ldso 4Subject: [PATCH] clang: driver: Add dyld-prefix when checking sysroot for ldso
@@ -19,10 +19,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
19 1 file changed, 10 insertions(+), 10 deletions(-) 19 1 file changed, 10 insertions(+), 10 deletions(-)
20 20
21diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp 21diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
22index de0d5950d2ee..c6acfc8924c9 100644 22index d2fa4b2f11cf..42b88e76a9d5 100644
23--- a/clang/lib/Driver/ToolChains/Linux.cpp 23--- a/clang/lib/Driver/ToolChains/Linux.cpp
24+++ b/clang/lib/Driver/ToolChains/Linux.cpp 24+++ b/clang/lib/Driver/ToolChains/Linux.cpp
25@@ -464,8 +464,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 25@@ -496,8 +496,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
26 tools::arm::getARMFloatABI(*this, Args) == tools::arm::FloatABI::Hard; 26 tools::arm::getARMFloatABI(*this, Args) == tools::arm::FloatABI::Hard;
27 27
28 LibDir = "lib32"; 28 LibDir = "lib32";
@@ -33,7 +33,7 @@ index de0d5950d2ee..c6acfc8924c9 100644
33 LibDir = "lib"; 33 LibDir = "lib";
34 } 34 }
35 Loader = HF ? "ld-linux-armhf.so.3" : "ld-linux.so.3"; 35 Loader = HF ? "ld-linux-armhf.so.3" : "ld-linux.so.3";
36@@ -522,8 +522,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 36@@ -554,8 +554,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
37 LibDir = "lib64"; 37 LibDir = "lib64";
38 Loader = 38 Loader =
39 (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1"; 39 (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
@@ -44,7 +44,7 @@ index de0d5950d2ee..c6acfc8924c9 100644
44 LibDir = "lib"; 44 LibDir = "lib";
45 } 45 }
46 break; 46 break;
47@@ -531,8 +531,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 47@@ -563,8 +563,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
48 LibDir = "lib64"; 48 LibDir = "lib64";
49 Loader = 49 Loader =
50 (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2"; 50 (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2";
@@ -55,7 +55,7 @@ index de0d5950d2ee..c6acfc8924c9 100644
55 LibDir = "lib"; 55 LibDir = "lib";
56 } 56 }
57 break; 57 break;
58@@ -556,8 +556,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 58@@ -588,8 +588,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
59 case llvm::Triple::sparcv9: 59 case llvm::Triple::sparcv9:
60 LibDir = "lib64"; 60 LibDir = "lib64";
61 Loader = "ld-linux.so.2"; 61 Loader = "ld-linux.so.2";
@@ -66,7 +66,7 @@ index de0d5950d2ee..c6acfc8924c9 100644
66 LibDir = "lib"; 66 LibDir = "lib";
67 } 67 }
68 break; 68 break;
69@@ -574,8 +574,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 69@@ -606,8 +606,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
70 70
71 LibDir = X32 ? "libx32" : "lib64"; 71 LibDir = X32 ? "libx32" : "lib64";
72 Loader = X32 ? "ld-linux-x32.so.2" : "ld-linux-x86-64.so.2"; 72 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 7c9c0c7..6de7a36 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 @@
1From 9c415718a3b38bd19d82b624fa0f564ad0f7a1fa Mon Sep 17 00:00:00 2001 1From 61de53f94868705c7a0379c3f20e6b9de76c6198 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 14 Oct 2020 22:19:57 -0700 3Date: Wed, 14 Oct 2020 22:19:57 -0700
4Subject: [PATCH] clang: Use python3 in python scripts 4Subject: [PATCH] clang: Use python3 in python scripts
@@ -10,32 +10,21 @@ Upstream-Status: Pending
10Signed-off-by: Khem Raj <raj.khem@gmail.com> 10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11--- 11---
12 .../find-all-symbols/tool/run-find-all-symbols.py | 2 +- 12 .../find-all-symbols/tool/run-find-all-symbols.py | 2 +-
13 clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py | 2 +-
14 clang/tools/scan-view/bin/scan-view | 2 +- 13 clang/tools/scan-view/bin/scan-view | 2 +-
15 3 files changed, 3 insertions(+), 3 deletions(-) 14 2 files changed, 2 insertions(+), 2 deletions(-)
16 15
17diff --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 16diff --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
18index a0fa64592e62..27aa97a35571 100755 17index 471dbf8c110b..f98385dc6651 100755
19--- a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py 18--- a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py
20+++ b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py 19+++ b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py
21@@ -1,4 +1,4 @@ 20@@ -1,4 +1,4 @@
22-#!/usr/bin/env python 21-#!/usr/bin/env python
23+#!/usr/bin/env python3 22+#!/usr/bin/env python3
24 # 23 #
25 #=- run-find-all-symbols.py - Parallel find-all-symbols runner -*- python -*-=# 24 # =- run-find-all-symbols.py - Parallel find-all-symbols runner -*- python -*-=#
26 #
27diff --git a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
28index a26d2144b7f9..396a201b667e 100755
29--- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
30+++ b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
31@@ -1,4 +1,4 @@
32-#!/usr/bin/env python
33+#!/usr/bin/env python3
34 #
35 #===- clang-tidy-diff.py - ClangTidy Diff Checker -----------*- python -*--===#
36 # 25 #
37diff --git a/clang/tools/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view 26diff --git a/clang/tools/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view
38index 6165432e7af8..07effbca5969 100755 27index d01aebb4029a..f3375804654d 100755
39--- a/clang/tools/scan-view/bin/scan-view 28--- a/clang/tools/scan-view/bin/scan-view
40+++ b/clang/tools/scan-view/bin/scan-view 29+++ b/clang/tools/scan-view/bin/scan-view
41@@ -1,4 +1,4 @@ 30@@ -1,4 +1,4 @@
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 bf5b48d..412b1c5 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 @@
1From 4498ef187dd9a9fc83fb433110c2af7b94f3aac0 Mon Sep 17 00:00:00 2001 1From 83fc70ac26c2412382341be61978e51bbd2e6c4f Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com> 2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Mon, 25 Jan 2021 16:14:35 +0800 3Date: Mon, 25 Jan 2021 16:14:35 +0800
4Subject: [PATCH] For x86_64, set Yocto based GCC install search path 4Subject: [PATCH] For x86_64, set Yocto based GCC install search path
@@ -45,7 +45,7 @@ is different between clang and clang-native
45 45
46The //CLANG_EXTRA_OE_VENDORS_TRIPLES string is replaced with list of 46The //CLANG_EXTRA_OE_VENDORS_TRIPLES string is replaced with list of
47additional triples based on CLANG_EXTRA_OE_VENDORS variable in 47additional triples based on CLANG_EXTRA_OE_VENDORS variable in
48recipes-devtools/clang/llvm-project-source.inc:add_more_target_vendors() 48recipes-devtools/clang/llvm-project-source.inc:add_distro_vendor()
49 49
50Upstream-Status: Inappropriate [oe specific] 50Upstream-Status: Inappropriate [oe specific]
51 51
@@ -57,10 +57,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
57 1 file changed, 1 insertion(+) 57 1 file changed, 1 insertion(+)
58 58
59diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp 59diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
60index 846163329d92..0db37c6ef1a8 100644 60index e1c2cdc0e93b..0b355d9a3f4b 100644
61--- a/clang/lib/Driver/ToolChains/Gnu.cpp 61--- a/clang/lib/Driver/ToolChains/Gnu.cpp
62+++ b/clang/lib/Driver/ToolChains/Gnu.cpp 62+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
63@@ -2254,6 +2254,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( 63@@ -2334,6 +2334,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
64 "x86_64-redhat-linux", "x86_64-suse-linux", 64 "x86_64-redhat-linux", "x86_64-suse-linux",
65 "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", 65 "x86_64-manbo-linux-gnu", "x86_64-linux-gnu",
66 "x86_64-slackware-linux", "x86_64-unknown-linux", 66 "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 d461614..db94867 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 @@
1From 72388158dd0791b597fdc7ffd6913de0401f4b43 Mon Sep 17 00:00:00 2001 1From 45a0c6817175c12aac685b4d45badf761bd7f4fc Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 7 Feb 2021 23:58:41 -0800 3Date: Sun, 7 Feb 2021 23:58:41 -0800
4Subject: [PATCH] llvm: Do not use find_library for ncurses 4Subject: [PATCH] llvm: Do not use find_library for ncurses
@@ -18,10 +18,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
18 2 files changed, 2 insertions(+), 2 deletions(-) 18 2 files changed, 2 insertions(+), 2 deletions(-)
19 19
20diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake 20diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
21index 5f51befc1973..55c04b76908e 100644 21index 8d3dc8d208b2..14dfbe147bdd 100644
22--- a/compiler-rt/cmake/config-ix.cmake 22--- a/compiler-rt/cmake/config-ix.cmake
23+++ b/compiler-rt/cmake/config-ix.cmake 23+++ b/compiler-rt/cmake/config-ix.cmake
24@@ -179,7 +179,7 @@ else() 24@@ -177,7 +177,7 @@ else()
25 set(MAYBE_REQUIRED) 25 set(MAYBE_REQUIRED)
26 endif() 26 endif()
27 if(LLVM_ENABLE_TERMINFO) 27 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 17c83eb..480163e 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 @@
1From 9ac3b933821e3cb3fa71985c8a4f6291d1810d92 Mon Sep 17 00:00:00 2001 1From 3ee6071f459375e0534db3bd84b1a71a5694daef Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 11 Feb 2021 16:42:49 -0800 3Date: Thu, 11 Feb 2021 16:42:49 -0800
4Subject: [PATCH] llvm: Insert anchor for adding OE distro vendor names 4Subject: [PATCH] llvm: Insert anchor for adding OE distro vendor names
@@ -7,7 +7,7 @@ This helps in making right detection for OE built gcc toolchains
7 7
8The //CLANG_EXTRA_OE_VENDORS_CASES string is replaced with list of 8The //CLANG_EXTRA_OE_VENDORS_CASES string is replaced with list of
9additional Ceses based on CLANG_EXTRA_OE_VENDORS variable in 9additional Ceses based on CLANG_EXTRA_OE_VENDORS variable in
10recipes-devtools/clang/llvm-project-source.inc:add_more_target_vendors() 10recipes-devtools/clang/llvm-project-source.inc:add_distro_vendor()
11 11
12Upstream-Status: Inappropriate [OE-specific] 12Upstream-Status: Inappropriate [OE-specific]
13 13
@@ -18,10 +18,10 @@ Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
18 1 file changed, 1 insertion(+), 1 deletion(-) 18 1 file changed, 1 insertion(+), 1 deletion(-)
19 19
20diff --git a/llvm/lib/TargetParser/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp 20diff --git a/llvm/lib/TargetParser/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp
21index a68035989a93..ab1fef23d6fc 100644 21index a3d6a06af976..953132c543cd 100644
22--- a/llvm/lib/TargetParser/Triple.cpp 22--- a/llvm/lib/TargetParser/Triple.cpp
23+++ b/llvm/lib/TargetParser/Triple.cpp 23+++ b/llvm/lib/TargetParser/Triple.cpp
24@@ -551,7 +551,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) { 24@@ -569,7 +569,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) {
25 .Case("amd", Triple::AMD) 25 .Case("amd", Triple::AMD)
26 .Case("mesa", Triple::Mesa) 26 .Case("mesa", Triple::Mesa)
27 .Case("suse", Triple::SUSE) 27 .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
index 4dea592..3813446 100644
--- 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
@@ -1,4 +1,4 @@
1From 671ccc83d1e5da6a08ca8bcec2a70df57a955bf8 Mon Sep 17 00:00:00 2001 1From 073a80b1f50e27c88c931bedea516effcff0945e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 19 May 2021 17:32:13 -0700 3Date: Wed, 19 May 2021 17:32:13 -0700
4Subject: [PATCH] compiler-rt: Do not use backtrace APIs on non-glibc linux 4Subject: [PATCH] compiler-rt: Do not use backtrace APIs on non-glibc linux
diff --git a/recipes-devtools/clang/clang/0023-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch b/recipes-devtools/clang/clang/0023-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch
index 1cc785e..349c1f8 100644
--- 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
@@ -1,4 +1,4 @@
1From b51eef97a31d797941c88bc228e220fef13f8e7e Mon Sep 17 00:00:00 2001 1From 64bf8ed61750e9139851c866d9cfbed9a3fb5bb9 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 19 May 2021 17:56:03 -0700 3Date: Wed, 19 May 2021 17:56:03 -0700
4Subject: [PATCH] clang: Fix x86 triple for non-debian multiarch linux distros 4Subject: [PATCH] clang: Fix x86 triple for non-debian multiarch linux distros
@@ -13,10 +13,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 1 file changed, 3 insertions(+) 13 1 file changed, 3 insertions(+)
14 14
15diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp 15diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
16index ca9f5f2e4f74..20c7c7a745be 100644 16index 42b88e76a9d5..ef8435385130 100644
17--- a/clang/lib/Driver/ToolChains/Linux.cpp 17--- a/clang/lib/Driver/ToolChains/Linux.cpp
18+++ b/clang/lib/Driver/ToolChains/Linux.cpp 18+++ b/clang/lib/Driver/ToolChains/Linux.cpp
19@@ -667,6 +667,9 @@ void Linux::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, 19@@ -703,6 +703,9 @@ void Linux::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
20 GCCInstallation.getTriple().getArch() == llvm::Triple::x86 20 GCCInstallation.getTriple().getArch() == llvm::Triple::x86
21 ? "i386-linux-gnu" 21 ? "i386-linux-gnu"
22 : TripleStr; 22 : TripleStr;
diff --git a/recipes-devtools/clang/clang/0024-libunwind-Added-unw_backtrace-method.patch b/recipes-devtools/clang/clang/0024-libunwind-Added-unw_backtrace-method.patch
index 55d9714..170999b 100644
--- a/recipes-devtools/clang/clang/0024-libunwind-Added-unw_backtrace-method.patch
+++ b/recipes-devtools/clang/clang/0024-libunwind-Added-unw_backtrace-method.patch
@@ -1,4 +1,4 @@
1From 841592392822de2d39c0a208b0a2f9fc7e9b184d Mon Sep 17 00:00:00 2001 1From 755f0c575bb3efa82703eda87df3c37aeb6f96b0 Mon Sep 17 00:00:00 2001
2From: Maksim Kita <maksim-kita@yandex-team.ru> 2From: Maksim Kita <maksim-kita@yandex-team.ru>
3Date: Sun, 23 May 2021 10:27:29 +0000 3Date: Sun, 23 May 2021 10:27:29 +0000
4Subject: [PATCH] libunwind: Added unw_backtrace method 4Subject: [PATCH] libunwind: Added unw_backtrace method
@@ -8,8 +8,8 @@ Upstream-Status: Pending
8Signed-off-by: Khem Raj <raj.khem@gmail.com> 8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9--- 9---
10 libunwind/include/libunwind.h | 1 + 10 libunwind/include/libunwind.h | 1 +
11 libunwind/src/libunwind.cpp | 18 ++++++++++++++++++ 11 libunwind/src/libunwind.cpp | 20 ++++++++++++++++++++
12 2 files changed, 19 insertions(+) 12 2 files changed, 21 insertions(+)
13 13
14diff --git a/libunwind/include/libunwind.h b/libunwind/include/libunwind.h 14diff --git a/libunwind/include/libunwind.h b/libunwind/include/libunwind.h
15index d2ad5ab87122..d735d955aee2 100644 15index d2ad5ab87122..d735d955aee2 100644
@@ -24,12 +24,12 @@ index d2ad5ab87122..d735d955aee2 100644
24 extern unw_addr_space_t unw_local_addr_space; 24 extern unw_addr_space_t unw_local_addr_space;
25 25
26diff --git a/libunwind/src/libunwind.cpp b/libunwind/src/libunwind.cpp 26diff --git a/libunwind/src/libunwind.cpp b/libunwind/src/libunwind.cpp
27index 0faea2b78570..14bf07d8f470 100644 27index 1bd18659b786..64819826cfea 100644
28--- a/libunwind/src/libunwind.cpp 28--- a/libunwind/src/libunwind.cpp
29+++ b/libunwind/src/libunwind.cpp 29+++ b/libunwind/src/libunwind.cpp
30@@ -349,7 +349,25 @@ void __unw_remove_dynamic_eh_frame_section(unw_word_t eh_frame_start) { 30@@ -431,6 +431,26 @@ int __unw_remove_find_dynamic_unwind_sections(
31 #endif // defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) 31
32 #endif // !defined(__USING_SJLJ_EXCEPTIONS__) 32 #endif // __APPLE__
33 33
34+int unw_backtrace(void **buffer, int size) { 34+int unw_backtrace(void **buffer, int size) {
35+ unw_context_t context; 35+ unw_context_t context;
@@ -44,12 +44,13 @@ index 0faea2b78570..14bf07d8f470 100644
44+ if (current >= size || unw_get_reg(&cursor, UNW_REG_IP, &ip)) { 44+ if (current >= size || unw_get_reg(&cursor, UNW_REG_IP, &ip)) {
45+ break; 45+ break;
46+ } 46+ }
47 47+
48+ buffer[current++] = reinterpret_cast<void *>(static_cast<uintptr_t>(ip)); 48+ buffer[current++] = reinterpret_cast<void *>(static_cast<uintptr_t>(ip));
49+ } 49+ }
50+ 50+
51+ return current; 51+ return current;
52+} 52+}
53 53+
54 // Add logging hooks in Debug builds only 54 // Add logging hooks in Debug builds only
55 #ifndef NDEBUG 55 #ifndef NDEBUG
56 #include <stdlib.h>
diff --git a/recipes-devtools/clang/clang/0025-clang-Do-not-use-install-relative-libc-headers.patch b/recipes-devtools/clang/clang/0025-clang-Do-not-use-install-relative-libc-headers.patch
index 4e5832a..8d35b41 100644
--- a/recipes-devtools/clang/clang/0025-clang-Do-not-use-install-relative-libc-headers.patch
+++ b/recipes-devtools/clang/clang/0025-clang-Do-not-use-install-relative-libc-headers.patch
@@ -1,4 +1,4 @@
1From 8b052f0c29a83176e4b17e9890e1aa279da9a7cf Mon Sep 17 00:00:00 2001 1From 6fd8342c1b41a5d3f2aad1e8b215d1d9c70df800 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 11 Aug 2021 18:37:11 -0700 3Date: Wed, 11 Aug 2021 18:37:11 -0700
4Subject: [PATCH] clang: Do not use install relative libc++ headers 4Subject: [PATCH] clang: Do not use install relative libc++ headers
@@ -16,10 +16,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
16 1 file changed, 3 insertions(+), 1 deletion(-) 16 1 file changed, 3 insertions(+), 1 deletion(-)
17 17
18diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp 18diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
19index 0db37c6ef1a8..80a21d58c86c 100644 19index 0b355d9a3f4b..f228bd14e8a8 100644
20--- a/clang/lib/Driver/ToolChains/Gnu.cpp 20--- a/clang/lib/Driver/ToolChains/Gnu.cpp
21+++ b/clang/lib/Driver/ToolChains/Gnu.cpp 21+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
22@@ -3093,7 +3093,9 @@ Generic_GCC::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, 22@@ -3128,7 +3128,9 @@ Generic_GCC::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
23 23
24 // Android never uses the libc++ headers installed alongside the toolchain, 24 // Android never uses the libc++ headers installed alongside the toolchain,
25 // which are generally incompatible with the NDK libraries anyway. 25 // which are generally incompatible with the NDK libraries anyway.
diff --git a/recipes-devtools/clang/clang/0026-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch b/recipes-devtools/clang/clang/0026-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch
index 402fc11..90783bb 100644
--- a/recipes-devtools/clang/clang/0026-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch
+++ b/recipes-devtools/clang/clang/0026-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch
@@ -1,4 +1,4 @@
1From 96a3194262a641ac20e1bf19f9db7f657e03785f Mon Sep 17 00:00:00 2001 1From b00d9692a5337fdbbb5635cc9077061c47c7b741 Mon Sep 17 00:00:00 2001
2From: David Abdurachmanov <david.abdurachmanov@sifive.com> 2From: David Abdurachmanov <david.abdurachmanov@sifive.com>
3Date: Wed, 20 Oct 2021 17:30:36 -0700 3Date: Wed, 20 Oct 2021 17:30:36 -0700
4Subject: [PATCH] clang: Fix how driver finds GCC installation path on 4Subject: [PATCH] clang: Fix how driver finds GCC installation path on
@@ -27,54 +27,70 @@ Upstream-Status: Pending
27Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com> 27Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
28Signed-off-by: Khem Raj <raj.khem@gmail.com> 28Signed-off-by: Khem Raj <raj.khem@gmail.com>
29--- 29---
30 clang/lib/Driver/ToolChains/Gnu.cpp | 39 +++++++++++++++++++++-------- 30 clang/lib/Driver/ToolChains/Gnu.cpp | 57 ++++++++++++++++++++---------
31 1 file changed, 28 insertions(+), 11 deletions(-) 31 1 file changed, 39 insertions(+), 18 deletions(-)
32 32
33diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp 33diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
34index 80a21d58c86c..77f5c3f58a8b 100644 34index f228bd14e8a8..d746db487e1f 100644
35--- a/clang/lib/Driver/ToolChains/Gnu.cpp 35--- a/clang/lib/Driver/ToolChains/Gnu.cpp
36+++ b/clang/lib/Driver/ToolChains/Gnu.cpp 36+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
37@@ -1748,18 +1748,29 @@ static void findRISCVMultilibs(const Driver &D, 37@@ -1793,23 +1793,38 @@ static void findRISCVMultilibs(const Driver &D,
38 return findRISCVBareMetalMultilibs(D, TargetTriple, Path, Args, Result); 38 return findRISCVBareMetalMultilibs(D, TargetTriple, Path, Args, Result);
39 39
40 FilterNonExistent NonExistent(Path, "/crtbegin.o", D.getVFS()); 40 FilterNonExistent NonExistent(Path, "/crtbegin.o", D.getVFS());
41- Multilib Ilp32 = makeMultilib("lib32/ilp32").flag("+m32").flag("+mabi=ilp32"); 41- MultilibBuilder Ilp32 =
42- Multilib Ilp32f = 42- MultilibBuilder("lib32/ilp32").flag("-m32").flag("-mabi=ilp32");
43- MultilibBuilder Ilp32f =
44- MultilibBuilder("lib32/ilp32f").flag("-m32").flag("-mabi=ilp32f");
45- MultilibBuilder Ilp32d =
46- MultilibBuilder("lib32/ilp32d").flag("-m32").flag("-mabi=ilp32d");
47- MultilibBuilder Lp64 =
48- MultilibBuilder("lib64/lp64").flag("-m64").flag("-mabi=lp64");
49- MultilibBuilder Lp64f =
50- MultilibBuilder("lib64/lp64f").flag("-m64").flag("-mabi=lp64f");
51- MultilibBuilder Lp64d =
52- MultilibBuilder("lib64/lp64d").flag("-m64").flag("-mabi=lp64d");
53- MultilibSet RISCVMultilibs =
54- MultilibSetBuilder()
55- .Either({Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d})
56- .makeMultilibSet()
57- .FilterOut(NonExistent);
58+
43+ MultilibSet RISCVMultilibs; 59+ MultilibSet RISCVMultilibs;
44+ 60+
45+ if (TargetTriple.getVendor() == llvm::Triple::OpenEmbedded) { 61+ if (TargetTriple.getVendor() == llvm::Triple::OpenEmbedded) {
46+ Multilib OpenEmbeddedIlp32d = makeMultilib("").flag("+m32").flag("+mabi=ilp32d"); 62+ MultilibBuilder OpenEmbeddedIlp32d =
47+ Multilib OpenEmbeddedLp64d = makeMultilib("").flag("+m64").flag("+mabi=lp64d"); 63+ MultilibBuilder("").flag("+m32").flag("+mabi=ilp32d");
64+ MultilibBuilder OpenEmbeddedLp64d =
65+ MultilibBuilder("").flag("+m64").flag("+mabi=lp64d");
48+ RISCVMultilibs = 66+ RISCVMultilibs =
49+ MultilibSet() 67+ MultilibSetBuilder()
50+ .Either({OpenEmbeddedIlp32d, OpenEmbeddedLp64d}) 68+ .Either({OpenEmbeddedIlp32d, OpenEmbeddedLp64d})
69+ .makeMultilibSet()
51+ .FilterOut(NonExistent); 70+ .FilterOut(NonExistent);
52+ } else { 71+ } else {
53+ Multilib Ilp32 = makeMultilib("lib32/ilp32").flag("+m32").flag("+mabi=ilp32"); 72+ MultilibBuilder Ilp32 =
54+ Multilib Ilp32f = 73+ MultilibBuilder("lib32/ilp32").flag("-m32").flag("-mabi=ilp32");
55 makeMultilib("lib32/ilp32f").flag("+m32").flag("+mabi=ilp32f"); 74+ MultilibBuilder Ilp32f =
56- Multilib Ilp32d = 75+ MultilibBuilder("lib32/ilp32f").flag("-m32").flag("-mabi=ilp32f");
57+ Multilib Ilp32d = 76+ MultilibBuilder Ilp32d =
58 makeMultilib("lib32/ilp32d").flag("+m32").flag("+mabi=ilp32d"); 77+ MultilibBuilder("lib32/ilp32d").flag("-m32").flag("-mabi=ilp32d");
59- Multilib Lp64 = makeMultilib("lib64/lp64").flag("+m64").flag("+mabi=lp64"); 78+ MultilibBuilder Lp64 =
60- Multilib Lp64f = makeMultilib("lib64/lp64f").flag("+m64").flag("+mabi=lp64f"); 79+ MultilibBuilder("lib64/lp64").flag("-m64").flag("-mabi=lp64");
61- Multilib Lp64d = makeMultilib("lib64/lp64d").flag("+m64").flag("+mabi=lp64d"); 80+ MultilibBuilder Lp64f =
62- MultilibSet RISCVMultilibs = 81+ MultilibBuilder("lib64/lp64f").flag("-m64").flag("-mabi=lp64f");
63- MultilibSet() 82+ MultilibBuilder Lp64d =
64- .Either({Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d}) 83+ MultilibBuilder("lib64/lp64d").flag("-m64").flag("-mabi=lp64d");
65- .FilterOut(NonExistent);
66+ Multilib Lp64 = makeMultilib("lib64/lp64").flag("+m64").flag("+mabi=lp64");
67+ Multilib Lp64f = makeMultilib("lib64/lp64f").flag("+m64").flag("+mabi=lp64f");
68+ Multilib Lp64d = makeMultilib("lib64/lp64d").flag("+m64").flag("+mabi=lp64d");
69+ RISCVMultilibs = 84+ RISCVMultilibs =
70+ MultilibSet() 85+ MultilibSetBuilder()
71+ .Either({Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d}) 86+ .Either({Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d})
87+ .makeMultilibSet()
72+ .FilterOut(NonExistent); 88+ .FilterOut(NonExistent);
73+ } 89+ }
74 90
75 Multilib::flags_list Flags; 91 Multilib::flags_list Flags;
76 bool IsRV64 = TargetTriple.getArch() == llvm::Triple::riscv64; 92 bool IsRV64 = TargetTriple.getArch() == llvm::Triple::riscv64;
77@@ -2713,13 +2724,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( 93@@ -2776,13 +2791,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
78 continue; // Saw this path before; no need to look at it again. 94 continue; // Saw this path before; no need to look at it again.
79 if (CandidateVersion.isOlderThan(4, 1, 1)) 95 if (CandidateVersion.isOlderThan(4, 1, 1))
80 continue; 96 continue;
diff --git a/recipes-devtools/clang/clang/0027-Fix-lib-paths-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0027-Fix-lib-paths-for-OpenEmbedded-Host.patch
index 3bac5b5..59f3af1 100644
--- a/recipes-devtools/clang/clang/0027-Fix-lib-paths-for-OpenEmbedded-Host.patch
+++ b/recipes-devtools/clang/clang/0027-Fix-lib-paths-for-OpenEmbedded-Host.patch
@@ -1,4 +1,4 @@
1From a7b8523a9f649ca3bdc2759e2bb500bc7f957b48 Mon Sep 17 00:00:00 2001 1From f910a403e898d42d589b694bc9856f052386136e Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com> 2From: Changqing Li <changqing.li@windriver.com>
3Date: Tue, 7 Dec 2021 04:08:22 +0000 3Date: Tue, 7 Dec 2021 04:08:22 +0000
4Subject: [PATCH] Fix lib paths for OpenEmbedded Host 4Subject: [PATCH] Fix lib paths for OpenEmbedded Host
@@ -48,18 +48,18 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
48 1 file changed, 4 insertions(+), 1 deletion(-) 48 1 file changed, 4 insertions(+), 1 deletion(-)
49 49
50diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp 50diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
51index 77f5c3f58a8b..0ec2dadafc05 100644 51index d746db487e1f..020fd106a629 100644
52--- a/clang/lib/Driver/ToolChains/Gnu.cpp 52--- a/clang/lib/Driver/ToolChains/Gnu.cpp
53+++ b/clang/lib/Driver/ToolChains/Gnu.cpp 53+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
54@@ -18,6 +18,7 @@ 54@@ -19,6 +19,7 @@
55 #include "Linux.h" 55 #include "Linux.h"
56 #include "clang/Config/config.h" // for GCC_INSTALL_PREFIX 56 #include "clang/Config/config.h" // for GCC_INSTALL_PREFIX
57 #include "clang/Driver/Compilation.h" 57 #include "clang/Driver/Compilation.h"
58+#include "clang/Driver/Distro.h" 58+#include "clang/Driver/Distro.h"
59 #include "clang/Driver/Driver.h" 59 #include "clang/Driver/Driver.h"
60 #include "clang/Driver/DriverDiagnostic.h" 60 #include "clang/Driver/DriverDiagnostic.h"
61 #include "clang/Driver/Options.h" 61 #include "clang/Driver/MultilibBuilder.h"
62@@ -2682,6 +2683,7 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( 62@@ -2749,6 +2750,7 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
63 const llvm::Triple &TargetTriple, const ArgList &Args, 63 const llvm::Triple &TargetTriple, const ArgList &Args,
64 const std::string &LibDir, StringRef CandidateTriple, 64 const std::string &LibDir, StringRef CandidateTriple,
65 bool NeedsBiarchSuffix, bool GCCDirExists, bool GCCCrossDirExists) { 65 bool NeedsBiarchSuffix, bool GCCDirExists, bool GCCCrossDirExists) {
@@ -67,7 +67,7 @@ index 77f5c3f58a8b..0ec2dadafc05 100644
67 // Locations relative to the system lib directory where GCC's triple-specific 67 // Locations relative to the system lib directory where GCC's triple-specific
68 // directories might reside. 68 // directories might reside.
69 struct GCCLibSuffix { 69 struct GCCLibSuffix {
70@@ -2699,7 +2701,8 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( 70@@ -2766,7 +2768,8 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
71 // files in that location, not just GCC installation data. 71 // files in that location, not just GCC installation data.
72 {CandidateTriple.str(), "..", 72 {CandidateTriple.str(), "..",
73 TargetTriple.getVendor() == llvm::Triple::Freescale || 73 TargetTriple.getVendor() == llvm::Triple::Freescale ||
diff --git a/recipes-devtools/clang/clang/0028-Correct-library-search-path-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0028-Correct-library-search-path-for-OpenEmbedded-Host.patch
index fc45054..9fc5223 100644
--- a/recipes-devtools/clang/clang/0028-Correct-library-search-path-for-OpenEmbedded-Host.patch
+++ b/recipes-devtools/clang/clang/0028-Correct-library-search-path-for-OpenEmbedded-Host.patch
@@ -1,4 +1,4 @@
1From 18cf3957bb9a0021059c64dc8e640028be821bc3 Mon Sep 17 00:00:00 2001 1From 9ed567b3fcce1759947621765199f13261c615a4 Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com> 2From: Changqing Li <changqing.li@windriver.com>
3Date: Tue, 7 Dec 2021 04:55:48 +0000 3Date: Tue, 7 Dec 2021 04:55:48 +0000
4Subject: [PATCH] Correct library search path for OpenEmbedded Host 4Subject: [PATCH] Correct library search path for OpenEmbedded Host
@@ -39,7 +39,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
39 3 files changed, 4 insertions(+) 39 3 files changed, 4 insertions(+)
40 40
41diff --git a/clang/include/clang/Driver/Distro.h b/clang/include/clang/Driver/Distro.h 41diff --git a/clang/include/clang/Driver/Distro.h b/clang/include/clang/Driver/Distro.h
42index 1aaf93ddb7c4..31f03e327b78 100644 42index 8291f6575a71..7ce64b9a2c25 100644
43--- a/clang/include/clang/Driver/Distro.h 43--- a/clang/include/clang/Driver/Distro.h
44+++ b/clang/include/clang/Driver/Distro.h 44+++ b/clang/include/clang/Driver/Distro.h
45@@ -45,6 +45,7 @@ public: 45@@ -45,6 +45,7 @@ public:
@@ -50,7 +50,7 @@ index 1aaf93ddb7c4..31f03e327b78 100644
50 OpenSUSE, 50 OpenSUSE,
51 UbuntuHardy, 51 UbuntuHardy,
52 UbuntuIntrepid, 52 UbuntuIntrepid,
53@@ -135,6 +136,7 @@ public: 53@@ -136,6 +137,7 @@ public:
54 54
55 bool IsGentoo() const { return DistroVal == Gentoo; } 55 bool IsGentoo() const { return DistroVal == Gentoo; }
56 56
@@ -59,7 +59,7 @@ index 1aaf93ddb7c4..31f03e327b78 100644
59 }; 59 };
60 60
61diff --git a/clang/lib/Driver/Distro.cpp b/clang/lib/Driver/Distro.cpp 61diff --git a/clang/lib/Driver/Distro.cpp b/clang/lib/Driver/Distro.cpp
62index 87a0c5a58511..b607a3f18d1e 100644 62index 6e0087565941..13e45b1ea088 100644
63--- a/clang/lib/Driver/Distro.cpp 63--- a/clang/lib/Driver/Distro.cpp
64+++ b/clang/lib/Driver/Distro.cpp 64+++ b/clang/lib/Driver/Distro.cpp
65@@ -44,6 +44,7 @@ static Distro::DistroType DetectOsRelease(llvm::vfs::FileSystem &VFS) { 65@@ -44,6 +44,7 @@ static Distro::DistroType DetectOsRelease(llvm::vfs::FileSystem &VFS) {
@@ -71,7 +71,7 @@ index 87a0c5a58511..b607a3f18d1e 100644
71 return Version; 71 return Version;
72 } 72 }
73diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp 73diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
74index 20c7c7a745be..f5d9b3187cf5 100644 74index ef8435385130..8bd21eebfed3 100644
75--- a/clang/lib/Driver/ToolChains/Linux.cpp 75--- a/clang/lib/Driver/ToolChains/Linux.cpp
76+++ b/clang/lib/Driver/ToolChains/Linux.cpp 76+++ b/clang/lib/Driver/ToolChains/Linux.cpp
77@@ -78,6 +78,7 @@ std::string Linux::getMultiarchTriple(const Driver &D, 77@@ -78,6 +78,7 @@ std::string Linux::getMultiarchTriple(const Driver &D,
diff --git a/recipes-devtools/clang/clang/0029-lldb-Link-with-libatomic-on-x86.patch b/recipes-devtools/clang/clang/0029-lldb-Link-with-libatomic-on-x86.patch
index 666e14d..6d71f75 100644
--- a/recipes-devtools/clang/clang/0029-lldb-Link-with-libatomic-on-x86.patch
+++ b/recipes-devtools/clang/clang/0029-lldb-Link-with-libatomic-on-x86.patch
@@ -1,4 +1,4 @@
1From 5a16f3cf25bfa15ddccb72f16d296648d6512ede Mon Sep 17 00:00:00 2001 1From 374f62b718dbb04a88764cdfa747cd42ebf57829 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 8 Feb 2022 01:31:26 -0800 3Date: Tue, 8 Feb 2022 01:31:26 -0800
4Subject: [PATCH] lldb: Link with libatomic on x86 4Subject: [PATCH] lldb: Link with libatomic on x86
@@ -17,7 +17,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
17 1 file changed, 4 insertions(+) 17 1 file changed, 4 insertions(+)
18 18
19diff --git a/lldb/source/Utility/CMakeLists.txt b/lldb/source/Utility/CMakeLists.txt 19diff --git a/lldb/source/Utility/CMakeLists.txt b/lldb/source/Utility/CMakeLists.txt
20index 89acd7cd2eaf..6aa84f9d284d 100644 20index b376ace0ebe3..b9bb39220524 100644
21--- a/lldb/source/Utility/CMakeLists.txt 21--- a/lldb/source/Utility/CMakeLists.txt
22+++ b/lldb/source/Utility/CMakeLists.txt 22+++ b/lldb/source/Utility/CMakeLists.txt
23@@ -19,6 +19,10 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows") 23@@ -19,6 +19,10 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows")
diff --git a/recipes-devtools/clang/clang/0030-clang-exclude-openembedded-distributions-from-settin.patch b/recipes-devtools/clang/clang/0030-clang-exclude-openembedded-distributions-from-settin.patch
deleted file mode 100644
index d1a9fd5..0000000
--- a/recipes-devtools/clang/clang/0030-clang-exclude-openembedded-distributions-from-settin.patch
+++ /dev/null
@@ -1,35 +0,0 @@
1From 43418cfdfc19953e43c5e1f62fd0720f160de1a2 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 11 Feb 2022 12:29:14 -0800
4Subject: [PATCH] clang: exclude openembedded distributions from setting rpath
5 on openmp executables
6
7OpenEmbedded based SDKs stage toolchains outsides the target rootfs and
8libomp.so is part of the target rootfs and not part of compiler
9toolchain install or relative to it. It finds the libraries via
10--sysroot during compile. This ensures that -rpath is not added for such
11systems, since it is adding cross-compile paths to rpath which is not
12correct when the binaries are run on real targets.
13
14Upstream-Status: Submitted [https://reviews.llvm.org/D119590]
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16---
17 clang/lib/Driver/ToolChains/CommonArgs.cpp | 5 +++++
18 1 file changed, 5 insertions(+)
19
20diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
21index 580d326935c0..412218f04df5 100644
22--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
23+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
24@@ -801,6 +801,11 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args,
25 void tools::addOpenMPRuntimeSpecificRPath(const ToolChain &TC,
26 const ArgList &Args,
27 ArgStringList &CmdArgs) {
28+ // OpenEmbedded/Yocto installs libomp.so into <sysroot>/usr/lib
29+ // therefore using -rpath is not needed, on the contrary it adds
30+ // paths from cross compiler install location which is not correct
31+ if (TC.getTriple().getVendor() == llvm::Triple::OpenEmbedded)
32+ return;
33
34 if (Args.hasFlag(options::OPT_fopenmp_implicit_rpath,
35 options::OPT_fno_openmp_implicit_rpath, true)) {
diff --git a/recipes-devtools/clang/clang/0031-compiler-rt-Enable-__int128-for-ppc32.patch b/recipes-devtools/clang/clang/0030-compiler-rt-Enable-__int128-for-ppc32.patch
index 9ebc57e..9eb42e5 100644
--- a/recipes-devtools/clang/clang/0031-compiler-rt-Enable-__int128-for-ppc32.patch
+++ b/recipes-devtools/clang/clang/0030-compiler-rt-Enable-__int128-for-ppc32.patch
@@ -1,4 +1,4 @@
1From cd16176a1b45061623ec0219a12a0a7a407fa738 Mon Sep 17 00:00:00 2001 1From b907dbdce5520eaf841ae041fcca6941a8529456 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 9 Mar 2022 16:28:16 -0800 3Date: Wed, 9 Mar 2022 16:28:16 -0800
4Subject: [PATCH] compiler-rt: Enable __int128 for ppc32 4Subject: [PATCH] compiler-rt: Enable __int128 for ppc32
@@ -11,10 +11,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
11 2 files changed, 8 insertions(+), 9 deletions(-) 11 2 files changed, 8 insertions(+), 9 deletions(-)
12 12
13diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt 13diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt
14index 2fc70522895f..55f0ecb20a1f 100644 14index d62fa0432e2a..126505bd8921 100644
15--- a/compiler-rt/lib/builtins/CMakeLists.txt 15--- a/compiler-rt/lib/builtins/CMakeLists.txt
16+++ b/compiler-rt/lib/builtins/CMakeLists.txt 16+++ b/compiler-rt/lib/builtins/CMakeLists.txt
17@@ -668,11 +668,9 @@ set(mips64_SOURCES ${GENERIC_TF_SOURCES} 17@@ -669,11 +669,9 @@ set(mips64_SOURCES ${GENERIC_TF_SOURCES}
18 set(mips64el_SOURCES ${GENERIC_TF_SOURCES} 18 set(mips64el_SOURCES ${GENERIC_TF_SOURCES}
19 ${mips_SOURCES}) 19 ${mips_SOURCES})
20 20
@@ -27,10 +27,10 @@ index 2fc70522895f..55f0ecb20a1f 100644
27 ppc/divtc3.c 27 ppc/divtc3.c
28 ppc/fixtfdi.c 28 ppc/fixtfdi.c
29 ppc/fixunstfdi.c 29 ppc/fixunstfdi.c
30@@ -687,14 +685,15 @@ set(powerpc64_SOURCES 30@@ -688,14 +686,15 @@ set(powerpc64_SOURCES
31 ) 31 )
32 # These routines require __int128, which isn't supported on AIX. 32 # These routines require __int128, which isn't supported on AIX.
33 if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "AIX") 33 if (NOT OS_NAME MATCHES "AIX")
34- set(powerpc64_SOURCES 34- set(powerpc64_SOURCES
35+ set(powerpc_SOURCES 35+ set(powerpc_SOURCES
36 ppc/floattitf.c 36 ppc/floattitf.c
@@ -46,15 +46,15 @@ index 2fc70522895f..55f0ecb20a1f 100644
46 46
47 set(riscv_SOURCES 47 set(riscv_SOURCES
48 riscv/fp_mode.c 48 riscv/fp_mode.c
49@@ -818,9 +817,9 @@ else () 49@@ -823,9 +822,9 @@ else ()
50 list(APPEND BUILTIN_CFLAGS_${arch} -fomit-frame-pointer -DCOMPILER_RT_ARMHF_TARGET) 50 list(APPEND BUILTIN_CFLAGS_${arch} -fomit-frame-pointer -DCOMPILER_RT_ARMHF_TARGET)
51 endif() 51 endif()
52 52
53- # For RISCV32, we must force enable int128 for compiling long 53- # For RISCV32, we must force enable int128 for compiling long
54+ # For RISCV32/PPC32, we must force enable int128 for compiling long 54+ # For RISCV32/PPC32, we must force enable int128 for compiling long
55 # double routines. 55 # double routines.
56- if("${arch}" STREQUAL "riscv32") 56- if(COMPILER_RT_ENABLE_SOFTWARE_INT128 OR "${arch}" STREQUAL "riscv32")
57+ if("${arch}" STREQUAL "riscv32" OR "${arch}" STREQUAL "powerpc" ) 57+ if(COMPILER_RT_ENABLE_SOFTWARE_INT128 OR "${arch}" STREQUAL "riscv32" OR "${arch}" STREQUAL "powerpc")
58 list(APPEND BUILTIN_CFLAGS_${arch} -fforce-enable-int128) 58 list(APPEND BUILTIN_CFLAGS_${arch} -fforce-enable-int128)
59 endif() 59 endif()
60 60
diff --git a/recipes-devtools/clang/clang/0032-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch b/recipes-devtools/clang/clang/0031-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch
index c52aa55..37c93de 100644
--- a/recipes-devtools/clang/clang/0032-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch
+++ b/recipes-devtools/clang/clang/0031-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch
@@ -1,4 +1,4 @@
1From 6f1ddaf3cfca94d3c3d00d0e7e9486eaf98f8b44 Mon Sep 17 00:00:00 2001 1From fc268457a7ef1a8481a1d563550cc8e9a8a5afcb Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 12 Aug 2022 11:50:57 -0700 3Date: Fri, 12 Aug 2022 11:50:57 -0700
4Subject: [PATCH] llvm: Do not use cmake infra to detect libzstd 4Subject: [PATCH] llvm: Do not use cmake infra to detect libzstd
@@ -21,7 +21,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
21 1 file changed, 4 insertions(+), 4 deletions(-) 21 1 file changed, 4 insertions(+), 4 deletions(-)
22 22
23diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt 23diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt
24index 4cbc3b79f3bb..08c4bfd5efc1 100644 24index 87fe7bebf688..e12e292fdfbf 100644
25--- a/llvm/lib/Support/CMakeLists.txt 25--- a/llvm/lib/Support/CMakeLists.txt
26+++ b/llvm/lib/Support/CMakeLists.txt 26+++ b/llvm/lib/Support/CMakeLists.txt
27@@ -22,7 +22,7 @@ if (HAS_WERROR_GLOBAL_CTORS) 27@@ -22,7 +22,7 @@ if (HAS_WERROR_GLOBAL_CTORS)
diff --git a/recipes-devtools/clang/clang/0035-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch b/recipes-devtools/clang/clang/0032-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch
index afdb6bc..9d462b0 100644
--- a/recipes-devtools/clang/clang/0035-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch
+++ b/recipes-devtools/clang/clang/0032-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch
@@ -1,4 +1,4 @@
1From eb6c2fe33206567b6a658d74bfd2a906f61893ed Mon Sep 17 00:00:00 2001 1From b5be1155dbe4d82fef53960f5df8a25770cd8bfc Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 3 Jan 2023 18:44:34 -0800 3Date: Tue, 3 Jan 2023 18:44:34 -0800
4Subject: [PATCH] compiler-rt: Fix stat struct's size for O32 ABI 4Subject: [PATCH] compiler-rt: Fix stat struct's size for O32 ABI
@@ -14,10 +14,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 1 file changed, 13 insertions(+) 14 1 file changed, 13 insertions(+)
15 15
16diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h 16diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
17index fdc69b8a5fba..d2246893f8a5 100644 17index 58244c9944a0..70daaf279f4a 100644
18--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h 18--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
19+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h 19+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
20@@ -97,11 +97,24 @@ const unsigned struct_kernel_stat64_sz = 104; 20@@ -98,11 +98,24 @@ const unsigned struct_kernel_stat64_sz = 104;
21 const unsigned struct_kernel_stat_sz = 144; 21 const unsigned struct_kernel_stat_sz = 144;
22 const unsigned struct_kernel_stat64_sz = 104; 22 const unsigned struct_kernel_stat64_sz = 104;
23 #elif defined(__mips__) 23 #elif defined(__mips__)
diff --git a/recipes-devtools/clang/clang/0033-build-Enable-64bit-off_t-on-32bit-glibc-systems.patch b/recipes-devtools/clang/clang/0033-build-Enable-64bit-off_t-on-32bit-glibc-systems.patch
deleted file mode 100644
index 85a0a0d..0000000
--- a/recipes-devtools/clang/clang/0033-build-Enable-64bit-off_t-on-32bit-glibc-systems.patch
+++ /dev/null
@@ -1,53 +0,0 @@
1From 81298058cd344f695fe22da4a367db08709a85e1 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 25 Dec 2022 15:13:41 -0800
4Subject: [PATCH] build: Enable 64bit off_t on 32bit glibc systems
5
6Pass -D_FILE_OFFSET_BITS=64 to compiler flags on 32bit glibc based
7systems. This will make sure that 64bit versions of LFS functions are
8used e.g. lseek will behave same as lseek64. Also revert [1] partially
9because this added a cmake test to detect lseek64 but then forgot to
10pass the needed macro during actual compile, this test was incomplete too
11since libc implementations like musl has 64-bit off_t by default on 32-bit
12systems and does not bundle -D_LARGEFILE64_SOURCE [2] under -D_GNU_SOURCE
13like glibc, which means the compile now fails on musl because the cmake
14check passes but we do not have _LARGEFILE64_SOURCE defined. Moreover,
15Using the *64 function was transitional anyways so use
16-D_FILE_OFFSET_BITS=64 instead
17
18[1] https://github.com/llvm/llvm-project/commit/8db7e5e4eed4c4e697dc3164f2c9351d8c3e942b
19[2] https://git.musl-libc.org/cgit/musl/commit/?id=25e6fee27f4a293728dd15b659170e7b9c7db9bc
20
21Upstream-Status: Pending
22Signed-off-by: Khem Raj <raj.khem@gmail.com>
23---
24 utils/bazel/llvm-project-overlay/llvm/config.bzl | 1 -
25 .../llvm-project-overlay/llvm/include/llvm/Config/config.h | 3 ---
26 2 files changed, 4 deletions(-)
27
28diff --git a/utils/bazel/llvm-project-overlay/llvm/config.bzl b/utils/bazel/llvm-project-overlay/llvm/config.bzl
29index 5507f80efa0b..b15ec9e1bb39 100644
30--- a/utils/bazel/llvm-project-overlay/llvm/config.bzl
31+++ b/utils/bazel/llvm-project-overlay/llvm/config.bzl
32@@ -48,7 +48,6 @@ posix_defines = [
33 linux_defines = posix_defines + [
34 "_GNU_SOURCE",
35 "HAVE_LINK_H=1",
36- "HAVE_LSEEK64=1",
37 "HAVE_MALLINFO=1",
38 "HAVE_SBRK=1",
39 "HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=1",
40diff --git a/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h b/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h
41index 8a30957b6120..6a68ac040bb8 100644
42--- a/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h
43+++ b/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h
44@@ -144,9 +144,6 @@
45 /* Define to 1 if you have the <link.h> header file. */
46 /* HAVE_LINK_H defined in Bazel */
47
48-/* Define to 1 if you have the `lseek64' function. */
49-/* HAVE_LSEEK64 defined in Bazel */
50-
51 /* Define to 1 if you have the <mach/mach.h> header file. */
52 /* HAVE_MACH_MACH_H defined in Bazel */
53
diff --git a/recipes-devtools/clang/clang/0036-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch b/recipes-devtools/clang/clang/0033-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch
index b30b475..dde742a 100644
--- a/recipes-devtools/clang/clang/0036-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch
+++ b/recipes-devtools/clang/clang/0033-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch
@@ -1,4 +1,4 @@
1From 46643a33c0889bc6cb4034337b02962c673e0ac4 Mon Sep 17 00:00:00 2001 1From e8ecd192495c092dcee4fdb1ee5514222a8aa0c1 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 21 Feb 2023 12:46:10 -0800 3Date: Tue, 21 Feb 2023 12:46:10 -0800
4Subject: [PATCH] compiler-rt: Undef _TIME_BITS along with _FILE_OFFSET_BITS in 4Subject: [PATCH] compiler-rt: Undef _TIME_BITS along with _FILE_OFFSET_BITS in
@@ -22,7 +22,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
22 1 file changed, 9 insertions(+) 22 1 file changed, 9 insertions(+)
23 23
24diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h 24diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
25index 764996e57355..df3d165ecdb6 100644 25index 764996e57355..99024169f925 100644
26--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h 26--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
27+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h 27+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
28@@ -22,6 +22,15 @@ 28@@ -22,6 +22,15 @@
@@ -34,7 +34,7 @@ index 764996e57355..df3d165ecdb6 100644
34+// 32-bit architectures using 64-bit time_t and users passing _TIME_BITS=64 34+// 32-bit architectures using 64-bit time_t and users passing _TIME_BITS=64
35+// from build environment, therefore both _FILE_OFFSET_BITS and _TIME_BITS 35+// from build environment, therefore both _FILE_OFFSET_BITS and _TIME_BITS
36+// need to be undefined together since features.h will check for both being 64 36+// need to be undefined together since features.h will check for both being 64
37+// if one is set to 64 37+// if one is set to 64.
38+# if !defined(_FILE_OFFSET_BITS) 38+# if !defined(_FILE_OFFSET_BITS)
39+# undef _TIME_BITS 39+# undef _TIME_BITS
40+# endif 40+# endif
diff --git a/recipes-devtools/clang/clang/0040-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch b/recipes-devtools/clang/clang/0034-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch
index 0929024..5a6b184 100644
--- a/recipes-devtools/clang/clang/0040-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch
+++ b/recipes-devtools/clang/clang/0034-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch
@@ -1,4 +1,4 @@
1From 0f5f2e8e84d37e94aad0a6bf90bb3406e289b5e5 Mon Sep 17 00:00:00 2001 1From 9fa41e535f7b95005e4aa2c764aebe674feeea69 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com> 2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Thu, 31 Aug 2023 18:14:47 +0200 3Date: Thu, 31 Aug 2023 18:14:47 +0200
4Subject: [PATCH] ToolChains/Gnu.cpp: ARMLibDirs search also in lib32 4Subject: [PATCH] ToolChains/Gnu.cpp: ARMLibDirs search also in lib32
@@ -50,14 +50,15 @@ CMake Error at TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-c
50Upstream-Status: Pending 50Upstream-Status: Pending
51Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> 51Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
52--- 52---
53 clang/lib/Driver/ToolChains/Gnu.cpp | 2 +- 53 clang/lib/Driver/ToolChains/Gnu.cpp | 2 +-
54 1 file changed, 1 insertion(+), 1 deletion(-) 54 clang/lib/Driver/ToolChains/Linux.cpp | 1 +
55 2 files changed, 2 insertions(+), 1 deletion(-)
55 56
56diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp 57diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
57index 0ec2dadafc05..a67e87365a7a 100644 58index 020fd106a629..358c0ade7b27 100644
58--- a/clang/lib/Driver/ToolChains/Gnu.cpp 59--- a/clang/lib/Driver/ToolChains/Gnu.cpp
59+++ b/clang/lib/Driver/ToolChains/Gnu.cpp 60+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
60@@ -2241,7 +2241,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( 61@@ -2325,7 +2325,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
61 static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu", 62 static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu",
62 "aarch64_be-linux-gnu"}; 63 "aarch64_be-linux-gnu"};
63 64
@@ -67,10 +68,10 @@ index 0ec2dadafc05..a67e87365a7a 100644
67 static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf", 68 static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
68 "armv7hl-redhat-linux-gnueabi", 69 "armv7hl-redhat-linux-gnueabi",
69diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp 70diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
70index c6fb290ffdb4..82acaf8a4bfd 100644 71index 8bd21eebfed3..2492db058cf9 100644
71--- a/clang/lib/Driver/ToolChains/Linux.cpp 72--- a/clang/lib/Driver/ToolChains/Linux.cpp
72+++ b/clang/lib/Driver/ToolChains/Linux.cpp 73+++ b/clang/lib/Driver/ToolChains/Linux.cpp
73@@ -166,6 +166,7 @@ static StringRef getOSLibDir(const llvm::Triple &Triple, const ArgList &Args) { 74@@ -198,6 +198,7 @@ static StringRef getOSLibDir(const llvm::Triple &Triple, const ArgList &Args) {
74 // reasoning about oslibdir spellings with the lib dir spellings in the 75 // reasoning about oslibdir spellings with the lib dir spellings in the
75 // GCCInstallationDetector, but that is a more significant refactoring. 76 // GCCInstallationDetector, but that is a more significant refactoring.
76 if (Triple.getArch() == llvm::Triple::x86 || Triple.isPPC32() || 77 if (Triple.getArch() == llvm::Triple::x86 || Triple.isPPC32() ||
diff --git a/recipes-devtools/clang/clang/0034-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch b/recipes-devtools/clang/clang/0034-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch
deleted file mode 100644
index ab35769..0000000
--- a/recipes-devtools/clang/clang/0034-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch
+++ /dev/null
@@ -1,36 +0,0 @@
1From 6c4db3884b0271d80725fc8912083c48e9f3112c Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 31 Dec 2022 15:03:24 -0800
4Subject: [PATCH] compiler-rt: Undef _TIME_BITS along with _FILE_OFFSET_BITS on
5 linux
6
7On 32bit systems using 64bit time_t build fails because
8_FILE_OFFSET_BITS is undefined here but _TIME_BITS is still set to 64
9
10Fixes
11/usr/include/features-time64.h:26:5: error: "_TIME_BITS=64 is allowed
12 only with _FILE_OFFSET_BITS=64"
13| # error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
14| ^
15| 1 error generated.
16
17Also avoid LFS64 functions on musl
18
19Upstream-Status: Pending
20Signed-off-by: Khem Raj <raj.khem@gmail.com>
21---
22 .../lib/sanitizer_common/sanitizer_platform_limits_posix.cpp | 1 +
23 1 file changed, 1 insertion(+)
24
25diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
26index fc01498aa228..eb2ee78c2f45 100644
27--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
28+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
29@@ -18,6 +18,7 @@
30 // depends on _FILE_OFFSET_BITS setting.
31 // To get this "true" dirent definition, we undefine _FILE_OFFSET_BITS below.
32 #undef _FILE_OFFSET_BITS
33+#undef _TIME_BITS
34 #endif
35
36 // Must go after undef _FILE_OFFSET_BITS.
diff --git a/recipes-devtools/clang/clang/0037-Call-printName-to-get-name-of-Decl.patch b/recipes-devtools/clang/clang/0037-Call-printName-to-get-name-of-Decl.patch
deleted file mode 100644
index 8ede20b..0000000
--- a/recipes-devtools/clang/clang/0037-Call-printName-to-get-name-of-Decl.patch
+++ /dev/null
@@ -1,71 +0,0 @@
1From ab8b6331592fb92a2dc1c689483a4772d51aed8b Mon Sep 17 00:00:00 2001
2From: Dan McGregor <dan.mcgregor@usask.ca>
3Date: Tue, 21 Mar 2023 13:04:51 -0600
4Subject: [PATCH] Call printName to get name of Decl
5
6Rather than sending a name directly to the stream, use printName
7to preserve any PrintingPolicy. This ensures that names are properly
8affected by path remapping.
9
10Differential Revision: https://reviews.llvm.org/D149272
11
12Upstream-Status: Pending
13Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
14---
15 clang/lib/AST/Decl.cpp | 4 ++--
16 clang/lib/AST/DeclarationName.cpp | 4 ++--
17 clang/test/CodeGen/debug-prefix-map.cpp | 11 +++++++++++
18 3 files changed, 15 insertions(+), 4 deletions(-)
19 create mode 100644 clang/test/CodeGen/debug-prefix-map.cpp
20
21diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
22index e60cc28f6e0f..24de6156c0f5 100644
23--- a/clang/lib/AST/Decl.cpp
24+++ b/clang/lib/AST/Decl.cpp
25@@ -1626,8 +1626,8 @@ Module *Decl::getOwningModuleForLinkage(bool IgnoreLinkage) const {
26 llvm_unreachable("unknown module kind");
27 }
28
29-void NamedDecl::printName(raw_ostream &OS, const PrintingPolicy&) const {
30- OS << Name;
31+void NamedDecl::printName(raw_ostream &OS, const PrintingPolicy &Policy) const {
32+ Name.print(OS, Policy);
33 }
34
35 void NamedDecl::printName(raw_ostream &OS) const {
36diff --git a/clang/lib/AST/DeclarationName.cpp b/clang/lib/AST/DeclarationName.cpp
37index c1219041a466..da8b3886c340 100644
38--- a/clang/lib/AST/DeclarationName.cpp
39+++ b/clang/lib/AST/DeclarationName.cpp
40@@ -117,12 +117,12 @@ static void printCXXConstructorDestructorName(QualType ClassType,
41 Policy.adjustForCPlusPlus();
42
43 if (const RecordType *ClassRec = ClassType->getAs<RecordType>()) {
44- OS << *ClassRec->getDecl();
45+ ClassRec->getDecl()->printName(OS, Policy);
46 return;
47 }
48 if (Policy.SuppressTemplateArgsInCXXConstructors) {
49 if (auto *InjTy = ClassType->getAs<InjectedClassNameType>()) {
50- OS << *InjTy->getDecl();
51+ InjTy->getDecl()->printName(OS, Policy);
52 return;
53 }
54 }
55diff --git a/clang/test/CodeGen/debug-prefix-map.cpp b/clang/test/CodeGen/debug-prefix-map.cpp
56new file mode 100644
57index 000000000000..5e90aedd8ed7
58--- /dev/null
59+++ b/clang/test/CodeGen/debug-prefix-map.cpp
60@@ -0,0 +1,11 @@
61+// RUN: %clang_cc1 -debug-info-kind=standalone -fdebug-prefix-map=%p=./UNLIKELY_PATH/empty -S %s -emit-llvm -o - | FileCheck %s
62+
63+struct alignas(64) an {
64+ struct {
65+ unsigned char x{0};
66+ } arr[64];
67+};
68+
69+struct an *pan = new an;
70+
71+// CHECK: !DISubprogram(name: "(unnamed struct at ./UNLIKELY_PATH/empty{{/|\\\\}}{{.*}}",
diff --git a/recipes-devtools/clang/clang/0038-Apply-fmacro-prefix-map-to-anonymous-tags-in-templat.patch b/recipes-devtools/clang/clang/0038-Apply-fmacro-prefix-map-to-anonymous-tags-in-templat.patch
deleted file mode 100644
index 12c8d73..0000000
--- a/recipes-devtools/clang/clang/0038-Apply-fmacro-prefix-map-to-anonymous-tags-in-templat.patch
+++ /dev/null
@@ -1,84 +0,0 @@
1From 648ef1a807d27d51b7cddbf2df7499984c857ba4 Mon Sep 17 00:00:00 2001
2From: Dan McGregor <dan.mcgregor@usask.ca>
3Date: Fri, 16 Jun 2023 08:47:00 -0700
4Subject: [PATCH] Apply -fmacro-prefix-map to anonymous tags in template
5 arguments
6
7When expanding template arguments for pretty function printing,
8such as for __PRETTY_FUNCTION__, make TypePrinter apply
9macro-prefix-map remapping to anonymous tags such as lambdas.
10
11Fixes https://github.com/llvm/llvm-project/issues/63219
12
13Reviewed By: MaskRay, aaron.ballman
14
15Differential Revision: https://reviews.llvm.org/D152570
16
17Upstream-Status: Backport [https://reviews.llvm.org/D152570]
18Signed-off-by: Khem Raj <raj.khem@gmail.com>
19---
20 clang/docs/ReleaseNotes.rst | 2 ++
21 clang/lib/AST/Expr.cpp | 14 ++++++++++++++
22 clang/test/CodeGenCXX/macro-prefix-map-lambda.cpp | 14 ++++++++++++++
23 3 files changed, 30 insertions(+)
24 create mode 100644 clang/test/CodeGenCXX/macro-prefix-map-lambda.cpp
25
26diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
27index 8d67ff904469..bf3ea4a54d01 100644
28--- a/clang/docs/ReleaseNotes.rst
29+++ b/clang/docs/ReleaseNotes.rst
30@@ -724,6 +724,8 @@ Bug Fixes in This Version
31 - Fix crash when passing a braced initializer list to a parentehsized aggregate
32 initialization expression.
33 (`#63008 <https://github.com/llvm/llvm-project/issues/63008>`_).
34+- Apply ``-fmacro-prefix-map`` to anonymous tags in template arguments
35+ (`#63219 <https://github.com/llvm/llvm-project/issues/63219>`_).
36
37 Bug Fixes to Compiler Builtins
38 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
40index e45ae68cd5fe..a65678f5998c 100644
41--- a/clang/lib/AST/Expr.cpp
42+++ b/clang/lib/AST/Expr.cpp
43@@ -783,7 +783,21 @@ std::string PredefinedExpr::ComputeName(IdentKind IK, const Decl *CurrentDecl) {
44 Out << "static ";
45 }
46
47+ class PrettyCallbacks final : public PrintingCallbacks {
48+ public:
49+ PrettyCallbacks(const LangOptions &LO) : LO(LO) {}
50+ std::string remapPath(StringRef Path) const override {
51+ SmallString<128> p(Path);
52+ LO.remapPathPrefix(p);
53+ return std::string(p);
54+ }
55+
56+ private:
57+ const LangOptions &LO;
58+ };
59 PrintingPolicy Policy(Context.getLangOpts());
60+ PrettyCallbacks PrettyCB(Context.getLangOpts());
61+ Policy.Callbacks = &PrettyCB;
62 std::string Proto;
63 llvm::raw_string_ostream POut(Proto);
64
65diff --git a/clang/test/CodeGenCXX/macro-prefix-map-lambda.cpp b/clang/test/CodeGenCXX/macro-prefix-map-lambda.cpp
66new file mode 100644
67index 000000000000..e87f0ab484dc
68--- /dev/null
69+++ b/clang/test/CodeGenCXX/macro-prefix-map-lambda.cpp
70@@ -0,0 +1,14 @@
71+// RUN: %clang_cc1 -triple %itanium_abi_triple -fmacro-prefix-map=%p=./UNLIKELY_PATH/empty %s -emit-llvm -o - | FileCheck %s
72+
73+template<typename f>
74+auto lambdatest(f&& cb) {
75+ const char *s = __PRETTY_FUNCTION__;
76+ return s;
77+}
78+
79+int main() {
80+ auto *s = lambdatest([](){});
81+// CHECK: @"__PRETTY_FUNCTION__._Z10lambdatestIZ4mainE3$_0EDaOT_" = private unnamed_addr constant [{{[0-9]+}} x i8] c"auto lambdatest(f &&) [f = (lambda at ./UNLIKELY_PATH/empty{{/|\\\\}}{{.*}}.cpp:[[#@LINE-1]]:24)]\00", align 1
82+
83+ return 0;
84+}
diff --git a/recipes-devtools/clang/clang/0039-lld-RISCV-Handle-relaxation-reductions-of-more-than-.patch b/recipes-devtools/clang/clang/0039-lld-RISCV-Handle-relaxation-reductions-of-more-than-.patch
deleted file mode 100644
index 713cd3a..0000000
--- a/recipes-devtools/clang/clang/0039-lld-RISCV-Handle-relaxation-reductions-of-more-than-.patch
+++ /dev/null
@@ -1,78 +0,0 @@
1From 1405446343007159cdbef39b37427b3cc2e94266 Mon Sep 17 00:00:00 2001
2From: Roland McGrath <mcgrathr@google.com>
3Date: Tue, 16 May 2023 13:35:35 -0700
4Subject: [PATCH] [lld][RISCV] Handle relaxation reductions of more than 65536
5 bytes
6
7In a real-world case with functions that have many, many
8R_RISCV_CALL_PLT relocations due to asan and ubsan
9instrumentation, all these can be relaxed by an instruction and
10the net result is more than 65536 bytes of reduction in the
11output .text section that totals about 1.2MiB in final size.
12
13This changes InputSection to use a 32-bit field for bytesDropped.
14The RISCV relaxation keeps track in a 64-bit field and detects
1532-bit overflow as it previously detected 16-bit overflow. It
16doesn't seem likely that 32-bit overflow will arise, but it's not
17inconceivable and it's cheap enough to detect it.
18
19This unfortunately increases the size of InputSection on 64-bit
20hosts by a word, but that seems hard to avoid.
21
22Reviewed By: MaskRay
23
24Differential Revision: https://reviews.llvm.org/D150722
25
26Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/9d37ea95df1b84cca9b5e954d8964c976a5e303e]
27Signed-off-by: Khem Raj <raj.khem@gmail.com>
28---
29 lld/ELF/Arch/RISCV.cpp | 6 +++---
30 lld/ELF/InputSection.h | 4 ++--
31 2 files changed, 5 insertions(+), 5 deletions(-)
32
33diff --git a/lld/ELF/Arch/RISCV.cpp b/lld/ELF/Arch/RISCV.cpp
34index 87887b314a5a..80754e37d3ed 100644
35--- a/lld/ELF/Arch/RISCV.cpp
36+++ b/lld/ELF/Arch/RISCV.cpp
37@@ -621,7 +621,7 @@ static bool relax(InputSection &sec) {
38 // iteration.
39 DenseMap<const Defined *, uint64_t> valueDelta;
40 ArrayRef<SymbolAnchor> sa = ArrayRef(aux.anchors);
41- uint32_t delta = 0;
42+ uint64_t delta = 0;
43 for (auto [i, r] : llvm::enumerate(sec.relocs())) {
44 for (; sa.size() && sa[0].offset <= r.offset; sa = sa.slice(1))
45 if (!sa[0].end)
46@@ -688,8 +688,8 @@ static bool relax(InputSection &sec) {
47 a.d->value -= delta - valueDelta.find(a.d)->second;
48 }
49 // Inform assignAddresses that the size has changed.
50- if (!isUInt<16>(delta))
51- fatal("section size decrease is too large");
52+ if (!isUInt<32>(delta))
53+ fatal("section size decrease is too large: " + Twine(delta));
54 sec.bytesDropped = delta;
55 return changed;
56 }
57diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h
58index 356ccda2d743..143384b3ba7b 100644
59--- a/lld/ELF/InputSection.h
60+++ b/lld/ELF/InputSection.h
61@@ -137,7 +137,7 @@ public:
62 // Used by --optimize-bb-jumps and RISC-V linker relaxation temporarily to
63 // indicate the number of bytes which is not counted in the size. This should
64 // be reset to zero after uses.
65- uint16_t bytesDropped = 0;
66+ uint32_t bytesDropped = 0;
67
68 mutable bool compressed = false;
69
70@@ -401,7 +401,7 @@ private:
71 template <class ELFT> void copyShtGroup(uint8_t *buf);
72 };
73
74-static_assert(sizeof(InputSection) <= 152, "InputSection is too big");
75+static_assert(sizeof(InputSection) <= 160, "InputSection is too big");
76
77 class SyntheticSection : public InputSection {
78 public:
diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc
index cb16e5a..aaf7e7d 100644
--- a/recipes-devtools/clang/common.inc
+++ b/recipes-devtools/clang/common.inc
@@ -35,21 +35,14 @@ SRC_URI = "\
35 file://0023-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch \ 35 file://0023-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch \
36 file://0024-libunwind-Added-unw_backtrace-method.patch \ 36 file://0024-libunwind-Added-unw_backtrace-method.patch \
37 file://0025-clang-Do-not-use-install-relative-libc-headers.patch \ 37 file://0025-clang-Do-not-use-install-relative-libc-headers.patch \
38 file://0026-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch \
39 file://0027-Fix-lib-paths-for-OpenEmbedded-Host.patch \ 38 file://0027-Fix-lib-paths-for-OpenEmbedded-Host.patch \
40 file://0028-Correct-library-search-path-for-OpenEmbedded-Host.patch \ 39 file://0028-Correct-library-search-path-for-OpenEmbedded-Host.patch \
41 file://0029-lldb-Link-with-libatomic-on-x86.patch \ 40 file://0029-lldb-Link-with-libatomic-on-x86.patch \
42 file://0030-clang-exclude-openembedded-distributions-from-settin.patch \ 41 file://0030-compiler-rt-Enable-__int128-for-ppc32.patch \
43 file://0031-compiler-rt-Enable-__int128-for-ppc32.patch \ 42 file://0031-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch \
44 file://0032-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch \ 43 file://0032-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch \
45 file://0033-build-Enable-64bit-off_t-on-32bit-glibc-systems.patch \ 44 file://0033-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch \
46 file://0034-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch \ 45 file://0034-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch \
47 file://0035-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch \
48 file://0036-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch \
49 file://0037-Call-printName-to-get-name-of-Decl.patch \
50 file://0038-Apply-fmacro-prefix-map-to-anonymous-tags-in-templat.patch \
51 file://0039-lld-RISCV-Handle-relaxation-reductions-of-more-than-.patch \
52 file://0040-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch \
53 " 46 "
54# Fallback to no-PIE if not set 47# Fallback to no-PIE if not set
55GCCPIE ??= "" 48GCCPIE ??= ""