summaryrefslogtreecommitdiffstats
path: root/recipes-devtools
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2023-01-11 23:06:51 -0800
committerKhem Raj <raj.khem@gmail.com>2023-03-20 07:48:27 -0700
commitde56f14e886e276db52f1cfa02c05dc0b0b79dca (patch)
treeaa0fec2037f6086dbd1e1d16abe105a85451fec1 /recipes-devtools
parent00766db290f8e6b9a536998bb5af0a17605d3d62 (diff)
downloadmeta-clang-de56f14e886e276db52f1cfa02c05dc0b0b79dca.tar.gz
clang: Update to 16.0.0
Changes are described here [1] [1] https://discourse.llvm.org/t/llvm-16-0-0-release/69326 Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'recipes-devtools')
-rw-r--r--recipes-devtools/clang/clang.inc9
-rw-r--r--recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch8
-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.patch28
-rw-r--r--recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch61
-rw-r--r--recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch10
-rw-r--r--recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch10
-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.patch6
-rw-r--r--recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch16
-rw-r--r--recipes-devtools/clang/clang/0010-clang-Define-releative-gcc-installation-dir.patch6
-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.patch12
-rw-r--r--recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch4
-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.patch53
-rw-r--r--recipes-devtools/clang/clang/0016-clang-Fix-resource-dir-location-for-cross-toolchains.patch10
-rw-r--r--recipes-devtools/clang/clang/0017-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch12
-rw-r--r--recipes-devtools/clang/clang/0018-clang-Use-python3-in-python-scripts.patch28
-rw-r--r--recipes-devtools/clang/clang/0019-For-x86_64-set-Yocto-based-GCC-install-search-path.patch6
-rw-r--r--recipes-devtools/clang/clang/0020-llvm-Do-not-use-find_library-for-ncurses.patch8
-rw-r--r--recipes-devtools/clang/clang/0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch14
-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-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch28
-rw-r--r--recipes-devtools/clang/clang/0024-libunwind-Added-unw_backtrace-method.patch (renamed from recipes-devtools/clang/clang/0025-libunwind-Added-unw_backtrace-method.patch)8
-rw-r--r--recipes-devtools/clang/clang/0025-clang-Do-not-use-install-relative-libc-headers.patch (renamed from recipes-devtools/clang/clang/0026-clang-Do-not-use-install-relative-libc-headers.patch)6
-rw-r--r--recipes-devtools/clang/clang/0026-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch (renamed from recipes-devtools/clang/clang/0027-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch)8
-rw-r--r--recipes-devtools/clang/clang/0027-Fix-lib-paths-for-OpenEmbedded-Host.patch (renamed from recipes-devtools/clang/clang/0028-Fix-lib-paths-for-OpenEmbedded-Host.patch)22
-rw-r--r--recipes-devtools/clang/clang/0028-Correct-library-search-path-for-OpenEmbedded-Host.patch (renamed from recipes-devtools/clang/clang/0029-Correct-library-search-path-for-OpenEmbedded-Host.patch)12
-rw-r--r--recipes-devtools/clang/clang/0029-lldb-Link-with-libatomic-on-x86.patch (renamed from recipes-devtools/clang/clang/0030-lldb-Link-with-libatomic-on-x86.patch)4
-rw-r--r--recipes-devtools/clang/clang/0030-clang-exclude-openembedded-distributions-from-settin.patch (renamed from recipes-devtools/clang/clang/0031-clang-exclude-openembedded-distributions-from-settin.patch)6
-rw-r--r--recipes-devtools/clang/clang/0031-compiler-rt-Enable-__int128-for-ppc32.patch (renamed from recipes-devtools/clang/clang/0032-compiler-rt-Enable-__int128-for-ppc32.patch)18
-rw-r--r--recipes-devtools/clang/clang/0032-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch (renamed from recipes-devtools/clang/clang/0033-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch)12
-rw-r--r--recipes-devtools/clang/clang/0033-build-Enable-64bit-off_t-on-32bit-glibc-systems.patch52
-rw-r--r--recipes-devtools/clang/clang/0034-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch35
-rw-r--r--recipes-devtools/clang/clang/0035-cmake-Enable-64bit-off_t-on-32bit-glibc-systems.patch131
-rw-r--r--recipes-devtools/clang/clang/0035-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch (renamed from recipes-devtools/clang/clang/0034-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch)12
-rw-r--r--recipes-devtools/clang/clang/0036-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch56
-rw-r--r--recipes-devtools/clang/common.inc24
-rw-r--r--recipes-devtools/clang/llvm-project-source.inc4
41 files changed, 340 insertions, 429 deletions
diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc
index 9ec03a5..dd85690 100644
--- a/recipes-devtools/clang/clang.inc
+++ b/recipes-devtools/clang/clang.inc
@@ -4,14 +4,15 @@ 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 = "15" 7MAJOR_VER = "16"
8MINOR_VER = "0" 8MINOR_VER = "0"
9PATCH_VER = "7" 9PATCH_VER = "0"
10 10
11SRCREV ?= "8dfdcc7b7bf66834a761bd8de445840ef68e4d1a" 11SRCREV ?= "08d094a0e457360ad8b94b017d2dc277e697ca76"
12 12
13PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}" 13PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}"
14BRANCH = "release/15.x" 14#BRANCH = "release/15.x"
15BRANCH = "release/16.x"
15 16
16LLVMMD5SUM = "8a15a0759ef07f2682d2ba4b893c9afe" 17LLVMMD5SUM = "8a15a0759ef07f2682d2ba4b893c9afe"
17CLANGMD5SUM = "ff42885ed2ab98f1ecb8c1fc41205343" 18CLANGMD5SUM = "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 0baeeca..2426a03 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 f37af7da6832c871007bebe4927f0fc739ae5ad6 Mon Sep 17 00:00:00 2001 1From b7242e2eb52519556821e6af7c7cc7c9a61e8468 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
@@ -17,10 +17,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
17 1 file changed, 11 insertions(+), 5 deletions(-) 17 1 file changed, 11 insertions(+), 5 deletions(-)
18 18
19diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt 19diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
20index b8326d08d23a..cb16b5d4238b 100644 20index 8f48d402bc22..c2470267d8e3 100644
21--- a/libcxxabi/CMakeLists.txt 21--- a/libcxxabi/CMakeLists.txt
22+++ b/libcxxabi/CMakeLists.txt 22+++ b/libcxxabi/CMakeLists.txt
23@@ -474,7 +474,7 @@ set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH 23@@ -483,7 +483,7 @@ set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH
24 "Specify path to libunwind source." FORCE) 24 "Specify path to libunwind source." FORCE)
25 25
26 if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) 26 if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
@@ -29,7 +29,7 @@ index b8326d08d23a..cb16b5d4238b 100644
29 PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES} 29 PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES}
30 ${LIBCXXABI_LIBUNWIND_PATH}/include 30 ${LIBCXXABI_LIBUNWIND_PATH}/include
31 ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES} 31 ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES}
32@@ -485,15 +485,21 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) 32@@ -494,15 +494,21 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
33 NO_CMAKE_FIND_ROOT_PATH 33 NO_CMAKE_FIND_ROOT_PATH
34 ) 34 )
35 35
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 a4717f4..5531965 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 2734739b0c2478ebad3f57462c5c68ce71338551 Mon Sep 17 00:00:00 2001 1From 76423fd130d7719020ae8c84f6475c45b5385c97 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 8bee349..4f9c13b 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 0980511a0eba734da6112c4416a8a086a13c8c82 Mon Sep 17 00:00:00 2001 1From 422ca329c7174d89bcc896e6434dcaf4cf195c64 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
@@ -20,24 +20,24 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
20 1 file changed, 10 insertions(+), 1 deletion(-) 20 1 file changed, 10 insertions(+), 1 deletion(-)
21 21
22diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt 22diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
23index 62737735695f..a2c7c3a786ab 100644 23index 8a13508fcb98..2c2bda5befa5 100644
24--- a/compiler-rt/CMakeLists.txt 24--- a/compiler-rt/CMakeLists.txt
25+++ b/compiler-rt/CMakeLists.txt 25+++ b/compiler-rt/CMakeLists.txt
26@@ -68,7 +68,16 @@ set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOL 26@@ -89,7 +89,16 @@ if (COMPILER_RT_STANDALONE_BUILD)
27 "Build for a bare-metal target.") 27 set(CMAKE_CXX_EXTENSIONS NO)
28 28
29 if (COMPILER_RT_STANDALONE_BUILD) 29 if (NOT LLVM_RUNTIMES_BUILD)
30- load_llvm_config() 30- load_llvm_config()
31+ find_package(LLVM REQUIRED) 31+ find_package(LLVM REQUIRED)
32+ list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}") 32+ list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
33+ 33+
34+ # Variables that AddLLVM.cmake depends on (included by AddCompilerRT) 34+ # Variables that AddLLVM.cmake depends on (included by AddCompilerRT)
35+ set(LLVM_TOOLS_BINARY_DIR "${LLVM_INSTALL_PREFIX}/bin") 35+ set(LLVM_TOOLS_BINARY_DIR "${LLVM_INSTALL_PREFIX}/bin")
36+ set(LLVM_LIBRARY_DIR "${LLVM_INSTALL_PREFIX}/lib") 36+ set(LLVM_LIBRARY_DIR "${LLVM_INSTALL_PREFIX}/lib")
37+ 37+
38+ set(LLVM_LIBRARY_OUTPUT_INTDIR 38+ set(LLVM_LIBRARY_OUTPUT_INTDIR
39+ ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) 39+ ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
40+ 40+
41 endif()
41 if (TARGET intrinsics_gen) 42 if (TARGET intrinsics_gen)
42 # Loading the llvm config causes this target to be imported so place it 43 # Loading the llvm config causes this target to be imported so place it
43 # under the appropriate folder in an IDE.
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 0060f15..13e3bba 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 b0a0d9f515b8423b7f8e0cd8f4882a4ef6fd43af Mon Sep 17 00:00:00 2001 1From 8fc118eafbba4013390751a0e74785e3cddfbf7d 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
@@ -9,80 +9,81 @@ if this is the case then make sure to undefine them
9 9
10Signed-off-by: Khem Raj <raj.khem@gmail.com> 10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11--- 11---
12 .../llvm/Analysis/TargetLibraryInfo.def | 21 +++++++++++++++++++ 12 .../llvm/Analysis/TargetLibraryInfo.def | 22 ++++++++++++++++++-
13 1 file changed, 21 insertions(+) 13 1 file changed, 21 insertions(+), 1 deletion(-)
14 14
15diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.def b/llvm/include/llvm/Analysis/TargetLibraryInfo.def 15diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.def b/llvm/include/llvm/Analysis/TargetLibraryInfo.def
16index 9c1abef33b28..29d2a79ddecc 100644 16index 5f6af3514fc2..9ac2e912590f 100644
17--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.def 17--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.def
18+++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.def 18+++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.def
19@@ -815,6 +815,9 @@ TLI_DEFINE_STRING_INTERNAL("fmodl") 19@@ -1303,6 +1303,9 @@ TLI_DEFINE_STRING_INTERNAL("fopen")
20 TLI_DEFINE_ENUM_INTERNAL(fopen) 20 TLI_DEFINE_SIG_INTERNAL(Ptr, Ptr, Ptr)
21 TLI_DEFINE_STRING_INTERNAL("fopen") 21
22 /// FILE *fopen64(const char *filename, const char *opentype) 22 /// FILE *fopen64(const char *filename, const char *opentype)
23+#ifdef fopen64 23+#ifdef fopen64
24+#undef fopen64 24+#undef fopen64
25+#endif 25+#endif
26 TLI_DEFINE_ENUM_INTERNAL(fopen64) 26 TLI_DEFINE_ENUM_INTERNAL(fopen64)
27 TLI_DEFINE_STRING_INTERNAL("fopen64") 27 TLI_DEFINE_STRING_INTERNAL("fopen64")
28 /// int fork(); 28 TLI_DEFINE_SIG_INTERNAL(Ptr, Ptr, Ptr)
29@@ -862,6 +865,9 @@ TLI_DEFINE_STRING_INTERNAL("fseek") 29@@ -1381,7 +1384,9 @@ TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Long, Int)
30 /// int fseeko(FILE *stream, off_t offset, int whence);
31 TLI_DEFINE_ENUM_INTERNAL(fseeko) 30 TLI_DEFINE_ENUM_INTERNAL(fseeko)
32 TLI_DEFINE_STRING_INTERNAL("fseeko") 31 TLI_DEFINE_STRING_INTERNAL("fseeko")
32 TLI_DEFINE_SIG_INTERNAL(Int, Ptr, IntX, Int)
33-
33+#ifdef fseeko64 34+#ifdef fseeko64
34+#undef fseeko64 35+#undef fseeko64
35+#endif 36+#endif
36 /// int fseeko64(FILE *stream, off64_t offset, int whence) 37 /// int fseeko64(FILE *stream, off64_t offset, int whence)
37 TLI_DEFINE_ENUM_INTERNAL(fseeko64) 38 TLI_DEFINE_ENUM_INTERNAL(fseeko64)
38 TLI_DEFINE_STRING_INTERNAL("fseeko64") 39 TLI_DEFINE_STRING_INTERNAL("fseeko64")
39@@ -872,6 +878,9 @@ TLI_DEFINE_STRING_INTERNAL("fsetpos") 40@@ -1398,6 +1403,9 @@ TLI_DEFINE_STRING_INTERNAL("fstat")
40 TLI_DEFINE_ENUM_INTERNAL(fstat) 41 TLI_DEFINE_SIG_INTERNAL(Int, Int, Ptr)
41 TLI_DEFINE_STRING_INTERNAL("fstat") 42
42 /// int fstat64(int filedes, struct stat64 *buf) 43 /// int fstat64(int filedes, struct stat64 *buf)
43+#ifdef fstat64 44+#ifdef fstat64
44+#undef fstat64 45+#undef fstat64
45+#endif 46+#endif
46 TLI_DEFINE_ENUM_INTERNAL(fstat64) 47 TLI_DEFINE_ENUM_INTERNAL(fstat64)
47 TLI_DEFINE_STRING_INTERNAL("fstat64") 48 TLI_DEFINE_STRING_INTERNAL("fstat64")
48 /// int fstatvfs(int fildes, struct statvfs *buf); 49 TLI_DEFINE_SIG_INTERNAL(Int, Int, Ptr)
49@@ -887,6 +896,9 @@ TLI_DEFINE_STRING_INTERNAL("ftell") 50@@ -1423,6 +1431,9 @@ TLI_DEFINE_STRING_INTERNAL("ftello")
50 TLI_DEFINE_ENUM_INTERNAL(ftello) 51 TLI_DEFINE_SIG_INTERNAL(IntPlus, Ptr)
51 TLI_DEFINE_STRING_INTERNAL("ftello") 52
52 /// off64_t ftello64(FILE *stream) 53 /// off64_t ftello64(FILE *stream)
53+#ifdef ftello64 54+#ifdef ftello64
54+#undef ftello64 55+#undef ftello64
55+#endif 56+#endif
56 TLI_DEFINE_ENUM_INTERNAL(ftello64) 57 TLI_DEFINE_ENUM_INTERNAL(ftello64)
57 TLI_DEFINE_STRING_INTERNAL("ftello64") 58 TLI_DEFINE_STRING_INTERNAL("ftello64")
58 /// int ftrylockfile(FILE *file); 59 TLI_DEFINE_SIG_INTERNAL(Int64, Ptr)
59@@ -1013,6 +1025,9 @@ TLI_DEFINE_STRING_INTERNAL("logl") 60@@ -1633,6 +1644,9 @@ TLI_DEFINE_STRING_INTERNAL("lstat")
60 TLI_DEFINE_ENUM_INTERNAL(lstat) 61 TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Ptr)
61 TLI_DEFINE_STRING_INTERNAL("lstat") 62
62 /// int lstat64(const char *path, struct stat64 *buf); 63 /// int lstat64(const char *path, struct stat64 *buf);
63+#ifdef lstat64 64+#ifdef lstat64
64+#undef lstat64 65+#undef lstat64
65+#endif 66+#endif
66 TLI_DEFINE_ENUM_INTERNAL(lstat64) 67 TLI_DEFINE_ENUM_INTERNAL(lstat64)
67 TLI_DEFINE_STRING_INTERNAL("lstat64") 68 TLI_DEFINE_STRING_INTERNAL("lstat64")
68 /// void *malloc(size_t size); 69 TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Ptr)
69@@ -1262,6 +1277,9 @@ TLI_DEFINE_STRING_INTERNAL("sscanf") 70@@ -2045,6 +2059,9 @@ TLI_DEFINE_STRING_INTERNAL("stat")
70 TLI_DEFINE_ENUM_INTERNAL(stat) 71 TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Ptr)
71 TLI_DEFINE_STRING_INTERNAL("stat") 72
72 /// int stat64(const char *path, struct stat64 *buf); 73 /// int stat64(const char *path, struct stat64 *buf);
73+#ifdef stat64 74+#ifdef stat64
74+#undef stat64 75+#undef stat64
75+#endif 76+#endif
76 TLI_DEFINE_ENUM_INTERNAL(stat64) 77 TLI_DEFINE_ENUM_INTERNAL(stat64)
77 TLI_DEFINE_STRING_INTERNAL("stat64") 78 TLI_DEFINE_STRING_INTERNAL("stat64")
78 /// int statvfs(const char *path, struct statvfs *buf); 79 TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Ptr)
79@@ -1397,6 +1415,9 @@ TLI_DEFINE_STRING_INTERNAL("times") 80@@ -2270,6 +2287,9 @@ TLI_DEFINE_STRING_INTERNAL("tmpfile")
80 TLI_DEFINE_ENUM_INTERNAL(tmpfile) 81 TLI_DEFINE_SIG_INTERNAL(Ptr)
81 TLI_DEFINE_STRING_INTERNAL("tmpfile") 82
82 /// FILE *tmpfile64(void) 83 /// FILE *tmpfile64(void)
83+#ifdef tmpfile64 84+#ifdef tmpfile64
84+#undef tmpfile64 85+#undef tmpfile64
85+#endif 86+#endif
86 TLI_DEFINE_ENUM_INTERNAL(tmpfile64) 87 TLI_DEFINE_ENUM_INTERNAL(tmpfile64)
87 TLI_DEFINE_STRING_INTERNAL("tmpfile64") 88 TLI_DEFINE_STRING_INTERNAL("tmpfile64")
88 /// int toascii(int c); 89 TLI_DEFINE_SIG_INTERNAL(Ptr)
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 564e43f..be25e44 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 d88d1f16df8f3f28246c8fdeb2a3bdb84bfe3121 Mon Sep 17 00:00:00 2001 1From b3f8e09eb814c54899e292ab3d5b3d45420b6221 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,10 +19,10 @@ 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 2c6c55f89d38..77da3d7827dd 100644 22index b1d795a0a349..dbeddeb2152e 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@@ -249,6 +249,13 @@ Typical components:\n\ 25@@ -246,6 +246,13 @@ Typical components:\n\
26 26
27 /// Compute the path to the main executable. 27 /// Compute the path to the main executable.
28 std::string GetExecutablePath(const char *Argv0) { 28 std::string GetExecutablePath(const char *Argv0) {
@@ -36,7 +36,7 @@ index 2c6c55f89d38..77da3d7827dd 100644
36 // This just needs to be some symbol in the binary; C++ doesn't 36 // This just needs to be some symbol in the binary; C++ doesn't
37 // allow taking the address of ::main however. 37 // allow taking the address of ::main however.
38 void *P = (void *)(intptr_t)GetExecutablePath; 38 void *P = (void *)(intptr_t)GetExecutablePath;
39@@ -328,7 +335,7 @@ int main(int argc, char **argv) { 39@@ -325,7 +332,7 @@ int main(int argc, char **argv) {
40 // Compute various directory locations based on the derived location 40 // Compute various directory locations based on the derived location
41 // information. 41 // information.
42 std::string ActivePrefix, ActiveBinDir, ActiveIncludeDir, ActiveLibDir, 42 std::string ActivePrefix, ActiveBinDir, ActiveIncludeDir, ActiveLibDir,
@@ -45,7 +45,7 @@ index 2c6c55f89d38..77da3d7827dd 100644
45 std::string ActiveIncludeOption; 45 std::string ActiveIncludeOption;
46 if (IsInDevelopmentTree) { 46 if (IsInDevelopmentTree) {
47 ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include"; 47 ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include";
48@@ -369,12 +376,18 @@ int main(int argc, char **argv) { 48@@ -366,12 +373,18 @@ int main(int argc, char **argv) {
49 sys::fs::make_absolute(ActivePrefix, Path); 49 sys::fs::make_absolute(ActivePrefix, Path);
50 ActiveBinDir = std::string(Path.str()); 50 ActiveBinDir = std::string(Path.str());
51 } 51 }
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 fb4f3fa..faaaade 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 3f9d367a0f519c04c0a59c6aec49898270860f46 Mon Sep 17 00:00:00 2001 1From f69ded14e5b298919d325cd54fbfbf961c5ba047 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
@@ -14,10 +14,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 1 file changed, 16 insertions(+) 14 1 file changed, 16 insertions(+)
15 15
16diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp 16diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
17index ceb1a982c3a4..69f5a4662732 100644 17index c6fb290ffdb4..2a58f876a68d 100644
18--- a/clang/lib/Driver/ToolChains/Linux.cpp 18--- a/clang/lib/Driver/ToolChains/Linux.cpp
19+++ b/clang/lib/Driver/ToolChains/Linux.cpp 19+++ b/clang/lib/Driver/ToolChains/Linux.cpp
20@@ -508,11 +508,19 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 20@@ -518,11 +518,19 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
21 LibDir = "lib64"; 21 LibDir = "lib64";
22 Loader = 22 Loader =
23 (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1"; 23 (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
@@ -37,7 +37,7 @@ index ceb1a982c3a4..69f5a4662732 100644
37 break; 37 break;
38 case llvm::Triple::riscv32: { 38 case llvm::Triple::riscv32: {
39 StringRef ABIName = tools::riscv::getRISCVABI(Args, Triple); 39 StringRef ABIName = tools::riscv::getRISCVABI(Args, Triple);
40@@ -534,6 +542,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 40@@ -544,6 +552,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
41 case llvm::Triple::sparcv9: 41 case llvm::Triple::sparcv9:
42 LibDir = "lib64"; 42 LibDir = "lib64";
43 Loader = "ld-linux.so.2"; 43 Loader = "ld-linux.so.2";
@@ -48,7 +48,7 @@ index ceb1a982c3a4..69f5a4662732 100644
48 break; 48 break;
49 case llvm::Triple::systemz: 49 case llvm::Triple::systemz:
50 LibDir = "lib"; 50 LibDir = "lib";
51@@ -548,6 +560,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 51@@ -558,6 +570,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
52 52
53 LibDir = X32 ? "libx32" : "lib64"; 53 LibDir = X32 ? "libx32" : "lib64";
54 Loader = X32 ? "ld-linux-x32.so.2" : "ld-linux-x86-64.so.2"; 54 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 a7436f6..f792438 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 8d8ad213bf8683093f95112ba61934dff0d42c52 Mon Sep 17 00:00:00 2001 1From dae3dcb6e1ac2e81dfd7fb9c2459e6041c73c3bb 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
@@ -13,10 +13,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 1 file changed, 6 insertions(+) 13 1 file changed, 6 insertions(+)
14 14
15diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp 15diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
16index f203cae1d329..0b5255a10404 100644 16index 4f2340316654..cc9ed4f6b8ac 100644
17--- a/clang/lib/Driver/ToolChains/Gnu.cpp 17--- a/clang/lib/Driver/ToolChains/Gnu.cpp
18+++ b/clang/lib/Driver/ToolChains/Gnu.cpp 18+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
19@@ -654,6 +654,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, 19@@ -653,6 +653,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
20 if (IsIAMCU) 20 if (IsIAMCU)
21 CmdArgs.push_back("-lgloss"); 21 CmdArgs.push_back("-lgloss");
22 22
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 acc9091..40601d3 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 0004f72d90c276ee934f39706bb101d6d738333f Mon Sep 17 00:00:00 2001 1From 1fb955d17bdc04aec9ac93e620dea87ede4718c6 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
@@ -24,10 +24,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
24 1 file changed, 1 insertion(+), 1 deletion(-) 24 1 file changed, 1 insertion(+), 1 deletion(-)
25 25
26diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp 26diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
27index 69f5a4662732..7555466e7e2b 100644 27index 2a58f876a68d..c68a842b45e0 100644
28--- a/clang/lib/Driver/ToolChains/Linux.cpp 28--- a/clang/lib/Driver/ToolChains/Linux.cpp
29+++ b/clang/lib/Driver/ToolChains/Linux.cpp 29+++ b/clang/lib/Driver/ToolChains/Linux.cpp
30@@ -183,7 +183,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) 30@@ -184,7 +184,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
31 Multilibs = GCCInstallation.getMultilibs(); 31 Multilibs = GCCInstallation.getMultilibs();
32 SelectedMultilib = GCCInstallation.getMultilib(); 32 SelectedMultilib = GCCInstallation.getMultilib();
33 llvm::Triple::ArchType Arch = Triple.getArch(); 33 llvm::Triple::ArchType Arch = Triple.getArch();
diff --git a/recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch b/recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch
index bdc0dd2..3e55700 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 6c3940c923c5554b2b26e09e347e452ba293b391 Mon Sep 17 00:00:00 2001 1From 79ba8f02b706ae8ffb794b0a46844d3726c4e54a 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
@@ -15,7 +15,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
15 1 file changed, 5 insertions(+), 1 deletion(-) 15 1 file changed, 5 insertions(+), 1 deletion(-)
16 16
17diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp 17diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp
18index 7a4319ea680f..3068d25dab75 100644 18index bc70205a6c01..527efd421e01 100644
19--- a/clang/lib/Driver/ToolChain.cpp 19--- a/clang/lib/Driver/ToolChain.cpp
20+++ b/clang/lib/Driver/ToolChain.cpp 20+++ b/clang/lib/Driver/ToolChain.cpp
21@@ -13,6 +13,7 @@ 21@@ -13,6 +13,7 @@
@@ -26,15 +26,15 @@ index 7a4319ea680f..3068d25dab75 100644
26 #include "clang/Config/config.h" 26 #include "clang/Config/config.h"
27 #include "clang/Driver/Action.h" 27 #include "clang/Driver/Action.h"
28 #include "clang/Driver/Driver.h" 28 #include "clang/Driver/Driver.h"
29@@ -458,7 +459,10 @@ StringRef ToolChain::getOSLibName() const { 29@@ -488,7 +489,10 @@ StringRef ToolChain::getOSLibName() const {
30 } 30 }
31 31
32 std::string ToolChain::getCompilerRTPath() const { 32 std::string ToolChain::getCompilerRTPath() const {
33- SmallString<128> Path(getDriver().ResourceDir); 33- SmallString<128> Path(getDriver().ResourceDir);
34+ SmallString<128> Path(getDriver().SysRoot); 34+ SmallString<128> Path(getDriver().SysRoot);
35+ StringRef ClangLibdirSuffix(CLANG_LIBDIR_SUFFIX); 35+ StringRef ClangLibdirBasename(CLANG_INSTALL_LIBDIR_BASENAME);
36+ llvm::sys::path::append(Path, "/usr/", Twine("lib") + ClangLibdirSuffix, "clang", 36+ llvm::sys::path::append(Path, "/usr/", ClangLibdirBasename, "clang",
37+ CLANG_VERSION_STRING); 37+ CLANG_VERSION_STRING);
38 if (Triple.isOSUnknown()) { 38 if (isBareMetal()) {
39 llvm::sys::path::append(Path, "lib"); 39 llvm::sys::path::append(Path, "lib", getOSLibName());
40 } else { 40 Path += SelectedMultilib.gccSuffix();
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 bc66adf..bfc571f 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 349fd23e6ecf8b6290460dd7da2e79cbe2fddf7a Mon Sep 17 00:00:00 2001 1From edd7ad1bf15cb949dd3826054e7b14f010cf6e7d 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
@@ -14,10 +14,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 1 file changed, 7 insertions(+), 7 deletions(-) 14 1 file changed, 7 insertions(+), 7 deletions(-)
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 0b5255a10404..bddc77cde2d6 100644 17index cc9ed4f6b8ac..846163329d92 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@@ -2642,19 +2642,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( 20@@ -2681,19 +2681,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
21 // Whether this library suffix is relevant for the triple. 21 // Whether this library suffix is relevant for the triple.
22 bool Active; 22 bool Active;
23 } Suffixes[] = { 23 } 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 91bc211..1c5b946 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 0680ca156584888a7eddef687e47888369ad70c3 Mon Sep 17 00:00:00 2001 1From a48171a40390b970d3162f0ce90d5a71aacca841 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
@@ -20,10 +20,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
20 1 file changed, 2 insertions(+) 20 1 file changed, 2 insertions(+)
21 21
22diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp 22diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
23index 443725f7d8a8..c8eabfac21dc 100644 23index 0883631dfe98..dfab4075e03e 100644
24--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp 24--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
25+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp 25+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
26@@ -1537,6 +1537,8 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D, 26@@ -1718,6 +1718,8 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D,
27 CmdArgs.push_back("-lunwind"); 27 CmdArgs.push_back("-lunwind");
28 } else if (LGT == LibGccType::StaticLibGcc) { 28 } else if (LGT == LibGccType::StaticLibGcc) {
29 CmdArgs.push_back("-l:libunwind.a"); 29 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 1752b49..21e96df 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 e47a0db499655d06965e517f2aca297fb9c7ef8d Mon Sep 17 00:00:00 2001 1From 443b2d8bad07bd3404a591c58e8ae65b26127bbd 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
@@ -10,14 +10,14 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
10 1 file changed, 1 insertion(+) 10 1 file changed, 1 insertion(+)
11 11
12diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake 12diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake
13index 52b893dd0214..4399cec3e19a 100644 13index a46a0fd630b0..55f6dba2901a 100644
14--- a/llvm/cmake/modules/CrossCompile.cmake 14--- a/llvm/cmake/modules/CrossCompile.cmake
15+++ b/llvm/cmake/modules/CrossCompile.cmake 15+++ b/llvm/cmake/modules/CrossCompile.cmake
16@@ -84,6 +84,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype) 16@@ -86,6 +86,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype)
17 -DLLVM_ENABLE_RUNTIMES="${llvm_enable_runtimes_arg}"
18 ${external_project_source_dirs}
19 -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN="${LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN}" 17 -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN="${LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN}"
20+ -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" 18 -DLLVM_INCLUDE_BENCHMARKS=OFF
19 -DLLVM_INCLUDE_TESTS=OFF
20+ -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}"
21 ${build_type_flags} ${linker_flag} ${external_clang_dir} 21 ${build_type_flags} ${linker_flag} ${external_clang_dir}
22 ${ARGN} 22 ${ARGN}
23 WORKING_DIRECTORY ${${project_name}_${target_name}_BUILD} 23 WORKING_DIRECTORY ${${project_name}_${target_name}_BUILD}
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 d0fa1df..2c51e89 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 4686a186fa1b70adc646eb10fe293f47a397071b Mon Sep 17 00:00:00 2001 1From b9b3041b7bbadef16b3572187b8b5c7b3f4986c9 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
@@ -15,7 +15,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
15 1 file changed, 2 insertions(+), 1 deletion(-) 15 1 file changed, 2 insertions(+), 1 deletion(-)
16 16
17diff --git a/llvm/cmake/modules/CheckAtomic.cmake b/llvm/cmake/modules/CheckAtomic.cmake 17diff --git a/llvm/cmake/modules/CheckAtomic.cmake b/llvm/cmake/modules/CheckAtomic.cmake
18index 3c5ba72993a3..34a1b950bbed 100644 18index f11cadf39ff6..80a18a92956a 100644
19--- a/llvm/cmake/modules/CheckAtomic.cmake 19--- a/llvm/cmake/modules/CheckAtomic.cmake
20+++ b/llvm/cmake/modules/CheckAtomic.cmake 20+++ b/llvm/cmake/modules/CheckAtomic.cmake
21@@ -30,10 +30,11 @@ function(check_working_cxx_atomics64 varname) 21@@ -30,10 +30,11 @@ function(check_working_cxx_atomics64 varname)
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 1e818d4..6e87bea 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 c99af87e7ff2088c2fabdae236fa142fbe415ec8 Mon Sep 17 00:00:00 2001 1From 8d03b99e91a47925eae5056b355e23b548e97732 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 9abf548abbb9..a16c529781c6 100644 17index 9ff2a62e9394..e76625d5a5ac 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@@ -199,7 +199,7 @@ if (LIBCXX_ENABLE_SHARED) 20@@ -200,7 +200,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 9abf548abbb9..a16c529781c6 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@@ -283,7 +283,7 @@ if (LIBCXX_ENABLE_STATIC) 29@@ -294,7 +294,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 06df244..5197490 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 a85b06f3aa67a35b65fe2742d6ca53c949235198 Mon Sep 17 00:00:00 2001 1From 8340042f1213d72fde9c8545de2ba47d1729d865 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
@@ -22,20 +22,20 @@ This is due to the fact that currently the cmake scripts look for target
22binaries in sysroot. Work around this by not exporting the target binaries in 22binaries in sysroot. Work around this by not exporting the target binaries in
23Exports-* cmake files. 23Exports-* cmake files.
24 24
25Upstream-Status: Inappropriate [oe-specific] 25Upstream-Status: Innapropriate [oe-specific]
26 26
27Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> 27Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
28--- 28---
29 clang/cmake/modules/AddClang.cmake | 2 -- 29 clang/cmake/modules/AddClang.cmake | 2 --
30 llvm/cmake/modules/AddLLVM.cmake | 6 ------ 30 llvm/cmake/modules/AddLLVM.cmake | 6 ------
31 llvm/cmake/modules/TableGen.cmake | 7 ------- 31 llvm/cmake/modules/TableGen.cmake | 6 ------
32 3 files changed, 15 deletions(-) 32 3 files changed, 14 deletions(-)
33 33
34diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake 34diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake
35index 21ac332e4f5f..86c93cfec59d 100644 35index 75b0080f6715..ddf446a13eca 100644
36--- a/clang/cmake/modules/AddClang.cmake 36--- a/clang/cmake/modules/AddClang.cmake
37+++ b/clang/cmake/modules/AddClang.cmake 37+++ b/clang/cmake/modules/AddClang.cmake
38@@ -165,7 +165,6 @@ macro(add_clang_tool name) 38@@ -168,7 +168,6 @@ macro(add_clang_tool name)
39 if (CLANG_BUILD_TOOLS) 39 if (CLANG_BUILD_TOOLS)
40 get_target_export_arg(${name} Clang export_to_clangtargets) 40 get_target_export_arg(${name} Clang export_to_clangtargets)
41 install(TARGETS ${name} 41 install(TARGETS ${name}
@@ -43,7 +43,7 @@ index 21ac332e4f5f..86c93cfec59d 100644
43 RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" 43 RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
44 COMPONENT ${name}) 44 COMPONENT ${name})
45 45
46@@ -174,7 +173,6 @@ macro(add_clang_tool name) 46@@ -177,7 +176,6 @@ macro(add_clang_tool name)
47 DEPENDS ${name} 47 DEPENDS ${name}
48 COMPONENT ${name}) 48 COMPONENT ${name})
49 endif() 49 endif()
@@ -52,10 +52,10 @@ index 21ac332e4f5f..86c93cfec59d 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 057431208322..e7c77e824d58 100644 55index 9eef4eb7e35d..5bde133cdceb 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@@ -1299,7 +1299,6 @@ macro(llvm_add_tool project name) 58@@ -1335,7 +1335,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 057431208322..e7c77e824d58 100644
63 RUNTIME DESTINATION ${${project}_TOOLS_INSTALL_DIR} 63 RUNTIME DESTINATION ${${project}_TOOLS_INSTALL_DIR}
64 COMPONENT ${name}) 64 COMPONENT ${name})
65 65
66@@ -1310,9 +1309,6 @@ macro(llvm_add_tool project name) 66@@ -1346,9 +1345,6 @@ macro(llvm_add_tool project name)
67 endif() 67 endif()
68 endif() 68 endif()
69 endif() 69 endif()
@@ -73,7 +73,7 @@ index 057431208322..e7c77e824d58 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@@ -1357,7 +1353,6 @@ macro(add_llvm_utility name) 76@@ -1393,7 +1389,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 057431208322..e7c77e824d58 100644
81 RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR} 81 RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR}
82 COMPONENT ${name}) 82 COMPONENT ${name})
83 83
84@@ -1366,7 +1361,6 @@ macro(add_llvm_utility name) 84@@ -1402,7 +1397,6 @@ macro(add_llvm_utility name)
85 DEPENDS ${name} 85 DEPENDS ${name}
86 COMPONENT ${name}) 86 COMPONENT ${name})
87 endif() 87 endif()
@@ -90,27 +90,26 @@ index 057431208322..e7c77e824d58 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 4711456776c8..857392499525 100644 93index 70c2edb8c833..e012fea08982 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@@ -187,14 +187,8 @@ macro(add_tablegen target project) 96@@ -189,12 +189,7 @@ macro(add_tablegen target project)
97 endif()
98 97
99 if ((${project} STREQUAL LLVM OR ${project} STREQUAL MLIR) AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_UTILS) 98 if (ADD_TABLEGEN_DESTINATION AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND
100- set(export_to_llvmexports) 99 (LLVM_BUILD_UTILS OR ${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS))
101- if(${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR 100- set(export_arg)
102- NOT LLVM_DISTRIBUTION_COMPONENTS) 101- if(ADD_TABLEGEN_EXPORT)
103- set(export_to_llvmexports EXPORT LLVMExports) 102- get_target_export_arg(${target} ${ADD_TABLEGEN_EXPORT} export_arg)
104- endif() 103- endif()
105
106 install(TARGETS ${target} 104 install(TARGETS ${target}
107- ${export_to_llvmexports} 105- ${export_arg}
108 COMPONENT ${target} 106 COMPONENT ${target}
109 RUNTIME DESTINATION "${${project}_TOOLS_INSTALL_DIR}") 107 RUNTIME DESTINATION "${ADD_TABLEGEN_DESTINATION}")
110 if(NOT LLVM_ENABLE_IDE) 108 if(NOT LLVM_ENABLE_IDE)
111@@ -203,5 +197,4 @@ macro(add_tablegen target project) 109@@ -205,6 +200,5 @@ macro(add_tablegen target project)
112 COMPONENT ${target}) 110 endif()
113 endif() 111 if(ADD_TABLEGEN_EXPORT)
112 string(TOUPPER ${ADD_TABLEGEN_EXPORT} export_upper)
113- set_property(GLOBAL APPEND PROPERTY ${export_upper}_EXPORTS ${target})
114 endif() 114 endif()
115- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${target})
116 endmacro() 115 endmacro()
diff --git a/recipes-devtools/clang/clang/0016-clang-Fix-resource-dir-location-for-cross-toolchains.patch b/recipes-devtools/clang/clang/0016-clang-Fix-resource-dir-location-for-cross-toolchains.patch
index 8172927..bbbb365 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 96c42b814881a7548d3d6a74423bf47b85482ca9 Mon Sep 17 00:00:00 2001 1From 5e8f81f47c4e7f944c22900c7f388ec0e57a678e 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
@@ -19,10 +19,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
19 1 file changed, 7 insertions(+), 1 deletion(-) 19 1 file changed, 7 insertions(+), 1 deletion(-)
20 20
21diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp 21diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
22index 3f29afd35971..45f2e0bede97 100644 22index a268f2fa8fc5..ab813044dc8c 100644
23--- a/clang/lib/Driver/Driver.cpp 23--- a/clang/lib/Driver/Driver.cpp
24+++ b/clang/lib/Driver/Driver.cpp 24+++ b/clang/lib/Driver/Driver.cpp
25@@ -179,7 +179,13 @@ std::string Driver::GetResourcesPath(StringRef BinaryPath, 25@@ -181,7 +181,13 @@ std::string Driver::GetResourcesPath(StringRef BinaryPath,
26 // With a static-library build of libclang, LibClangPath will contain the 26 // With a static-library build of libclang, LibClangPath will contain the
27 // path of the embedding binary, which for LLVM binaries will be in bin/. 27 // path of the embedding binary, which for LLVM binaries will be in bin/.
28 // ../lib gets us to lib/ in both cases. 28 // ../lib gets us to lib/ in both cases.
@@ -34,6 +34,6 @@ index 3f29afd35971..45f2e0bede97 100644
34+ Dir = std::string(llvm::sys::path::parent_path(Dir)); 34+ Dir = std::string(llvm::sys::path::parent_path(Dir));
35+ } 35+ }
36+ P = Dir; 36+ P = Dir;
37 llvm::sys::path::append(P, Twine("lib") + CLANG_LIBDIR_SUFFIX, "clang", 37 llvm::sys::path::append(P, CLANG_INSTALL_LIBDIR_BASENAME, "clang",
38 CLANG_VERSION_STRING); 38 CLANG_VERSION_MAJOR_STRING);
39 } 39 }
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 bb4e1c8..8d49729 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 1669b300c9460e1cf1ebcff9ee9bfb7e499c9d95 Mon Sep 17 00:00:00 2001 1From 18cb0737f26205ee004470a7dc4182d1a205db82 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
@@ -18,10 +18,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
18 1 file changed, 8 insertions(+), 8 deletions(-) 18 1 file changed, 8 insertions(+), 8 deletions(-)
19 19
20diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp 20diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
21index 7555466e7e2b..27951858fb5d 100644 21index c68a842b45e0..ca9f5f2e4f74 100644
22--- a/clang/lib/Driver/ToolChains/Linux.cpp 22--- a/clang/lib/Driver/ToolChains/Linux.cpp
23+++ b/clang/lib/Driver/ToolChains/Linux.cpp 23+++ b/clang/lib/Driver/ToolChains/Linux.cpp
24@@ -508,8 +508,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 24@@ -518,8 +518,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
25 LibDir = "lib64"; 25 LibDir = "lib64";
26 Loader = 26 Loader =
27 (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1"; 27 (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
@@ -32,7 +32,7 @@ index 7555466e7e2b..27951858fb5d 100644
32 LibDir = "lib"; 32 LibDir = "lib";
33 } 33 }
34 break; 34 break;
35@@ -517,8 +517,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 35@@ -527,8 +527,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
36 LibDir = "lib64"; 36 LibDir = "lib64";
37 Loader = 37 Loader =
38 (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2"; 38 (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2";
@@ -43,7 +43,7 @@ index 7555466e7e2b..27951858fb5d 100644
43 LibDir = "lib"; 43 LibDir = "lib";
44 } 44 }
45 break; 45 break;
46@@ -542,8 +542,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 46@@ -552,8 +552,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
47 case llvm::Triple::sparcv9: 47 case llvm::Triple::sparcv9:
48 LibDir = "lib64"; 48 LibDir = "lib64";
49 Loader = "ld-linux.so.2"; 49 Loader = "ld-linux.so.2";
@@ -54,7 +54,7 @@ index 7555466e7e2b..27951858fb5d 100644
54 LibDir = "lib"; 54 LibDir = "lib";
55 } 55 }
56 break; 56 break;
57@@ -560,8 +560,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 57@@ -570,8 +570,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
58 58
59 LibDir = X32 ? "libx32" : "lib64"; 59 LibDir = X32 ? "libx32" : "lib64";
60 Loader = X32 ? "ld-linux-x32.so.2" : "ld-linux-x86-64.so.2"; 60 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 0375916..f2e2e1c 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 88fb7548f93674b4ec1e5e7f3e096791bd32ed42 Mon Sep 17 00:00:00 2001 1From 0de83e5b83308362248261fa0d89a766cd8b2aca 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,14 +10,12 @@ 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/add_new_check.py | 2 +-
14 clang-tools-extra/clang-tidy/rename_check.py | 2 +-
15 clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py | 2 +- 13 clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py | 2 +-
16 clang/tools/scan-view/bin/scan-view | 2 +- 14 clang/tools/scan-view/bin/scan-view | 2 +-
17 5 files changed, 5 insertions(+), 5 deletions(-) 15 3 files changed, 3 insertions(+), 3 deletions(-)
18 16
19diff --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 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
20index 8655af137bb2..e95ba59a421c 100755 18index a0fa64592e62..27aa97a35571 100755
21--- a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py 19--- a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py
22+++ b/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
23@@ -1,4 +1,4 @@ 21@@ -1,4 +1,4 @@
@@ -26,26 +24,6 @@ index 8655af137bb2..e95ba59a421c 100755
26 # 24 #
27 #=- run-find-all-symbols.py - Parallel find-all-symbols runner -*- python -*-=# 25 #=- run-find-all-symbols.py - Parallel find-all-symbols runner -*- python -*-=#
28 # 26 #
29diff --git a/clang-tools-extra/clang-tidy/add_new_check.py b/clang-tools-extra/clang-tidy/add_new_check.py
30index 19b6896e508f..a85767acdce9 100644
31--- a/clang-tools-extra/clang-tidy/add_new_check.py
32+++ b/clang-tools-extra/clang-tidy/add_new_check.py
33@@ -1,4 +1,4 @@
34-#!/usr/bin/env python
35+#!/usr/bin/env python3
36 #
37 #===- add_new_check.py - clang-tidy check generator ---------*- python -*--===#
38 #
39diff --git a/clang-tools-extra/clang-tidy/rename_check.py b/clang-tools-extra/clang-tidy/rename_check.py
40index 9c2021751e0e..4bb9af8cbe0a 100755
41--- a/clang-tools-extra/clang-tidy/rename_check.py
42+++ b/clang-tools-extra/clang-tidy/rename_check.py
43@@ -1,4 +1,4 @@
44-#!/usr/bin/env python
45+#!/usr/bin/env python3
46 #
47 #===- rename_check.py - clang-tidy check renamer ------------*- python -*--===#
48 #
49diff --git a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py 27diff --git a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
50index a26d2144b7f9..396a201b667e 100755 28index a26d2144b7f9..396a201b667e 100755
51--- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py 29--- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
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 a5957fd..97da817 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 c9b225aeeb3d2b1d98d823c9a6c8afc613fc932b Mon Sep 17 00:00:00 2001 1From bc82ba9cb65f3aacdaa4e5c473603d89dfcc9a29 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
@@ -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 bddc77cde2d6..5b4271b58337 100644 60index 846163329d92..0db37c6ef1a8 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@@ -2224,6 +2224,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( 63@@ -2254,6 +2254,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 1667a96..60caae8 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 77c05d78ece8599932dc7c53aa43d153471ea13c Mon Sep 17 00:00:00 2001 1From e8560dd482e3b7f89a5fd1ab7b53738dace4b126 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
@@ -17,10 +17,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
17 2 files changed, 2 insertions(+), 2 deletions(-) 17 2 files changed, 2 insertions(+), 2 deletions(-)
18 18
19diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake 19diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
20index cd45176cf2ba..73948a0274cd 100644 20index 5f51befc1973..55c04b76908e 100644
21--- a/compiler-rt/cmake/config-ix.cmake 21--- a/compiler-rt/cmake/config-ix.cmake
22+++ b/compiler-rt/cmake/config-ix.cmake 22+++ b/compiler-rt/cmake/config-ix.cmake
23@@ -160,7 +160,7 @@ else() 23@@ -179,7 +179,7 @@ else()
24 set(MAYBE_REQUIRED) 24 set(MAYBE_REQUIRED)
25 endif() 25 endif()
26 if(LLVM_ENABLE_TERMINFO) 26 if(LLVM_ENABLE_TERMINFO)
@@ -30,7 +30,7 @@ index cd45176cf2ba..73948a0274cd 100644
30 if(COMPILER_RT_TERMINFO_LIB) 30 if(COMPILER_RT_TERMINFO_LIB)
31 set(LLVM_ENABLE_TERMINFO 1) 31 set(LLVM_ENABLE_TERMINFO 1)
32diff --git a/llvm/cmake/modules/FindTerminfo.cmake b/llvm/cmake/modules/FindTerminfo.cmake 32diff --git a/llvm/cmake/modules/FindTerminfo.cmake b/llvm/cmake/modules/FindTerminfo.cmake
33index 65edb80fa69a..a58180be8926 100644 33index eef1f95853eb..b3b330dd3d59 100644
34--- a/llvm/cmake/modules/FindTerminfo.cmake 34--- a/llvm/cmake/modules/FindTerminfo.cmake
35+++ b/llvm/cmake/modules/FindTerminfo.cmake 35+++ b/llvm/cmake/modules/FindTerminfo.cmake
36@@ -11,7 +11,7 @@ 36@@ -11,7 +11,7 @@
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 3e0a49c..48de8c1 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 addc8d02106241de5c0913fa302c4cca8c6f95ec Mon Sep 17 00:00:00 2001 1From 81e81bbbafdd380bcb3cbdbbefdebf9c18cf8721 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
@@ -14,14 +14,14 @@ Upstream-Status: Inappropriate [OE-specific]
14Signed-off-by: Khem Raj <raj.khem@gmail.com> 14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15Signed-off-by: Martin Jansa <martin.jansa@gmail.com> 15Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
16--- 16---
17 llvm/lib/Support/Triple.cpp | 2 +- 17 llvm/lib/TargetParser/Triple.cpp | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-) 18 1 file changed, 1 insertion(+), 1 deletion(-)
19 19
20diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp 20diff --git a/llvm/lib/TargetParser/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp
21index 6696d158b2c1..c5aea898ab24 100644 21index a68035989a93..ab1fef23d6fc 100644
22--- a/llvm/lib/Support/Triple.cpp 22--- a/llvm/lib/TargetParser/Triple.cpp
23+++ b/llvm/lib/Support/Triple.cpp 23+++ b/llvm/lib/TargetParser/Triple.cpp
24@@ -542,7 +542,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) { 24@@ -551,7 +551,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 529578d..2edf616 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 e83ac76ea900deb1b12ad97e1241f67c305a9c04 Mon Sep 17 00:00:00 2001 1From 66cd1dc5aed351a422ac29f503b348598a8d53ad 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 2b84007..5c6d430 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 54a8c40d02d02e169f0e646e419e7f72305646af Mon Sep 17 00:00:00 2001 1From 24a2776f0ea951b48f3df9f3d33230776bed97bd 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
@@ -12,10 +12,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
12 1 file changed, 3 insertions(+) 12 1 file changed, 3 insertions(+)
13 13
14diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp 14diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
15index 27951858fb5d..aac45650f97b 100644 15index ca9f5f2e4f74..20c7c7a745be 100644
16--- a/clang/lib/Driver/ToolChains/Linux.cpp 16--- a/clang/lib/Driver/ToolChains/Linux.cpp
17+++ b/clang/lib/Driver/ToolChains/Linux.cpp 17+++ b/clang/lib/Driver/ToolChains/Linux.cpp
18@@ -657,6 +657,9 @@ void Linux::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, 18@@ -667,6 +667,9 @@ void Linux::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
19 GCCInstallation.getTriple().getArch() == llvm::Triple::x86 19 GCCInstallation.getTriple().getArch() == llvm::Triple::x86
20 ? "i386-linux-gnu" 20 ? "i386-linux-gnu"
21 : TripleStr; 21 : TripleStr;
diff --git a/recipes-devtools/clang/clang/0024-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch b/recipes-devtools/clang/clang/0024-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch
deleted file mode 100644
index 02203b7..0000000
--- a/recipes-devtools/clang/clang/0024-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1From 458b502f8fabf9559d5323225a9ce746fabc05e7 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 19 May 2021 21:49:18 -0700
4Subject: [PATCH] compiler-rt: Link scudo with SANITIZER_CXX_ABI_LIBRARIES
5
6If SANITIZER_CXX_ABI_LIBRARIES is set then link scudo with it, this
7fixes build time errors like
8
9projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.armhf.dir/sanitizer_posix_libcdep.cpp.o: in function `__sanitizer::UnsetAlternateSignalStack()':
10| sanitizer_posix_libcdep.cpp:(.text+0x3d2): undefined reference to `__cxa_guard_acquire'
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 compiler-rt/lib/scudo/CMakeLists.txt | 1 +
15 1 file changed, 1 insertion(+)
16
17diff --git a/compiler-rt/lib/scudo/CMakeLists.txt b/compiler-rt/lib/scudo/CMakeLists.txt
18index 31a6976960f7..8f3e291960b0 100644
19--- a/compiler-rt/lib/scudo/CMakeLists.txt
20+++ b/compiler-rt/lib/scudo/CMakeLists.txt
21@@ -15,6 +15,7 @@ append_list_if(COMPILER_RT_HAS_LIBDL dl SCUDO_MINIMAL_DYNAMIC_LIBS)
22 append_list_if(COMPILER_RT_HAS_LIBRT rt SCUDO_MINIMAL_DYNAMIC_LIBS)
23 append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread SCUDO_MINIMAL_DYNAMIC_LIBS)
24 append_list_if(COMPILER_RT_HAS_LIBLOG log SCUDO_MINIMAL_DYNAMIC_LIBS)
25+append_list_if(SANITIZER_CXX_ABI_LIBRARIES ${SANITIZER_CXX_ABI_LIBRARIES} SCUDO_MINIMAL_DYNAMIC_LIBS)
26 append_list_if(COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG -fno-omit-frame-pointer
27 SCUDO_CFLAGS)
28
diff --git a/recipes-devtools/clang/clang/0025-libunwind-Added-unw_backtrace-method.patch b/recipes-devtools/clang/clang/0024-libunwind-Added-unw_backtrace-method.patch
index 597c065..9d6f74f 100644
--- a/recipes-devtools/clang/clang/0025-libunwind-Added-unw_backtrace-method.patch
+++ b/recipes-devtools/clang/clang/0024-libunwind-Added-unw_backtrace-method.patch
@@ -1,4 +1,4 @@
1From 85855552afe94097eaaa0adf904d016af66b3424 Mon Sep 17 00:00:00 2001 1From b75d3ed8f09ee013809a4321ff21b3bfb7e4a467 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
@@ -12,7 +12,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
12 2 files changed, 19 insertions(+) 12 2 files changed, 19 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 f878b46f0348..d922f84011ee 100644 15index d2ad5ab87122..d735d955aee2 100644
16--- a/libunwind/include/libunwind.h 16--- a/libunwind/include/libunwind.h
17+++ b/libunwind/include/libunwind.h 17+++ b/libunwind/include/libunwind.h
18@@ -130,6 +130,7 @@ extern int unw_is_fpreg(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL; 18@@ -130,6 +130,7 @@ extern int unw_is_fpreg(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL;
@@ -24,10 +24,10 @@ index f878b46f0348..d922f84011ee 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 b8b41ff25e54..ca7d9a01e631 100644 27index 0faea2b78570..14bf07d8f470 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@@ -338,7 +338,25 @@ void __unw_remove_dynamic_eh_frame_section(unw_word_t eh_frame_start) { 30@@ -349,7 +349,25 @@ void __unw_remove_dynamic_eh_frame_section(unw_word_t eh_frame_start) {
31 #endif // defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) 31 #endif // defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
32 #endif // !defined(__USING_SJLJ_EXCEPTIONS__) 32 #endif // !defined(__USING_SJLJ_EXCEPTIONS__)
33 33
diff --git a/recipes-devtools/clang/clang/0026-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 a4fb181..d19d165 100644
--- a/recipes-devtools/clang/clang/0026-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 176d5b0f6a46f015854eb48f34922bc34a999d2f Mon Sep 17 00:00:00 2001 1From 0a80036efcec431252a1e8a521e7aab3df11c8fc 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 5b4271b58337..107ab8d78598 100644 19index 0db37c6ef1a8..80a21d58c86c 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@@ -3049,7 +3049,9 @@ Generic_GCC::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, 22@@ -3093,7 +3093,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/0027-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 35f4cfe..159f850 100644
--- a/recipes-devtools/clang/clang/0027-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 e58c09f18c4489ed414c2921a37e6e977141b93a Mon Sep 17 00:00:00 2001 1From 86ffd52656788e0566f082b856f5dfad6db6e288 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
@@ -31,10 +31,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
31 1 file changed, 28 insertions(+), 11 deletions(-) 31 1 file changed, 28 insertions(+), 11 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 107ab8d78598..b5ee01c566e3 100644 34index 80a21d58c86c..77f5c3f58a8b 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@@ -1737,18 +1737,29 @@ static void findRISCVMultilibs(const Driver &D, 37@@ -1748,18 +1748,29 @@ 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());
@@ -74,7 +74,7 @@ index 107ab8d78598..b5ee01c566e3 100644
74 74
75 Multilib::flags_list Flags; 75 Multilib::flags_list Flags;
76 bool IsRV64 = TargetTriple.getArch() == llvm::Triple::riscv64; 76 bool IsRV64 = TargetTriple.getArch() == llvm::Triple::riscv64;
77@@ -2674,13 +2685,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( 77@@ -2713,13 +2724,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
78 continue; // Saw this path before; no need to look at it again. 78 continue; // Saw this path before; no need to look at it again.
79 if (CandidateVersion.isOlderThan(4, 1, 1)) 79 if (CandidateVersion.isOlderThan(4, 1, 1))
80 continue; 80 continue;
diff --git a/recipes-devtools/clang/clang/0028-Fix-lib-paths-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0027-Fix-lib-paths-for-OpenEmbedded-Host.patch
index d3db1eb..e01fa6f 100644
--- a/recipes-devtools/clang/clang/0028-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 a1ef24c4217263bc4914e5e1ad21da79211ea4cc Mon Sep 17 00:00:00 2001 1From ee326805d679fdf2d9bbbbb8827f17a280ff00db 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 b5ee01c566e3..f9dce01b579f 100644 51index 77f5c3f58a8b..0ec2dadafc05 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@@ -23,6 +23,7 @@ 54@@ -18,6 +18,7 @@
55 #include "clang/Driver/Options.h" 55 #include "Linux.h"
56 #include "clang/Driver/Tool.h" 56 #include "clang/Config/config.h" // for GCC_INSTALL_PREFIX
57 #include "clang/Driver/ToolChain.h" 57 #include "clang/Driver/Compilation.h"
58+#include "clang/Driver/Distro.h" 58+#include "clang/Driver/Distro.h"
59 #include "llvm/Option/ArgList.h" 59 #include "clang/Driver/Driver.h"
60 #include "llvm/Support/CodeGen.h" 60 #include "clang/Driver/DriverDiagnostic.h"
61 #include "llvm/Support/Path.h" 61 #include "clang/Driver/Options.h"
62@@ -2643,6 +2644,7 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( 62@@ -2682,6 +2683,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 b5ee01c566e3..f9dce01b579f 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@@ -2660,7 +2662,8 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( 70@@ -2699,7 +2701,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/0029-Correct-library-search-path-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0028-Correct-library-search-path-for-OpenEmbedded-Host.patch
index 80710fc..7e7afbd 100644
--- a/recipes-devtools/clang/clang/0029-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 8691b31bfbebf0b5ad31f7f164470b2d3d17b15d Mon Sep 17 00:00:00 2001 1From d1aa73e650483447ba96fed6837294a27a6dfd96 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 01d66b30b038..4d5aa366a005 100644 42index 1aaf93ddb7c4..31f03e327b78 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 01d66b30b038..4d5aa366a005 100644
50 OpenSUSE, 50 OpenSUSE,
51 UbuntuHardy, 51 UbuntuHardy,
52 UbuntuIntrepid, 52 UbuntuIntrepid,
53@@ -134,6 +135,7 @@ public: 53@@ -135,6 +136,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 01d66b30b038..4d5aa366a005 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 1898667279cc..ab7bc8d45ac1 100644 62index 87a0c5a58511..b607a3f18d1e 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,10 +71,10 @@ index 1898667279cc..ab7bc8d45ac1 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 aac45650f97b..3c4034ea4921 100644 74index 20c7c7a745be..f5d9b3187cf5 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@@ -77,6 +77,7 @@ std::string Linux::getMultiarchTriple(const Driver &D, 77@@ -78,6 +78,7 @@ std::string Linux::getMultiarchTriple(const Driver &D,
78 return "x86_64-linux-android"; 78 return "x86_64-linux-android";
79 if (TargetEnvironment == llvm::Triple::GNUX32) 79 if (TargetEnvironment == llvm::Triple::GNUX32)
80 return "x86_64-linux-gnux32"; 80 return "x86_64-linux-gnux32";
diff --git a/recipes-devtools/clang/clang/0030-lldb-Link-with-libatomic-on-x86.patch b/recipes-devtools/clang/clang/0029-lldb-Link-with-libatomic-on-x86.patch
index e81f945..bbcfe57 100644
--- a/recipes-devtools/clang/clang/0030-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 d63ad7dc689b4c6e7d30614bc70ab43f4c50c62c Mon Sep 17 00:00:00 2001 1From 7bbc8ca2768b3863e72df5b44da33f9bcb80e30f 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 1a92c033fac4..a0d8f3288c06 100644 20index 89acd7cd2eaf..6aa84f9d284d 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/0031-clang-exclude-openembedded-distributions-from-settin.patch b/recipes-devtools/clang/clang/0030-clang-exclude-openembedded-distributions-from-settin.patch
index 59723ea..ada430c 100644
--- a/recipes-devtools/clang/clang/0031-clang-exclude-openembedded-distributions-from-settin.patch
+++ b/recipes-devtools/clang/clang/0030-clang-exclude-openembedded-distributions-from-settin.patch
@@ -1,4 +1,4 @@
1From 556bf92b3b502cc1eeb9a435c241ca2ce3f6968b Mon Sep 17 00:00:00 2001 1From 2e602dffe1074aa66c37f28a735559982429b5a3 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 11 Feb 2022 12:29:14 -0800 3Date: Fri, 11 Feb 2022 12:29:14 -0800
4Subject: [PATCH] clang: exclude openembedded distributions from setting rpath 4Subject: [PATCH] clang: exclude openembedded distributions from setting rpath
@@ -18,10 +18,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
18 1 file changed, 5 insertions(+) 18 1 file changed, 5 insertions(+)
19 19
20diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp 20diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
21index c8eabfac21dc..6e1e626a90ea 100644 21index dfab4075e03e..14c6f0a3b21d 100644
22--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp 22--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
23+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp 23+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
24@@ -649,6 +649,11 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args, 24@@ -794,6 +794,11 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args,
25 void tools::addOpenMPRuntimeSpecificRPath(const ToolChain &TC, 25 void tools::addOpenMPRuntimeSpecificRPath(const ToolChain &TC,
26 const ArgList &Args, 26 const ArgList &Args,
27 ArgStringList &CmdArgs) { 27 ArgStringList &CmdArgs) {
diff --git a/recipes-devtools/clang/clang/0032-compiler-rt-Enable-__int128-for-ppc32.patch b/recipes-devtools/clang/clang/0031-compiler-rt-Enable-__int128-for-ppc32.patch
index ba839c8..6a6ceda 100644
--- a/recipes-devtools/clang/clang/0032-compiler-rt-Enable-__int128-for-ppc32.patch
+++ b/recipes-devtools/clang/clang/0031-compiler-rt-Enable-__int128-for-ppc32.patch
@@ -1,4 +1,4 @@
1From c9784a9dff18bce24e68f8d5654c57c2345babff Mon Sep 17 00:00:00 2001 1From 14b9c872b5c07039a1638c299c916b3c0eeebf55 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 ec668e294d6d..72556d2fc58e 100644 14index 5e2274d52256..70cd43c69fd3 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@@ -628,11 +628,9 @@ set(mips64_SOURCES ${GENERIC_TF_SOURCES} 17@@ -670,11 +670,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,7 +27,7 @@ index ec668e294d6d..72556d2fc58e 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@@ -647,14 +645,15 @@ set(powerpc64_SOURCES 30@@ -689,14 +687,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 ${CMAKE_SYSTEM_NAME} MATCHES "AIX")
@@ -45,8 +45,8 @@ index ec668e294d6d..72556d2fc58e 100644
45+set(powerpc64_SOURCES ${powerpc_SOURCES}) 45+set(powerpc64_SOURCES ${powerpc_SOURCES})
46 46
47 set(riscv_SOURCES 47 set(riscv_SOURCES
48 riscv/save.S 48 riscv/fp_mode.c
49@@ -761,9 +760,9 @@ else () 49@@ -809,9 +808,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
@@ -59,15 +59,15 @@ index ec668e294d6d..72556d2fc58e 100644
59 endif() 59 endif()
60 60
61diff --git a/compiler-rt/lib/builtins/int_types.h b/compiler-rt/lib/builtins/int_types.h 61diff --git a/compiler-rt/lib/builtins/int_types.h b/compiler-rt/lib/builtins/int_types.h
62index 7a72de480676..9ee5a327b28a 100644 62index e94d3154c6d4..37b2cb43f932 100644
63--- a/compiler-rt/lib/builtins/int_types.h 63--- a/compiler-rt/lib/builtins/int_types.h
64+++ b/compiler-rt/lib/builtins/int_types.h 64+++ b/compiler-rt/lib/builtins/int_types.h
65@@ -64,7 +64,7 @@ typedef union { 65@@ -64,7 +64,7 @@ typedef union {
66 } udwords; 66 } udwords;
67 67
68 #if defined(__LP64__) || defined(__wasm__) || defined(__mips64) || \ 68 #if defined(__LP64__) || defined(__wasm__) || defined(__mips64) || \
69- defined(__riscv) || defined(_WIN64) 69- defined(__SIZEOF_INT128__) || defined(_WIN64)
70+ defined(__riscv) || defined(_WIN64) || defined(__powerpc__) 70+ defined(__SIZEOF_INT128__) || defined(_WIN64) || defined(__powerpc__)
71 #define CRT_HAS_128BIT 71 #define CRT_HAS_128BIT
72 #endif 72 #endif
73 73
diff --git a/recipes-devtools/clang/clang/0033-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch b/recipes-devtools/clang/clang/0032-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch
index 1cea38c..e0d5790 100644
--- a/recipes-devtools/clang/clang/0033-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch
+++ b/recipes-devtools/clang/clang/0032-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch
@@ -1,4 +1,4 @@
1From fde148342b7475a1d83cf270db1c912a22d950f7 Mon Sep 17 00:00:00 2001 1From a333802272d875cc580b4f67e28205dfb0d40d3f 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
@@ -17,9 +17,11 @@ format
17Upstream-Status: Inappropriate [OE-Specific] 17Upstream-Status: Inappropriate [OE-Specific]
18Signed-off-by: Khem Raj <raj.khem@gmail.com> 18Signed-off-by: Khem Raj <raj.khem@gmail.com>
19--- 19---
20 llvm/lib/Support/CMakeLists.txt | 2 +- 20 llvm/lib/Support/CMakeLists.txt | 8 ++++----
21 1 file changed, 1 insertion(+), 1 deletion(-) 21 1 file changed, 4 insertions(+), 4 deletions(-)
22 22
23diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt
24index 4cbc3b79f3bb..08c4bfd5efc1 100644
23--- a/llvm/lib/Support/CMakeLists.txt 25--- a/llvm/lib/Support/CMakeLists.txt
24+++ b/llvm/lib/Support/CMakeLists.txt 26+++ b/llvm/lib/Support/CMakeLists.txt
25@@ -22,7 +22,7 @@ if (HAS_WERROR_GLOBAL_CTORS) 27@@ -22,7 +22,7 @@ if (HAS_WERROR_GLOBAL_CTORS)
@@ -40,7 +42,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
40 endif() 42 endif()
41 43
42 if( MSVC OR MINGW ) 44 if( MSVC OR MINGW )
43@@ -301,7 +301,7 @@ if(LLVM_ENABLE_ZLIB) 45@@ -292,7 +292,7 @@ if(LLVM_ENABLE_ZLIB)
44 get_property(zlib_library TARGET ZLIB::ZLIB PROPERTY LOCATION) 46 get_property(zlib_library TARGET ZLIB::ZLIB PROPERTY LOCATION)
45 endif() 47 endif()
46 get_library_name(${zlib_library} zlib_library) 48 get_library_name(${zlib_library} zlib_library)
@@ -49,7 +51,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
49 endif() 51 endif()
50 52
51 if(LLVM_ENABLE_ZSTD) 53 if(LLVM_ENABLE_ZSTD)
52@@ -314,7 +314,7 @@ if(LLVM_ENABLE_ZSTD) 54@@ -305,7 +305,7 @@ if(LLVM_ENABLE_ZSTD)
53 get_property(zstd_library TARGET ${zstd_target} PROPERTY LOCATION) 55 get_property(zstd_library TARGET ${zstd_target} PROPERTY LOCATION)
54 endif() 56 endif()
55 get_library_name(${zstd_library} zstd_library) 57 get_library_name(${zstd_library} zstd_library)
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
new file mode 100644
index 0000000..13991b9
--- /dev/null
+++ b/recipes-devtools/clang/clang/0033-build-Enable-64bit-off_t-on-32bit-glibc-systems.patch
@@ -0,0 +1,52 @@
1From 617dc83077d725f33ae3c30f6a5de84edb8ed9f8 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
21Signed-off-by: Khem Raj <raj.khem@gmail.com>
22---
23 utils/bazel/llvm-project-overlay/llvm/config.bzl | 1 -
24 .../llvm-project-overlay/llvm/include/llvm/Config/config.h | 3 ---
25 2 files changed, 4 deletions(-)
26
27diff --git a/utils/bazel/llvm-project-overlay/llvm/config.bzl b/utils/bazel/llvm-project-overlay/llvm/config.bzl
28index 5507f80efa0b..b15ec9e1bb39 100644
29--- a/utils/bazel/llvm-project-overlay/llvm/config.bzl
30+++ b/utils/bazel/llvm-project-overlay/llvm/config.bzl
31@@ -48,7 +48,6 @@ posix_defines = [
32 linux_defines = posix_defines + [
33 "_GNU_SOURCE",
34 "HAVE_LINK_H=1",
35- "HAVE_LSEEK64=1",
36 "HAVE_MALLINFO=1",
37 "HAVE_SBRK=1",
38 "HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=1",
39diff --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
40index 8a30957b6120..6a68ac040bb8 100644
41--- a/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h
42+++ b/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h
43@@ -144,9 +144,6 @@
44 /* Define to 1 if you have the <link.h> header file. */
45 /* HAVE_LINK_H defined in Bazel */
46
47-/* Define to 1 if you have the `lseek64' function. */
48-/* HAVE_LSEEK64 defined in Bazel */
49-
50 /* Define to 1 if you have the <mach/mach.h> header file. */
51 /* HAVE_MACH_MACH_H defined in Bazel */
52
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
new file mode 100644
index 0000000..8d39a50
--- /dev/null
+++ b/recipes-devtools/clang/clang/0034-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch
@@ -0,0 +1,35 @@
1From 3f82cc31a96a6db32fe5ea20fffa1269e026b43c 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
19Signed-off-by: Khem Raj <raj.khem@gmail.com>
20---
21 .../lib/sanitizer_common/sanitizer_platform_limits_posix.cpp | 1 +
22 1 file changed, 1 insertion(+)
23
24diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
25index fc01498aa228..eb2ee78c2f45 100644
26--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
27+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
28@@ -18,6 +18,7 @@
29 // depends on _FILE_OFFSET_BITS setting.
30 // To get this "true" dirent definition, we undefine _FILE_OFFSET_BITS below.
31 #undef _FILE_OFFSET_BITS
32+#undef _TIME_BITS
33 #endif
34
35 // Must go after undef _FILE_OFFSET_BITS.
diff --git a/recipes-devtools/clang/clang/0035-cmake-Enable-64bit-off_t-on-32bit-glibc-systems.patch b/recipes-devtools/clang/clang/0035-cmake-Enable-64bit-off_t-on-32bit-glibc-systems.patch
deleted file mode 100644
index 7730c6f..0000000
--- a/recipes-devtools/clang/clang/0035-cmake-Enable-64bit-off_t-on-32bit-glibc-systems.patch
+++ /dev/null
@@ -1,131 +0,0 @@
1From cd2fa12d715929642513fc441287c402f4560096 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: Submitted [https://reviews.llvm.org/D139752]
22Signed-off-by: Khem Raj <raj.khem@gmail.com>
23---
24 llvm/cmake/config-ix.cmake | 8 +++++---
25 llvm/include/llvm/Config/config.h.cmake | 3 ---
26 llvm/lib/Support/raw_ostream.cpp | 2 --
27 llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn | 2 --
28 utils/bazel/llvm-project-overlay/llvm/config.bzl | 1 -
29 .../llvm/include/llvm/Config/config.h | 3 ---
30 utils/bazel/llvm_configs/config.h.cmake | 3 ---
31 7 files changed, 5 insertions(+), 17 deletions(-)
32
33--- a/llvm/cmake/config-ix.cmake
34+++ b/llvm/cmake/config-ix.cmake
35@@ -284,9 +284,6 @@ check_symbol_exists(futimes sys/time.h H
36 if( HAVE_SIGNAL_H AND NOT LLVM_USE_SANITIZER MATCHES ".*Address.*" AND NOT APPLE )
37 check_symbol_exists(sigaltstack signal.h HAVE_SIGALTSTACK)
38 endif()
39-set(CMAKE_REQUIRED_DEFINITIONS "-D_LARGEFILE64_SOURCE")
40-check_symbol_exists(lseek64 "sys/types.h;unistd.h" HAVE_LSEEK64)
41-set(CMAKE_REQUIRED_DEFINITIONS "")
42 check_symbol_exists(mallctl malloc_np.h HAVE_MALLCTL)
43 check_symbol_exists(mallinfo malloc.h HAVE_MALLINFO)
44 check_symbol_exists(mallinfo2 malloc.h HAVE_MALLINFO2)
45@@ -350,6 +347,11 @@ check_symbol_exists(__GLIBC__ stdio.h LL
46 if( LLVM_USING_GLIBC )
47 add_definitions( -D_GNU_SOURCE )
48 list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE")
49+# enable 64bit off_t on 32bit systems using glibc
50+ if (CMAKE_SIZEOF_VOID_P EQUAL 4)
51+ add_compile_definitions(_FILE_OFFSET_BITS=64)
52+ list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_FILE_OFFSET_BITS=64")
53+ endif()
54 endif()
55 # This check requires _GNU_SOURCE
56 if (NOT PURE_WINDOWS)
57--- a/llvm/include/llvm/Config/config.h.cmake
58+++ b/llvm/include/llvm/Config/config.h.cmake
59@@ -128,9 +128,6 @@
60 /* Define to 1 if you have the <link.h> header file. */
61 #cmakedefine HAVE_LINK_H ${HAVE_LINK_H}
62
63-/* Define to 1 if you have the `lseek64' function. */
64-#cmakedefine HAVE_LSEEK64 ${HAVE_LSEEK64}
65-
66 /* Define to 1 if you have the <mach/mach.h> header file. */
67 #cmakedefine HAVE_MACH_MACH_H ${HAVE_MACH_MACH_H}
68
69--- a/llvm/lib/Support/raw_ostream.cpp
70+++ b/llvm/lib/Support/raw_ostream.cpp
71@@ -804,8 +804,6 @@ uint64_t raw_fd_ostream::seek(uint64_t o
72 flush();
73 #ifdef _WIN32
74 pos = ::_lseeki64(FD, off, SEEK_SET);
75-#elif defined(HAVE_LSEEK64)
76- pos = ::lseek64(FD, off, SEEK_SET);
77 #else
78 pos = ::lseek(FD, off, SEEK_SET);
79 #endif
80--- a/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
81+++ b/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
82@@ -139,7 +139,6 @@ write_cmake_config("config") {
83 values += [
84 "HAVE_FUTIMENS=1",
85 "HAVE_LINK_H=1",
86- "HAVE_LSEEK64=1",
87 "HAVE_MALLINFO=1",
88 "HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=1",
89 ]
90@@ -147,7 +146,6 @@ write_cmake_config("config") {
91 values += [
92 "HAVE_FUTIMENS=",
93 "HAVE_LINK_H=",
94- "HAVE_LSEEK64=",
95 "HAVE_MALLINFO=",
96 "HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=",
97 ]
98--- a/utils/bazel/llvm-project-overlay/llvm/config.bzl
99+++ b/utils/bazel/llvm-project-overlay/llvm/config.bzl
100@@ -40,7 +40,6 @@ posix_defines = [
101 linux_defines = posix_defines + [
102 "_GNU_SOURCE",
103 "HAVE_LINK_H=1",
104- "HAVE_LSEEK64=1",
105 "HAVE_MALLINFO=1",
106 "HAVE_SBRK=1",
107 "HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=1",
108--- a/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h
109+++ b/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h
110@@ -144,9 +144,6 @@
111 /* Define to 1 if you have the <link.h> header file. */
112 /* HAVE_LINK_H defined in Bazel */
113
114-/* Define to 1 if you have the `lseek64' function. */
115-/* HAVE_LSEEK64 defined in Bazel */
116-
117 /* Define to 1 if you have the <mach/mach.h> header file. */
118 /* HAVE_MACH_MACH_H defined in Bazel */
119
120--- a/utils/bazel/llvm_configs/config.h.cmake
121+++ b/utils/bazel/llvm_configs/config.h.cmake
122@@ -128,9 +128,6 @@
123 /* Define to 1 if you have the <link.h> header file. */
124 #cmakedefine HAVE_LINK_H ${HAVE_LINK_H}
125
126-/* Define to 1 if you have the `lseek64' function. */
127-#cmakedefine HAVE_LSEEK64 ${HAVE_LSEEK64}
128-
129 /* Define to 1 if you have the <mach/mach.h> header file. */
130 #cmakedefine HAVE_MACH_MACH_H ${HAVE_MACH_MACH_H}
131
diff --git a/recipes-devtools/clang/clang/0034-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch b/recipes-devtools/clang/clang/0035-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch
index f723bb3..57ae3d4 100644
--- a/recipes-devtools/clang/clang/0034-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch
+++ b/recipes-devtools/clang/clang/0035-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch
@@ -1,4 +1,4 @@
1From abebd2f8fd9b78e4fa3403fd93d926f8cc16a001 Mon Sep 17 00:00:00 2001 1From f6e903f6ff980ca29cd5556c8dd188ebf8b13e5c 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
@@ -7,17 +7,16 @@ stat struct size differs on glibc based on ABI choices e.g. 64bit off_t
7and/or 64bit time_t will make this size different. Therefore separate 7and/or 64bit time_t will make this size different. Therefore separate
8out the O32 case out, makes it more readable. 8out the O32 case out, makes it more readable.
9 9
10Upstream-Status: Submitted [https://reviews.llvm.org/D140948]
11Signed-off-by: Khem Raj <raj.khem@gmail.com> 10Signed-off-by: Khem Raj <raj.khem@gmail.com>
12--- 11---
13 .../sanitizer_platform_limits_posix.h | 13 +++++++++++++ 12 .../sanitizer_platform_limits_posix.h | 13 +++++++++++++
14 1 file changed, 13 insertions(+) 13 1 file changed, 13 insertions(+)
15 14
16diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h 15diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
17index bd5692ed511b..08d1ac8ab51b 100644 16index fdc69b8a5fba..d2246893f8a5 100644
18--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h 17--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
19+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h 18+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
20@@ -98,11 +98,24 @@ const unsigned struct_kernel_stat64_sz = 104; 19@@ -97,11 +97,24 @@ const unsigned struct_kernel_stat64_sz = 104;
21 const unsigned struct_kernel_stat_sz = 144; 20 const unsigned struct_kernel_stat_sz = 144;
22 const unsigned struct_kernel_stat64_sz = 104; 21 const unsigned struct_kernel_stat64_sz = 104;
23 #elif defined(__mips__) 22 #elif defined(__mips__)
@@ -36,12 +35,9 @@ index bd5692ed511b..08d1ac8ab51b 100644
36 const unsigned struct_kernel_stat_sz = 35 const unsigned struct_kernel_stat_sz =
37 SANITIZER_ANDROID 36 SANITIZER_ANDROID
38 ? FIRST_32_SECOND_64(104, 128) 37 ? FIRST_32_SECOND_64(104, 128)
39 : FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 160 : 144, 216); 38 : FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 176 : 160, 216);
40 const unsigned struct_kernel_stat64_sz = 104; 39 const unsigned struct_kernel_stat64_sz = 104;
41+#endif 40+#endif
42 #elif defined(__s390__) && !defined(__s390x__) 41 #elif defined(__s390__) && !defined(__s390x__)
43 const unsigned struct_kernel_stat_sz = 64; 42 const unsigned struct_kernel_stat_sz = 64;
44 const unsigned struct_kernel_stat64_sz = 104; 43 const unsigned struct_kernel_stat64_sz = 104;
45--
462.39.0
47
diff --git a/recipes-devtools/clang/clang/0036-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch b/recipes-devtools/clang/clang/0036-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch
index 8648736..bc33ad0 100644
--- a/recipes-devtools/clang/clang/0036-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch
+++ b/recipes-devtools/clang/clang/0036-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch
@@ -1,37 +1,43 @@
1From 2030455a866828bb6d5f03e901e1147dacd95ed5 Mon Sep 17 00:00:00 2001 1From 76dd1850e6e5c985b86c6af06cd7169073f74b3e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 31 Dec 2022 15:03:24 -0800 3Date: Tue, 21 Feb 2023 12:46:10 -0800
4Subject: [PATCH] compiler-rt: Undef _TIME_BITS along with _FILE_OFFSET_BITS on 4Subject: [PATCH] compiler-rt: Undef _TIME_BITS along with _FILE_OFFSET_BITS in
5 linux 5 sanitizers
6 6
7On 32bit systems using 64bit time_t build fails because 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 8_FILE_OFFSET_BITS is undefined here but _TIME_BITS is still set to 64
9 9
10Fixes 10Fixes
11/usr/include/features-time64.h:26:5: error: "_TIME_BITS=64 is allowed 11In file included from compiler-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp:17:
12 only with _FILE_OFFSET_BITS=64" 12In file included from compiler-rt/lib/sanitizer_common/sanitizer_platform.h:25:
13| # error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64" 13In file included from /usr/include/features.h:393:
14| ^ 14/usr/include/features-time64.h:26:5: error: "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
15| 1 error generated. 15 ^
161 error generated.
16 17
17Upstream-Status: Submitted [https://reviews.llvm.org/D140812] 18Upstream-Status: Submitted [https://reviews.llvm.org/D144514]
18Signed-off-by: Khem Raj <raj.khem@gmail.com> 19Signed-off-by: Khem Raj <raj.khem@gmail.com>
19--- 20---
20 .../lib/sanitizer_common/sanitizer_platform_limits_posix.cpp | 1 + 21 compiler-rt/lib/sanitizer_common/sanitizer_platform.h | 9 +++++++++
21 1 file changed, 1 insertion(+) 22 1 file changed, 9 insertions(+)
22 23
23diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp 24diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
24index 4e0d428d3284..9e646500350b 100644 25index 764996e57355..df3d165ecdb6 100644
25--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp 26--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
26+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp 27+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
27@@ -18,6 +18,7 @@ 28@@ -22,6 +22,15 @@
28 // depends on _FILE_OFFSET_BITS setting. 29 // function declarations into a .S file which doesn't compile.
29 // To get this "true" dirent definition, we undefine _FILE_OFFSET_BITS below. 30 // https://crbug.com/1162741
30 #undef _FILE_OFFSET_BITS 31 #if __has_include(<features.h>) && !defined(__ANDROID__)
31+#undef _TIME_BITS 32+// Some sources undefine _FILE_OFFSET_BITS deliberately e.g.
33+// sanitizer_procmaps_solaris.cpp. This is problematic on glibc systems with
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
36+// need to be undefined together since features.h will check for both being 64
37+// if one is set to 64
38+# if !defined(_FILE_OFFSET_BITS)
39+# undef _TIME_BITS
40+# endif
41 # include <features.h>
32 #endif 42 #endif
33 43
34 // Must go after undef _FILE_OFFSET_BITS.
35--
362.39.0
37
diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc
index 6e87145..6b85edf 100644
--- a/recipes-devtools/clang/common.inc
+++ b/recipes-devtools/clang/common.inc
@@ -33,18 +33,18 @@ SRC_URI = "\
33 file://0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch \ 33 file://0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch \
34 file://0022-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch \ 34 file://0022-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch \
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-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch \ 36 file://0024-libunwind-Added-unw_backtrace-method.patch \
37 file://0025-libunwind-Added-unw_backtrace-method.patch \ 37 file://0025-clang-Do-not-use-install-relative-libc-headers.patch \
38 file://0026-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-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch \ 39 file://0027-Fix-lib-paths-for-OpenEmbedded-Host.patch \
40 file://0028-Fix-lib-paths-for-OpenEmbedded-Host.patch \ 40 file://0028-Correct-library-search-path-for-OpenEmbedded-Host.patch \
41 file://0029-Correct-library-search-path-for-OpenEmbedded-Host.patch \ 41 file://0029-lldb-Link-with-libatomic-on-x86.patch \
42 file://0030-lldb-Link-with-libatomic-on-x86.patch \ 42 file://0030-clang-exclude-openembedded-distributions-from-settin.patch \
43 file://0031-clang-exclude-openembedded-distributions-from-settin.patch \ 43 file://0031-compiler-rt-Enable-__int128-for-ppc32.patch \
44 file://0032-compiler-rt-Enable-__int128-for-ppc32.patch \ 44 file://0032-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch \
45 file://0033-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch \ 45 file://0033-build-Enable-64bit-off_t-on-32bit-glibc-systems.patch \
46 file://0034-compiler-rt-Fix-stat-struct-s-size-for-O32-ABI.patch \ 46 file://0034-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch \
47 file://0035-cmake-Enable-64bit-off_t-on-32bit-glibc-systems.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 \ 48 file://0036-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch \
49 " 49 "
50# Fallback to no-PIE if not set 50# Fallback to no-PIE if not set
diff --git a/recipes-devtools/clang/llvm-project-source.inc b/recipes-devtools/clang/llvm-project-source.inc
index 6bcb29f..44493fd 100644
--- a/recipes-devtools/clang/llvm-project-source.inc
+++ b/recipes-devtools/clang/llvm-project-source.inc
@@ -57,10 +57,10 @@ python add_distro_vendor() {
57 57
58 bb.note("Adding support following TARGET_VENDOR values") 58 bb.note("Adding support following TARGET_VENDOR values")
59 bb.note(str(vendors_to_add)) 59 bb.note(str(vendors_to_add))
60 bb.note("in llvm/lib/Support/Triple.cpp and ${S}/clang/lib/Driver/ToolChains/Gnu.cpp") 60 bb.note("in llvm/lib/TargetParser/Triple.cpp and ${S}/clang/lib/Driver/ToolChains/Gnu.cpp")
61 cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_VENDORS_TRIPLES#%s#g' ${S}/clang/lib/Driver/ToolChains/Gnu.cpp" % (triple)) 61 cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_VENDORS_TRIPLES#%s#g' ${S}/clang/lib/Driver/ToolChains/Gnu.cpp" % (triple))
62 subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) 62 subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
63 cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_VENDORS_CASES#%s#g' -i ${S}/llvm/lib/Support/Triple.cpp" % (case)) 63 cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_VENDORS_CASES#%s#g' -i ${S}/llvm/lib/TargetParser/Triple.cpp" % (case))
64 subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) 64 subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
65 65
66 66