summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2021-01-28 11:35:50 -0800
committerKhem Raj <raj.khem@gmail.com>2021-03-01 11:12:14 -0800
commit596e0e7c195378a1b02e6ebcad0fb98054230e28 (patch)
treea1ac857fee80a85b588a9b9653e4a9a54e4e79c8
parent6611405d0e50724afe4b6ee1d6e80417a31721d6 (diff)
downloadmeta-clang-596e0e7c195378a1b02e6ebcad0fb98054230e28.tar.gz
clang: Update to 12.0.0 RC2
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--conf/layer.conf2
-rw-r--r--recipes-devtools/clang/clang.inc6
-rw-r--r--recipes-devtools/clang/clang/0001-Fix-libclc-to-look-for-python3-explicitly.patch29
-rw-r--r--recipes-devtools/clang/clang/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch9
-rw-r--r--recipes-devtools/clang/clang/0002-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch13
-rw-r--r--recipes-devtools/clang/clang/0003-compiler-rt-support-a-new-embedded-linux-target.patch13
-rw-r--r--recipes-devtools/clang/clang/0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch11
-rw-r--r--recipes-devtools/clang/clang/0005-compiler-rt-Disable-tsan-on-OE-glibc.patch13
-rw-r--r--recipes-devtools/clang/clang/0006-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch25
-rw-r--r--recipes-devtools/clang/clang/0007-llvm-allow-env-override-of-exe-path.patch11
-rw-r--r--recipes-devtools/clang/clang/0008-clang-driver-Check-sysroot-for-ldso-path.patch15
-rw-r--r--recipes-devtools/clang/clang/0009-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch11
-rw-r--r--recipes-devtools/clang/clang/0010-clang-musl-ppc-does-not-support-128-bit-long-double.patch11
-rw-r--r--recipes-devtools/clang/clang/0011-clang-Prepend-trailing-to-sysroot.patch11
-rw-r--r--recipes-devtools/clang/clang/0012-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch12
-rw-r--r--recipes-devtools/clang/clang/0013-clang-Define-releative-gcc-installation-dir.patch43
-rw-r--r--recipes-devtools/clang/clang/0014-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch13
-rw-r--r--recipes-devtools/clang/clang/0015-clang-scan-view-needs-python-2.x.patch9
-rw-r--r--recipes-devtools/clang/clang/0016-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch13
-rw-r--r--recipes-devtools/clang/clang/0017-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch10
-rw-r--r--recipes-devtools/clang/clang/0018-Check-for-atomic-double-intrinsics.patch12
-rw-r--r--recipes-devtools/clang/clang/0019-clang-Enable-SSP-and-PIE-by-default.patch68
-rw-r--r--recipes-devtools/clang/clang/0020-libcxx-Add-compiler-runtime-library-to-link-step-for.patch18
-rw-r--r--recipes-devtools/clang/clang/0021-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch27
-rw-r--r--recipes-devtools/clang/clang/0022-clang-Fix-resource-dir-location-for-cross-toolchains.patch8
-rw-r--r--recipes-devtools/clang/clang/0023-fix-path-to-libffi.patch11
-rw-r--r--recipes-devtools/clang/clang/0024-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch19
-rw-r--r--recipes-devtools/clang/clang/0025-clang-Use-python3-in-python-scripts.patch (renamed from recipes-devtools/clang/clang/0026-clang-Use-python3-in-python-scripts.patch)25
-rw-r--r--recipes-devtools/clang/clang/0025-libcxx-Define-__NR_futex-to-be-__NR_futex_time64-on-.patch35
-rw-r--r--recipes-devtools/clang/clang/0026-For-x86_64-set-Yocto-based-GCC-install-search-path.patch (renamed from recipes-devtools/clang/clang/0027-For-x86_64-set-Yocto-based-GCC-install-search-path.patch)10
-rw-r--r--recipes-devtools/clang/clang/0027-compiler-rt-Include-stddef.h.patch27
-rw-r--r--recipes-devtools/clang/clang/0028-llvm-Do-not-use-find_library-for-ncurses.patch44
-rw-r--r--recipes-devtools/clang/clang/D95527_against_11.x.patch85
-rw-r--r--recipes-devtools/clang/clang_git.bb4
-rw-r--r--recipes-devtools/clang/common.inc10
35 files changed, 271 insertions, 412 deletions
diff --git a/conf/layer.conf b/conf/layer.conf
index 423db9f..6db969b 100644
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -29,7 +29,7 @@ INHERIT += "clang"
29# Do not include clang in SDK unless user wants to 29# Do not include clang in SDK unless user wants to
30CLANGSDK ??= "0" 30CLANGSDK ??= "0"
31 31
32LLVMVERSION = "11.1.0" 32LLVMVERSION = "12.0.0"
33 33
34require conf/nonclangable.conf 34require conf/nonclangable.conf
35require conf/nonscanable.conf 35require conf/nonscanable.conf
diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc
index e5b6793..df35290 100644
--- a/recipes-devtools/clang/clang.inc
+++ b/recipes-devtools/clang/clang.inc
@@ -4,11 +4,11 @@ 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 = "11" 7MAJOR_VER = "12"
8MINOR_VER = "1" 8MINOR_VER = "0"
9PATCH_VER = "0" 9PATCH_VER = "0"
10 10
11SRCREV ?= "1fdec59bffc11ae37eb51a1b9869f0696bfd5312" 11SRCREV ?= "4918a3d138b907a571f496661b5367e090e1e8bb"
12 12
13PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}" 13PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}"
14BRANCH = "release/${MAJOR_VER}.x" 14BRANCH = "release/${MAJOR_VER}.x"
diff --git a/recipes-devtools/clang/clang/0001-Fix-libclc-to-look-for-python3-explicitly.patch b/recipes-devtools/clang/clang/0001-Fix-libclc-to-look-for-python3-explicitly.patch
deleted file mode 100644
index 5619944..0000000
--- a/recipes-devtools/clang/clang/0001-Fix-libclc-to-look-for-python3-explicitly.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1From 419d8e0602401c813fc5a87b6c593ac0598a445f Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?= <zboszor@pr.hu>
3Date: Fri, 12 Feb 2021 23:56:04 -0500
4Subject: [PATCH] Fix libclc to look for python3 explicitly
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
10---
11 libclc/CMakeLists.txt | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
15index 9472f19..a7908c8 100644
16--- a/libclc/CMakeLists.txt
17+++ b/libclc/CMakeLists.txt
18@@ -170,7 +170,7 @@ if( ENABLE_RUNTIME_SUBNORMAL )
19 DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
20 endif()
21
22-find_program( PYTHON python )
23+find_program( PYTHON python3 )
24 file( TO_CMAKE_PATH ${CMAKE_SOURCE_DIR}/generic/lib/gen_convert.py script_loc )
25 add_custom_command(
26 OUTPUT convert.cl
27--
281.8.3.1
29
diff --git a/recipes-devtools/clang/clang/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch b/recipes-devtools/clang/clang/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch
index 9f493ce..b8b56e7 100644
--- a/recipes-devtools/clang/clang/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch
+++ b/recipes-devtools/clang/clang/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch
@@ -1,7 +1,7 @@
1From 435b79f52c7b20a88a6ec0d9a272a9ffd1b6d80d Mon Sep 17 00:00:00 2001 1From 6bf608a67654eaf3312d8ca4813a19526e35c8b1 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 22 May 2017 17:36:16 -0700 3Date: Mon, 22 May 2017 17:36:16 -0700
4Subject: [PATCH 01/24] lldb: Add -lxml2 to linker cmdline of xml is found 4Subject: [PATCH] lldb: Add -lxml2 to linker cmdline of xml is found
5 5
6When cross compiling for systems where static libs 6When cross compiling for systems where static libs
7for libxml are not available cmake's detection mechanism 7for libxml are not available cmake's detection mechanism
@@ -23,7 +23,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
23 1 file changed, 1 insertion(+), 1 deletion(-) 23 1 file changed, 1 insertion(+), 1 deletion(-)
24 24
25diff --git a/lldb/source/Host/CMakeLists.txt b/lldb/source/Host/CMakeLists.txt 25diff --git a/lldb/source/Host/CMakeLists.txt b/lldb/source/Host/CMakeLists.txt
26index add503a5f36..8ddb874c880 100644 26index 7456cb98bfa1..1a732ec5cb89 100644
27--- a/lldb/source/Host/CMakeLists.txt 27--- a/lldb/source/Host/CMakeLists.txt
28+++ b/lldb/source/Host/CMakeLists.txt 28+++ b/lldb/source/Host/CMakeLists.txt
29@@ -138,7 +138,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "NetBSD") 29@@ -138,7 +138,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
@@ -35,6 +35,3 @@ index add503a5f36..8ddb874c880 100644
35 endif() 35 endif()
36 if (HAVE_LIBDL) 36 if (HAVE_LIBDL)
37 list(APPEND EXTRA_LIBS ${CMAKE_DL_LIBS}) 37 list(APPEND EXTRA_LIBS ${CMAKE_DL_LIBS})
38--
392.27.0
40
diff --git a/recipes-devtools/clang/clang/0002-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch b/recipes-devtools/clang/clang/0002-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch
index 3291369..4a6d415 100644
--- a/recipes-devtools/clang/clang/0002-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch
+++ b/recipes-devtools/clang/clang/0002-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch
@@ -1,7 +1,7 @@
1From ed6cff51a51de8a69f3b326bedc7389bc8a74a8f Mon Sep 17 00:00:00 2001 1From 9e5acc06fe366c08a313bb033010f2e56c8cb65d 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 02/24] libcxxabi: Find libunwind headers when 4Subject: [PATCH] libcxxabi: Find libunwind headers when
5 LIBCXXABI_LIBUNWIND_INCLUDES is set 5 LIBCXXABI_LIBUNWIND_INCLUDES is set
6 6
7Currently, when LIBCXXABI_LIBUNWIND_INCLUDES is set via CMake arguments 7Currently, when LIBCXXABI_LIBUNWIND_INCLUDES is set via CMake arguments
@@ -17,10 +17,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
17 1 file changed, 11 insertions(+), 10 deletions(-) 17 1 file changed, 11 insertions(+), 10 deletions(-)
18 18
19diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt 19diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
20index 8881a5018dc..2821d1ad346 100644 20index 426c855288fc..06a62c642898 100644
21--- a/libcxxabi/CMakeLists.txt 21--- a/libcxxabi/CMakeLists.txt
22+++ b/libcxxabi/CMakeLists.txt 22+++ b/libcxxabi/CMakeLists.txt
23@@ -442,14 +442,9 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBCXXABI_C_FLAGS}") 23@@ -478,14 +478,9 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBCXXABI_C_FLAGS}")
24 # Setup Source Code 24 # Setup Source Code
25 #=============================================================================== 25 #===============================================================================
26 26
@@ -36,7 +36,7 @@ index 8881a5018dc..2821d1ad346 100644
36 PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES} 36 PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES}
37 ${LIBCXXABI_LIBUNWIND_PATH}/include 37 ${LIBCXXABI_LIBUNWIND_PATH}/include
38 ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES} 38 ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES}
39@@ -460,15 +455,21 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) 39@@ -496,15 +491,21 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
40 NO_CMAKE_FIND_ROOT_PATH 40 NO_CMAKE_FIND_ROOT_PATH
41 ) 41 )
42 42
@@ -62,6 +62,3 @@ index 8881a5018dc..2821d1ad346 100644
62 # Add source code. This also contains all of the logic for deciding linker flags 62 # Add source code. This also contains all of the logic for deciding linker flags
63 # soname, etc... 63 # soname, etc...
64 add_subdirectory(src) 64 add_subdirectory(src)
65--
662.27.0
67
diff --git a/recipes-devtools/clang/clang/0003-compiler-rt-support-a-new-embedded-linux-target.patch b/recipes-devtools/clang/clang/0003-compiler-rt-support-a-new-embedded-linux-target.patch
index 8689276..250d663 100644
--- a/recipes-devtools/clang/clang/0003-compiler-rt-support-a-new-embedded-linux-target.patch
+++ b/recipes-devtools/clang/clang/0003-compiler-rt-support-a-new-embedded-linux-target.patch
@@ -1,7 +1,7 @@
1From 7a7a7d6f730ec71b95475855ff216e431c6cfe1f Mon Sep 17 00:00:00 2001 1From f8ec4b59e6ad2a91ded1f05a9e711a68d9897608 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 03/24] compiler-rt: support a new embedded linux target 4Subject: [PATCH] compiler-rt: support a new embedded linux target
5 5
6Signed-off-by: Khem Raj <raj.khem@gmail.com> 6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7--- 7---
@@ -13,7 +13,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 create mode 100644 compiler-rt/make/platform/clang_linux_embedded_test_input.c 13 create mode 100644 compiler-rt/make/platform/clang_linux_embedded_test_input.c
14 14
15diff --git a/compiler-rt/lib/builtins/int_util.c b/compiler-rt/lib/builtins/int_util.c 15diff --git a/compiler-rt/lib/builtins/int_util.c b/compiler-rt/lib/builtins/int_util.c
16index 226a6e93440..efc977acbb3 100644 16index 226a6e93440d..efc977acbb39 100644
17--- a/compiler-rt/lib/builtins/int_util.c 17--- a/compiler-rt/lib/builtins/int_util.c
18+++ b/compiler-rt/lib/builtins/int_util.c 18+++ b/compiler-rt/lib/builtins/int_util.c
19@@ -54,7 +54,7 @@ void __compilerrt_abort_impl(const char *file, int line, const char *function) { 19@@ -54,7 +54,7 @@ void __compilerrt_abort_impl(const char *file, int line, const char *function) {
@@ -27,7 +27,7 @@ index 226a6e93440..efc977acbb3 100644
27 __attribute__((weak)) 27 __attribute__((weak))
28diff --git a/compiler-rt/make/platform/clang_linux_embedded.mk b/compiler-rt/make/platform/clang_linux_embedded.mk 28diff --git a/compiler-rt/make/platform/clang_linux_embedded.mk b/compiler-rt/make/platform/clang_linux_embedded.mk
29new file mode 100644 29new file mode 100644
30index 00000000000..d0a890075a1 30index 000000000000..d0a890075a1c
31--- /dev/null 31--- /dev/null
32+++ b/compiler-rt/make/platform/clang_linux_embedded.mk 32+++ b/compiler-rt/make/platform/clang_linux_embedded.mk
33@@ -0,0 +1,286 @@ 33@@ -0,0 +1,286 @@
@@ -319,7 +319,4 @@ index 00000000000..d0a890075a1
319+FUNCTIONS.hard_pic.x86_64 := $(FUNCTIONS_X86_64) 319+FUNCTIONS.hard_pic.x86_64 := $(FUNCTIONS_X86_64)
320diff --git a/compiler-rt/make/platform/clang_linux_embedded_test_input.c b/compiler-rt/make/platform/clang_linux_embedded_test_input.c 320diff --git a/compiler-rt/make/platform/clang_linux_embedded_test_input.c b/compiler-rt/make/platform/clang_linux_embedded_test_input.c
321new file mode 100644 321new file mode 100644
322index 00000000000..e69de29bb2d 322index 000000000000..e69de29bb2d1
323--
3242.27.0
325
diff --git a/recipes-devtools/clang/clang/0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch b/recipes-devtools/clang/clang/0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch
index db934c9..820f841 100644
--- a/recipes-devtools/clang/clang/0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch
+++ b/recipes-devtools/clang/clang/0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch
@@ -1,7 +1,7 @@
1From ccf22e891d6a4b74c9845e9dc03b569694af107c Mon Sep 17 00:00:00 2001 1From 9aaf03ac32985430e5c08347ed4e5d2721d5db1b 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 04/24] compiler-rt: Simplify cross-compilation. Don't use 4Subject: [PATCH] compiler-rt: Simplify cross-compilation. Don't use
5 native-compiled llvm-config. 5 native-compiled llvm-config.
6 6
7 Note: AddLLVM.cmake does not expose the LLVM source directory. 7 Note: AddLLVM.cmake does not expose the LLVM source directory.
@@ -20,10 +20,10 @@ 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 fa62814b635..5948ed6fa5e 100644 23index b44ad2c2118e..ed8f4bd80e93 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@@ -74,7 +74,16 @@ set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOL 26@@ -72,7 +72,16 @@ set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOL
27 "Build for a bare-metal target.") 27 "Build for a bare-metal target.")
28 28
29 if (COMPILER_RT_STANDALONE_BUILD) 29 if (COMPILER_RT_STANDALONE_BUILD)
@@ -41,6 +41,3 @@ index fa62814b635..5948ed6fa5e 100644
41 if (TARGET intrinsics_gen) 41 if (TARGET intrinsics_gen)
42 # Loading the llvm config causes this target to be imported so place it 42 # Loading the llvm config causes this target to be imported so place it
43 # under the appropriate folder in an IDE. 43 # under the appropriate folder in an IDE.
44--
452.27.0
46
diff --git a/recipes-devtools/clang/clang/0005-compiler-rt-Disable-tsan-on-OE-glibc.patch b/recipes-devtools/clang/clang/0005-compiler-rt-Disable-tsan-on-OE-glibc.patch
index c341d91..d2bd6a4 100644
--- a/recipes-devtools/clang/clang/0005-compiler-rt-Disable-tsan-on-OE-glibc.patch
+++ b/recipes-devtools/clang/clang/0005-compiler-rt-Disable-tsan-on-OE-glibc.patch
@@ -1,7 +1,7 @@
1From 556e35f02d3e92d149c25547ddc7c7cc8f4cdc84 Mon Sep 17 00:00:00 2001 1From 0565a77f6bd5fdc7a440455fb31ee5f6fd42afff Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 18 Jul 2016 08:05:02 +0000 3Date: Mon, 18 Jul 2016 08:05:02 +0000
4Subject: [PATCH 05/24] compiler-rt: Disable tsan on OE/glibc 4Subject: [PATCH] compiler-rt: Disable tsan on OE/glibc
5 5
6It does not build see 6It does not build see
7http://lists.llvm.org/pipermail/llvm-dev/2016-July/102235.html 7http://lists.llvm.org/pipermail/llvm-dev/2016-July/102235.html
@@ -13,10 +13,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 2 files changed, 2 insertions(+), 2 deletions(-) 13 2 files changed, 2 insertions(+), 2 deletions(-)
14 14
15diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake 15diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
16index 2edc1dabd90..ec4b5e7ee93 100644 16index f81b8384cbd5..196aa62fd01c 100644
17--- a/compiler-rt/cmake/config-ix.cmake 17--- a/compiler-rt/cmake/config-ix.cmake
18+++ b/compiler-rt/cmake/config-ix.cmake 18+++ b/compiler-rt/cmake/config-ix.cmake
19@@ -692,7 +692,7 @@ else() 19@@ -723,7 +723,7 @@ else()
20 endif() 20 endif()
21 21
22 if (COMPILER_RT_HAS_SANITIZER_COMMON AND TSAN_SUPPORTED_ARCH AND 22 if (COMPILER_RT_HAS_SANITIZER_COMMON AND TSAN_SUPPORTED_ARCH AND
@@ -26,7 +26,7 @@ index 2edc1dabd90..ec4b5e7ee93 100644
26 else() 26 else()
27 set(COMPILER_RT_HAS_TSAN FALSE) 27 set(COMPILER_RT_HAS_TSAN FALSE)
28diff --git a/compiler-rt/test/sanitizer_common/CMakeLists.txt b/compiler-rt/test/sanitizer_common/CMakeLists.txt 28diff --git a/compiler-rt/test/sanitizer_common/CMakeLists.txt b/compiler-rt/test/sanitizer_common/CMakeLists.txt
29index fcd651ebe42..821de915be8 100644 29index 7f1b0f257716..2caf78be2511 100644
30--- a/compiler-rt/test/sanitizer_common/CMakeLists.txt 30--- a/compiler-rt/test/sanitizer_common/CMakeLists.txt
31+++ b/compiler-rt/test/sanitizer_common/CMakeLists.txt 31+++ b/compiler-rt/test/sanitizer_common/CMakeLists.txt
32@@ -11,7 +11,7 @@ set(SANITIZER_COMMON_TESTSUITES) 32@@ -11,7 +11,7 @@ set(SANITIZER_COMMON_TESTSUITES)
@@ -38,6 +38,3 @@ index fcd651ebe42..821de915be8 100644
38 set(SUPPORTED_TOOLS) 38 set(SUPPORTED_TOOLS)
39 foreach(SANITIZER_TOOL ${SUPPORTED_TOOLS_INIT}) 39 foreach(SANITIZER_TOOL ${SUPPORTED_TOOLS_INIT})
40 string(TOUPPER ${SANITIZER_TOOL} SANITIZER_TOOL_UPPER) 40 string(TOUPPER ${SANITIZER_TOOL} SANITIZER_TOOL_UPPER)
41--
422.27.0
43
diff --git a/recipes-devtools/clang/clang/0006-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch b/recipes-devtools/clang/clang/0006-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch
index 7990ab0..678e80c 100644
--- a/recipes-devtools/clang/clang/0006-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch
+++ b/recipes-devtools/clang/clang/0006-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch
@@ -1,8 +1,8 @@
1From 262adc1859d04c5142da4dfc512204564183090b Mon Sep 17 00:00:00 2001 1From 5152fffda4231ad41d81a8fe954adec3b2955ed5 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 06/24] llvm: TargetLibraryInfo: Undefine libc functions if 4Subject: [PATCH] llvm: TargetLibraryInfo: Undefine libc functions if they are
5 they are macros 5 macros
6 6
7musl defines some functions as macros and not inline functions 7musl defines some functions as macros and not inline functions
8if this is the case then make sure to undefine them 8if this is the case then make sure to undefine them
@@ -13,10 +13,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 1 file changed, 21 insertions(+) 13 1 file changed, 21 insertions(+)
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 3864d495510..cc1b69ef625 100644 16index defc95d0062a..41d2099d0c5b 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@@ -800,6 +800,9 @@ TLI_DEFINE_STRING_INTERNAL("fmodl") 19@@ -809,6 +809,9 @@ TLI_DEFINE_STRING_INTERNAL("fmodl")
20 TLI_DEFINE_ENUM_INTERNAL(fopen) 20 TLI_DEFINE_ENUM_INTERNAL(fopen)
21 TLI_DEFINE_STRING_INTERNAL("fopen") 21 TLI_DEFINE_STRING_INTERNAL("fopen")
22 /// FILE *fopen64(const char *filename, const char *opentype) 22 /// FILE *fopen64(const char *filename, const char *opentype)
@@ -26,7 +26,7 @@ index 3864d495510..cc1b69ef625 100644
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 /// int fork();
29@@ -847,6 +850,9 @@ TLI_DEFINE_STRING_INTERNAL("fseek") 29@@ -856,6 +859,9 @@ TLI_DEFINE_STRING_INTERNAL("fseek")
30 /// int fseeko(FILE *stream, off_t offset, int whence); 30 /// int fseeko(FILE *stream, off_t offset, int whence);
31 TLI_DEFINE_ENUM_INTERNAL(fseeko) 31 TLI_DEFINE_ENUM_INTERNAL(fseeko)
32 TLI_DEFINE_STRING_INTERNAL("fseeko") 32 TLI_DEFINE_STRING_INTERNAL("fseeko")
@@ -36,7 +36,7 @@ index 3864d495510..cc1b69ef625 100644
36 /// int fseeko64(FILE *stream, off64_t offset, int whence) 36 /// int fseeko64(FILE *stream, off64_t offset, int whence)
37 TLI_DEFINE_ENUM_INTERNAL(fseeko64) 37 TLI_DEFINE_ENUM_INTERNAL(fseeko64)
38 TLI_DEFINE_STRING_INTERNAL("fseeko64") 38 TLI_DEFINE_STRING_INTERNAL("fseeko64")
39@@ -857,6 +863,9 @@ TLI_DEFINE_STRING_INTERNAL("fsetpos") 39@@ -866,6 +872,9 @@ TLI_DEFINE_STRING_INTERNAL("fsetpos")
40 TLI_DEFINE_ENUM_INTERNAL(fstat) 40 TLI_DEFINE_ENUM_INTERNAL(fstat)
41 TLI_DEFINE_STRING_INTERNAL("fstat") 41 TLI_DEFINE_STRING_INTERNAL("fstat")
42 /// int fstat64(int filedes, struct stat64 *buf) 42 /// int fstat64(int filedes, struct stat64 *buf)
@@ -46,7 +46,7 @@ index 3864d495510..cc1b69ef625 100644
46 TLI_DEFINE_ENUM_INTERNAL(fstat64) 46 TLI_DEFINE_ENUM_INTERNAL(fstat64)
47 TLI_DEFINE_STRING_INTERNAL("fstat64") 47 TLI_DEFINE_STRING_INTERNAL("fstat64")
48 /// int fstatvfs(int fildes, struct statvfs *buf); 48 /// int fstatvfs(int fildes, struct statvfs *buf);
49@@ -872,6 +881,9 @@ TLI_DEFINE_STRING_INTERNAL("ftell") 49@@ -881,6 +890,9 @@ TLI_DEFINE_STRING_INTERNAL("ftell")
50 TLI_DEFINE_ENUM_INTERNAL(ftello) 50 TLI_DEFINE_ENUM_INTERNAL(ftello)
51 TLI_DEFINE_STRING_INTERNAL("ftello") 51 TLI_DEFINE_STRING_INTERNAL("ftello")
52 /// off64_t ftello64(FILE *stream) 52 /// off64_t ftello64(FILE *stream)
@@ -56,7 +56,7 @@ index 3864d495510..cc1b69ef625 100644
56 TLI_DEFINE_ENUM_INTERNAL(ftello64) 56 TLI_DEFINE_ENUM_INTERNAL(ftello64)
57 TLI_DEFINE_STRING_INTERNAL("ftello64") 57 TLI_DEFINE_STRING_INTERNAL("ftello64")
58 /// int ftrylockfile(FILE *file); 58 /// int ftrylockfile(FILE *file);
59@@ -998,6 +1010,9 @@ TLI_DEFINE_STRING_INTERNAL("logl") 59@@ -1007,6 +1019,9 @@ TLI_DEFINE_STRING_INTERNAL("logl")
60 TLI_DEFINE_ENUM_INTERNAL(lstat) 60 TLI_DEFINE_ENUM_INTERNAL(lstat)
61 TLI_DEFINE_STRING_INTERNAL("lstat") 61 TLI_DEFINE_STRING_INTERNAL("lstat")
62 /// int lstat64(const char *path, struct stat64 *buf); 62 /// int lstat64(const char *path, struct stat64 *buf);
@@ -66,7 +66,7 @@ index 3864d495510..cc1b69ef625 100644
66 TLI_DEFINE_ENUM_INTERNAL(lstat64) 66 TLI_DEFINE_ENUM_INTERNAL(lstat64)
67 TLI_DEFINE_STRING_INTERNAL("lstat64") 67 TLI_DEFINE_STRING_INTERNAL("lstat64")
68 /// void *malloc(size_t size); 68 /// void *malloc(size_t size);
69@@ -1241,6 +1256,9 @@ TLI_DEFINE_STRING_INTERNAL("sscanf") 69@@ -1250,6 +1265,9 @@ TLI_DEFINE_STRING_INTERNAL("sscanf")
70 TLI_DEFINE_ENUM_INTERNAL(stat) 70 TLI_DEFINE_ENUM_INTERNAL(stat)
71 TLI_DEFINE_STRING_INTERNAL("stat") 71 TLI_DEFINE_STRING_INTERNAL("stat")
72 /// int stat64(const char *path, struct stat64 *buf); 72 /// int stat64(const char *path, struct stat64 *buf);
@@ -76,7 +76,7 @@ index 3864d495510..cc1b69ef625 100644
76 TLI_DEFINE_ENUM_INTERNAL(stat64) 76 TLI_DEFINE_ENUM_INTERNAL(stat64)
77 TLI_DEFINE_STRING_INTERNAL("stat64") 77 TLI_DEFINE_STRING_INTERNAL("stat64")
78 /// int statvfs(const char *path, struct statvfs *buf); 78 /// int statvfs(const char *path, struct statvfs *buf);
79@@ -1376,6 +1394,9 @@ TLI_DEFINE_STRING_INTERNAL("times") 79@@ -1385,6 +1403,9 @@ TLI_DEFINE_STRING_INTERNAL("times")
80 TLI_DEFINE_ENUM_INTERNAL(tmpfile) 80 TLI_DEFINE_ENUM_INTERNAL(tmpfile)
81 TLI_DEFINE_STRING_INTERNAL("tmpfile") 81 TLI_DEFINE_STRING_INTERNAL("tmpfile")
82 /// FILE *tmpfile64(void) 82 /// FILE *tmpfile64(void)
@@ -86,6 +86,3 @@ index 3864d495510..cc1b69ef625 100644
86 TLI_DEFINE_ENUM_INTERNAL(tmpfile64) 86 TLI_DEFINE_ENUM_INTERNAL(tmpfile64)
87 TLI_DEFINE_STRING_INTERNAL("tmpfile64") 87 TLI_DEFINE_STRING_INTERNAL("tmpfile64")
88 /// int toascii(int c); 88 /// int toascii(int c);
89--
902.27.0
91
diff --git a/recipes-devtools/clang/clang/0007-llvm-allow-env-override-of-exe-path.patch b/recipes-devtools/clang/clang/0007-llvm-allow-env-override-of-exe-path.patch
index 39e6166..d8af3ff 100644
--- a/recipes-devtools/clang/clang/0007-llvm-allow-env-override-of-exe-path.patch
+++ b/recipes-devtools/clang/clang/0007-llvm-allow-env-override-of-exe-path.patch
@@ -1,7 +1,7 @@
1From fdc01a13dddebef34e5cc037484dd368b9985d63 Mon Sep 17 00:00:00 2001 1From d8875d549490e392fe432de259fb13c00b585598 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 07/24] llvm: allow env override of exe path 4Subject: [PATCH] llvm: allow env override of exe path
5 5
6When using a native llvm-config from inside a sysroot, we need llvm-config to 6When using a native llvm-config from inside a sysroot, we need llvm-config to
7return the libraries, include directories, etc. from inside the sysroot rather 7return the libraries, include directories, etc. from inside the sysroot rather
@@ -15,10 +15,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
15 1 file changed, 7 insertions(+) 15 1 file changed, 7 insertions(+)
16 16
17diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp 17diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp
18index 7e74b7c9081..8aa541aae38 100644 18index 1a2f04552d13..019d8f2b5c5e 100644
19--- a/llvm/tools/llvm-config/llvm-config.cpp 19--- a/llvm/tools/llvm-config/llvm-config.cpp
20+++ b/llvm/tools/llvm-config/llvm-config.cpp 20+++ b/llvm/tools/llvm-config/llvm-config.cpp
21@@ -248,6 +248,13 @@ Typical components:\n\ 21@@ -247,6 +247,13 @@ Typical components:\n\
22 22
23 /// Compute the path to the main executable. 23 /// Compute the path to the main executable.
24 std::string GetExecutablePath(const char *Argv0) { 24 std::string GetExecutablePath(const char *Argv0) {
@@ -32,6 +32,3 @@ index 7e74b7c9081..8aa541aae38 100644
32 // This just needs to be some symbol in the binary; C++ doesn't 32 // This just needs to be some symbol in the binary; C++ doesn't
33 // allow taking the address of ::main however. 33 // allow taking the address of ::main however.
34 void *P = (void *)(intptr_t)GetExecutablePath; 34 void *P = (void *)(intptr_t)GetExecutablePath;
35--
362.27.0
37
diff --git a/recipes-devtools/clang/clang/0008-clang-driver-Check-sysroot-for-ldso-path.patch b/recipes-devtools/clang/clang/0008-clang-driver-Check-sysroot-for-ldso-path.patch
index ec5dc42..3aff19a 100644
--- a/recipes-devtools/clang/clang/0008-clang-driver-Check-sysroot-for-ldso-path.patch
+++ b/recipes-devtools/clang/clang/0008-clang-driver-Check-sysroot-for-ldso-path.patch
@@ -1,7 +1,7 @@
1From 2b6da98883ad4d97df3016d89edff4c5cf9c1324 Mon Sep 17 00:00:00 2001 1From 09a0e9e8e39b31570f00ac70880e60377ce38973 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 08/24] clang: driver: Check sysroot for ldso path 4Subject: [PATCH] clang: driver: Check sysroot for ldso path
5 5
6OE does not necessarily follow the default path for the dynamic linker, 6OE does not necessarily follow the default path for the dynamic linker,
7therefore adjust it for OE. Check for the default path, and if it isn't 7therefore adjust it for OE. Check for the default path, and if it isn't
@@ -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 180350476c3..8606705b721 100644 17index e17a6bd4bdd2..199d9c867c96 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@@ -499,11 +499,19 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 20@@ -516,11 +516,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 180350476c3..8606705b721 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@@ -525,6 +533,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 40@@ -542,6 +550,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 180350476c3..8606705b721 100644
48 break; 48 break;
49 case llvm::Triple::systemz: 49 case llvm::Triple::systemz:
50 LibDir = "lib"; 50 LibDir = "lib";
51@@ -539,6 +551,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 51@@ -556,6 +568,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";
@@ -59,6 +59,3 @@ index 180350476c3..8606705b721 100644
59 break; 59 break;
60 } 60 }
61 case llvm::Triple::ve: 61 case llvm::Triple::ve:
62--
632.27.0
64
diff --git a/recipes-devtools/clang/clang/0009-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch b/recipes-devtools/clang/clang/0009-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch
index 2ab33a3..38c48d3 100644
--- a/recipes-devtools/clang/clang/0009-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch
+++ b/recipes-devtools/clang/clang/0009-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch
@@ -1,7 +1,7 @@
1From 157f27cb0796c8af04177e8472627207dde0950f Mon Sep 17 00:00:00 2001 1From 88f44c237f409d091966cebfbeff6c089d212b20 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 09/24] clang: Driver/tools.cpp: Add -lssp_nonshared on musl 4Subject: [PATCH] clang: Driver/tools.cpp: Add -lssp_nonshared on musl
5 5
6musl driver will need to add ssp_nonshared for stack_check_local 6musl driver will need to add ssp_nonshared for stack_check_local
7on the linker cmdline when using stack protector commands on 7on the linker cmdline when using stack protector commands on
@@ -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 c8a7fce07ef..48723c507a1 100644 16index 1d8a3cdce92a..195a302c8771 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@@ -630,6 +630,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, 19@@ -628,6 +628,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
@@ -29,6 +29,3 @@ index c8a7fce07ef..48723c507a1 100644
29 if (IsStatic || IsStaticPIE) 29 if (IsStatic || IsStaticPIE)
30 CmdArgs.push_back("--end-group"); 30 CmdArgs.push_back("--end-group");
31 else 31 else
32--
332.27.0
34
diff --git a/recipes-devtools/clang/clang/0010-clang-musl-ppc-does-not-support-128-bit-long-double.patch b/recipes-devtools/clang/clang/0010-clang-musl-ppc-does-not-support-128-bit-long-double.patch
index c402b8b..70cebab 100644
--- a/recipes-devtools/clang/clang/0010-clang-musl-ppc-does-not-support-128-bit-long-double.patch
+++ b/recipes-devtools/clang/clang/0010-clang-musl-ppc-does-not-support-128-bit-long-double.patch
@@ -1,7 +1,7 @@
1From ae0fcdcf66b3b633dd48a69cf5e0e2e905d184e0 Mon Sep 17 00:00:00 2001 1From 4c5c8ed9d14942e9c16cfdfb39257dc265a007c5 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 10 May 2016 02:00:11 -0700 3Date: Tue, 10 May 2016 02:00:11 -0700
4Subject: [PATCH 10/24] clang: musl/ppc does not support 128-bit long double 4Subject: [PATCH] clang: musl/ppc does not support 128-bit long double
5 5
6Signed-off-by: Khem Raj <raj.khem@gmail.com> 6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7--- 7---
@@ -9,10 +9,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
9 1 file changed, 4 insertions(+) 9 1 file changed, 4 insertions(+)
10 10
11diff --git a/clang/lib/Basic/Targets/PPC.h b/clang/lib/Basic/Targets/PPC.h 11diff --git a/clang/lib/Basic/Targets/PPC.h b/clang/lib/Basic/Targets/PPC.h
12index 858059bacb8..1d0d2ee65ea 100644 12index 56c8f33ef221..b7e7edf270be 100644
13--- a/clang/lib/Basic/Targets/PPC.h 13--- a/clang/lib/Basic/Targets/PPC.h
14+++ b/clang/lib/Basic/Targets/PPC.h 14+++ b/clang/lib/Basic/Targets/PPC.h
15@@ -382,6 +382,10 @@ public: 15@@ -386,6 +386,10 @@ public:
16 LongDoubleFormat = &llvm::APFloat::IEEEdouble(); 16 LongDoubleFormat = &llvm::APFloat::IEEEdouble();
17 } 17 }
18 18
@@ -23,6 +23,3 @@ index 858059bacb8..1d0d2ee65ea 100644
23 // PPC32 supports atomics up to 4 bytes. 23 // PPC32 supports atomics up to 4 bytes.
24 MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32; 24 MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32;
25 } 25 }
26--
272.27.0
28
diff --git a/recipes-devtools/clang/clang/0011-clang-Prepend-trailing-to-sysroot.patch b/recipes-devtools/clang/clang/0011-clang-Prepend-trailing-to-sysroot.patch
index 0692cf6..d9de6bf 100644
--- a/recipes-devtools/clang/clang/0011-clang-Prepend-trailing-to-sysroot.patch
+++ b/recipes-devtools/clang/clang/0011-clang-Prepend-trailing-to-sysroot.patch
@@ -1,7 +1,7 @@
1From d9abc62bb1e99f56df20194122a1aac5a74d0282 Mon Sep 17 00:00:00 2001 1From 20a2d20cb5c2eaa624a3ac514a663104c62786bf 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 11/24] clang: Prepend trailing '/' to sysroot 4Subject: [PATCH] clang: Prepend trailing '/' to sysroot
5 5
6This is needed to handle a case where clang 6This is needed to handle a case where clang
7isntall and target sysroot are perilously same 7isntall and target sysroot are perilously same
@@ -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 8606705b721..d908e40d86e 100644 27index 199d9c867c96..520ae5a7d2cf 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@@ -214,7 +214,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) 30@@ -218,7 +218,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();
@@ -36,6 +36,3 @@ index 8606705b721..d908e40d86e 100644
36 ToolChain::path_list &PPaths = getProgramPaths(); 36 ToolChain::path_list &PPaths = getProgramPaths();
37 37
38 Generic_GCC::PushPPaths(PPaths); 38 Generic_GCC::PushPPaths(PPaths);
39--
402.27.0
41
diff --git a/recipes-devtools/clang/clang/0012-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch b/recipes-devtools/clang/clang/0012-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch
index 2889bcf..f84dcaf 100644
--- a/recipes-devtools/clang/clang/0012-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch
+++ b/recipes-devtools/clang/clang/0012-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch
@@ -1,8 +1,7 @@
1From 30b2a171ab5b3649ae34d1ccab4920435ef4167e Mon Sep 17 00:00:00 2001 1From b1b677981b251e231b863dabbed938b7ece54eef 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 12/24] clang: Look inside the target sysroot for compiler 4Subject: [PATCH] clang: Look inside the target sysroot for compiler runtime
5 runtime
6 5
7In OE compiler-rt and libc++ are built and staged into target 6In OE compiler-rt and libc++ are built and staged into target
8sysroot and not into resourcedir which is relative to clang 7sysroot and not into resourcedir which is relative to clang
@@ -16,7 +15,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
16 1 file changed, 5 insertions(+), 1 deletion(-) 15 1 file changed, 5 insertions(+), 1 deletion(-)
17 16
18diff --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
19index b8c12fc9241..ee53fd4925f 100644 18index b2ddef141a75..784a946b453f 100644
20--- a/clang/lib/Driver/ToolChain.cpp 19--- a/clang/lib/Driver/ToolChain.cpp
21+++ b/clang/lib/Driver/ToolChain.cpp 20+++ b/clang/lib/Driver/ToolChain.cpp
22@@ -14,6 +14,7 @@ 21@@ -14,6 +14,7 @@
@@ -27,7 +26,7 @@ index b8c12fc9241..ee53fd4925f 100644
27 #include "clang/Config/config.h" 26 #include "clang/Config/config.h"
28 #include "clang/Driver/Action.h" 27 #include "clang/Driver/Action.h"
29 #include "clang/Driver/Driver.h" 28 #include "clang/Driver/Driver.h"
30@@ -397,7 +398,10 @@ StringRef ToolChain::getOSLibName() const { 29@@ -404,7 +405,10 @@ StringRef ToolChain::getOSLibName() const {
31 } 30 }
32 31
33 std::string ToolChain::getCompilerRTPath() const { 32 std::string ToolChain::getCompilerRTPath() const {
@@ -39,6 +38,3 @@ index b8c12fc9241..ee53fd4925f 100644
39 if (Triple.isOSUnknown()) { 38 if (Triple.isOSUnknown()) {
40 llvm::sys::path::append(Path, "lib"); 39 llvm::sys::path::append(Path, "lib");
41 } else { 40 } else {
42--
432.27.0
44
diff --git a/recipes-devtools/clang/clang/0013-clang-Define-releative-gcc-installation-dir.patch b/recipes-devtools/clang/clang/0013-clang-Define-releative-gcc-installation-dir.patch
index c23c882..47f897b 100644
--- a/recipes-devtools/clang/clang/0013-clang-Define-releative-gcc-installation-dir.patch
+++ b/recipes-devtools/clang/clang/0013-clang-Define-releative-gcc-installation-dir.patch
@@ -1,7 +1,7 @@
1From 7d7eb4b90e924649f317233fd87c3b700f98d4c0 Mon Sep 17 00:00:00 2001 1From 3658b52189bdbd9e742c0166d9bc919d4195b40e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 21 May 2017 15:38:25 -0700 3Date: Sun, 21 May 2017 15:38:25 -0700
4Subject: [PATCH 13/24] clang: Define / releative gcc installation dir 4Subject: [PATCH] clang: Define / releative gcc installation dir
5 5
6This is required for OE gcc installation to work. 6This is required for OE gcc installation to work.
7Without this its not able to find the paths for libgcc 7Without this its not able to find the paths for libgcc
@@ -10,23 +10,36 @@ installation in OE
10 10
11Signed-off-by: Khem Raj <raj.khem@gmail.com> 11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12--- 12---
13 clang/lib/Driver/ToolChains/Gnu.cpp | 3 +++ 13 clang/lib/Driver/ToolChains/Gnu.cpp | 12 ++++++------
14 1 file changed, 3 insertions(+) 14 1 file changed, 6 insertions(+), 6 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 48723c507a1..d02e644c720 100644 17index 195a302c8771..05d1d3003881 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@@ -2481,6 +2481,9 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( 20@@ -2514,12 +2514,6 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
21 {"gcc-cross/" + CandidateTriple.str(), "../..", 21 // Whether this library suffix is relevant for the triple.
22 TargetTriple.getOS() != llvm::Triple::Solaris}, 22 bool Active;
23 23 } Suffixes[] = {
24+ // OE cross-compilers path structures 24- // This is the normal place.
25+ {"/" + CandidateTriple.str(), "..", true}, 25- {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists},
26+ 26-
27- // Debian puts cross-compilers in gcc-cross.
28- {"gcc-cross/" + CandidateTriple.str(), "../..", GCCCrossDirExists},
29-
27 // The Freescale PPC SDK has the gcc libraries in 30 // The Freescale PPC SDK has the gcc libraries in
28 // <sysroot>/usr/lib/<triple>/x.y.z so have a look there as well. Only do 31 // <sysroot>/usr/lib/<triple>/x.y.z so have a look there as well. Only do
29 // this on Freescale triples, though, since some systems put a *lot* of 32 // this on Freescale triples, though, since some systems put a *lot* of
30-- 33@@ -2528,6 +2522,12 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
312.27.0 34 TargetTriple.getVendor() == llvm::Triple::Freescale ||
32 35 TargetTriple.getVendor() == llvm::Triple::OpenEmbedded},
36
37+ // This is the normal place.
38+ {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists},
39+
40+ // Debian puts cross-compilers in gcc-cross.
41+ {"gcc-cross/" + CandidateTriple.str(), "../..", GCCCrossDirExists},
42+
43 // Natively multiarch systems sometimes put the GCC triple-specific
44 // directory within their multiarch lib directory, resulting in the
45 // triple appearing twice.
diff --git a/recipes-devtools/clang/clang/0014-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch b/recipes-devtools/clang/clang/0014-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch
index c363b15..08f4222 100644
--- a/recipes-devtools/clang/clang/0014-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch
+++ b/recipes-devtools/clang/clang/0014-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch
@@ -1,7 +1,7 @@
1From 9413eabd3659763c550d6beb2d5290228758a53b Mon Sep 17 00:00:00 2001 1From 7b8ad95e1e5953234df3e06d5d01cbdd1a8c051d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 16 Aug 2017 15:16:15 -0700 3Date: Wed, 16 Aug 2017 15:16:15 -0700
4Subject: [PATCH 14/24] clang: Fix ldso for musl on x86 and x32 architectures 4Subject: [PATCH] clang: Fix ldso for musl on x86 and x32 architectures
5 5
6x32 linker is called ld-musl-x32.so.1 and x86 linker 6x32 linker is called ld-musl-x32.so.1 and x86 linker
7is called ld-musl-i386.so.1, Currently, linker for 7is called ld-musl-i386.so.1, Currently, linker for
@@ -14,10 +14,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 1 file changed, 8 insertions(+) 14 1 file changed, 8 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 d908e40d86e..add122d5cc8 100644 17index 520ae5a7d2cf..8b72e8f505fe 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@@ -422,6 +422,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 20@@ -435,6 +435,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
21 if (Triple.isMusl()) { 21 if (Triple.isMusl()) {
22 std::string ArchName; 22 std::string ArchName;
23 bool IsArm = false; 23 bool IsArm = false;
@@ -25,7 +25,7 @@ index d908e40d86e..add122d5cc8 100644
25 25
26 switch (Arch) { 26 switch (Arch) {
27 case llvm::Triple::arm: 27 case llvm::Triple::arm:
28@@ -434,6 +435,13 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 28@@ -447,6 +448,13 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
29 ArchName = "armeb"; 29 ArchName = "armeb";
30 IsArm = true; 30 IsArm = true;
31 break; 31 break;
@@ -39,6 +39,3 @@ index d908e40d86e..add122d5cc8 100644
39 default: 39 default:
40 ArchName = Triple.getArchName().str(); 40 ArchName = Triple.getArchName().str();
41 } 41 }
42--
432.27.0
44
diff --git a/recipes-devtools/clang/clang/0015-clang-scan-view-needs-python-2.x.patch b/recipes-devtools/clang/clang/0015-clang-scan-view-needs-python-2.x.patch
index 3cac628..97dc0cc 100644
--- a/recipes-devtools/clang/clang/0015-clang-scan-view-needs-python-2.x.patch
+++ b/recipes-devtools/clang/clang/0015-clang-scan-view-needs-python-2.x.patch
@@ -1,7 +1,7 @@
1From fa612803a3b55d763ad5498babd2f6bc81c6109b Mon Sep 17 00:00:00 2001 1From 330f45191d4e73ac50131d278fa201b56c173880 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 15 May 2018 10:28:43 -0700 3Date: Tue, 15 May 2018 10:28:43 -0700
4Subject: [PATCH 15/24] clang: scan-view needs python 2.x 4Subject: [PATCH] clang: scan-view needs python 2.x
5 5
6Some distributions e.g. archlinux have switched to pointing 6Some distributions e.g. archlinux have switched to pointing
7python to python3, therefore its better to be specific about 7python to python3, therefore its better to be specific about
@@ -13,7 +13,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 1 file changed, 1 insertion(+), 1 deletion(-) 13 1 file changed, 1 insertion(+), 1 deletion(-)
14 14
15diff --git a/clang/tools/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view 15diff --git a/clang/tools/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view
16index 6165432e7af..04ad518a60c 100755 16index 6165432e7af8..04ad518a60cd 100755
17--- a/clang/tools/scan-view/bin/scan-view 17--- a/clang/tools/scan-view/bin/scan-view
18+++ b/clang/tools/scan-view/bin/scan-view 18+++ b/clang/tools/scan-view/bin/scan-view
19@@ -1,4 +1,4 @@ 19@@ -1,4 +1,4 @@
@@ -22,6 +22,3 @@ index 6165432e7af..04ad518a60c 100755
22 22
23 from __future__ import print_function 23 from __future__ import print_function
24 24
25--
262.27.0
27
diff --git a/recipes-devtools/clang/clang/0016-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch b/recipes-devtools/clang/clang/0016-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch
index a57ffb3..4c450ca 100644
--- a/recipes-devtools/clang/clang/0016-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch
+++ b/recipes-devtools/clang/clang/0016-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch
@@ -1,8 +1,8 @@
1From a1d6f91cac4f24890081be8f594eef7ef09919e3 Mon Sep 17 00:00:00 2001 1From e5457a0d477d7a0f7fffef56670450744881554f 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 16/24] clang: Add -lpthread and -ldl along with -lunwind for 4Subject: [PATCH] clang: Add -lpthread and -ldl along with -lunwind for static
5 static linking 5 linking
6 6
7When doing static liking with --unwindlib=libunwind -static we encounter 7When doing static liking with --unwindlib=libunwind -static we encounter
8undefined symbols 8undefined symbols
@@ -20,10 +20,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
20 1 file changed, 6 insertions(+), 1 deletion(-) 20 1 file changed, 6 insertions(+), 1 deletion(-)
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 1cac5a0822a..29fe4a33a14 100644 23index bcaea71dca94..95b806e29ef2 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@@ -1275,8 +1275,13 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D, 26@@ -1423,8 +1423,13 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D,
27 // Let the linker choose between libunwind.dll.a and libunwind.a 27 // Let the linker choose between libunwind.dll.a and libunwind.a
28 // depending on what's available, and depending on the -static flag 28 // depending on what's available, and depending on the -static flag
29 CmdArgs.push_back("-lunwind"); 29 CmdArgs.push_back("-lunwind");
@@ -38,6 +38,3 @@ index 1cac5a0822a..29fe4a33a14 100644
38 break; 38 break;
39 } 39 }
40 40
41--
422.27.0
43
diff --git a/recipes-devtools/clang/clang/0017-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch b/recipes-devtools/clang/clang/0017-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch
index 5b55c4e..e7fffbe 100644
--- a/recipes-devtools/clang/clang/0017-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch
+++ b/recipes-devtools/clang/clang/0017-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch
@@ -1,8 +1,7 @@
1From f6bbe3e375104b495d7b0340d9df2c08f853c290 Mon Sep 17 00:00:00 2001 1From 20ad7e5562772d10d5edaafc1a054a26e91ccdb5 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 17/24] Pass PYTHON_EXECUTABLE when cross compiling for native 4Subject: [PATCH] Pass PYTHON_EXECUTABLE when cross compiling for native build
5 build
6 5
7Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> 6Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
8Signed-off-by: Khem Raj <raj.khem@gmail.com> 7Signed-off-by: Khem Raj <raj.khem@gmail.com>
@@ -11,7 +10,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
11 1 file changed, 1 insertion(+) 10 1 file changed, 1 insertion(+)
12 11
13diff --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
14index 01cd3712484..f50be9d967d 100644 13index 01cd37124841..f50be9d967df 100644
15--- a/llvm/cmake/modules/CrossCompile.cmake 14--- a/llvm/cmake/modules/CrossCompile.cmake
16+++ b/llvm/cmake/modules/CrossCompile.cmake 15+++ b/llvm/cmake/modules/CrossCompile.cmake
17@@ -79,6 +79,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype) 16@@ -79,6 +79,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype)
@@ -22,6 +21,3 @@ index 01cd3712484..f50be9d967d 100644
22 ${build_type_flags} ${linker_flag} ${external_clang_dir} 21 ${build_type_flags} ${linker_flag} ${external_clang_dir}
23 ${ARGN} 22 ${ARGN}
24 WORKING_DIRECTORY ${${project_name}_${target_name}_BUILD} 23 WORKING_DIRECTORY ${${project_name}_${target_name}_BUILD}
25--
262.27.0
27
diff --git a/recipes-devtools/clang/clang/0018-Check-for-atomic-double-intrinsics.patch b/recipes-devtools/clang/clang/0018-Check-for-atomic-double-intrinsics.patch
index e6df535..3e66ebb 100644
--- a/recipes-devtools/clang/clang/0018-Check-for-atomic-double-intrinsics.patch
+++ b/recipes-devtools/clang/clang/0018-Check-for-atomic-double-intrinsics.patch
@@ -1,7 +1,7 @@
1From 9f3168a04fcf9b44c7850c5977e8f1dfa2c4a2ff Mon Sep 17 00:00:00 2001 1From 1fbeaabbc22e1f665889a0f3fec5bb435207649b 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 18/24] Check for atomic<double> intrinsics 4Subject: [PATCH] Check for atomic<double> intrinsics
5 5
6On some architectures e.g. x86/32bit gcc decides to inline calls to 6On some architectures e.g. x86/32bit gcc decides to inline calls to
7double atomic variables but clang does not and defers it to libatomic 7double atomic variables but clang does not and defers it to libatomic
@@ -15,21 +15,19 @@ 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 d0b75f3bcc9..8ebe83b0d31 100644 18index 04eed1448482..e890cfecd139 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,9 +30,10 @@ function(check_working_cxx_atomics64 varname) 21@@ -30,10 +30,11 @@ function(check_working_cxx_atomics64 varname)
22 #include <atomic> 22 #include <atomic>
23 #include <cstdint> 23 #include <cstdint>
24 std::atomic<uint64_t> x (0); 24 std::atomic<uint64_t> x (0);
25+std::atomic<double> y (0); 25+std::atomic<double> y (0);
26 int main() { 26 int main() {
27 uint64_t i = x.load(std::memory_order_relaxed); 27 uint64_t i = x.load(std::memory_order_relaxed);
28 (void)i;
28- return 0; 29- return 0;
29+ return int(y); 30+ return int(y);
30 } 31 }
31 " ${varname}) 32 " ${varname})
32 set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) 33 set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
33--
342.27.0
35
diff --git a/recipes-devtools/clang/clang/0019-clang-Enable-SSP-and-PIE-by-default.patch b/recipes-devtools/clang/clang/0019-clang-Enable-SSP-and-PIE-by-default.patch
index 5e92940..9f73947 100644
--- a/recipes-devtools/clang/clang/0019-clang-Enable-SSP-and-PIE-by-default.patch
+++ b/recipes-devtools/clang/clang/0019-clang-Enable-SSP-and-PIE-by-default.patch
@@ -1,7 +1,7 @@
1From c93bfc2e7cf6e4abb077e3b18d8adf0985e707f6 Mon Sep 17 00:00:00 2001 1From 460c9c3c8d6384613f3a12af6f27513d1a2222f0 Mon Sep 17 00:00:00 2001
2From: Evangelos Foutras <evangelos@foutrelis.com> 2From: Evangelos Foutras <evangelos@foutrelis.com>
3Date: Thu, 26 Dec 2019 15:46:19 -0800 3Date: Thu, 26 Dec 2019 15:46:19 -0800
4Subject: [PATCH 19/24] clang: Enable SSP and PIE by default 4Subject: [PATCH] clang: Enable SSP and PIE by default
5 5
6This is a minimal set of changes needed to make clang use SSP and PIE by 6This is a minimal set of changes needed to make clang use SSP and PIE by
7default on Arch Linux. Tests that were easy to adjust have been changed 7default on Arch Linux. Tests that were easy to adjust have been changed
@@ -21,8 +21,8 @@ Taken from ArchLinux - https://git.archlinux.org/svntogit/packages.git/plain/tru
21 21
22Signed-off-by: Khem Raj <raj.khem@gmail.com> 22Signed-off-by: Khem Raj <raj.khem@gmail.com>
23--- 23---
24 clang/lib/Driver/ToolChains/Linux.cpp | 14 ++++++++++++-- 24 clang/lib/Driver/ToolChains/Linux.cpp | 10 ++++++++--
25 clang/lib/Driver/ToolChains/Linux.h | 1 + 25 clang/lib/Driver/ToolChains/Linux.h | 4 ++++
26 clang/test/Driver/cross-linux.c | 16 ++++++++-------- 26 clang/test/Driver/cross-linux.c | 16 ++++++++--------
27 clang/test/Driver/env.c | 2 +- 27 clang/test/Driver/env.c | 2 +-
28 clang/test/Driver/fsanitize.c | 14 +++++++------- 28 clang/test/Driver/fsanitize.c | 14 +++++++-------
@@ -34,13 +34,13 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
34 clang/test/Driver/riscv32-toolchain.c | 4 ++-- 34 clang/test/Driver/riscv32-toolchain.c | 4 ++--
35 clang/test/Driver/riscv64-toolchain.c | 4 ++-- 35 clang/test/Driver/riscv64-toolchain.c | 4 ++--
36 clang/test/Driver/stack-protector.c | 4 ++-- 36 clang/test/Driver/stack-protector.c | 4 ++--
37 13 files changed, 43 insertions(+), 30 deletions(-) 37 13 files changed, 42 insertions(+), 30 deletions(-)
38 38
39diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp 39diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
40index add122d5cc8..9128d4e0fa0 100644 40index 8b72e8f505fe..98f54a935465 100644
41--- a/clang/lib/Driver/ToolChains/Linux.cpp 41--- a/clang/lib/Driver/ToolChains/Linux.cpp
42+++ b/clang/lib/Driver/ToolChains/Linux.cpp 42+++ b/clang/lib/Driver/ToolChains/Linux.cpp
43@@ -843,8 +843,18 @@ void Linux::AddIAMCUIncludeArgs(const ArgList &DriverArgs, 43@@ -865,8 +865,14 @@ void Linux::AddIAMCUIncludeArgs(const ArgList &DriverArgs,
44 } 44 }
45 45
46 bool Linux::isPIEDefault() const { 46 bool Linux::isPIEDefault() const {
@@ -54,27 +54,26 @@ index add122d5cc8..9128d4e0fa0 100644
54+ getTriple().isMusl() || getSanitizerArgs().requiresPIE(); 54+ getTriple().isMusl() || getSanitizerArgs().requiresPIE();
55+ 55+
56+ return true; 56+ return true;
57+}
58+
59+unsigned Linux::GetDefaultStackProtectorLevel(bool KernelOrKext) const {
60+ return 2;
61 } 57 }
62 58
63 bool Linux::isNoExecStackDefault() const { 59 bool Linux::isNoExecStackDefault() const {
64diff --git a/clang/lib/Driver/ToolChains/Linux.h b/clang/lib/Driver/ToolChains/Linux.h 60diff --git a/clang/lib/Driver/ToolChains/Linux.h b/clang/lib/Driver/ToolChains/Linux.h
65index 6b16b0e6499..d0024110aef 100644 61index 6b16b0e64990..582d4bef81df 100644
66--- a/clang/lib/Driver/ToolChains/Linux.h 62--- a/clang/lib/Driver/ToolChains/Linux.h
67+++ b/clang/lib/Driver/ToolChains/Linux.h 63+++ b/clang/lib/Driver/ToolChains/Linux.h
68@@ -39,6 +39,7 @@ public: 64@@ -39,6 +39,10 @@ public:
69 bool isPIEDefault() const override; 65 bool isPIEDefault() const override;
70 bool isNoExecStackDefault() const override; 66 bool isNoExecStackDefault() const override;
71 bool IsMathErrnoDefault() const override; 67 bool IsMathErrnoDefault() const override;
72+ unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override; 68+ virtual LangOptions::StackProtectorMode
69+ GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
70+ return LangOptions::SSPStrong;
71+ }
73 SanitizerMask getSupportedSanitizers() const override; 72 SanitizerMask getSupportedSanitizers() const override;
74 void addProfileRTLibs(const llvm::opt::ArgList &Args, 73 void addProfileRTLibs(const llvm::opt::ArgList &Args,
75 llvm::opt::ArgStringList &CmdArgs) const override; 74 llvm::opt::ArgStringList &CmdArgs) const override;
76diff --git a/clang/test/Driver/cross-linux.c b/clang/test/Driver/cross-linux.c 75diff --git a/clang/test/Driver/cross-linux.c b/clang/test/Driver/cross-linux.c
77index 6c2dab26069..c28c5653e34 100644 76index 6c2dab260695..c28c5653e348 100644
78--- a/clang/test/Driver/cross-linux.c 77--- a/clang/test/Driver/cross-linux.c
79+++ b/clang/test/Driver/cross-linux.c 78+++ b/clang/test/Driver/cross-linux.c
80@@ -42,8 +42,8 @@ 79@@ -42,8 +42,8 @@
@@ -122,7 +121,7 @@ index 6c2dab26069..c28c5653e34 100644
122 // CHECK-MULTI64-X86-64: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib" 121 // CHECK-MULTI64-X86-64: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib"
123 // CHECK-MULTI64-X86-64: "-L[[sysroot]]/lib" 122 // CHECK-MULTI64-X86-64: "-L[[sysroot]]/lib"
124diff --git a/clang/test/Driver/env.c b/clang/test/Driver/env.c 123diff --git a/clang/test/Driver/env.c b/clang/test/Driver/env.c
125index 0371bc91c4a..ea89f525121 100644 124index 0371bc91c4a3..ea89f5251217 100644
126--- a/clang/test/Driver/env.c 125--- a/clang/test/Driver/env.c
127+++ b/clang/test/Driver/env.c 126+++ b/clang/test/Driver/env.c
128@@ -20,7 +20,7 @@ 127@@ -20,7 +20,7 @@
@@ -135,10 +134,10 @@ index 0371bc91c4a..ea89f525121 100644
135 // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib" 134 // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib"
136 // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.." 135 // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.."
137diff --git a/clang/test/Driver/fsanitize.c b/clang/test/Driver/fsanitize.c 136diff --git a/clang/test/Driver/fsanitize.c b/clang/test/Driver/fsanitize.c
138index 7340bfb35e4..681bb90b50e 100644 137index 8926d55a0cf4..40f628ccae45 100644
139--- a/clang/test/Driver/fsanitize.c 138--- a/clang/test/Driver/fsanitize.c
140+++ b/clang/test/Driver/fsanitize.c 139+++ b/clang/test/Driver/fsanitize.c
141@@ -329,15 +329,15 @@ 140@@ -330,15 +330,15 @@
142 // RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-sanitize=vptr -fsanitize=undefined,address %s -### 2>&1 141 // RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-sanitize=vptr -fsanitize=undefined,address %s -### 2>&1
143 // OK 142 // OK
144 143
@@ -158,7 +157,7 @@ index 7340bfb35e4..681bb90b50e 100644
158 157
159 // CHECK-NO-PIE-NOT: "-pie" 158 // CHECK-NO-PIE-NOT: "-pie"
160 // CHECK-NO-PIE: "-mrelocation-model" "static" 159 // CHECK-NO-PIE: "-mrelocation-model" "static"
161@@ -662,12 +662,12 @@ 160@@ -667,12 +667,12 @@
162 // RUN: %clang -fno-sanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NOSP 161 // RUN: %clang -fno-sanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NOSP
163 // NOSP-NOT: "-fsanitize=safe-stack" 162 // NOSP-NOT: "-fsanitize=safe-stack"
164 163
@@ -175,7 +174,7 @@ index 7340bfb35e4..681bb90b50e 100644
175 // NO-SP-NOT: stack-protector 174 // NO-SP-NOT: stack-protector
176 // NO-SP: "-fsanitize=safe-stack" 175 // NO-SP: "-fsanitize=safe-stack"
177diff --git a/clang/test/Driver/gcc-toolchain.cpp b/clang/test/Driver/gcc-toolchain.cpp 176diff --git a/clang/test/Driver/gcc-toolchain.cpp b/clang/test/Driver/gcc-toolchain.cpp
178index 6c872f4255c..f5006d1dd9a 100644 177index 6c872f4255c3..f5006d1dd9ab 100644
179--- a/clang/test/Driver/gcc-toolchain.cpp 178--- a/clang/test/Driver/gcc-toolchain.cpp
180+++ b/clang/test/Driver/gcc-toolchain.cpp 179+++ b/clang/test/Driver/gcc-toolchain.cpp
181@@ -26,6 +26,6 @@ 180@@ -26,6 +26,6 @@
@@ -187,7 +186,7 @@ index 6c872f4255c..f5006d1dd9a 100644
187 // CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5" 186 // CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5"
188 // CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../.." 187 // CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../.."
189diff --git a/clang/test/Driver/hexagon-toolchain-elf.c b/clang/test/Driver/hexagon-toolchain-elf.c 188diff --git a/clang/test/Driver/hexagon-toolchain-elf.c b/clang/test/Driver/hexagon-toolchain-elf.c
190index cc11f9fcba9..1fe8b5db587 100644 189index cc11f9fcba9e..1fe8b5db587b 100644
191--- a/clang/test/Driver/hexagon-toolchain-elf.c 190--- a/clang/test/Driver/hexagon-toolchain-elf.c
192+++ b/clang/test/Driver/hexagon-toolchain-elf.c 191+++ b/clang/test/Driver/hexagon-toolchain-elf.c
193@@ -487,7 +487,7 @@ 192@@ -487,7 +487,7 @@
@@ -200,7 +199,7 @@ index cc11f9fcba9..1fe8b5db587 100644
200 // CHECK042-NEXT: llvm-mc 199 // CHECK042-NEXT: llvm-mc
201 // CHECK042: "-gpsize=8" 200 // CHECK042: "-gpsize=8"
202diff --git a/clang/test/Driver/linux-as.c b/clang/test/Driver/linux-as.c 201diff --git a/clang/test/Driver/linux-as.c b/clang/test/Driver/linux-as.c
203index 77ac05f3094..cb474f32898 100644 202index 0959bd7ba0a1..4056a672b6f9 100644
204--- a/clang/test/Driver/linux-as.c 203--- a/clang/test/Driver/linux-as.c
205+++ b/clang/test/Driver/linux-as.c 204+++ b/clang/test/Driver/linux-as.c
206@@ -164,7 +164,7 @@ 205@@ -164,7 +164,7 @@
@@ -222,7 +221,7 @@ index 77ac05f3094..cb474f32898 100644
222 // CHECK-SPARCV9PIC: as 221 // CHECK-SPARCV9PIC: as
223 // CHECK-SPARCV9PIC: -64 222 // CHECK-SPARCV9PIC: -64
224diff --git a/clang/test/Driver/linux-ld.c b/clang/test/Driver/linux-ld.c 223diff --git a/clang/test/Driver/linux-ld.c b/clang/test/Driver/linux-ld.c
225index ec539522c25..caf96020a15 100644 224index 0b788ffcb852..0ee504cd00e3 100644
226--- a/clang/test/Driver/linux-ld.c 225--- a/clang/test/Driver/linux-ld.c
227+++ b/clang/test/Driver/linux-ld.c 226+++ b/clang/test/Driver/linux-ld.c
228@@ -1,3 +1,5 @@ 227@@ -1,3 +1,5 @@
@@ -232,28 +231,26 @@ index ec539522c25..caf96020a15 100644
232 // sysroot to make these tests independent of the host system. 231 // sysroot to make these tests independent of the host system.
233 // 232 //
234diff --git a/clang/test/Driver/ppc-abi.c b/clang/test/Driver/ppc-abi.c 233diff --git a/clang/test/Driver/ppc-abi.c b/clang/test/Driver/ppc-abi.c
235index acc4981a2ee..0d465516762 100644 234index a74a19953ca2..0ba4a14ab74f 100644
236--- a/clang/test/Driver/ppc-abi.c 235--- a/clang/test/Driver/ppc-abi.c
237+++ b/clang/test/Driver/ppc-abi.c 236+++ b/clang/test/Driver/ppc-abi.c
238@@ -32,11 +32,11 @@ 237@@ -26,9 +26,9 @@
239 238
240 // CHECK-ELFv1: "-mrelocation-model" "static" 239 // CHECK-ELFv1: "-mrelocation-model" "static"
241 // CHECK-ELFv1: "-target-abi" "elfv1" 240 // CHECK-ELFv1: "-target-abi" "elfv1"
242-// CHECK-ELFv1-LE: "-mrelocation-model" "static" 241-// CHECK-ELFv1-LE: "-mrelocation-model" "static"
243+// CHECK-ELFv1-LE: "-mrelocation-model" "pic" "-pic-level" "2" 242+// CHECK-ELFv1-LE: "-mrelocation-model" "pic" "-pic-level" "2"
244 // CHECK-ELFv1-LE: "-target-abi" "elfv1" 243 // CHECK-ELFv1-LE: "-target-abi" "elfv1"
245 // CHECK-ELFv1-QPX: "-mrelocation-model" "static"
246 // CHECK-ELFv1-QPX: "-target-abi" "elfv1-qpx"
247-// CHECK-ELFv2: "-mrelocation-model" "static" 244-// CHECK-ELFv2: "-mrelocation-model" "static"
248+// CHECK-ELFv2: "-mrelocation-model" "pic" "-pic-level" "2" 245+// CHECK-ELFv2: "-mrelocation-model" "pic" "-pic-level" "2"
249 // CHECK-ELFv2: "-target-abi" "elfv2" 246 // CHECK-ELFv2: "-target-abi" "elfv2"
250 // CHECK-ELFv2-BE: "-mrelocation-model" "static" 247 // CHECK-ELFv2-BE: "-mrelocation-model" "static"
251 // CHECK-ELFv2-BE: "-target-abi" "elfv2" 248 // CHECK-ELFv2-BE: "-target-abi" "elfv2"
252diff --git a/clang/test/Driver/riscv32-toolchain.c b/clang/test/Driver/riscv32-toolchain.c 249diff --git a/clang/test/Driver/riscv32-toolchain.c b/clang/test/Driver/riscv32-toolchain.c
253index b83c9aafcbf..15b6f6496b2 100644 250index a5852f5f3997..233d9ef003cf 100644
254--- a/clang/test/Driver/riscv32-toolchain.c 251--- a/clang/test/Driver/riscv32-toolchain.c
255+++ b/clang/test/Driver/riscv32-toolchain.c 252+++ b/clang/test/Driver/riscv32-toolchain.c
256@@ -81,7 +81,7 @@ 253@@ -84,7 +84,7 @@
257 // C-RV32-LINUX-MULTI-ILP32: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" 254 // C-RV32-LINUX-MULTI-ILP32: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot"
258 // C-RV32-LINUX-MULTI-ILP32: "-m" "elf32lriscv" 255 // C-RV32-LINUX-MULTI-ILP32: "-m" "elf32lriscv"
259 // C-RV32-LINUX-MULTI-ILP32: "-dynamic-linker" "/lib/ld-linux-riscv32-ilp32.so.1" 256 // C-RV32-LINUX-MULTI-ILP32: "-dynamic-linker" "/lib/ld-linux-riscv32-ilp32.so.1"
@@ -262,7 +259,7 @@ index b83c9aafcbf..15b6f6496b2 100644
262 // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32" 259 // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32"
263 // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib32/ilp32" 260 // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib32/ilp32"
264 // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib32/ilp32" 261 // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib32/ilp32"
265@@ -96,7 +96,7 @@ 262@@ -99,7 +99,7 @@
266 // C-RV32-LINUX-MULTI-ILP32D: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" 263 // C-RV32-LINUX-MULTI-ILP32D: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot"
267 // C-RV32-LINUX-MULTI-ILP32D: "-m" "elf32lriscv" 264 // C-RV32-LINUX-MULTI-ILP32D: "-m" "elf32lriscv"
268 // C-RV32-LINUX-MULTI-ILP32D: "-dynamic-linker" "/lib/ld-linux-riscv32-ilp32d.so.1" 265 // C-RV32-LINUX-MULTI-ILP32D: "-dynamic-linker" "/lib/ld-linux-riscv32-ilp32d.so.1"
@@ -272,10 +269,10 @@ index b83c9aafcbf..15b6f6496b2 100644
272 // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib32/ilp32d" 269 // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib32/ilp32d"
273 // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib32/ilp32d" 270 // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib32/ilp32d"
274diff --git a/clang/test/Driver/riscv64-toolchain.c b/clang/test/Driver/riscv64-toolchain.c 271diff --git a/clang/test/Driver/riscv64-toolchain.c b/clang/test/Driver/riscv64-toolchain.c
275index 5df069eb9fd..2617551ec35 100644 272index e727f20bb601..a801e5eee462 100644
276--- a/clang/test/Driver/riscv64-toolchain.c 273--- a/clang/test/Driver/riscv64-toolchain.c
277+++ b/clang/test/Driver/riscv64-toolchain.c 274+++ b/clang/test/Driver/riscv64-toolchain.c
278@@ -81,7 +81,7 @@ 275@@ -84,7 +84,7 @@
279 // C-RV64-LINUX-MULTI-LP64: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" 276 // C-RV64-LINUX-MULTI-LP64: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot"
280 // C-RV64-LINUX-MULTI-LP64: "-m" "elf64lriscv" 277 // C-RV64-LINUX-MULTI-LP64: "-m" "elf64lriscv"
281 // C-RV64-LINUX-MULTI-LP64: "-dynamic-linker" "/lib/ld-linux-riscv64-lp64.so.1" 278 // C-RV64-LINUX-MULTI-LP64: "-dynamic-linker" "/lib/ld-linux-riscv64-lp64.so.1"
@@ -284,7 +281,7 @@ index 5df069eb9fd..2617551ec35 100644
284 // C-RV64-LINUX-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib64/lp64" 281 // C-RV64-LINUX-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib64/lp64"
285 // C-RV64-LINUX-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib64/lp64" 282 // C-RV64-LINUX-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib64/lp64"
286 // C-RV64-LINUX-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib64/lp64" 283 // C-RV64-LINUX-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib64/lp64"
287@@ -96,7 +96,7 @@ 284@@ -99,7 +99,7 @@
288 // C-RV64-LINUX-MULTI-LP64D: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" 285 // C-RV64-LINUX-MULTI-LP64D: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot"
289 // C-RV64-LINUX-MULTI-LP64D: "-m" "elf64lriscv" 286 // C-RV64-LINUX-MULTI-LP64D: "-m" "elf64lriscv"
290 // C-RV64-LINUX-MULTI-LP64D: "-dynamic-linker" "/lib/ld-linux-riscv64-lp64d.so.1" 287 // C-RV64-LINUX-MULTI-LP64D: "-dynamic-linker" "/lib/ld-linux-riscv64-lp64d.so.1"
@@ -294,7 +291,7 @@ index 5df069eb9fd..2617551ec35 100644
294 // C-RV64-LINUX-MULTI-LP64D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib64/lp64d" 291 // C-RV64-LINUX-MULTI-LP64D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib64/lp64d"
295 // C-RV64-LINUX-MULTI-LP64D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib64/lp64d" 292 // C-RV64-LINUX-MULTI-LP64D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib64/lp64d"
296diff --git a/clang/test/Driver/stack-protector.c b/clang/test/Driver/stack-protector.c 293diff --git a/clang/test/Driver/stack-protector.c b/clang/test/Driver/stack-protector.c
297index a3e40b50eed..dfffe0d6cf8 100644 294index a3e40b50eed8..dfffe0d6cf85 100644
298--- a/clang/test/Driver/stack-protector.c 295--- a/clang/test/Driver/stack-protector.c
299+++ b/clang/test/Driver/stack-protector.c 296+++ b/clang/test/Driver/stack-protector.c
300@@ -3,11 +3,11 @@ 297@@ -3,11 +3,11 @@
@@ -311,6 +308,3 @@ index a3e40b50eed..dfffe0d6cf8 100644
311 // SSP-BUF: "-stack-protector-buffer-size" "16" 308 // SSP-BUF: "-stack-protector-buffer-size" "16"
312 309
313 // RUN: %clang -target i386-pc-openbsd -### %s 2>&1 | FileCheck %s -check-prefix=OPENBSD 310 // RUN: %clang -target i386-pc-openbsd -### %s 2>&1 | FileCheck %s -check-prefix=OPENBSD
314--
3152.27.0
316
diff --git a/recipes-devtools/clang/clang/0020-libcxx-Add-compiler-runtime-library-to-link-step-for.patch b/recipes-devtools/clang/clang/0020-libcxx-Add-compiler-runtime-library-to-link-step-for.patch
index afa5325..118742a 100644
--- a/recipes-devtools/clang/clang/0020-libcxx-Add-compiler-runtime-library-to-link-step-for.patch
+++ b/recipes-devtools/clang/clang/0020-libcxx-Add-compiler-runtime-library-to-link-step-for.patch
@@ -1,8 +1,7 @@
1From 70646ae410a97feb236b84bbb46fa8ff8e7da79a Mon Sep 17 00:00:00 2001 1From 81ece1b8e6762676679106f2c17c5fdd2aad3035 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 20/24] libcxx: Add compiler runtime library to link step for 4Subject: [PATCH] libcxx: Add compiler runtime library to link step for libcxx
5 libcxx
6 5
7This corrects "undefined reference to __divti3" 6This corrects "undefined reference to __divti3"
8 7
@@ -15,19 +14,19 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
15 1 file changed, 2 insertions(+), 2 deletions(-) 14 1 file changed, 2 insertions(+), 2 deletions(-)
16 15
17diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt 16diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
18index 2001c09761d..59ba5f7490c 100644 17index 9965104cb5b2..bee4d80bc67a 100644
19--- a/libcxx/src/CMakeLists.txt 18--- a/libcxx/src/CMakeLists.txt
20+++ b/libcxx/src/CMakeLists.txt 19+++ b/libcxx/src/CMakeLists.txt
21@@ -164,7 +164,7 @@ if (LIBCXX_ENABLE_SHARED) 20@@ -177,7 +177,7 @@ split_list(LIBCXX_LINK_FLAGS)
22 llvm_setup_rpath(cxx_shared) 21 if (LIBCXX_ENABLE_SHARED)
23 endif() 22 add_library(cxx_shared SHARED ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
24 target_link_libraries(cxx_shared PUBLIC cxx-headers 23 target_link_libraries(cxx_shared PUBLIC cxx-headers
25- PRIVATE ${LIBCXX_LIBRARIES}) 24- PRIVATE ${LIBCXX_LIBRARIES})
26+ PRIVATE ${LIBCXX_LIBRARIES} "$$($$CC --print-libgcc-file-name)") 25+ PRIVATE ${LIBCXX_LIBRARIES} "$$($$CC --print-libgcc-file-name)")
27 set_target_properties(cxx_shared 26 set_target_properties(cxx_shared
28 PROPERTIES 27 PROPERTIES
29 COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}" 28 COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
30@@ -246,7 +246,7 @@ endif() 29@@ -252,7 +252,7 @@ endif()
31 if (LIBCXX_ENABLE_STATIC) 30 if (LIBCXX_ENABLE_STATIC)
32 add_library(cxx_static STATIC ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS}) 31 add_library(cxx_static STATIC ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
33 target_link_libraries(cxx_static PUBLIC cxx-headers 32 target_link_libraries(cxx_static PUBLIC cxx-headers
@@ -36,6 +35,3 @@ index 2001c09761d..59ba5f7490c 100644
36 set(CMAKE_STATIC_LIBRARY_PREFIX "lib") 35 set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
37 set_target_properties(cxx_static 36 set_target_properties(cxx_static
38 PROPERTIES 37 PROPERTIES
39--
402.27.0
41
diff --git a/recipes-devtools/clang/clang/0021-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch b/recipes-devtools/clang/clang/0021-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch
index 09bc9d8..0ed15f0 100644
--- a/recipes-devtools/clang/clang/0021-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch
+++ b/recipes-devtools/clang/clang/0021-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch
@@ -1,7 +1,7 @@
1From f48b53ec65d4138139339f4d1cdc12c4e1a1c042 Mon Sep 17 00:00:00 2001 1From 62e0614c52cc2b084d993914451b5290759a1187 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 21/24] clang,llvm: cmake: Fix configure for packages using 4Subject: [PATCH] clang,llvm: cmake: Fix configure for packages using
5 find_package() 5 find_package()
6 6
7Currently, when a package (i.e. bcc [https://github.com/iovisor/bcc.git]) 7Currently, when a package (i.e. bcc [https://github.com/iovisor/bcc.git])
@@ -32,7 +32,7 @@ Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
32 3 files changed, 33 deletions(-) 32 3 files changed, 33 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 704278a0e93..6ea99c90772 100644 35index 704278a0e93b..6ea99c90772c 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@@ -161,15 +161,8 @@ macro(add_clang_tool name) 38@@ -161,15 +161,8 @@ macro(add_clang_tool name)
@@ -60,10 +60,10 @@ index 704278a0e93..6ea99c90772 100644
60 endmacro() 60 endmacro()
61 61
62diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake 62diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
63index 333167bfb6b..f00fd98bdb2 100644 63index 97c9980c7de3..2cb2ead31ba0 100644
64--- a/llvm/cmake/modules/AddLLVM.cmake 64--- a/llvm/cmake/modules/AddLLVM.cmake
65+++ b/llvm/cmake/modules/AddLLVM.cmake 65+++ b/llvm/cmake/modules/AddLLVM.cmake
66@@ -1169,15 +1169,8 @@ macro(add_llvm_tool name) 66@@ -1210,15 +1210,8 @@ macro(add_llvm_tool name)
67 67
68 if ( ${name} IN_LIST LLVM_TOOLCHAIN_TOOLS OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) 68 if ( ${name} IN_LIST LLVM_TOOLCHAIN_TOOLS OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
69 if( LLVM_BUILD_TOOLS ) 69 if( LLVM_BUILD_TOOLS )
@@ -79,7 +79,7 @@ index 333167bfb6b..f00fd98bdb2 100644
79 RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR} 79 RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR}
80 COMPONENT ${name}) 80 COMPONENT ${name})
81 81
82@@ -1188,9 +1181,6 @@ macro(add_llvm_tool name) 82@@ -1229,9 +1222,6 @@ macro(add_llvm_tool name)
83 endif() 83 endif()
84 endif() 84 endif()
85 endif() 85 endif()
@@ -89,9 +89,9 @@ index 333167bfb6b..f00fd98bdb2 100644
89 set_target_properties(${name} PROPERTIES FOLDER "Tools") 89 set_target_properties(${name} PROPERTIES FOLDER "Tools")
90 endmacro(add_llvm_tool name) 90 endmacro(add_llvm_tool name)
91 91
92@@ -1228,15 +1218,8 @@ macro(add_llvm_utility name) 92@@ -1269,15 +1259,8 @@ macro(add_llvm_utility name)
93 set_target_properties(${name} PROPERTIES FOLDER "Utils") 93 set_target_properties(${name} PROPERTIES FOLDER "Utils")
94 if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) 94 if ( ${name} IN_LIST LLVM_TOOLCHAIN_UTILITIES OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
95 if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS) 95 if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS)
96- set(export_to_llvmexports) 96- set(export_to_llvmexports)
97- if (${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR 97- if (${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
@@ -105,7 +105,7 @@ index 333167bfb6b..f00fd98bdb2 100644
105 RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR} 105 RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR}
106 COMPONENT ${name}) 106 COMPONENT ${name})
107 107
108@@ -1245,7 +1228,6 @@ macro(add_llvm_utility name) 108@@ -1286,7 +1269,6 @@ macro(add_llvm_utility name)
109 DEPENDS ${name} 109 DEPENDS ${name}
110 COMPONENT ${name}) 110 COMPONENT ${name})
111 endif() 111 endif()
@@ -114,10 +114,10 @@ index 333167bfb6b..f00fd98bdb2 100644
114 set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name}) 114 set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name})
115 endif() 115 endif()
116diff --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake 116diff --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake
117index 73c1e96d3d9..7b1c33961c1 100644 117index 5f07acc1f692..47fe887e083b 100644
118--- a/llvm/cmake/modules/TableGen.cmake 118--- a/llvm/cmake/modules/TableGen.cmake
119+++ b/llvm/cmake/modules/TableGen.cmake 119+++ b/llvm/cmake/modules/TableGen.cmake
120@@ -183,14 +183,8 @@ macro(add_tablegen target project) 120@@ -177,14 +177,8 @@ macro(add_tablegen target project)
121 endif() 121 endif()
122 122
123 if ((${project} STREQUAL LLVM OR ${project} STREQUAL MLIR) AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_UTILS) 123 if ((${project} STREQUAL LLVM OR ${project} STREQUAL MLIR) AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_UTILS)
@@ -132,12 +132,9 @@ index 73c1e96d3d9..7b1c33961c1 100644
132 COMPONENT ${target} 132 COMPONENT ${target}
133 RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR}) 133 RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR})
134 if(NOT LLVM_ENABLE_IDE) 134 if(NOT LLVM_ENABLE_IDE)
135@@ -199,5 +193,4 @@ macro(add_tablegen target project) 135@@ -193,5 +187,4 @@ macro(add_tablegen target project)
136 COMPONENT ${target}) 136 COMPONENT ${target})
137 endif() 137 endif()
138 endif() 138 endif()
139- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${target}) 139- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${target})
140 endmacro() 140 endmacro()
141--
1422.27.0
143
diff --git a/recipes-devtools/clang/clang/0022-clang-Fix-resource-dir-location-for-cross-toolchains.patch b/recipes-devtools/clang/clang/0022-clang-Fix-resource-dir-location-for-cross-toolchains.patch
index 85f1d8c..bd5a3a1 100644
--- a/recipes-devtools/clang/clang/0022-clang-Fix-resource-dir-location-for-cross-toolchains.patch
+++ b/recipes-devtools/clang/clang/0022-clang-Fix-resource-dir-location-for-cross-toolchains.patch
@@ -1,7 +1,7 @@
1From 5fb5780cdf9fe0f26ac1a076d0eaa82de61b5f8b Mon Sep 17 00:00:00 2001 1From 1dcf3b4cd50bfd75f7530a463f818ff2705fdb60 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 22/24] clang: Fix resource dir location for cross toolchains 4Subject: [PATCH] clang: Fix resource dir location for cross toolchains
5 5
6When clang looks for the resources directory, it does so based on the binary 6When clang looks for the resources directory, it does so based on the binary
7location and assumes that the containing directory is a sibling to lib. The 7location and assumes that the containing directory is a sibling to lib. The
@@ -18,9 +18,11 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
18 clang/lib/Driver/Driver.cpp | 8 +++++++- 18 clang/lib/Driver/Driver.cpp | 8 +++++++-
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
22index 418e1d3e8ec9..44c9f6e59d3f 100644
21--- a/clang/lib/Driver/Driver.cpp 23--- a/clang/lib/Driver/Driver.cpp
22+++ b/clang/lib/Driver/Driver.cpp 24+++ b/clang/lib/Driver/Driver.cpp
23@@ -112,7 +112,13 @@ std::string Driver::GetResourcesPath(Str 25@@ -119,7 +119,13 @@ std::string Driver::GetResourcesPath(StringRef BinaryPath,
24 // With a static-library build of libclang, LibClangPath will contain the 26 // With a static-library build of libclang, LibClangPath will contain the
25 // 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/.
26 // ../lib gets us to lib/ in both cases. 28 // ../lib gets us to lib/ in both cases.
diff --git a/recipes-devtools/clang/clang/0023-fix-path-to-libffi.patch b/recipes-devtools/clang/clang/0023-fix-path-to-libffi.patch
index 40c06c1..fbf95a6 100644
--- a/recipes-devtools/clang/clang/0023-fix-path-to-libffi.patch
+++ b/recipes-devtools/clang/clang/0023-fix-path-to-libffi.patch
@@ -1,7 +1,7 @@
1From 358d0e3732ffa2c7204d20a302c065b71806e3b8 Mon Sep 17 00:00:00 2001 1From d45e47dd0d7fe5e8b179557822292fc312a55cfc Mon Sep 17 00:00:00 2001
2From: Anuj Mittal <anuj.mittal@intel.com> 2From: Anuj Mittal <anuj.mittal@intel.com>
3Date: Fri, 3 Apr 2020 15:10:37 +0800 3Date: Fri, 3 Apr 2020 15:10:37 +0800
4Subject: [PATCH 23/24] fix path to libffi 4Subject: [PATCH] fix path to libffi
5 5
6FFI_LIBRARY_PATH is the full path to libffi so when building something that links to 6FFI_LIBRARY_PATH is the full path to libffi so when building something that links to
7libLLVMInterpreter, we were looking for libffi in clang's recipe-sysroot instead of 7libLLVMInterpreter, we were looking for libffi in clang's recipe-sysroot instead of
@@ -14,16 +14,13 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 1 file changed, 1 insertion(+), 1 deletion(-) 14 1 file changed, 1 insertion(+), 1 deletion(-)
15 15
16diff --git a/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt b/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt 16diff --git a/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt b/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt
17index b8adea5b7a9..7d8434c2d0e 100644 17index 976219830d5e..9930e01559e9 100644
18--- a/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt 18--- a/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt
19+++ b/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt 19+++ b/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt
20@@ -16,5 +16,5 @@ add_llvm_component_library(LLVMInterpreter 20@@ -22,5 +22,5 @@ add_llvm_component_library(LLVMInterpreter
21 ) 21 )
22 22
23 if( LLVM_ENABLE_FFI ) 23 if( LLVM_ENABLE_FFI )
24- target_link_libraries( LLVMInterpreter PRIVATE ${FFI_LIBRARY_PATH} ) 24- target_link_libraries( LLVMInterpreter PRIVATE ${FFI_LIBRARY_PATH} )
25+ target_link_libraries( LLVMInterpreter PRIVATE ffi ) 25+ target_link_libraries( LLVMInterpreter PRIVATE ffi )
26 endif() 26 endif()
27--
282.27.0
29
diff --git a/recipes-devtools/clang/clang/0024-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch b/recipes-devtools/clang/clang/0024-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch
index 15dcd13..0e64d17 100644
--- a/recipes-devtools/clang/clang/0024-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch
+++ b/recipes-devtools/clang/clang/0024-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch
@@ -1,8 +1,8 @@
1From 17e1e38501cb4008c53727d88ef87d2c89182008 Mon Sep 17 00:00:00 2001 1From 6c2721a8ee7f15f3035592dfd0d7983369ffd12a 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 24/24] clang: driver: Add dyld-prefix when checking sysroot 4Subject: [PATCH] clang: driver: Add dyld-prefix when checking sysroot for ldso
5 for ldso path 5 path
6 6
7 * the dyld-prefix shall be taken into account when the default 7 * the dyld-prefix shall be taken into account when the default
8 path for the dynamic linker has to be checked. 8 path for the dynamic linker has to be checked.
@@ -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 9128d4e0fa0..7f7d752a9a1 100644 21index 98f54a935465..cab25988e81a 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@@ -507,8 +507,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 24@@ -524,8 +524,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 9128d4e0fa0..7f7d752a9a1 100644
32 LibDir = "lib"; 32 LibDir = "lib";
33 } 33 }
34 break; 34 break;
35@@ -516,8 +516,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 35@@ -533,8 +533,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 9128d4e0fa0..7f7d752a9a1 100644
43 LibDir = "lib"; 43 LibDir = "lib";
44 } 44 }
45 break; 45 break;
46@@ -541,8 +541,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 46@@ -558,8 +558,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 9128d4e0fa0..7f7d752a9a1 100644
54 LibDir = "lib"; 54 LibDir = "lib";
55 } 55 }
56 break; 56 break;
57@@ -559,8 +559,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 57@@ -576,8 +576,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";
@@ -65,6 +65,3 @@ index 9128d4e0fa0..7f7d752a9a1 100644
65 LibDir = "lib"; 65 LibDir = "lib";
66 } 66 }
67 break; 67 break;
68--
692.27.0
70
diff --git a/recipes-devtools/clang/clang/0026-clang-Use-python3-in-python-scripts.patch b/recipes-devtools/clang/clang/0025-clang-Use-python3-in-python-scripts.patch
index 63e3a64..331737c 100644
--- a/recipes-devtools/clang/clang/0026-clang-Use-python3-in-python-scripts.patch
+++ b/recipes-devtools/clang/clang/0025-clang-Use-python3-in-python-scripts.patch
@@ -1,7 +1,7 @@
1From dec703abdd0503edcc513bdb45eb36402792b47a Mon Sep 17 00:00:00 2001 1From c308a31dc960830c7c325f85e0840c3f26b01a34 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 26/26] clang: Use python3 in python scripts 4Subject: [PATCH] clang: Use python3 in python scripts
5 5
6Some scripts ask for python, but they work fine with python3 6Some scripts ask for python, but they work fine with python3
7and in OE python symlink is not exposed to build, only python3 is 7and in OE python symlink is not exposed to build, only python3 is
@@ -21,7 +21,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
21 9 files changed, 9 insertions(+), 9 deletions(-) 21 9 files changed, 9 insertions(+), 9 deletions(-)
22 22
23diff --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 23diff --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
24index 8655af137bb..e95ba59a421 100755 24index 8655af137bb2..e95ba59a421c 100755
25--- a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py 25--- a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py
26+++ b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py 26+++ b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py
27@@ -1,4 +1,4 @@ 27@@ -1,4 +1,4 @@
@@ -31,7 +31,7 @@ index 8655af137bb..e95ba59a421 100755
31 #=- run-find-all-symbols.py - Parallel find-all-symbols runner -*- python -*-=# 31 #=- run-find-all-symbols.py - Parallel find-all-symbols runner -*- python -*-=#
32 # 32 #
33diff --git a/clang-tools-extra/clang-tidy/add_new_check.py b/clang-tools-extra/clang-tidy/add_new_check.py 33diff --git a/clang-tools-extra/clang-tidy/add_new_check.py b/clang-tools-extra/clang-tidy/add_new_check.py
34index 231f43c0b8f..fb8477b037a 100755 34index 14fcfe8d49ff..ee7e682690b7 100755
35--- a/clang-tools-extra/clang-tidy/add_new_check.py 35--- a/clang-tools-extra/clang-tidy/add_new_check.py
36+++ b/clang-tools-extra/clang-tidy/add_new_check.py 36+++ b/clang-tools-extra/clang-tidy/add_new_check.py
37@@ -1,4 +1,4 @@ 37@@ -1,4 +1,4 @@
@@ -41,7 +41,7 @@ index 231f43c0b8f..fb8477b037a 100755
41 #===- add_new_check.py - clang-tidy check generator ---------*- python -*--===# 41 #===- add_new_check.py - clang-tidy check generator ---------*- python -*--===#
42 # 42 #
43diff --git a/clang-tools-extra/clang-tidy/rename_check.py b/clang-tools-extra/clang-tidy/rename_check.py 43diff --git a/clang-tools-extra/clang-tidy/rename_check.py b/clang-tools-extra/clang-tidy/rename_check.py
44index 4d5311c9a29..c869744dd94 100755 44index 2410041fd5d2..976a02100cd6 100755
45--- a/clang-tools-extra/clang-tidy/rename_check.py 45--- a/clang-tools-extra/clang-tidy/rename_check.py
46+++ b/clang-tools-extra/clang-tidy/rename_check.py 46+++ b/clang-tools-extra/clang-tidy/rename_check.py
47@@ -1,4 +1,4 @@ 47@@ -1,4 +1,4 @@
@@ -51,7 +51,7 @@ index 4d5311c9a29..c869744dd94 100755
51 #===- rename_check.py - clang-tidy check renamer ------------*- python -*--===# 51 #===- rename_check.py - clang-tidy check renamer ------------*- python -*--===#
52 # 52 #
53diff --git a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py 53diff --git a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
54index 17086d15053..a20b1f1f46b 100755 54index 17086d15053e..a20b1f1f46b2 100755
55--- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py 55--- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
56+++ b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py 56+++ b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
57@@ -1,4 +1,4 @@ 57@@ -1,4 +1,4 @@
@@ -61,7 +61,7 @@ index 17086d15053..a20b1f1f46b 100755
61 #===- clang-tidy-diff.py - ClangTidy Diff Checker -----------*- python -*--===# 61 #===- clang-tidy-diff.py - ClangTidy Diff Checker -----------*- python -*--===#
62 # 62 #
63diff --git a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py 63diff --git a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
64index 7e23419cd91..3e5986d0f7d 100755 64index 313ecd2f9571..a298e38b1a45 100755
65--- a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py 65--- a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
66+++ b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py 66+++ b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
67@@ -1,4 +1,4 @@ 67@@ -1,4 +1,4 @@
@@ -71,7 +71,7 @@ index 7e23419cd91..3e5986d0f7d 100755
71 #===- run-clang-tidy.py - Parallel clang-tidy runner --------*- python -*--===# 71 #===- run-clang-tidy.py - Parallel clang-tidy runner --------*- python -*--===#
72 # 72 #
73diff --git a/clang/tools/clang-format/clang-format-diff.py b/clang/tools/clang-format/clang-format-diff.py 73diff --git a/clang/tools/clang-format/clang-format-diff.py b/clang/tools/clang-format/clang-format-diff.py
74index c5331202fc1..374253cf234 100755 74index 6e653a134289..1c31192a4562 100755
75--- a/clang/tools/clang-format/clang-format-diff.py 75--- a/clang/tools/clang-format/clang-format-diff.py
76+++ b/clang/tools/clang-format/clang-format-diff.py 76+++ b/clang/tools/clang-format/clang-format-diff.py
77@@ -1,4 +1,4 @@ 77@@ -1,4 +1,4 @@
@@ -81,7 +81,7 @@ index c5331202fc1..374253cf234 100755
81 #===- clang-format-diff.py - ClangFormat Diff Reformatter ----*- python -*--===# 81 #===- clang-format-diff.py - ClangFormat Diff Reformatter ----*- python -*--===#
82 # 82 #
83diff --git a/clang/tools/clang-format/git-clang-format b/clang/tools/clang-format/git-clang-format 83diff --git a/clang/tools/clang-format/git-clang-format b/clang/tools/clang-format/git-clang-format
84index f3cd585e7f4..63899c6f54a 100755 84index ccd2f50fa4ad..cfcfb9fcbaef 100755
85--- a/clang/tools/clang-format/git-clang-format 85--- a/clang/tools/clang-format/git-clang-format
86+++ b/clang/tools/clang-format/git-clang-format 86+++ b/clang/tools/clang-format/git-clang-format
87@@ -1,4 +1,4 @@ 87@@ -1,4 +1,4 @@
@@ -91,7 +91,7 @@ index f3cd585e7f4..63899c6f54a 100755
91 #===- git-clang-format - ClangFormat Git Integration ---------*- python -*--===# 91 #===- git-clang-format - ClangFormat Git Integration ---------*- python -*--===#
92 # 92 #
93diff --git a/clang/tools/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view 93diff --git a/clang/tools/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view
94index 04ad518a60c..07effbca596 100755 94index 04ad518a60cd..07effbca5969 100755
95--- a/clang/tools/scan-view/bin/scan-view 95--- a/clang/tools/scan-view/bin/scan-view
96+++ b/clang/tools/scan-view/bin/scan-view 96+++ b/clang/tools/scan-view/bin/scan-view
97@@ -1,4 +1,4 @@ 97@@ -1,4 +1,4 @@
@@ -101,7 +101,7 @@ index 04ad518a60c..07effbca596 100755
101 from __future__ import print_function 101 from __future__ import print_function
102 102
103diff --git a/clang/utils/hmaptool/hmaptool b/clang/utils/hmaptool/hmaptool 103diff --git a/clang/utils/hmaptool/hmaptool b/clang/utils/hmaptool/hmaptool
104index 58baab2f774..00296f11a16 100755 104index e647cde6bc46..7ed2fdf674b1 100755
105--- a/clang/utils/hmaptool/hmaptool 105--- a/clang/utils/hmaptool/hmaptool
106+++ b/clang/utils/hmaptool/hmaptool 106+++ b/clang/utils/hmaptool/hmaptool
107@@ -1,4 +1,4 @@ 107@@ -1,4 +1,4 @@
@@ -110,6 +110,3 @@ index 58baab2f774..00296f11a16 100755
110 from __future__ import absolute_import, division, print_function 110 from __future__ import absolute_import, division, print_function
111 111
112 import json 112 import json
113--
1142.28.0
115
diff --git a/recipes-devtools/clang/clang/0025-libcxx-Define-__NR_futex-to-be-__NR_futex_time64-on-.patch b/recipes-devtools/clang/clang/0025-libcxx-Define-__NR_futex-to-be-__NR_futex_time64-on-.patch
deleted file mode 100644
index 9097047..0000000
--- a/recipes-devtools/clang/clang/0025-libcxx-Define-__NR_futex-to-be-__NR_futex_time64-on-.patch
+++ /dev/null
@@ -1,35 +0,0 @@
1From e7c1d4b74df67070d3666843caeced417387886e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 2 Aug 2020 10:11:00 -0700
4Subject: [PATCH 25/26] libcxx: Define __NR_futex to be __NR_futex_time64 on
5 riscv32
6
7RISCV glibc has decided to use 64bit time_t from get go unlike
8other 32bit architecture therefore aliasing __NR_futex to
9__NR_futex_time64 helps avoid the below errors on rv32
10
11Upstream-Status: Submittted [https://reviews.llvm.org/D85095]
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 libcxx/src/atomic.cpp | 10 ++++++++++
15 1 file changed, 10 insertions(+)
16
17--- a/libcxx/src/atomic.cpp
18+++ b/libcxx/src/atomic.cpp
19@@ -21,6 +21,16 @@
20 #include <linux/futex.h>
21 #include <sys/syscall.h>
22
23+// libc++ uses SYS_futex, which it expects from system C library.
24+// in glibc (/usr/include/bits/syscall.h defines it in terms of of NR_futex)
25+// rv32 is using 64bit time_t from get go unlike other 32bit architectures
26+// in glibc, therefore it wont have NR_futex defined but just NR_futex_time64
27+// this aliases it to NR_futex so that SYS_futex is then defined for rv32
28+
29+#if !defined(SYS_futex) && defined(SYS_futex_time64)
30+#define SYS_futex SYS_futex_time64
31+#endif
32+
33 #else // <- Add other operating systems here
34
35 // Baseline needs no new headers
diff --git a/recipes-devtools/clang/clang/0027-For-x86_64-set-Yocto-based-GCC-install-search-path.patch b/recipes-devtools/clang/clang/0026-For-x86_64-set-Yocto-based-GCC-install-search-path.patch
index 4ebab1e..03bc290 100644
--- a/recipes-devtools/clang/clang/0027-For-x86_64-set-Yocto-based-GCC-install-search-path.patch
+++ b/recipes-devtools/clang/clang/0026-For-x86_64-set-Yocto-based-GCC-install-search-path.patch
@@ -1,4 +1,4 @@
1From d507046e9deec46f005ad164073d3cae4e0b8a47 Mon Sep 17 00:00:00 2001 1From 386cec2c3000b398cb0afe9bf9e9d57f7cdfd4eb 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
@@ -46,15 +46,16 @@ is different between clang and clang-native
46Upstream-Status: Inappropriate [oe specific] 46Upstream-Status: Inappropriate [oe specific]
47 47
48Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> 48Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
49Signed-off-by: Khem Raj <raj.khem@gmail.com>
49--- 50---
50 clang/lib/Driver/ToolChains/Gnu.cpp | 1 + 51 clang/lib/Driver/ToolChains/Gnu.cpp | 1 +
51 1 file changed, 1 insertion(+) 52 1 file changed, 1 insertion(+)
52 53
53diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp 54diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
54index d02e644c720b..fdcf6b91ebe1 100644 55index 05d1d3003881..e56812145e6d 100644
55--- a/clang/lib/Driver/ToolChains/Gnu.cpp 56--- a/clang/lib/Driver/ToolChains/Gnu.cpp
56+++ b/clang/lib/Driver/ToolChains/Gnu.cpp 57+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
57@@ -2083,6 +2083,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( 58@@ -2109,6 +2109,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
58 "x86_64-redhat-linux", "x86_64-suse-linux", 59 "x86_64-redhat-linux", "x86_64-suse-linux",
59 "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", 60 "x86_64-manbo-linux-gnu", "x86_64-linux-gnu",
60 "x86_64-slackware-linux", "x86_64-unknown-linux", 61 "x86_64-slackware-linux", "x86_64-unknown-linux",
@@ -62,6 +63,3 @@ index d02e644c720b..fdcf6b91ebe1 100644
62 "x86_64-amazon-linux", "x86_64-linux-android"}; 63 "x86_64-amazon-linux", "x86_64-linux-android"};
63 static const char *const X32LibDirs[] = {"/libx32"}; 64 static const char *const X32LibDirs[] = {"/libx32"};
64 static const char *const X86LibDirs[] = {"/lib32", "/lib"}; 65 static const char *const X86LibDirs[] = {"/lib32", "/lib"};
65--
662.18.2
67
diff --git a/recipes-devtools/clang/clang/0027-compiler-rt-Include-stddef.h.patch b/recipes-devtools/clang/clang/0027-compiler-rt-Include-stddef.h.patch
new file mode 100644
index 0000000..cde8e73
--- /dev/null
+++ b/recipes-devtools/clang/clang/0027-compiler-rt-Include-stddef.h.patch
@@ -0,0 +1,27 @@
1From cea47d9b88c94d1daf7d4c579e6ca4f9c72dc874 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 6 Feb 2021 12:44:30 -0800
4Subject: [PATCH] compiler-rt: Include stddef.h
5
6size_t is use in the source needs relevant header to include the
7definition, fixes build on musl
8
9compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp:82:61: error: unknown type name 'size_t'; did you mean 'std::size_t'?
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp | 1 +
14 1 file changed, 1 insertion(+)
15
16diff --git a/compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp b/compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp
17index b87798603fda..34e11727d77b 100644
18--- a/compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp
19+++ b/compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp
20@@ -26,6 +26,7 @@
21
22 #include <cassert>
23 #include <cstdint>
24+#include <cstddef> // for size_t
25 #include <dlfcn.h> // for dlsym()
26
27 static void *getFuncAddr(const char *name, uintptr_t wrapper_addr) {
diff --git a/recipes-devtools/clang/clang/0028-llvm-Do-not-use-find_library-for-ncurses.patch b/recipes-devtools/clang/clang/0028-llvm-Do-not-use-find_library-for-ncurses.patch
new file mode 100644
index 0000000..46898ad
--- /dev/null
+++ b/recipes-devtools/clang/clang/0028-llvm-Do-not-use-find_library-for-ncurses.patch
@@ -0,0 +1,44 @@
1From dcb04ae498c16f90b3a4376ad5674156c3ec0dc6 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 7 Feb 2021 23:58:41 -0800
4Subject: [PATCH] llvm: Do not use find_library for ncurses
5
6This ensures that it lets OE to decide which lib to link
7otherwise it adds absolute paths to linker cmdline and confuses it
8horribly with native and target libs when build clang for target
9
10TOPDIR/build/tmp/work/cortexa57-yoe-linux-musl/clang/12.0.0-r0/recipe-sysroot-native/usr/lib/libtinfo.so: error adding symbols: file in wrong format
11clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
12
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14---
15 compiler-rt/cmake/config-ix.cmake | 2 +-
16 llvm/cmake/config-ix.cmake | 2 +-
17 2 files changed, 2 insertions(+), 2 deletions(-)
18
19diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
20index 196aa62fd01c..49bbbd257d97 100644
21--- a/compiler-rt/cmake/config-ix.cmake
22+++ b/compiler-rt/cmake/config-ix.cmake
23@@ -140,7 +140,7 @@ else()
24 set(MAYBE_REQUIRED)
25 endif()
26 if(LLVM_ENABLE_TERMINFO)
27- find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED})
28+ set(TERMINFO_LIB tinfo curses ncurses ncursesw)
29 endif()
30 if(COMPILER_RT_TERMINFO_LIB)
31 set(LLVM_ENABLE_TERMINFO 1)
32diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
33index 818fafbce148..2f8ad6652334 100644
34--- a/llvm/cmake/config-ix.cmake
35+++ b/llvm/cmake/config-ix.cmake
36@@ -175,7 +175,7 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
37 set(MAYBE_REQUIRED)
38 endif()
39 if(LLVM_ENABLE_TERMINFO)
40- find_library(TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED})
41+ set(TERMINFO_LIB tinfo curses ncurses ncursesw)
42 endif()
43 if(TERMINFO_LIB)
44 set(LLVM_ENABLE_TERMINFO 1)
diff --git a/recipes-devtools/clang/clang/D95527_against_11.x.patch b/recipes-devtools/clang/clang/D95527_against_11.x.patch
deleted file mode 100644
index f96f732..0000000
--- a/recipes-devtools/clang/clang/D95527_against_11.x.patch
+++ /dev/null
@@ -1,85 +0,0 @@
1commit b08a140a8fe8d0b0d16a93042b4952d6e34ab913
2Author: Piotr Sobczak <Piotr.Sobczak@amd.com>
3Date: Wed Jan 27 16:02:49 2021 +0100
4
5 [AMDGPU] Avoid an illegal operand in si-shrink-instructions
6
7 Before the patch it was possible to trigger a constant bus
8 violation when folding immediates into a shrunk instruction.
9
10 The patch adds a check to enforce the legality of the new operand.
11
12 Differential Revision: https://reviews.llvm.org/D95527
13
14diff --git a/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp b/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
15index 9c6833a7dab6..6c1b16eddc84 100644
16--- a/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
17+++ b/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
18@@ -84,21 +84,23 @@ static bool foldImmediates(MachineInstr &MI, const SIInstrInfo *TII,
19 MachineOperand &MovSrc = Def->getOperand(1);
20 bool ConstantFolded = false;
21
22- if (MovSrc.isImm() && (isInt<32>(MovSrc.getImm()) ||
23- isUInt<32>(MovSrc.getImm()))) {
24- // It's possible to have only one component of a super-reg defined by
25- // a single mov, so we need to clear any subregister flag.
26- Src0.setSubReg(0);
27- Src0.ChangeToImmediate(MovSrc.getImm());
28- ConstantFolded = true;
29- } else if (MovSrc.isFI()) {
30- Src0.setSubReg(0);
31- Src0.ChangeToFrameIndex(MovSrc.getIndex());
32- ConstantFolded = true;
33- } else if (MovSrc.isGlobal()) {
34- Src0.ChangeToGA(MovSrc.getGlobal(), MovSrc.getOffset(),
35- MovSrc.getTargetFlags());
36- ConstantFolded = true;
37+ if (TII->isOperandLegal(MI, Src0Idx, &MovSrc)) {
38+ if (MovSrc.isImm() &&
39+ (isInt<32>(MovSrc.getImm()) || isUInt<32>(MovSrc.getImm()))) {
40+ // It's possible to have only one component of a super-reg defined
41+ // by a single mov, so we need to clear any subregister flag.
42+ Src0.setSubReg(0);
43+ Src0.ChangeToImmediate(MovSrc.getImm());
44+ ConstantFolded = true;
45+ } else if (MovSrc.isFI()) {
46+ Src0.setSubReg(0);
47+ Src0.ChangeToFrameIndex(MovSrc.getIndex());
48+ ConstantFolded = true;
49+ } else if (MovSrc.isGlobal()) {
50+ Src0.ChangeToGA(MovSrc.getGlobal(), MovSrc.getOffset(),
51+ MovSrc.getTargetFlags());
52+ ConstantFolded = true;
53+ }
54 }
55
56 if (ConstantFolded) {
57diff --git a/llvm/test/CodeGen/AMDGPU/shrink-instructions-illegal-fold.mir b/llvm/test/CodeGen/AMDGPU/shrink-instructions-illegal-fold.mir
58new file mode 100644
59index 000000000000..7889f437facf
60--- /dev/null
61+++ b/llvm/test/CodeGen/AMDGPU/shrink-instructions-illegal-fold.mir
62@@ -0,0 +1,23 @@
63+# RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=si-shrink-instructions --verify-machineinstrs %s -o - | FileCheck %s
64+
65+# Make sure immediate folding into V_CNDMASK respects constant bus restrictions.
66+---
67+
68+name: shrink_cndmask_illegal_imm_folding
69+tracksRegLiveness: true
70+body: |
71+ bb.0:
72+ liveins: $vgpr0, $vgpr1
73+ ; CHECK-LABEL: name: shrink_cndmask_illegal_imm_folding
74+ ; CHECK: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
75+ ; CHECK: [[MOV:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 32768, implicit $exec
76+ ; CHECK: V_CMP_EQ_U32_e32 0, [[COPY]], implicit-def $vcc, implicit $exec
77+ ; CHECK: V_CNDMASK_B32_e32 [[MOV]], killed [[COPY]], implicit $vcc, implicit $exec
78+
79+ %0:vgpr_32 = COPY $vgpr0
80+ %1:vgpr_32 = V_MOV_B32_e32 32768, implicit $exec
81+ V_CMP_EQ_U32_e32 0, %0:vgpr_32, implicit-def $vcc, implicit $exec
82+ %2:vgpr_32 = V_CNDMASK_B32_e64 0, %1:vgpr_32, 0, killed %0:vgpr_32, $vcc, implicit $exec
83+ S_NOP 0
84+
85+...
diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb
index 9391ca4..f759a70 100644
--- a/recipes-devtools/clang/clang_git.bb
+++ b/recipes-devtools/clang/clang_git.bb
@@ -53,7 +53,7 @@ def get_clang_experimental_target_arch(bb, d):
53 53
54PACKAGECONFIG ??= "compiler-rt libcplusplus shared-libs lldb-wchar \ 54PACKAGECONFIG ??= "compiler-rt libcplusplus shared-libs lldb-wchar \
55 ${@bb.utils.filter('DISTRO_FEATURES', 'thin-lto lto', d)} \ 55 ${@bb.utils.filter('DISTRO_FEATURES', 'thin-lto lto', d)} \
56 rtti eh libedit \ 56 rtti eh libedit terminfo \
57 " 57 "
58PACKAGECONFIG_class-native = "rtti eh libedit" 58PACKAGECONFIG_class-native = "rtti eh libedit"
59PACKAGECONFIG_class-nativesdk = "rtti eh libedit shared-libs ${@bb.utils.filter('DISTRO_FEATURES', 'thin-lto lto', d)}" 59PACKAGECONFIG_class-nativesdk = "rtti eh libedit shared-libs ${@bb.utils.filter('DISTRO_FEATURES', 'thin-lto lto', d)}"
@@ -64,7 +64,7 @@ PACKAGECONFIG[unwindlib] = "-DCLANG_DEFAULT_UNWINDLIB=libunwind,-DCLANG_DEFAULT_
64PACKAGECONFIG[thin-lto] = "-DLLVM_ENABLE_LTO=Thin -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils," 64PACKAGECONFIG[thin-lto] = "-DLLVM_ENABLE_LTO=Thin -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils,"
65PACKAGECONFIG[lto] = "-DLLVM_ENABLE_LTO=Full -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils," 65PACKAGECONFIG[lto] = "-DLLVM_ENABLE_LTO=Full -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils,"
66PACKAGECONFIG[shared-libs] = "-DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON,,," 66PACKAGECONFIG[shared-libs] = "-DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON,,,"
67PACKAGECONFIG[terminfo] = "-DLLVM_ENABLE_TERMINFO=ON,-DLLVM_ENABLE_TERMINFO=OFF,ncurses," 67PACKAGECONFIG[terminfo] = "-DLLVM_ENABLE_TERMINFO=ON -DCOMPILER_RT_TERMINFO_LIB=ON,-DLLVM_ENABLE_TERMINFO=OFF -DCOMPILER_RT_TERMINFO_LIB=OFF,ncurses,"
68PACKAGECONFIG[pfm] = "-DLLVM_ENABLE_LIBPFM=ON,-DLLVM_ENABLE_LIBPFM=OFF,libpfm," 68PACKAGECONFIG[pfm] = "-DLLVM_ENABLE_LIBPFM=ON,-DLLVM_ENABLE_LIBPFM=OFF,libpfm,"
69PACKAGECONFIG[lldb-wchar] = "-DLLDB_EDITLINE_USE_WCHAR=1,-DLLDB_EDITLINE_USE_WCHAR=0," 69PACKAGECONFIG[lldb-wchar] = "-DLLDB_EDITLINE_USE_WCHAR=1,-DLLDB_EDITLINE_USE_WCHAR=0,"
70PACKAGECONFIG[bootstrap] = "-DCLANG_ENABLE_BOOTSTRAP=On -DCLANG_BOOTSTRAP_PASSTHROUGH='${PASSTHROUGH}' -DBOOTSTRAP_LLVM_ENABLE_LTO=Thin -DBOOTSTRAP_LLVM_ENABLE_LLD=ON,,," 70PACKAGECONFIG[bootstrap] = "-DCLANG_ENABLE_BOOTSTRAP=On -DCLANG_BOOTSTRAP_PASSTHROUGH='${PASSTHROUGH}' -DBOOTSTRAP_LLVM_ENABLE_LTO=Thin -DBOOTSTRAP_LLVM_ENABLE_LLD=ON,,,"
diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc
index 8ef6be4..9b54432 100644
--- a/recipes-devtools/clang/common.inc
+++ b/recipes-devtools/clang/common.inc
@@ -33,13 +33,11 @@ SRC_URI = "\
33 file://0022-clang-Fix-resource-dir-location-for-cross-toolchains.patch \ 33 file://0022-clang-Fix-resource-dir-location-for-cross-toolchains.patch \
34 file://0023-fix-path-to-libffi.patch \ 34 file://0023-fix-path-to-libffi.patch \
35 file://0024-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch \ 35 file://0024-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch \
36 file://0025-libcxx-Define-__NR_futex-to-be-__NR_futex_time64-on-.patch \ 36 file://0025-clang-Use-python3-in-python-scripts.patch \
37 file://0026-clang-Use-python3-in-python-scripts.patch \ 37 file://0026-For-x86_64-set-Yocto-based-GCC-install-search-path.patch \
38 file://0027-For-x86_64-set-Yocto-based-GCC-install-search-path.patch \ 38 file://0027-compiler-rt-Include-stddef.h.patch \
39 file://D95527_against_11.x.patch \ 39 file://0028-llvm-Do-not-use-find_library-for-ncurses.patch \
40 file://0001-Fix-libclc-to-look-for-python3-explicitly.patch \
41" 40"
42
43# Fallback to no-PIE if not set 41# Fallback to no-PIE if not set
44GCCPIE ??= "" 42GCCPIE ??= ""
45 43