From 9eb6f440732b2043dab469f3987c2122695a764c Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 16 Jul 2020 17:49:48 -0700 Subject: clang: Update to 11.x release branch Signed-off-by: Khem Raj --- conf/layer.conf | 2 +- recipes-devtools/clang/clang.inc | 6 +- ...d-lxml2-to-linker-cmdline-of-xml-is-found.patch | 25 +- ...ind-libunwind-headers-when-LIBCXXABI_LIBU.patch | 13 +- ...er-rt-support-a-new-embedded-linux-target.patch | 7 +- ...-Simplify-cross-compilation.-Don-t-use-na.patch | 9 +- ...0005-compiler-rt-Disable-tsan-on-OE-glibc.patch | 11 +- ...LibraryInfo-Undefine-libc-functions-if-th.patch | 25 +- .../0007-llvm-allow-env-override-of-exe-path.patch | 11 +- ...-clang-driver-Check-sysroot-for-ldso-path.patch | 17 +- ...iver-tools.cpp-Add-lssp_nonshared-on-musl.patch | 11 +- ...-ppc-does-not-support-128-bit-long-double.patch | 11 +- .../0011-clang-Prepend-trailing-to-sysroot.patch | 15 +- ...inside-the-target-sysroot-for-compiler-ru.patch | 12 +- ...ang-Define-releative-gcc-installation-dir.patch | 11 +- ...dso-for-musl-on-x86-and-x32-architectures.patch | 13 +- .../0015-clang-scan-view-needs-python-2.x.patch | 7 +- ...pthread-and-ldl-along-with-lunwind-for-st.patch | 23 +- ..._EXECUTABLE-when-cross-compiling-for-nati.patch | 27 ++ ...lang-Use-CMAKE_DL_LIBS-for-deducing-libdl.patch | 33 --- .../0018-Check-for-atomic-double-intrinsics.patch | 35 +++ ..._EXECUTABLE-when-cross-compiling-for-nati.patch | 23 -- .../0019-Check-for-atomic-double-intrinsics.patch | 32 --- .../0019-clang-Enable-SSP-and-PIE-by-default.patch | 316 +++++++++++++++++++++ .../0020-clang-Enable-SSP-and-PIE-by-default.patch | 313 -------------------- ...compiler-runtime-library-to-link-step-for.patch | 41 +++ ...cmake-Fix-configure-for-packages-using-fi.patch | 143 ++++++++++ ...compiler-runtime-library-to-link-step-for.patch | 37 --- ...esource-dir-location-for-cross-toolchains.patch | 37 +++ ...cmake-Fix-configure-for-packages-using-fi.patch | 140 --------- ...esource-dir-location-for-cross-toolchains.patch | 41 --- .../clang/clang/0023-fix-path-to-libffi.patch | 29 ++ ...r-Add-dyld-prefix-when-checking-sysroot-f.patch | 70 +++++ .../clang/clang/0024-fix-path-to-libffi.patch | 28 -- ...r-Add-dyld-prefix-when-checking-sysroot-f.patch | 69 ----- recipes-devtools/clang/common.inc | 18 +- 36 files changed, 846 insertions(+), 815 deletions(-) create mode 100644 recipes-devtools/clang/clang/0017-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch delete mode 100644 recipes-devtools/clang/clang/0017-libclang-Use-CMAKE_DL_LIBS-for-deducing-libdl.patch create mode 100644 recipes-devtools/clang/clang/0018-Check-for-atomic-double-intrinsics.patch delete mode 100644 recipes-devtools/clang/clang/0018-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch delete mode 100644 recipes-devtools/clang/clang/0019-Check-for-atomic-double-intrinsics.patch create mode 100644 recipes-devtools/clang/clang/0019-clang-Enable-SSP-and-PIE-by-default.patch delete mode 100644 recipes-devtools/clang/clang/0020-clang-Enable-SSP-and-PIE-by-default.patch create mode 100644 recipes-devtools/clang/clang/0020-libcxx-Add-compiler-runtime-library-to-link-step-for.patch create mode 100644 recipes-devtools/clang/clang/0021-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch delete mode 100644 recipes-devtools/clang/clang/0021-libcxx-Add-compiler-runtime-library-to-link-step-for.patch create mode 100644 recipes-devtools/clang/clang/0022-clang-Fix-resource-dir-location-for-cross-toolchains.patch delete mode 100644 recipes-devtools/clang/clang/0022-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch delete mode 100644 recipes-devtools/clang/clang/0023-clang-Fix-resource-dir-location-for-cross-toolchains.patch create mode 100644 recipes-devtools/clang/clang/0023-fix-path-to-libffi.patch create mode 100644 recipes-devtools/clang/clang/0024-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch delete mode 100644 recipes-devtools/clang/clang/0024-fix-path-to-libffi.patch delete mode 100644 recipes-devtools/clang/clang/0025-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch diff --git a/conf/layer.conf b/conf/layer.conf index c0a422f..febdb6d 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -29,7 +29,7 @@ INHERIT += "clang" # Do not include clang in SDK unless user wants to CLANGSDK ??= "0" -LLVMVERSION = "10.0.1" +LLVMVERSION = "11.0.0" require conf/nonclangable.conf require conf/nonscanable.conf diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc index 41ba7bb..344403d 100644 --- a/recipes-devtools/clang/clang.inc +++ b/recipes-devtools/clang/clang.inc @@ -4,11 +4,11 @@ LLVM_DIR = "llvm${LLVM_RELEASE}" LLVM_GIT ?= "git://github.com/llvm" LLVM_GIT_PROTOCOL ?= "https" -MAJOR_VER = "10" +MAJOR_VER = "11" MINOR_VER = "0" -PATCH_VER = "1" +PATCH_VER = "0" -SRCREV ?= "ef32c611aa214dea855364efd7ba451ec5ec3f74" +SRCREV ?= "414f32a9e862b11f51063b75729278f8d81b12e9" PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}" BRANCH = "release/${MAJOR_VER}.x" 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 1a606f4..9f493ce 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 @@ -From 9f0c90da3de0706e3dd699ed0eb92744d4d9ea80 Mon Sep 17 00:00:00 2001 +From 435b79f52c7b20a88a6ec0d9a272a9ffd1b6d80d Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 22 May 2017 17:36:16 -0700 -Subject: [PATCH] lldb: Add -lxml2 to linker cmdline of xml is found +Subject: [PATCH 01/24] lldb: Add -lxml2 to linker cmdline of xml is found When cross compiling for systems where static libs for libxml are not available cmake's detection mechanism @@ -23,15 +23,18 @@ Signed-off-by: Khem Raj 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/source/Host/CMakeLists.txt b/lldb/source/Host/CMakeLists.txt -index 2e9bb402227..bfad6703c65 100644 +index add503a5f36..8ddb874c880 100644 --- a/lldb/source/Host/CMakeLists.txt +++ b/lldb/source/Host/CMakeLists.txt -@@ -149,7 +149,7 @@ if (APPLE) - list(APPEND EXTRA_LIBS xml2) - else () - if (LIBXML2_FOUND) -- list(APPEND EXTRA_LIBS ${LIBXML2_LIBRARIES}) -+ list(APPEND EXTRA_LIBS xml2) - endif() - endif () +@@ -138,7 +138,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "NetBSD") + list(APPEND EXTRA_LIBS kvm) + endif() + if (LLDB_ENABLE_LIBXML2) +- list(APPEND EXTRA_LIBS ${LIBXML2_LIBRARIES}) ++ list(APPEND EXTRA_LIBS xml2) + endif() if (HAVE_LIBDL) + list(APPEND EXTRA_LIBS ${CMAKE_DL_LIBS}) +-- +2.27.0 + 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 65fb23d..3291369 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 @@ -From a268e2fb21b30cce26f76536bf133b7a706e460f Mon Sep 17 00:00:00 2001 +From ed6cff51a51de8a69f3b326bedc7389bc8a74a8f Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 27 Aug 2017 10:37:49 -0700 -Subject: [PATCH] libcxxabi: Find libunwind headers when +Subject: [PATCH 02/24] libcxxabi: Find libunwind headers when LIBCXXABI_LIBUNWIND_INCLUDES is set Currently, when LIBCXXABI_LIBUNWIND_INCLUDES is set via CMake arguments @@ -17,10 +17,10 @@ Signed-off-by: Khem Raj 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt -index 59d99971a76..b0f51ebee3e 100644 +index 8881a5018dc..2821d1ad346 100644 --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt -@@ -497,14 +497,9 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBCXXABI_C_FLAGS}") +@@ -442,14 +442,9 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBCXXABI_C_FLAGS}") # Setup Source Code #=============================================================================== @@ -36,7 +36,7 @@ index 59d99971a76..b0f51ebee3e 100644 PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES} ${LIBCXXABI_LIBUNWIND_PATH}/include ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES} -@@ -515,15 +510,21 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) +@@ -460,15 +455,21 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) NO_CMAKE_FIND_ROOT_PATH ) @@ -62,3 +62,6 @@ index 59d99971a76..b0f51ebee3e 100644 # Add source code. This also contains all of the logic for deciding linker flags # soname, etc... add_subdirectory(src) +-- +2.27.0 + 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 4c8bc63..8689276 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 @@ -From 57ba81bfe82f18899b1c846bee6276b1b43ce4cf Mon Sep 17 00:00:00 2001 +From 7a7a7d6f730ec71b95475855ff216e431c6cfe1f Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 19 Apr 2015 15:16:23 -0700 -Subject: [PATCH] compiler-rt: support a new embedded linux target +Subject: [PATCH 03/24] compiler-rt: support a new embedded linux target Signed-off-by: Khem Raj --- @@ -320,3 +320,6 @@ index 00000000000..d0a890075a1 diff --git a/compiler-rt/make/platform/clang_linux_embedded_test_input.c b/compiler-rt/make/platform/clang_linux_embedded_test_input.c new file mode 100644 index 00000000000..e69de29bb2d +-- +2.27.0 + 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 dfbfb53..db934c9 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 @@ -From 1ecabb645e30330b82754b133f685d96c3e1ee42 Mon Sep 17 00:00:00 2001 +From ccf22e891d6a4b74c9845e9dc03b569694af107c Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 19 May 2016 23:11:45 -0700 -Subject: [PATCH] compiler-rt: Simplify cross-compilation. Don't use +Subject: [PATCH 04/24] compiler-rt: Simplify cross-compilation. Don't use native-compiled llvm-config. Note: AddLLVM.cmake does not expose the LLVM source directory. @@ -20,7 +20,7 @@ Signed-off-by: Khem Raj 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt -index 8d768a404f2..1b1a29dc25a 100644 +index fa62814b635..5948ed6fa5e 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -74,7 +74,16 @@ set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOL @@ -41,3 +41,6 @@ index 8d768a404f2..1b1a29dc25a 100644 if (TARGET intrinsics_gen) # Loading the llvm config causes this target to be imported so place it # under the appropriate folder in an IDE. +-- +2.27.0 + 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 59d774c..c341d91 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 @@ -From 7730422bbca50431386391ed341c5d5ed649d14e Mon Sep 17 00:00:00 2001 +From 556e35f02d3e92d149c25547ddc7c7cc8f4cdc84 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 18 Jul 2016 08:05:02 +0000 -Subject: [PATCH] compiler-rt: Disable tsan on OE/glibc +Subject: [PATCH 05/24] compiler-rt: Disable tsan on OE/glibc It does not build see http://lists.llvm.org/pipermail/llvm-dev/2016-July/102235.html @@ -13,10 +13,10 @@ Signed-off-by: Khem Raj 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake -index 3aad08e8896..a979d38c7a6 100644 +index 2edc1dabd90..ec4b5e7ee93 100644 --- a/compiler-rt/cmake/config-ix.cmake +++ b/compiler-rt/cmake/config-ix.cmake -@@ -653,7 +653,7 @@ else() +@@ -692,7 +692,7 @@ else() endif() if (COMPILER_RT_HAS_SANITIZER_COMMON AND TSAN_SUPPORTED_ARCH AND @@ -38,3 +38,6 @@ index fcd651ebe42..821de915be8 100644 set(SUPPORTED_TOOLS) foreach(SANITIZER_TOOL ${SUPPORTED_TOOLS_INIT}) string(TOUPPER ${SANITIZER_TOOL} SANITIZER_TOOL_UPPER) +-- +2.27.0 + 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 fd58c68..7990ab0 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 @@ -From c3f0b7eb02d4b13400f0cf8d8e77f9e898f189e9 Mon Sep 17 00:00:00 2001 +From 262adc1859d04c5142da4dfc512204564183090b Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 21 May 2016 00:33:20 +0000 -Subject: [PATCH] llvm: TargetLibraryInfo: Undefine libc functions if they are - macros +Subject: [PATCH 06/24] llvm: TargetLibraryInfo: Undefine libc functions if + they are macros musl defines some functions as macros and not inline functions if this is the case then make sure to undefine them @@ -13,10 +13,10 @@ Signed-off-by: Khem Raj 1 file changed, 21 insertions(+) diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.def b/llvm/include/llvm/Analysis/TargetLibraryInfo.def -index afed404f04c..876888656f2 100644 +index 3864d495510..cc1b69ef625 100644 --- a/llvm/include/llvm/Analysis/TargetLibraryInfo.def +++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.def -@@ -782,6 +782,9 @@ TLI_DEFINE_STRING_INTERNAL("fmodl") +@@ -800,6 +800,9 @@ TLI_DEFINE_STRING_INTERNAL("fmodl") TLI_DEFINE_ENUM_INTERNAL(fopen) TLI_DEFINE_STRING_INTERNAL("fopen") /// FILE *fopen64(const char *filename, const char *opentype) @@ -26,7 +26,7 @@ index afed404f04c..876888656f2 100644 TLI_DEFINE_ENUM_INTERNAL(fopen64) TLI_DEFINE_STRING_INTERNAL("fopen64") /// int fork(); -@@ -829,6 +832,9 @@ TLI_DEFINE_STRING_INTERNAL("fseek") +@@ -847,6 +850,9 @@ TLI_DEFINE_STRING_INTERNAL("fseek") /// int fseeko(FILE *stream, off_t offset, int whence); TLI_DEFINE_ENUM_INTERNAL(fseeko) TLI_DEFINE_STRING_INTERNAL("fseeko") @@ -36,7 +36,7 @@ index afed404f04c..876888656f2 100644 /// int fseeko64(FILE *stream, off64_t offset, int whence) TLI_DEFINE_ENUM_INTERNAL(fseeko64) TLI_DEFINE_STRING_INTERNAL("fseeko64") -@@ -839,6 +845,9 @@ TLI_DEFINE_STRING_INTERNAL("fsetpos") +@@ -857,6 +863,9 @@ TLI_DEFINE_STRING_INTERNAL("fsetpos") TLI_DEFINE_ENUM_INTERNAL(fstat) TLI_DEFINE_STRING_INTERNAL("fstat") /// int fstat64(int filedes, struct stat64 *buf) @@ -46,7 +46,7 @@ index afed404f04c..876888656f2 100644 TLI_DEFINE_ENUM_INTERNAL(fstat64) TLI_DEFINE_STRING_INTERNAL("fstat64") /// int fstatvfs(int fildes, struct statvfs *buf); -@@ -854,6 +863,9 @@ TLI_DEFINE_STRING_INTERNAL("ftell") +@@ -872,6 +881,9 @@ TLI_DEFINE_STRING_INTERNAL("ftell") TLI_DEFINE_ENUM_INTERNAL(ftello) TLI_DEFINE_STRING_INTERNAL("ftello") /// off64_t ftello64(FILE *stream) @@ -56,7 +56,7 @@ index afed404f04c..876888656f2 100644 TLI_DEFINE_ENUM_INTERNAL(ftello64) TLI_DEFINE_STRING_INTERNAL("ftello64") /// int ftrylockfile(FILE *file); -@@ -980,6 +992,9 @@ TLI_DEFINE_STRING_INTERNAL("logl") +@@ -998,6 +1010,9 @@ TLI_DEFINE_STRING_INTERNAL("logl") TLI_DEFINE_ENUM_INTERNAL(lstat) TLI_DEFINE_STRING_INTERNAL("lstat") /// int lstat64(const char *path, struct stat64 *buf); @@ -66,7 +66,7 @@ index afed404f04c..876888656f2 100644 TLI_DEFINE_ENUM_INTERNAL(lstat64) TLI_DEFINE_STRING_INTERNAL("lstat64") /// void *malloc(size_t size); -@@ -1205,6 +1220,9 @@ TLI_DEFINE_STRING_INTERNAL("sscanf") +@@ -1241,6 +1256,9 @@ TLI_DEFINE_STRING_INTERNAL("sscanf") TLI_DEFINE_ENUM_INTERNAL(stat) TLI_DEFINE_STRING_INTERNAL("stat") /// int stat64(const char *path, struct stat64 *buf); @@ -76,7 +76,7 @@ index afed404f04c..876888656f2 100644 TLI_DEFINE_ENUM_INTERNAL(stat64) TLI_DEFINE_STRING_INTERNAL("stat64") /// int statvfs(const char *path, struct statvfs *buf); -@@ -1340,6 +1358,9 @@ TLI_DEFINE_STRING_INTERNAL("times") +@@ -1376,6 +1394,9 @@ TLI_DEFINE_STRING_INTERNAL("times") TLI_DEFINE_ENUM_INTERNAL(tmpfile) TLI_DEFINE_STRING_INTERNAL("tmpfile") /// FILE *tmpfile64(void) @@ -86,3 +86,6 @@ index afed404f04c..876888656f2 100644 TLI_DEFINE_ENUM_INTERNAL(tmpfile64) TLI_DEFINE_STRING_INTERNAL("tmpfile64") /// int toascii(int c); +-- +2.27.0 + 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 804cde9..39e6166 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 @@ -From f9e72bc861144d8f77505ce833fc0c8397520e9b Mon Sep 17 00:00:00 2001 +From fdc01a13dddebef34e5cc037484dd368b9985d63 Mon Sep 17 00:00:00 2001 From: Martin Kelly Date: Fri, 19 May 2017 00:22:57 -0700 -Subject: [PATCH] llvm: allow env override of exe path +Subject: [PATCH 07/24] llvm: allow env override of exe path When using a native llvm-config from inside a sysroot, we need llvm-config to return the libraries, include directories, etc. from inside the sysroot rather @@ -15,10 +15,10 @@ Signed-off-by: Khem Raj 1 file changed, 7 insertions(+) diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp -index 6c31df3e173..f34f3a935ad 100644 +index 7e74b7c9081..8aa541aae38 100644 --- a/llvm/tools/llvm-config/llvm-config.cpp +++ b/llvm/tools/llvm-config/llvm-config.cpp -@@ -225,6 +225,13 @@ Typical components:\n\ +@@ -248,6 +248,13 @@ Typical components:\n\ /// Compute the path to the main executable. std::string GetExecutablePath(const char *Argv0) { @@ -32,3 +32,6 @@ index 6c31df3e173..f34f3a935ad 100644 // This just needs to be some symbol in the binary; C++ doesn't // allow taking the address of ::main however. void *P = (void *)(intptr_t)GetExecutablePath; +-- +2.27.0 + 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 2d0cb1c..ec5dc42 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 @@ -From 2aa9b771b258b45e7de0bef6a99bcdd248ce3b17 Mon Sep 17 00:00:00 2001 +From 2b6da98883ad4d97df3016d89edff4c5cf9c1324 Mon Sep 17 00:00:00 2001 From: Dan McGregor Date: Wed, 26 Apr 2017 20:29:41 -0600 -Subject: [PATCH] clang: driver: Check sysroot for ldso path +Subject: [PATCH 08/24] clang: driver: Check sysroot for ldso path OE does not necessarily follow the default path for the dynamic linker, therefore adjust it for OE. Check for the default path, and if it isn't @@ -14,10 +14,10 @@ Signed-off-by: Khem Raj 1 file changed, 16 insertions(+) diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index bff1ab1009b..02e3d676567 100644 +index 180350476c3..8606705b721 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -596,11 +596,19 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -499,11 +499,19 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { LibDir = "lib64"; Loader = (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1"; @@ -37,7 +37,7 @@ index bff1ab1009b..02e3d676567 100644 break; case llvm::Triple::riscv32: { StringRef ABIName = tools::riscv::getRISCVABI(Args, Triple); -@@ -622,6 +630,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -525,6 +533,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { case llvm::Triple::sparcv9: LibDir = "lib64"; Loader = "ld-linux.so.2"; @@ -48,7 +48,7 @@ index bff1ab1009b..02e3d676567 100644 break; case llvm::Triple::systemz: LibDir = "lib"; -@@ -636,6 +648,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -539,6 +551,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { LibDir = X32 ? "libx32" : "lib64"; Loader = X32 ? "ld-linux-x32.so.2" : "ld-linux-x86-64.so.2"; @@ -58,4 +58,7 @@ index bff1ab1009b..02e3d676567 100644 + } break; } - } + case llvm::Triple::ve: +-- +2.27.0 + 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 51ce720..2ab33a3 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 @@ -From 42800fd6bf0040ddd0abf280ea205407e9e004b5 Mon Sep 17 00:00:00 2001 +From 157f27cb0796c8af04177e8472627207dde0950f Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 19 May 2016 21:11:06 -0700 -Subject: [PATCH] clang: Driver/tools.cpp: Add -lssp_nonshared on musl +Subject: [PATCH 09/24] clang: Driver/tools.cpp: Add -lssp_nonshared on musl musl driver will need to add ssp_nonshared for stack_check_local on the linker cmdline when using stack protector commands on @@ -13,10 +13,10 @@ Signed-off-by: Khem Raj 1 file changed, 6 insertions(+) diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index da197e47662..4821cfebc21 100644 +index c8a7fce07ef..48723c507a1 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -583,6 +583,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, +@@ -630,6 +630,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, if (IsIAMCU) CmdArgs.push_back("-lgloss"); @@ -29,3 +29,6 @@ index da197e47662..4821cfebc21 100644 if (IsStatic || IsStaticPIE) CmdArgs.push_back("--end-group"); else +-- +2.27.0 + 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 2de6618..c402b8b 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 @@ -From d4719b78a4d59d572b9de7397d8179a5ed7460e9 Mon Sep 17 00:00:00 2001 +From ae0fcdcf66b3b633dd48a69cf5e0e2e905d184e0 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 10 May 2016 02:00:11 -0700 -Subject: [PATCH] clang: musl/ppc does not support 128-bit long double +Subject: [PATCH 10/24] clang: musl/ppc does not support 128-bit long double Signed-off-by: Khem Raj --- @@ -9,10 +9,10 @@ Signed-off-by: Khem Raj 1 file changed, 4 insertions(+) diff --git a/clang/lib/Basic/Targets/PPC.h b/clang/lib/Basic/Targets/PPC.h -index 270aa7ff918..8b1bb167818 100644 +index 858059bacb8..1d0d2ee65ea 100644 --- a/clang/lib/Basic/Targets/PPC.h +++ b/clang/lib/Basic/Targets/PPC.h -@@ -364,6 +364,10 @@ public: +@@ -382,6 +382,10 @@ public: LongDoubleFormat = &llvm::APFloat::IEEEdouble(); } @@ -23,3 +23,6 @@ index 270aa7ff918..8b1bb167818 100644 // PPC32 supports atomics up to 4 bytes. MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32; } +-- +2.27.0 + 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 418afba..0692cf6 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 @@ -From 90ac3c6f6407ed40aa76e779ddbcfc0d24c58780 Mon Sep 17 00:00:00 2001 +From d9abc62bb1e99f56df20194122a1aac5a74d0282 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 16 Mar 2017 09:02:13 -0700 -Subject: [PATCH] clang: Prepend trailing '/' to sysroot +Subject: [PATCH 11/24] clang: Prepend trailing '/' to sysroot This is needed to handle a case where clang isntall and target sysroot are perilously same @@ -24,15 +24,18 @@ Signed-off-by: Khem Raj 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 02e3d676567..d95da11e351 100644 +index 8606705b721..d908e40d86e 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -223,7 +223,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) +@@ -214,7 +214,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) Multilibs = GCCInstallation.getMultilibs(); SelectedMultilib = GCCInstallation.getMultilib(); llvm::Triple::ArchType Arch = Triple.getArch(); - std::string SysRoot = computeSysRoot(); + std::string SysRoot = computeSysRoot() + "/"; + ToolChain::path_list &PPaths = getProgramPaths(); - // Cross-compiling binutils and GCC installations (vanilla and openSUSE at - // least) put various tools in a triple-prefixed directory off of the parent + Generic_GCC::PushPPaths(PPaths); +-- +2.27.0 + 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 9316157..2889bcf 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,7 +1,8 @@ -From 805b4ce637faedee91bb92fdae273b01bd5aa363 Mon Sep 17 00:00:00 2001 +From 30b2a171ab5b3649ae34d1ccab4920435ef4167e Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 16 Mar 2017 19:06:26 -0700 -Subject: [PATCH] clang: Look inside the target sysroot for compiler runtime +Subject: [PATCH 12/24] clang: Look inside the target sysroot for compiler + runtime In OE compiler-rt and libc++ are built and staged into target sysroot and not into resourcedir which is relative to clang @@ -15,7 +16,7 @@ Signed-off-by: Khem Raj 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp -index cab97b1a601..059a5e62c40 100644 +index b8c12fc9241..ee53fd4925f 100644 --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/lib/Driver/ToolChain.cpp @@ -14,6 +14,7 @@ @@ -26,7 +27,7 @@ index cab97b1a601..059a5e62c40 100644 #include "clang/Config/config.h" #include "clang/Driver/Action.h" #include "clang/Driver/Driver.h" -@@ -379,7 +380,10 @@ StringRef ToolChain::getOSLibName() const { +@@ -397,7 +398,10 @@ StringRef ToolChain::getOSLibName() const { } std::string ToolChain::getCompilerRTPath() const { @@ -38,3 +39,6 @@ index cab97b1a601..059a5e62c40 100644 if (Triple.isOSUnknown()) { llvm::sys::path::append(Path, "lib"); } else { +-- +2.27.0 + 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 b1b3f05..c23c882 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 @@ -From 56a43865d296b6b3293cd35f3e4732dac8b00523 Mon Sep 17 00:00:00 2001 +From 7d7eb4b90e924649f317233fd87c3b700f98d4c0 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 21 May 2017 15:38:25 -0700 -Subject: [PATCH] clang: Define / releative gcc installation dir +Subject: [PATCH 13/24] clang: Define / releative gcc installation dir This is required for OE gcc installation to work. Without this its not able to find the paths for libgcc @@ -14,10 +14,10 @@ Signed-off-by: Khem Raj 1 file changed, 3 insertions(+) diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 4821cfebc21..0c8d9e2f475 100644 +index 48723c507a1..d02e644c720 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2428,6 +2428,9 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( +@@ -2481,6 +2481,9 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( {"gcc-cross/" + CandidateTriple.str(), "../..", TargetTriple.getOS() != llvm::Triple::Solaris}, @@ -27,3 +27,6 @@ index 4821cfebc21..0c8d9e2f475 100644 // The Freescale PPC SDK has the gcc libraries in // /usr/lib//x.y.z so have a look there as well. Only do // this on Freescale triples, though, since some systems put a *lot* of +-- +2.27.0 + 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 71c1c52..c363b15 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 @@ -From b11d1668890778d6d55cadeaec4f6c2e291b583b Mon Sep 17 00:00:00 2001 +From 9413eabd3659763c550d6beb2d5290228758a53b Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 16 Aug 2017 15:16:15 -0700 -Subject: [PATCH] clang: Fix ldso for musl on x86 and x32 architectures +Subject: [PATCH 14/24] clang: Fix ldso for musl on x86 and x32 architectures x32 linker is called ld-musl-x32.so.1 and x86 linker is called ld-musl-i386.so.1, Currently, linker for @@ -14,10 +14,10 @@ Signed-off-by: Khem Raj 1 file changed, 8 insertions(+) diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index d95da11e351..0a4644dab9f 100644 +index d908e40d86e..add122d5cc8 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -519,6 +519,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -422,6 +422,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { if (Triple.isMusl()) { std::string ArchName; bool IsArm = false; @@ -25,7 +25,7 @@ index d95da11e351..0a4644dab9f 100644 switch (Arch) { case llvm::Triple::arm: -@@ -531,6 +532,13 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -434,6 +435,13 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { ArchName = "armeb"; IsArm = true; break; @@ -39,3 +39,6 @@ index d95da11e351..0a4644dab9f 100644 default: ArchName = Triple.getArchName().str(); } +-- +2.27.0 + 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 7b762f1..3cac628 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 @@ -From 0f969665b80310b90bcb304b2e60c4493687c5a6 Mon Sep 17 00:00:00 2001 +From fa612803a3b55d763ad5498babd2f6bc81c6109b Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 15 May 2018 10:28:43 -0700 -Subject: [PATCH] clang: scan-view needs python 2.x +Subject: [PATCH 15/24] clang: scan-view needs python 2.x Some distributions e.g. archlinux have switched to pointing python to python3, therefore its better to be specific about @@ -22,3 +22,6 @@ index 6165432e7af..04ad518a60c 100755 from __future__ import print_function +-- +2.27.0 + 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 b77f433..a57ffb3 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 @@ -From a1fa38408f7524c8452709574b3d83b72ebcfa38 Mon Sep 17 00:00:00 2001 +From a1d6f91cac4f24890081be8f594eef7ef09919e3 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 31 Jul 2019 22:51:39 -0700 -Subject: [PATCH] clang: Add -lpthread and -ldl along with -lunwind for static - linking +Subject: [PATCH 16/24] clang: Add -lpthread and -ldl along with -lunwind for + static linking When doing static liking with --unwindlib=libunwind -static we encounter undefined symbols @@ -20,15 +20,15 @@ Signed-off-by: Khem Raj 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp -index 37ec7346857..c849b2242e9 100644 +index 1cac5a0822a..29fe4a33a14 100644 --- a/clang/lib/Driver/ToolChains/CommonArgs.cpp +++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp -@@ -1211,8 +1211,13 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D, - case ToolChain::UNW_CompilerRT: - if (LGT == LibGccType::StaticLibGcc) - CmdArgs.push_back("-l:libunwind.a"); -- else -+ else { +@@ -1275,8 +1275,13 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D, + // Let the linker choose between libunwind.dll.a and libunwind.a + // depending on what's available, and depending on the -static flag + CmdArgs.push_back("-lunwind"); +- } else ++ } else { CmdArgs.push_back("-l:libunwind.so"); + if (Args.hasArg(options::OPT_static)) { + CmdArgs.push_back("-lpthread"); @@ -38,3 +38,6 @@ index 37ec7346857..c849b2242e9 100644 break; } +-- +2.27.0 + 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 new file mode 100644 index 0000000..5b55c4e --- /dev/null +++ b/recipes-devtools/clang/clang/0017-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch @@ -0,0 +1,27 @@ +From f6bbe3e375104b495d7b0340d9df2c08f853c290 Mon Sep 17 00:00:00 2001 +From: Anuj Mittal +Date: Thu, 26 Dec 2019 12:56:16 -0800 +Subject: [PATCH 17/24] Pass PYTHON_EXECUTABLE when cross compiling for native + build + +Signed-off-by: Anuj Mittal +Signed-off-by: Khem Raj +--- + llvm/cmake/modules/CrossCompile.cmake | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake +index 01cd3712484..f50be9d967d 100644 +--- a/llvm/cmake/modules/CrossCompile.cmake ++++ b/llvm/cmake/modules/CrossCompile.cmake +@@ -79,6 +79,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype) + -DLLVM_EXTERNAL_PROJECTS="${llvm_external_projects_arg}" + ${external_project_source_dirs} + -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN="${LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN}" ++ -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" + ${build_type_flags} ${linker_flag} ${external_clang_dir} + ${ARGN} + WORKING_DIRECTORY ${${project_name}_${target_name}_BUILD} +-- +2.27.0 + diff --git a/recipes-devtools/clang/clang/0017-libclang-Use-CMAKE_DL_LIBS-for-deducing-libdl.patch b/recipes-devtools/clang/clang/0017-libclang-Use-CMAKE_DL_LIBS-for-deducing-libdl.patch deleted file mode 100644 index f5bc773..0000000 --- a/recipes-devtools/clang/clang/0017-libclang-Use-CMAKE_DL_LIBS-for-deducing-libdl.patch +++ /dev/null @@ -1,33 +0,0 @@ -From cfe4473e8447cd2c73a2f42c9c235ce1dfd08bec Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 11 Dec 2019 10:23:15 -0800 -Subject: [PATCH] libclang: Use CMAKE_DL_LIBS for deducing libdl - -This helps in getting right settings for libdl irrespective of platform -it also fixes build with -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON - -Fixes - -tools/clang/tools/libclang/CMakeFiles/libclang.dir/CIndexer.cpp.o: In function clang::CIndexer::getClangResourcesPath[abi:cxx11]()': 2019-12-06T06:04:39.2987601Z | CIndexer.cpp:(.text._ZN5clang8CIndexer21getClangResourcesPathB5cxx11Ev+0x8b): undefined reference to dladdr' - -Signed-off-by: Khem Raj ---- - clang/tools/libclang/CMakeLists.txt | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -diff --git a/clang/tools/libclang/CMakeLists.txt b/clang/tools/libclang/CMakeLists.txt -index bd0c945a5e1..723fa95f14b 100644 ---- a/clang/tools/libclang/CMakeLists.txt -+++ b/clang/tools/libclang/CMakeLists.txt -@@ -60,9 +60,8 @@ if (TARGET clangTidyPlugin) - endif() - endif () - --find_library(DL_LIBRARY_PATH dl) --if (DL_LIBRARY_PATH) -- list(APPEND LIBS dl) -+if (HAVE_LIBDL) -+ list(APPEND LIBS ${CMAKE_DL_LIBS}) - endif() - - option(LIBCLANG_BUILD_STATIC 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 new file mode 100644 index 0000000..e6df535 --- /dev/null +++ b/recipes-devtools/clang/clang/0018-Check-for-atomic-double-intrinsics.patch @@ -0,0 +1,35 @@ +From 9f3168a04fcf9b44c7850c5977e8f1dfa2c4a2ff Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 18 Nov 2019 17:00:29 -0800 +Subject: [PATCH 18/24] Check for atomic intrinsics + +On some architectures e.g. x86/32bit gcc decides to inline calls to +double atomic variables but clang does not and defers it to libatomic +therefore detect if clang can use built-ins for atomic if not +then link libatomic, this helps building clangd for x86 on linux systems +with gcc runtime + +Signed-off-by: Khem Raj +--- + llvm/cmake/modules/CheckAtomic.cmake | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/llvm/cmake/modules/CheckAtomic.cmake b/llvm/cmake/modules/CheckAtomic.cmake +index d0b75f3bcc9..8ebe83b0d31 100644 +--- a/llvm/cmake/modules/CheckAtomic.cmake ++++ b/llvm/cmake/modules/CheckAtomic.cmake +@@ -30,9 +30,10 @@ function(check_working_cxx_atomics64 varname) + #include + #include + std::atomic x (0); ++std::atomic y (0); + int main() { + uint64_t i = x.load(std::memory_order_relaxed); +- return 0; ++ return int(y); + } + " ${varname}) + set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) +-- +2.27.0 + diff --git a/recipes-devtools/clang/clang/0018-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch b/recipes-devtools/clang/clang/0018-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch deleted file mode 100644 index de92b2f..0000000 --- a/recipes-devtools/clang/clang/0018-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch +++ /dev/null @@ -1,23 +0,0 @@ -From a415287545ffe17f7dbc743a033877fd239856b5 Mon Sep 17 00:00:00 2001 -From: Anuj Mittal -Date: Thu, 26 Dec 2019 12:56:16 -0800 -Subject: [PATCH] Pass PYTHON_EXECUTABLE when cross compiling for native build - -Signed-off-by: Anuj Mittal -Signed-off-by: Khem Raj ---- - llvm/cmake/modules/CrossCompile.cmake | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake -index 8a6e880c4e2..259211df18e 100644 ---- a/llvm/cmake/modules/CrossCompile.cmake -+++ b/llvm/cmake/modules/CrossCompile.cmake -@@ -79,6 +79,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype) - -DLLVM_EXTERNAL_PROJECTS="${llvm_external_projects_arg}" - ${external_project_source_dirs} - -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN="${LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN}" -+ -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" - ${build_type_flags} ${linker_flag} ${external_clang_dir} - ${ARGN} - WORKING_DIRECTORY ${${project_name}_${target_name}_BUILD} diff --git a/recipes-devtools/clang/clang/0019-Check-for-atomic-double-intrinsics.patch b/recipes-devtools/clang/clang/0019-Check-for-atomic-double-intrinsics.patch deleted file mode 100644 index 0885648..0000000 --- a/recipes-devtools/clang/clang/0019-Check-for-atomic-double-intrinsics.patch +++ /dev/null @@ -1,32 +0,0 @@ -From dd6a749dee10f537fc7cb558ace319041a63e5f3 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Mon, 18 Nov 2019 17:00:29 -0800 -Subject: [PATCH] Check for atomic intrinsics - -On some architectures e.g. x86/32bit gcc decides to inline calls to -double atomic variables but clang does not and defers it to libatomic -therefore detect if clang can use built-ins for atomic if not -then link libatomic, this helps building clangd for x86 on linux systems -with gcc runtime - -Signed-off-by: Khem Raj ---- - llvm/cmake/modules/CheckAtomic.cmake | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/llvm/cmake/modules/CheckAtomic.cmake b/llvm/cmake/modules/CheckAtomic.cmake -index 29f3bdd57f0..6460842cf63 100644 ---- a/llvm/cmake/modules/CheckAtomic.cmake -+++ b/llvm/cmake/modules/CheckAtomic.cmake -@@ -26,9 +26,10 @@ function(check_working_cxx_atomics64 varname) - #include - #include - std::atomic x (0); -+std::atomic y (0); - int main() { - uint64_t i = x.load(std::memory_order_relaxed); -- return 0; -+ return int(y); - } - " ${varname}) - set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) 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 new file mode 100644 index 0000000..5e92940 --- /dev/null +++ b/recipes-devtools/clang/clang/0019-clang-Enable-SSP-and-PIE-by-default.patch @@ -0,0 +1,316 @@ +From c93bfc2e7cf6e4abb077e3b18d8adf0985e707f6 Mon Sep 17 00:00:00 2001 +From: Evangelos Foutras +Date: Thu, 26 Dec 2019 15:46:19 -0800 +Subject: [PATCH 19/24] clang: Enable SSP and PIE by default + +This is a minimal set of changes needed to make clang use SSP and PIE by +default on Arch Linux. Tests that were easy to adjust have been changed +accordingly; only test/Driver/linux-ld.c has been marked as "expected +failure" due to the number of changes it would require (mostly replacing +crtbegin.o with crtbeginS.o). + +Doing so is needed in order to align clang with the new default GCC +behavior in Arch which generates PIE executables by default and also +defaults to -fstack-protector-strong. It is not meant to be a long term +solution, but a simple temporary fix. + +Hopefully these changes will be obsoleted by the introduction upstream +of a compile-time option (https://bugs.llvm.org/show_bug.cgi?id=13410) + +Taken from ArchLinux - https://git.archlinux.org/svntogit/packages.git/plain/trunk/enable-SSP-and-PIE-by-default.patch?h=packages/clang + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Linux.cpp | 14 ++++++++++++-- + clang/lib/Driver/ToolChains/Linux.h | 1 + + clang/test/Driver/cross-linux.c | 16 ++++++++-------- + clang/test/Driver/env.c | 2 +- + clang/test/Driver/fsanitize.c | 14 +++++++------- + clang/test/Driver/gcc-toolchain.cpp | 2 +- + clang/test/Driver/hexagon-toolchain-elf.c | 2 +- + clang/test/Driver/linux-as.c | 4 ++-- + clang/test/Driver/linux-ld.c | 2 ++ + clang/test/Driver/ppc-abi.c | 4 ++-- + clang/test/Driver/riscv32-toolchain.c | 4 ++-- + clang/test/Driver/riscv64-toolchain.c | 4 ++-- + clang/test/Driver/stack-protector.c | 4 ++-- + 13 files changed, 43 insertions(+), 30 deletions(-) + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index add122d5cc8..9128d4e0fa0 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -843,8 +843,18 @@ void Linux::AddIAMCUIncludeArgs(const ArgList &DriverArgs, + } + + bool Linux::isPIEDefault() const { +- return (getTriple().isAndroid() && !getTriple().isAndroidVersionLT(16)) || +- getTriple().isMusl() || getSanitizerArgs().requiresPIE(); ++ const bool IsMips = getTriple().isMIPS(); ++ const bool IsAndroid = getTriple().isAndroid(); ++ ++ if (IsMips || IsAndroid) ++ return (getTriple().isAndroid() && !getTriple().isAndroidVersionLT(16)) || ++ getTriple().isMusl() || getSanitizerArgs().requiresPIE(); ++ ++ return true; ++} ++ ++unsigned Linux::GetDefaultStackProtectorLevel(bool KernelOrKext) const { ++ return 2; + } + + bool Linux::isNoExecStackDefault() const { +diff --git a/clang/lib/Driver/ToolChains/Linux.h b/clang/lib/Driver/ToolChains/Linux.h +index 6b16b0e6499..d0024110aef 100644 +--- a/clang/lib/Driver/ToolChains/Linux.h ++++ b/clang/lib/Driver/ToolChains/Linux.h +@@ -39,6 +39,7 @@ public: + bool isPIEDefault() const override; + bool isNoExecStackDefault() const override; + bool IsMathErrnoDefault() const override; ++ unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override; + SanitizerMask getSupportedSanitizers() const override; + void addProfileRTLibs(const llvm::opt::ArgList &Args, + llvm::opt::ArgStringList &CmdArgs) const override; +diff --git a/clang/test/Driver/cross-linux.c b/clang/test/Driver/cross-linux.c +index 6c2dab26069..c28c5653e34 100644 +--- a/clang/test/Driver/cross-linux.c ++++ b/clang/test/Driver/cross-linux.c +@@ -42,8 +42,8 @@ + // CHECK-MULTI32-I386: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\\\}}ld" + // CHECK-MULTI32-I386: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" + // CHECK-MULTI32-I386: "-m" "elf_i386" +-// CHECK-MULTI32-I386: "crti.o" "[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]{{/|\\\\}}crtbegin.o" +-// CHECK-MULTI32-I386: "-L[[gcc_install]]" ++// CHECK-MULTI32-I386: "crti.o" "crtbeginS.o" ++// CHECK-MULTI32-I386: "-L[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]" + // CHECK-MULTI32-I386: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib/../lib32" + // CHECK-MULTI32-I386: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib" + // CHECK-MULTI32-I386: "-L[[sysroot]]/lib" +@@ -60,8 +60,8 @@ + // CHECK-MULTI32-X86-64: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\\\}}ld" + // CHECK-MULTI32-X86-64: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" + // CHECK-MULTI32-X86-64: "-m" "elf_x86_64" +-// CHECK-MULTI32-X86-64: "crti.o" "[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]/64{{/|\\\\}}crtbegin.o" +-// CHECK-MULTI32-X86-64: "-L[[gcc_install]]/64" ++// CHECK-MULTI32-X86-64: "crti.o" "crtbeginS.o" ++// CHECK-MULTI32-X86-64: "-L[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]/64" + // CHECK-MULTI32-X86-64: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib/../lib64" + // CHECK-MULTI32-X86-64: "-L[[gcc_install]]" + // CHECK-MULTI32-X86-64: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib" +@@ -79,8 +79,8 @@ + // CHECK-MULTI64-I386: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\\\}}ld" + // CHECK-MULTI64-I386: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" + // CHECK-MULTI64-I386: "-m" "elf_i386" +-// CHECK-MULTI64-I386: "crti.o" "[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]/32{{/|\\\\}}crtbegin.o" +-// CHECK-MULTI64-I386: "-L[[gcc_install]]/32" ++// CHECK-MULTI64-I386: "crti.o" "crtbeginS.o" ++// CHECK-MULTI64-I386: "-L[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]/32" + // CHECK-MULTI64-I386: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib/../lib32" + // CHECK-MULTI64-I386: "-L[[gcc_install]]" + // CHECK-MULTI64-I386: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib" +@@ -98,8 +98,8 @@ + // CHECK-MULTI64-X86-64: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\\\}}ld" + // CHECK-MULTI64-X86-64: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" + // CHECK-MULTI64-X86-64: "-m" "elf_x86_64" +-// CHECK-MULTI64-X86-64: "crti.o" "[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]{{/|\\\\}}crtbegin.o" +-// CHECK-MULTI64-X86-64: "-L[[gcc_install]]" ++// CHECK-MULTI64-X86-64: "crti.o" "crtbeginS.o" ++// CHECK-MULTI64-X86-64: "-L[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]" + // CHECK-MULTI64-X86-64: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib/../lib64" + // CHECK-MULTI64-X86-64: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib" + // CHECK-MULTI64-X86-64: "-L[[sysroot]]/lib" +diff --git a/clang/test/Driver/env.c b/clang/test/Driver/env.c +index 0371bc91c4a..ea89f525121 100644 +--- a/clang/test/Driver/env.c ++++ b/clang/test/Driver/env.c +@@ -20,7 +20,7 @@ + // + // CHECK-LD-32-NOT: warning: + // CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-LD-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o" ++// CHECK-LD-32: "crtbeginS.o" + // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0" + // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib" + // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.." +diff --git a/clang/test/Driver/fsanitize.c b/clang/test/Driver/fsanitize.c +index 7340bfb35e4..681bb90b50e 100644 +--- a/clang/test/Driver/fsanitize.c ++++ b/clang/test/Driver/fsanitize.c +@@ -329,15 +329,15 @@ + // RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-sanitize=vptr -fsanitize=undefined,address %s -### 2>&1 + // OK + +-// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE +-// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE ++// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE ++// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE + // RUN: %clang -target x86_64-unknown-freebsd -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE + // RUN: %clang -target aarch64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE + // RUN: %clang -target arm-linux-androideabi -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIC-NO-PIE + // RUN: %clang -target arm-linux-androideabi24 -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE + // RUN: %clang -target aarch64-linux-android -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE +-// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE +-// RUN: %clang -target i386-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE ++// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE ++// RUN: %clang -target i386-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE + + // CHECK-NO-PIE-NOT: "-pie" + // CHECK-NO-PIE: "-mrelocation-model" "static" +@@ -662,12 +662,12 @@ + // RUN: %clang -fno-sanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NOSP + // NOSP-NOT: "-fsanitize=safe-stack" + +-// RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP ++// RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP + // RUN: %clang -target x86_64-linux-gnu -fsanitize=address,safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP-ASAN + // RUN: %clang -target x86_64-linux-gnu -fstack-protector -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP + // RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -fstack-protector-all -### %s 2>&1 | FileCheck %s -check-prefix=SP +-// RUN: %clang -target arm-linux-androideabi -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP +-// RUN: %clang -target aarch64-linux-android -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP ++// RUN: %clang -target arm-linux-androideabi -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP ++// RUN: %clang -target aarch64-linux-android -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP + // RUN: %clang -target i386-contiki-unknown -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP + // NO-SP-NOT: stack-protector + // NO-SP: "-fsanitize=safe-stack" +diff --git a/clang/test/Driver/gcc-toolchain.cpp b/clang/test/Driver/gcc-toolchain.cpp +index 6c872f4255c..f5006d1dd9a 100644 +--- a/clang/test/Driver/gcc-toolchain.cpp ++++ b/clang/test/Driver/gcc-toolchain.cpp +@@ -26,6 +26,6 @@ + // the same precise formatting of the path as the '-internal-system' flags + // above, so we just blanket wildcard match the 'crtbegin.o'. + // CHECK: "{{[^"]*}}ld{{(.exe)?}}" +-// CHECK: "{{[^"]*}}/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5{{/|\\\\}}crtbegin.o" ++// CHECK: "crtbeginS.o" + // CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5" + // CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../.." +diff --git a/clang/test/Driver/hexagon-toolchain-elf.c b/clang/test/Driver/hexagon-toolchain-elf.c +index cc11f9fcba9..1fe8b5db587 100644 +--- a/clang/test/Driver/hexagon-toolchain-elf.c ++++ b/clang/test/Driver/hexagon-toolchain-elf.c +@@ -487,7 +487,7 @@ + // RUN: %s 2>&1 \ + // RUN: | FileCheck -check-prefix=CHECK042 %s + // CHECK042: "-cc1" +-// CHECK042: "-mrelocation-model" "static" ++// CHECK042: "-mrelocation-model" "pic" + // CHECK042: "-mllvm" "-hexagon-small-data-threshold=8" + // CHECK042-NEXT: llvm-mc + // CHECK042: "-gpsize=8" +diff --git a/clang/test/Driver/linux-as.c b/clang/test/Driver/linux-as.c +index 77ac05f3094..cb474f32898 100644 +--- a/clang/test/Driver/linux-as.c ++++ b/clang/test/Driver/linux-as.c +@@ -164,7 +164,7 @@ + // CHECK-PPC-NO-MCPU-NOT: as{{.*}} "-mcpu=invalid-cpu" + // + // RUN: %clang -target sparc64-linux -mcpu=invalid-cpu -### \ +-// RUN: -no-integrated-as -c %s 2>&1 \ ++// RUN: -no-integrated-as -fno-pic -c %s 2>&1 \ + // RUN: | FileCheck -check-prefix=CHECK-SPARCV9 %s + // CHECK-SPARCV9: as + // CHECK-SPARCV9: -64 +@@ -173,7 +173,7 @@ + // CHECK-SPARCV9: -o + // + // RUN: %clang -target sparc64-linux -mcpu=invalid-cpu -### \ +-// RUN: -no-integrated-as -fpic -c %s 2>&1 \ ++// RUN: -no-integrated-as -c %s 2>&1 \ + // RUN: | FileCheck -check-prefix=CHECK-SPARCV9PIC %s + // CHECK-SPARCV9PIC: as + // CHECK-SPARCV9PIC: -64 +diff --git a/clang/test/Driver/linux-ld.c b/clang/test/Driver/linux-ld.c +index ec539522c25..caf96020a15 100644 +--- a/clang/test/Driver/linux-ld.c ++++ b/clang/test/Driver/linux-ld.c +@@ -1,3 +1,5 @@ ++// XFAIL: linux ++ + // General tests that ld invocations on Linux targets sane. Note that we use + // sysroot to make these tests independent of the host system. + // +diff --git a/clang/test/Driver/ppc-abi.c b/clang/test/Driver/ppc-abi.c +index acc4981a2ee..0d465516762 100644 +--- a/clang/test/Driver/ppc-abi.c ++++ b/clang/test/Driver/ppc-abi.c +@@ -32,11 +32,11 @@ + + // CHECK-ELFv1: "-mrelocation-model" "static" + // CHECK-ELFv1: "-target-abi" "elfv1" +-// CHECK-ELFv1-LE: "-mrelocation-model" "static" ++// CHECK-ELFv1-LE: "-mrelocation-model" "pic" "-pic-level" "2" + // CHECK-ELFv1-LE: "-target-abi" "elfv1" + // CHECK-ELFv1-QPX: "-mrelocation-model" "static" + // CHECK-ELFv1-QPX: "-target-abi" "elfv1-qpx" +-// CHECK-ELFv2: "-mrelocation-model" "static" ++// CHECK-ELFv2: "-mrelocation-model" "pic" "-pic-level" "2" + // CHECK-ELFv2: "-target-abi" "elfv2" + // CHECK-ELFv2-BE: "-mrelocation-model" "static" + // CHECK-ELFv2-BE: "-target-abi" "elfv2" +diff --git a/clang/test/Driver/riscv32-toolchain.c b/clang/test/Driver/riscv32-toolchain.c +index b83c9aafcbf..15b6f6496b2 100644 +--- a/clang/test/Driver/riscv32-toolchain.c ++++ b/clang/test/Driver/riscv32-toolchain.c +@@ -81,7 +81,7 @@ + // C-RV32-LINUX-MULTI-ILP32: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" + // C-RV32-LINUX-MULTI-ILP32: "-m" "elf32lriscv" + // C-RV32-LINUX-MULTI-ILP32: "-dynamic-linker" "/lib/ld-linux-riscv32-ilp32.so.1" +-// C-RV32-LINUX-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32{{/|\\\\}}crtbegin.o" ++// C-RV32-LINUX-MULTI-ILP32: "crtbeginS.o" + // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32" + // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib32/ilp32" + // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib32/ilp32" +@@ -96,7 +96,7 @@ + // C-RV32-LINUX-MULTI-ILP32D: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" + // C-RV32-LINUX-MULTI-ILP32D: "-m" "elf32lriscv" + // C-RV32-LINUX-MULTI-ILP32D: "-dynamic-linker" "/lib/ld-linux-riscv32-ilp32d.so.1" +-// C-RV32-LINUX-MULTI-ILP32D: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32d{{/|\\\\}}crtbegin.o" ++// C-RV32-LINUX-MULTI-ILP32D: "crtbeginS.o" + // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32d" + // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib32/ilp32d" + // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib32/ilp32d" +diff --git a/clang/test/Driver/riscv64-toolchain.c b/clang/test/Driver/riscv64-toolchain.c +index 5df069eb9fd..2617551ec35 100644 +--- a/clang/test/Driver/riscv64-toolchain.c ++++ b/clang/test/Driver/riscv64-toolchain.c +@@ -81,7 +81,7 @@ + // C-RV64-LINUX-MULTI-LP64: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" + // C-RV64-LINUX-MULTI-LP64: "-m" "elf64lriscv" + // C-RV64-LINUX-MULTI-LP64: "-dynamic-linker" "/lib/ld-linux-riscv64-lp64.so.1" +-// C-RV64-LINUX-MULTI-LP64: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib64/lp64{{/|\\\\}}crtbegin.o" ++// C-RV64-LINUX-MULTI-LP64: "crtbeginS.o" + // C-RV64-LINUX-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib64/lp64" + // C-RV64-LINUX-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib64/lp64" + // C-RV64-LINUX-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib64/lp64" +@@ -96,7 +96,7 @@ + // C-RV64-LINUX-MULTI-LP64D: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" + // C-RV64-LINUX-MULTI-LP64D: "-m" "elf64lriscv" + // C-RV64-LINUX-MULTI-LP64D: "-dynamic-linker" "/lib/ld-linux-riscv64-lp64d.so.1" +-// C-RV64-LINUX-MULTI-LP64D: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib64/lp64d{{/|\\\\}}crtbegin.o" ++// C-RV64-LINUX-MULTI-LP64D: "crtbeginS.o" + // C-RV64-LINUX-MULTI-LP64D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib64/lp64d" + // C-RV64-LINUX-MULTI-LP64D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib64/lp64d" + // C-RV64-LINUX-MULTI-LP64D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib64/lp64d" +diff --git a/clang/test/Driver/stack-protector.c b/clang/test/Driver/stack-protector.c +index a3e40b50eed..dfffe0d6cf8 100644 +--- a/clang/test/Driver/stack-protector.c ++++ b/clang/test/Driver/stack-protector.c +@@ -3,11 +3,11 @@ + // NOSSP-NOT: "-stack-protector-buffer-size" + + // RUN: %clang -target i386-unknown-linux -fstack-protector -### %s 2>&1 | FileCheck %s -check-prefix=SSP +-// SSP: "-stack-protector" "1" ++// SSP: "-stack-protector" "2" + // SSP-NOT: "-stack-protector-buffer-size" + + // RUN: %clang -target i386-unknown-linux -fstack-protector --param ssp-buffer-size=16 -### %s 2>&1 | FileCheck %s -check-prefix=SSP-BUF +-// SSP-BUF: "-stack-protector" "1" ++// SSP-BUF: "-stack-protector" "2" + // SSP-BUF: "-stack-protector-buffer-size" "16" + + // RUN: %clang -target i386-pc-openbsd -### %s 2>&1 | FileCheck %s -check-prefix=OPENBSD +-- +2.27.0 + diff --git a/recipes-devtools/clang/clang/0020-clang-Enable-SSP-and-PIE-by-default.patch b/recipes-devtools/clang/clang/0020-clang-Enable-SSP-and-PIE-by-default.patch deleted file mode 100644 index 39d500c..0000000 --- a/recipes-devtools/clang/clang/0020-clang-Enable-SSP-and-PIE-by-default.patch +++ /dev/null @@ -1,313 +0,0 @@ -From b826518219333760c4632062dc586bbe17a055e6 Mon Sep 17 00:00:00 2001 -From: Evangelos Foutras -Date: Thu, 26 Dec 2019 15:46:19 -0800 -Subject: [PATCH] clang: Enable SSP and PIE by default - -This is a minimal set of changes needed to make clang use SSP and PIE by -default on Arch Linux. Tests that were easy to adjust have been changed -accordingly; only test/Driver/linux-ld.c has been marked as "expected -failure" due to the number of changes it would require (mostly replacing -crtbegin.o with crtbeginS.o). - -Doing so is needed in order to align clang with the new default GCC -behavior in Arch which generates PIE executables by default and also -defaults to -fstack-protector-strong. It is not meant to be a long term -solution, but a simple temporary fix. - -Hopefully these changes will be obsoleted by the introduction upstream -of a compile-time option (https://bugs.llvm.org/show_bug.cgi?id=13410) - -Taken from ArchLinux - https://git.archlinux.org/svntogit/packages.git/plain/trunk/enable-SSP-and-PIE-by-default.patch?h=packages/clang - -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Linux.cpp | 14 ++++++++++++-- - clang/lib/Driver/ToolChains/Linux.h | 1 + - clang/test/Driver/cross-linux.c | 16 ++++++++-------- - clang/test/Driver/env.c | 2 +- - clang/test/Driver/fsanitize.c | 14 +++++++------- - clang/test/Driver/gcc-toolchain.cpp | 2 +- - clang/test/Driver/hexagon-toolchain-elf.c | 2 +- - clang/test/Driver/linux-as.c | 4 ++-- - clang/test/Driver/linux-ld.c | 2 ++ - clang/test/Driver/ppc-abi.c | 4 ++-- - clang/test/Driver/riscv32-toolchain.c | 4 ++-- - clang/test/Driver/riscv64-toolchain.c | 4 ++-- - clang/test/Driver/stack-protector.c | 4 ++-- - 13 files changed, 43 insertions(+), 30 deletions(-) - -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 0a4644dab9f..fb579e7ad60 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -941,8 +941,18 @@ void Linux::AddIAMCUIncludeArgs(const ArgList &DriverArgs, - } - - bool Linux::isPIEDefault() const { -- return (getTriple().isAndroid() && !getTriple().isAndroidVersionLT(16)) || -- getTriple().isMusl() || getSanitizerArgs().requiresPIE(); -+ const bool IsMips = getTriple().isMIPS(); -+ const bool IsAndroid = getTriple().isAndroid(); -+ -+ if (IsMips || IsAndroid) -+ return (getTriple().isAndroid() && !getTriple().isAndroidVersionLT(16)) || -+ getTriple().isMusl() || getSanitizerArgs().requiresPIE(); -+ -+ return true; -+} -+ -+unsigned Linux::GetDefaultStackProtectorLevel(bool KernelOrKext) const { -+ return 2; - } - - bool Linux::isNoExecStackDefault() const { -diff --git a/clang/lib/Driver/ToolChains/Linux.h b/clang/lib/Driver/ToolChains/Linux.h -index f5518eac218..2d4973cf40c 100644 ---- a/clang/lib/Driver/ToolChains/Linux.h -+++ b/clang/lib/Driver/ToolChains/Linux.h -@@ -37,6 +37,7 @@ public: - bool isPIEDefault() const override; - bool isNoExecStackDefault() const override; - bool IsMathErrnoDefault() const override; -+ unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override; - SanitizerMask getSupportedSanitizers() const override; - void addProfileRTLibs(const llvm::opt::ArgList &Args, - llvm::opt::ArgStringList &CmdArgs) const override; -diff --git a/clang/test/Driver/cross-linux.c b/clang/test/Driver/cross-linux.c -index 6c2dab26069..c28c5653e34 100644 ---- a/clang/test/Driver/cross-linux.c -+++ b/clang/test/Driver/cross-linux.c -@@ -42,8 +42,8 @@ - // CHECK-MULTI32-I386: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\\\}}ld" - // CHECK-MULTI32-I386: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" - // CHECK-MULTI32-I386: "-m" "elf_i386" --// CHECK-MULTI32-I386: "crti.o" "[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]{{/|\\\\}}crtbegin.o" --// CHECK-MULTI32-I386: "-L[[gcc_install]]" -+// CHECK-MULTI32-I386: "crti.o" "crtbeginS.o" -+// CHECK-MULTI32-I386: "-L[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]" - // CHECK-MULTI32-I386: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib/../lib32" - // CHECK-MULTI32-I386: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib" - // CHECK-MULTI32-I386: "-L[[sysroot]]/lib" -@@ -60,8 +60,8 @@ - // CHECK-MULTI32-X86-64: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\\\}}ld" - // CHECK-MULTI32-X86-64: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" - // CHECK-MULTI32-X86-64: "-m" "elf_x86_64" --// CHECK-MULTI32-X86-64: "crti.o" "[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]/64{{/|\\\\}}crtbegin.o" --// CHECK-MULTI32-X86-64: "-L[[gcc_install]]/64" -+// CHECK-MULTI32-X86-64: "crti.o" "crtbeginS.o" -+// CHECK-MULTI32-X86-64: "-L[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]/64" - // CHECK-MULTI32-X86-64: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib/../lib64" - // CHECK-MULTI32-X86-64: "-L[[gcc_install]]" - // CHECK-MULTI32-X86-64: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib" -@@ -79,8 +79,8 @@ - // CHECK-MULTI64-I386: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\\\}}ld" - // CHECK-MULTI64-I386: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" - // CHECK-MULTI64-I386: "-m" "elf_i386" --// CHECK-MULTI64-I386: "crti.o" "[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]/32{{/|\\\\}}crtbegin.o" --// CHECK-MULTI64-I386: "-L[[gcc_install]]/32" -+// CHECK-MULTI64-I386: "crti.o" "crtbeginS.o" -+// CHECK-MULTI64-I386: "-L[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]/32" - // CHECK-MULTI64-I386: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib/../lib32" - // CHECK-MULTI64-I386: "-L[[gcc_install]]" - // CHECK-MULTI64-I386: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib" -@@ -98,8 +98,8 @@ - // CHECK-MULTI64-X86-64: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\\\}}ld" - // CHECK-MULTI64-X86-64: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" - // CHECK-MULTI64-X86-64: "-m" "elf_x86_64" --// CHECK-MULTI64-X86-64: "crti.o" "[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]{{/|\\\\}}crtbegin.o" --// CHECK-MULTI64-X86-64: "-L[[gcc_install]]" -+// CHECK-MULTI64-X86-64: "crti.o" "crtbeginS.o" -+// CHECK-MULTI64-X86-64: "-L[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]" - // CHECK-MULTI64-X86-64: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib/../lib64" - // CHECK-MULTI64-X86-64: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib" - // CHECK-MULTI64-X86-64: "-L[[sysroot]]/lib" -diff --git a/clang/test/Driver/env.c b/clang/test/Driver/env.c -index 0371bc91c4a..ea89f525121 100644 ---- a/clang/test/Driver/env.c -+++ b/clang/test/Driver/env.c -@@ -20,7 +20,7 @@ - // - // CHECK-LD-32-NOT: warning: - // CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" --// CHECK-LD-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o" -+// CHECK-LD-32: "crtbeginS.o" - // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0" - // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib" - // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.." -diff --git a/clang/test/Driver/fsanitize.c b/clang/test/Driver/fsanitize.c -index f02f94d8c5a..358917588c7 100644 ---- a/clang/test/Driver/fsanitize.c -+++ b/clang/test/Driver/fsanitize.c -@@ -328,15 +328,15 @@ - // RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-sanitize=vptr -fsanitize=undefined,address %s -### 2>&1 - // OK - --// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE --// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE -+// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE -+// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE - // RUN: %clang -target x86_64-unknown-freebsd -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE - // RUN: %clang -target aarch64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE - // RUN: %clang -target arm-linux-androideabi -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIC-NO-PIE - // RUN: %clang -target arm-linux-androideabi24 -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE - // RUN: %clang -target aarch64-linux-android -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE --// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE --// RUN: %clang -target i386-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE -+// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE -+// RUN: %clang -target i386-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE - - // CHECK-NO-PIE-NOT: "-pie" - // CHECK-NO-PIE: "-mrelocation-model" "static" -@@ -661,12 +661,12 @@ - // RUN: %clang -fno-sanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NOSP - // NOSP-NOT: "-fsanitize=safe-stack" - --// RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP -+// RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP - // RUN: %clang -target x86_64-linux-gnu -fsanitize=address,safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP-ASAN - // RUN: %clang -target x86_64-linux-gnu -fstack-protector -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP - // RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -fstack-protector-all -### %s 2>&1 | FileCheck %s -check-prefix=SP --// RUN: %clang -target arm-linux-androideabi -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP --// RUN: %clang -target aarch64-linux-android -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP -+// RUN: %clang -target arm-linux-androideabi -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP -+// RUN: %clang -target aarch64-linux-android -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP - // RUN: %clang -target i386-contiki-unknown -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP - // NO-SP-NOT: stack-protector - // NO-SP: "-fsanitize=safe-stack" -diff --git a/clang/test/Driver/gcc-toolchain.cpp b/clang/test/Driver/gcc-toolchain.cpp -index 6c872f4255c..f5006d1dd9a 100644 ---- a/clang/test/Driver/gcc-toolchain.cpp -+++ b/clang/test/Driver/gcc-toolchain.cpp -@@ -26,6 +26,6 @@ - // the same precise formatting of the path as the '-internal-system' flags - // above, so we just blanket wildcard match the 'crtbegin.o'. - // CHECK: "{{[^"]*}}ld{{(.exe)?}}" --// CHECK: "{{[^"]*}}/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5{{/|\\\\}}crtbegin.o" -+// CHECK: "crtbeginS.o" - // CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5" - // CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../.." -diff --git a/clang/test/Driver/hexagon-toolchain-elf.c b/clang/test/Driver/hexagon-toolchain-elf.c -index 44bff6f703a..6575d032f5d 100644 ---- a/clang/test/Driver/hexagon-toolchain-elf.c -+++ b/clang/test/Driver/hexagon-toolchain-elf.c -@@ -470,7 +470,7 @@ - // RUN: %s 2>&1 \ - // RUN: | FileCheck -check-prefix=CHECK042 %s - // CHECK042: "-cc1" --// CHECK042: "-mrelocation-model" "static" -+// CHECK042: "-mrelocation-model" "pic" - // CHECK042: "-mllvm" "-hexagon-small-data-threshold=8" - // CHECK042-NEXT: llvm-mc - // CHECK042: "-gpsize=8" -diff --git a/clang/test/Driver/linux-as.c b/clang/test/Driver/linux-as.c -index 77ac05f3094..cb474f32898 100644 ---- a/clang/test/Driver/linux-as.c -+++ b/clang/test/Driver/linux-as.c -@@ -164,7 +164,7 @@ - // CHECK-PPC-NO-MCPU-NOT: as{{.*}} "-mcpu=invalid-cpu" - // - // RUN: %clang -target sparc64-linux -mcpu=invalid-cpu -### \ --// RUN: -no-integrated-as -c %s 2>&1 \ -+// RUN: -no-integrated-as -fno-pic -c %s 2>&1 \ - // RUN: | FileCheck -check-prefix=CHECK-SPARCV9 %s - // CHECK-SPARCV9: as - // CHECK-SPARCV9: -64 -@@ -173,7 +173,7 @@ - // CHECK-SPARCV9: -o - // - // RUN: %clang -target sparc64-linux -mcpu=invalid-cpu -### \ --// RUN: -no-integrated-as -fpic -c %s 2>&1 \ -+// RUN: -no-integrated-as -c %s 2>&1 \ - // RUN: | FileCheck -check-prefix=CHECK-SPARCV9PIC %s - // CHECK-SPARCV9PIC: as - // CHECK-SPARCV9PIC: -64 -diff --git a/clang/test/Driver/linux-ld.c b/clang/test/Driver/linux-ld.c -index 51227550b52..d01d6627131 100644 ---- a/clang/test/Driver/linux-ld.c -+++ b/clang/test/Driver/linux-ld.c -@@ -1,3 +1,5 @@ -+// XFAIL: linux -+ - // General tests that ld invocations on Linux targets sane. Note that we use - // sysroot to make these tests independent of the host system. - // -diff --git a/clang/test/Driver/ppc-abi.c b/clang/test/Driver/ppc-abi.c -index acc4981a2ee..0d465516762 100644 ---- a/clang/test/Driver/ppc-abi.c -+++ b/clang/test/Driver/ppc-abi.c -@@ -32,11 +32,11 @@ - - // CHECK-ELFv1: "-mrelocation-model" "static" - // CHECK-ELFv1: "-target-abi" "elfv1" --// CHECK-ELFv1-LE: "-mrelocation-model" "static" -+// CHECK-ELFv1-LE: "-mrelocation-model" "pic" "-pic-level" "2" - // CHECK-ELFv1-LE: "-target-abi" "elfv1" - // CHECK-ELFv1-QPX: "-mrelocation-model" "static" - // CHECK-ELFv1-QPX: "-target-abi" "elfv1-qpx" --// CHECK-ELFv2: "-mrelocation-model" "static" -+// CHECK-ELFv2: "-mrelocation-model" "pic" "-pic-level" "2" - // CHECK-ELFv2: "-target-abi" "elfv2" - // CHECK-ELFv2-BE: "-mrelocation-model" "static" - // CHECK-ELFv2-BE: "-target-abi" "elfv2" -diff --git a/clang/test/Driver/riscv32-toolchain.c b/clang/test/Driver/riscv32-toolchain.c -index 2ff3a585bda..f923b728c0f 100644 ---- a/clang/test/Driver/riscv32-toolchain.c -+++ b/clang/test/Driver/riscv32-toolchain.c -@@ -76,7 +76,7 @@ - // C-RV32-LINUX-MULTI-ILP32: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" - // C-RV32-LINUX-MULTI-ILP32: "-m" "elf32lriscv" - // C-RV32-LINUX-MULTI-ILP32: "-dynamic-linker" "/lib/ld-linux-riscv32-ilp32.so.1" --// C-RV32-LINUX-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32{{/|\\\\}}crtbegin.o" -+// C-RV32-LINUX-MULTI-ILP32: "crtbeginS.o" - // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32" - // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib32/ilp32" - // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib32/ilp32" -@@ -91,7 +91,7 @@ - // C-RV32-LINUX-MULTI-ILP32D: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" - // C-RV32-LINUX-MULTI-ILP32D: "-m" "elf32lriscv" - // C-RV32-LINUX-MULTI-ILP32D: "-dynamic-linker" "/lib/ld-linux-riscv32-ilp32d.so.1" --// C-RV32-LINUX-MULTI-ILP32D: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32d{{/|\\\\}}crtbegin.o" -+// C-RV32-LINUX-MULTI-ILP32D: "crtbeginS.o" - // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32d" - // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib32/ilp32d" - // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib32/ilp32d" -diff --git a/clang/test/Driver/riscv64-toolchain.c b/clang/test/Driver/riscv64-toolchain.c -index 42cac51de59..42a05e02fcc 100644 ---- a/clang/test/Driver/riscv64-toolchain.c -+++ b/clang/test/Driver/riscv64-toolchain.c -@@ -76,7 +76,7 @@ - // C-RV64-LINUX-MULTI-LP64: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" - // C-RV64-LINUX-MULTI-LP64: "-m" "elf64lriscv" - // C-RV64-LINUX-MULTI-LP64: "-dynamic-linker" "/lib/ld-linux-riscv64-lp64.so.1" --// C-RV64-LINUX-MULTI-LP64: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib64/lp64{{/|\\\\}}crtbegin.o" -+// C-RV64-LINUX-MULTI-LP64: "crtbeginS.o" - // C-RV64-LINUX-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib64/lp64" - // C-RV64-LINUX-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib64/lp64" - // C-RV64-LINUX-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib64/lp64" -@@ -91,7 +91,7 @@ - // C-RV64-LINUX-MULTI-LP64D: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" - // C-RV64-LINUX-MULTI-LP64D: "-m" "elf64lriscv" - // C-RV64-LINUX-MULTI-LP64D: "-dynamic-linker" "/lib/ld-linux-riscv64-lp64d.so.1" --// C-RV64-LINUX-MULTI-LP64D: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib64/lp64d{{/|\\\\}}crtbegin.o" -+// C-RV64-LINUX-MULTI-LP64D: "crtbeginS.o" - // C-RV64-LINUX-MULTI-LP64D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib64/lp64d" - // C-RV64-LINUX-MULTI-LP64D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib64/lp64d" - // C-RV64-LINUX-MULTI-LP64D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib64/lp64d" -diff --git a/clang/test/Driver/stack-protector.c b/clang/test/Driver/stack-protector.c -index a3e40b50eed..dfffe0d6cf8 100644 ---- a/clang/test/Driver/stack-protector.c -+++ b/clang/test/Driver/stack-protector.c -@@ -3,11 +3,11 @@ - // NOSSP-NOT: "-stack-protector-buffer-size" - - // RUN: %clang -target i386-unknown-linux -fstack-protector -### %s 2>&1 | FileCheck %s -check-prefix=SSP --// SSP: "-stack-protector" "1" -+// SSP: "-stack-protector" "2" - // SSP-NOT: "-stack-protector-buffer-size" - - // RUN: %clang -target i386-unknown-linux -fstack-protector --param ssp-buffer-size=16 -### %s 2>&1 | FileCheck %s -check-prefix=SSP-BUF --// SSP-BUF: "-stack-protector" "1" -+// SSP-BUF: "-stack-protector" "2" - // SSP-BUF: "-stack-protector-buffer-size" "16" - - // RUN: %clang -target i386-pc-openbsd -### %s 2>&1 | FileCheck %s -check-prefix=OPENBSD 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 new file mode 100644 index 0000000..afa5325 --- /dev/null +++ b/recipes-devtools/clang/clang/0020-libcxx-Add-compiler-runtime-library-to-link-step-for.patch @@ -0,0 +1,41 @@ +From 70646ae410a97feb236b84bbb46fa8ff8e7da79a Mon Sep 17 00:00:00 2001 +From: Jeremy Puhlman +Date: Thu, 16 Jan 2020 21:16:10 +0000 +Subject: [PATCH 20/24] libcxx: Add compiler runtime library to link step for + libcxx + +This corrects "undefined reference to __divti3" + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Jeremy Puhlman +Signed-off-by: Khem Raj +--- + libcxx/src/CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt +index 2001c09761d..59ba5f7490c 100644 +--- a/libcxx/src/CMakeLists.txt ++++ b/libcxx/src/CMakeLists.txt +@@ -164,7 +164,7 @@ if (LIBCXX_ENABLE_SHARED) + llvm_setup_rpath(cxx_shared) + endif() + target_link_libraries(cxx_shared PUBLIC cxx-headers +- PRIVATE ${LIBCXX_LIBRARIES}) ++ PRIVATE ${LIBCXX_LIBRARIES} "$$($$CC --print-libgcc-file-name)") + set_target_properties(cxx_shared + PROPERTIES + COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}" +@@ -246,7 +246,7 @@ endif() + if (LIBCXX_ENABLE_STATIC) + add_library(cxx_static STATIC ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS}) + target_link_libraries(cxx_static PUBLIC cxx-headers +- PRIVATE ${LIBCXX_LIBRARIES}) ++ PRIVATE ${LIBCXX_LIBRARIES} "$$($$CC --print-libgcc-file-name)") + set(CMAKE_STATIC_LIBRARY_PREFIX "lib") + set_target_properties(cxx_static + PROPERTIES +-- +2.27.0 + 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 new file mode 100644 index 0000000..09bc9d8 --- /dev/null +++ b/recipes-devtools/clang/clang/0021-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch @@ -0,0 +1,143 @@ +From f48b53ec65d4138139339f4d1cdc12c4e1a1c042 Mon Sep 17 00:00:00 2001 +From: Ovidiu Panait +Date: Fri, 31 Jan 2020 10:56:11 +0200 +Subject: [PATCH 21/24] clang,llvm: cmake: Fix configure for packages using + find_package() + +Currently, when a package (i.e. bcc [https://github.com/iovisor/bcc.git]) +that depends on LLVM/Clang tries to run cmake find_package() during +do_configure, it will fail with a similar error: + +| The imported target "llvm-tblgen" references the file +| ".../recipe-sysroot/usr/bin/llvm-tblgen" +| +| but this file does not exist. Possible reasons include: +| * The file was deleted, renamed, or moved to another location. +| * An install or uninstall procedure did not complete successfully. +| * The installation package was faulty and contained +| ".../recipe-sysroot/usr/lib/cmake/LLVMExports.cmake" +| but not all the files it references. + +This is due to the fact that currently the cmake scripts look for target +binaries in sysroot. Work around this by not exporting the target binaries in +Exports-* cmake files. + +Upstream-Status: Innapropriate [oe-specific] + +Signed-off-by: Ovidiu Panait +--- + clang/cmake/modules/AddClang.cmake | 8 -------- + llvm/cmake/modules/AddLLVM.cmake | 18 ------------------ + llvm/cmake/modules/TableGen.cmake | 7 ------- + 3 files changed, 33 deletions(-) + +diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake +index 704278a0e93..6ea99c90772 100644 +--- a/clang/cmake/modules/AddClang.cmake ++++ b/clang/cmake/modules/AddClang.cmake +@@ -161,15 +161,8 @@ macro(add_clang_tool name) + add_dependencies(${name} clang-resource-headers) + + if (CLANG_BUILD_TOOLS) +- set(export_to_clangtargets) +- if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR +- NOT LLVM_DISTRIBUTION_COMPONENTS) +- set(export_to_clangtargets EXPORT ClangTargets) +- set_property(GLOBAL PROPERTY CLANG_HAS_EXPORTS True) +- endif() + + install(TARGETS ${name} +- ${export_to_clangtargets} + RUNTIME DESTINATION bin + COMPONENT ${name}) + +@@ -178,7 +171,6 @@ macro(add_clang_tool name) + DEPENDS ${name} + COMPONENT ${name}) + endif() +- set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS ${name}) + endif() + endmacro() + +diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake +index 333167bfb6b..f00fd98bdb2 100644 +--- a/llvm/cmake/modules/AddLLVM.cmake ++++ b/llvm/cmake/modules/AddLLVM.cmake +@@ -1169,15 +1169,8 @@ macro(add_llvm_tool name) + + if ( ${name} IN_LIST LLVM_TOOLCHAIN_TOOLS OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + if( LLVM_BUILD_TOOLS ) +- set(export_to_llvmexports) +- if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR +- NOT LLVM_DISTRIBUTION_COMPONENTS) +- set(export_to_llvmexports EXPORT LLVMExports) +- set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True) +- endif() + + install(TARGETS ${name} +- ${export_to_llvmexports} + RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR} + COMPONENT ${name}) + +@@ -1188,9 +1181,6 @@ macro(add_llvm_tool name) + endif() + endif() + endif() +- if( LLVM_BUILD_TOOLS ) +- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) +- endif() + set_target_properties(${name} PROPERTIES FOLDER "Tools") + endmacro(add_llvm_tool name) + +@@ -1228,15 +1218,8 @@ macro(add_llvm_utility name) + set_target_properties(${name} PROPERTIES FOLDER "Utils") + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS) +- set(export_to_llvmexports) +- if (${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR +- NOT LLVM_DISTRIBUTION_COMPONENTS) +- set(export_to_llvmexports EXPORT LLVMExports) +- set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True) +- endif() + + install(TARGETS ${name} +- ${export_to_llvmexports} + RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR} + COMPONENT ${name}) + +@@ -1245,7 +1228,6 @@ macro(add_llvm_utility name) + DEPENDS ${name} + COMPONENT ${name}) + endif() +- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) + elseif(LLVM_BUILD_UTILS) + set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name}) + endif() +diff --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake +index 73c1e96d3d9..7b1c33961c1 100644 +--- a/llvm/cmake/modules/TableGen.cmake ++++ b/llvm/cmake/modules/TableGen.cmake +@@ -183,14 +183,8 @@ macro(add_tablegen target project) + endif() + + if ((${project} STREQUAL LLVM OR ${project} STREQUAL MLIR) AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_UTILS) +- set(export_to_llvmexports) +- if(${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR +- NOT LLVM_DISTRIBUTION_COMPONENTS) +- set(export_to_llvmexports EXPORT LLVMExports) +- endif() + + install(TARGETS ${target} +- ${export_to_llvmexports} + COMPONENT ${target} + RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR}) + if(NOT LLVM_ENABLE_IDE) +@@ -199,5 +193,4 @@ macro(add_tablegen target project) + COMPONENT ${target}) + endif() + endif() +- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${target}) + endmacro() +-- +2.27.0 + diff --git a/recipes-devtools/clang/clang/0021-libcxx-Add-compiler-runtime-library-to-link-step-for.patch b/recipes-devtools/clang/clang/0021-libcxx-Add-compiler-runtime-library-to-link-step-for.patch deleted file mode 100644 index ab406d0..0000000 --- a/recipes-devtools/clang/clang/0021-libcxx-Add-compiler-runtime-library-to-link-step-for.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 6330360e13936fca5625e39ceed7441b45c3efd3 Mon Sep 17 00:00:00 2001 -From: Jeremy Puhlman -Date: Thu, 16 Jan 2020 21:16:10 +0000 -Subject: [PATCH] libcxx: Add compiler runtime library to link step for libcxx - -This corrects "undefined reference to __divti3" - -Upstream-Status: Inappropriate [configuration] - -Signed-off-by: Jeremy Puhlman -Signed-off-by: Khem Raj ---- - libcxx/src/CMakeLists.txt | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt -index 120505fe18d..b337fa2e403 100644 ---- a/libcxx/src/CMakeLists.txt -+++ b/libcxx/src/CMakeLists.txt -@@ -160,7 +160,7 @@ if (LIBCXX_ENABLE_SHARED) - if(COMMAND llvm_setup_rpath) - llvm_setup_rpath(cxx_shared) - endif() -- target_link_libraries(cxx_shared PRIVATE ${LIBCXX_LIBRARIES}) -+ target_link_libraries(cxx_shared PRIVATE ${LIBCXX_LIBRARIES} "$$($$CC --print-libgcc-file-name)") - set_target_properties(cxx_shared - PROPERTIES - COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}" -@@ -238,7 +238,7 @@ endif() - # Build the static library. - if (LIBCXX_ENABLE_STATIC) - add_library(cxx_static STATIC ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS}) -- target_link_libraries(cxx_static PRIVATE ${LIBCXX_LIBRARIES}) -+ target_link_libraries(cxx_static PRIVATE ${LIBCXX_LIBRARIES} "$$($$CC --print-libgcc-file-name)") - set(CMAKE_STATIC_LIBRARY_PREFIX "lib") - set_target_properties(cxx_static - PROPERTIES 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 new file mode 100644 index 0000000..85f1d8c --- /dev/null +++ b/recipes-devtools/clang/clang/0022-clang-Fix-resource-dir-location-for-cross-toolchains.patch @@ -0,0 +1,37 @@ +From 5fb5780cdf9fe0f26ac1a076d0eaa82de61b5f8b Mon Sep 17 00:00:00 2001 +From: Jim Broadus +Date: Thu, 26 Mar 2020 16:05:53 -0700 +Subject: [PATCH 22/24] clang: Fix resource dir location for cross toolchains + +When clang looks for the resources directory, it does so based on the binary +location and assumes that the containing directory is a sibling to lib. The +Yocto cross.bbclass defines the default bindir as +${exec_prefix}/bin/${CROSS_TARGET_SYS_DIR}. ex: /usr/bin/aarch64-poky-linux/. +This causes clang to form a path that looks like /usr/bin/lib/clang/... + +As a fix for this, check the parent directory name. If that is "bin", then +use that directory's parent. + +Signed-off-by: Jim Broadus +Signed-off-by: Khem Raj +--- + clang/lib/Driver/Driver.cpp | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/clang/lib/Driver/Driver.cpp ++++ b/clang/lib/Driver/Driver.cpp +@@ -112,7 +112,13 @@ std::string Driver::GetResourcesPath(Str + // With a static-library build of libclang, LibClangPath will contain the + // path of the embedding binary, which for LLVM binaries will be in bin/. + // ../lib gets us to lib/ in both cases. +- P = llvm::sys::path::parent_path(Dir); ++ Dir = std::string(llvm::sys::path::parent_path(Dir)); ++ ++ // OE cross toolchains are installed, by default, in a subdir of bin. ++ if (llvm::sys::path::filename(Dir) == "bin") { ++ Dir = std::string(llvm::sys::path::parent_path(Dir)); ++ } ++ P = Dir; + llvm::sys::path::append(P, Twine("lib") + CLANG_LIBDIR_SUFFIX, "clang", + CLANG_VERSION_STRING); + } diff --git a/recipes-devtools/clang/clang/0022-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch b/recipes-devtools/clang/clang/0022-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch deleted file mode 100644 index 5413693..0000000 --- a/recipes-devtools/clang/clang/0022-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch +++ /dev/null @@ -1,140 +0,0 @@ -From 9f5949b795a92f85c98277fd8d72954fb52df164 Mon Sep 17 00:00:00 2001 -From: Ovidiu Panait -Date: Fri, 31 Jan 2020 10:56:11 +0200 -Subject: [PATCH] clang,llvm: cmake: Fix configure for packages using - find_package() - -Currently, when a package (i.e. bcc [https://github.com/iovisor/bcc.git]) -that depends on LLVM/Clang tries to run cmake find_package() during -do_configure, it will fail with a similar error: - -| The imported target "llvm-tblgen" references the file -| ".../recipe-sysroot/usr/bin/llvm-tblgen" -| -| but this file does not exist. Possible reasons include: -| * The file was deleted, renamed, or moved to another location. -| * An install or uninstall procedure did not complete successfully. -| * The installation package was faulty and contained -| ".../recipe-sysroot/usr/lib/cmake/LLVMExports.cmake" -| but not all the files it references. - -This is due to the fact that currently the cmake scripts look for target -binaries in sysroot. Work around this by not exporting the target binaries in -Exports-* cmake files. - -Upstream-Status: Innapropriate [oe-specific] - -Signed-off-by: Ovidiu Panait ---- - clang/cmake/modules/AddClang.cmake | 8 -------- - llvm/cmake/modules/AddLLVM.cmake | 18 ------------------ - llvm/cmake/modules/TableGen.cmake | 7 ------- - 3 files changed, 33 deletions(-) - -diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake -index 577cc11ab01..5c859d86069 100644 ---- a/clang/cmake/modules/AddClang.cmake -+++ b/clang/cmake/modules/AddClang.cmake -@@ -151,15 +151,8 @@ macro(add_clang_tool name) - add_dependencies(${name} clang-resource-headers) - - if (CLANG_BUILD_TOOLS) -- set(export_to_clangtargets) -- if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR -- NOT LLVM_DISTRIBUTION_COMPONENTS) -- set(export_to_clangtargets EXPORT ClangTargets) -- set_property(GLOBAL PROPERTY CLANG_HAS_EXPORTS True) -- endif() - - install(TARGETS ${name} -- ${export_to_clangtargets} - RUNTIME DESTINATION bin - COMPONENT ${name}) - -@@ -168,7 +161,6 @@ macro(add_clang_tool name) - DEPENDS ${name} - COMPONENT ${name}) - endif() -- set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS ${name}) - endif() - endmacro() - -diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake -index fd69786544a..70580ccb129 100644 ---- a/llvm/cmake/modules/AddLLVM.cmake -+++ b/llvm/cmake/modules/AddLLVM.cmake -@@ -1045,15 +1045,8 @@ macro(add_llvm_tool name) - - if ( ${name} IN_LIST LLVM_TOOLCHAIN_TOOLS OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - if( LLVM_BUILD_TOOLS ) -- set(export_to_llvmexports) -- if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR -- NOT LLVM_DISTRIBUTION_COMPONENTS) -- set(export_to_llvmexports EXPORT LLVMExports) -- set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True) -- endif() - - install(TARGETS ${name} -- ${export_to_llvmexports} - RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR} - COMPONENT ${name}) - -@@ -1064,9 +1057,6 @@ macro(add_llvm_tool name) - endif() - endif() - endif() -- if( LLVM_BUILD_TOOLS ) -- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) -- endif() - set_target_properties(${name} PROPERTIES FOLDER "Tools") - endmacro(add_llvm_tool name) - -@@ -1104,15 +1094,8 @@ macro(add_llvm_utility name) - set_target_properties(${name} PROPERTIES FOLDER "Utils") - if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS) -- set(export_to_llvmexports) -- if (${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR -- NOT LLVM_DISTRIBUTION_COMPONENTS) -- set(export_to_llvmexports EXPORT LLVMExports) -- set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True) -- endif() - - install(TARGETS ${name} -- ${export_to_llvmexports} - RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR} - COMPONENT ${name}) - -@@ -1121,7 +1104,6 @@ macro(add_llvm_utility name) - DEPENDS ${name} - COMPONENT ${name}) - endif() -- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) - elseif(LLVM_BUILD_UTILS) - set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name}) - endif() -diff --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake -index 9d2fcd9a793..acdb898149d 100644 ---- a/llvm/cmake/modules/TableGen.cmake -+++ b/llvm/cmake/modules/TableGen.cmake -@@ -161,14 +161,8 @@ macro(add_tablegen target project) - endif() - - if ((${project} STREQUAL LLVM OR ${project} STREQUAL MLIR) AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_UTILS) -- set(export_to_llvmexports) -- if(${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR -- NOT LLVM_DISTRIBUTION_COMPONENTS) -- set(export_to_llvmexports EXPORT LLVMExports) -- endif() - - install(TARGETS ${target} -- ${export_to_llvmexports} - COMPONENT ${target} - RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR}) - if(NOT LLVM_ENABLE_IDE) -@@ -177,5 +171,4 @@ macro(add_tablegen target project) - COMPONENT ${target}) - endif() - endif() -- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${target}) - endmacro() diff --git a/recipes-devtools/clang/clang/0023-clang-Fix-resource-dir-location-for-cross-toolchains.patch b/recipes-devtools/clang/clang/0023-clang-Fix-resource-dir-location-for-cross-toolchains.patch deleted file mode 100644 index decab68..0000000 --- a/recipes-devtools/clang/clang/0023-clang-Fix-resource-dir-location-for-cross-toolchains.patch +++ /dev/null @@ -1,41 +0,0 @@ -From ed3b5d8bb197f01556b42dfc2281693475fd830e Mon Sep 17 00:00:00 2001 -From: Jim Broadus -Date: Thu, 26 Mar 2020 16:05:53 -0700 -Subject: [PATCH] clang: Fix resource dir location for cross toolchains - -When clang looks for the resources directory, it does so based on the binary -location and assumes that the containing directory is a sibling to lib. The -Yocto cross.bbclass defines the default bindir as -${exec_prefix}/bin/${CROSS_TARGET_SYS_DIR}. ex: /usr/bin/aarch64-poky-linux/. -This causes clang to form a path that looks like /usr/bin/lib/clang/... - -As a fix for this, check the parent directory name. If that is "bin", then -use that directory's parent. - -Signed-off-by: Jim Broadus ---- - clang/lib/Driver/Driver.cpp | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp -index fb8335a3695..819887944b5 100644 ---- a/clang/lib/Driver/Driver.cpp -+++ b/clang/lib/Driver/Driver.cpp -@@ -110,7 +110,13 @@ std::string Driver::GetResourcesPath(StringRef BinaryPath, - // With a static-library build of libclang, LibClangPath will contain the - // path of the embedding binary, which for LLVM binaries will be in bin/. - // ../lib gets us to lib/ in both cases. -- P = llvm::sys::path::parent_path(Dir); -+ Dir = llvm::sys::path::parent_path(Dir); -+ -+ // OE cross toolchains are installed, by default, in a subdir of bin. -+ if (llvm::sys::path::filename(Dir) == "bin") { -+ Dir = llvm::sys::path::parent_path(Dir); -+ } -+ P = Dir; - llvm::sys::path::append(P, Twine("lib") + CLANG_LIBDIR_SUFFIX, "clang", - CLANG_VERSION_STRING); - } --- -2.24.1 - diff --git a/recipes-devtools/clang/clang/0023-fix-path-to-libffi.patch b/recipes-devtools/clang/clang/0023-fix-path-to-libffi.patch new file mode 100644 index 0000000..40c06c1 --- /dev/null +++ b/recipes-devtools/clang/clang/0023-fix-path-to-libffi.patch @@ -0,0 +1,29 @@ +From 358d0e3732ffa2c7204d20a302c065b71806e3b8 Mon Sep 17 00:00:00 2001 +From: Anuj Mittal +Date: Fri, 3 Apr 2020 15:10:37 +0800 +Subject: [PATCH 23/24] fix path to libffi + +FFI_LIBRARY_PATH is the full path to libffi so when building something that links to +libLLVMInterpreter, we were looking for libffi in clang's recipe-sysroot instead of +the recipe's sysroot. + +Signed-off-by: Anuj Mittal +Signed-off-by: Khem Raj +--- + llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt b/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt +index b8adea5b7a9..7d8434c2d0e 100644 +--- a/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt ++++ b/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt +@@ -16,5 +16,5 @@ add_llvm_component_library(LLVMInterpreter + ) + + if( LLVM_ENABLE_FFI ) +- target_link_libraries( LLVMInterpreter PRIVATE ${FFI_LIBRARY_PATH} ) ++ target_link_libraries( LLVMInterpreter PRIVATE ffi ) + endif() +-- +2.27.0 + 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 new file mode 100644 index 0000000..15dcd13 --- /dev/null +++ b/recipes-devtools/clang/clang/0024-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch @@ -0,0 +1,70 @@ +From 17e1e38501cb4008c53727d88ef87d2c89182008 Mon Sep 17 00:00:00 2001 +From: Oleksandr Ocheretnyi +Date: Wed, 15 Apr 2020 00:08:39 +0300 +Subject: [PATCH 24/24] clang: driver: Add dyld-prefix when checking sysroot + for ldso path + + * the dyld-prefix shall be taken into account when the default + path for the dynamic linker has to be checked. + + * this patch shall be used as annex to the next patch: + 'clang: driver: Check sysroot for ldso path' which includes + the usrmerge scenario. + +Signed-off-by: Oleksandr Ocheretnyi +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Linux.cpp | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index 9128d4e0fa0..7f7d752a9a1 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -507,8 +507,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + LibDir = "lib64"; + Loader = + (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1"; +- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && +- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { + LibDir = "lib"; + } + break; +@@ -516,8 +516,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + LibDir = "lib64"; + Loader = + (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2"; +- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && +- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { + LibDir = "lib"; + } + break; +@@ -541,8 +541,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + case llvm::Triple::sparcv9: + LibDir = "lib64"; + Loader = "ld-linux.so.2"; +- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && +- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { + LibDir = "lib"; + } + break; +@@ -559,8 +559,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + + LibDir = X32 ? "libx32" : "lib64"; + Loader = X32 ? "ld-linux-x32.so.2" : "ld-linux-x86-64.so.2"; +- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && +- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { + LibDir = "lib"; + } + break; +-- +2.27.0 + diff --git a/recipes-devtools/clang/clang/0024-fix-path-to-libffi.patch b/recipes-devtools/clang/clang/0024-fix-path-to-libffi.patch deleted file mode 100644 index 2890228..0000000 --- a/recipes-devtools/clang/clang/0024-fix-path-to-libffi.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 52b4e74809eba796663f0f65194ab4f3eafe2cb1 Mon Sep 17 00:00:00 2001 -From: Anuj Mittal -Date: Fri, 3 Apr 2020 15:10:37 +0800 -Subject: [PATCH] fix path to libffi - -FFI_LIBRARY_PATH is the full path to libffi so when building something that links to -libLLVMInterpreter, we were looking for libffi in clang's recipe-sysroot instead of -the recipe's sysroot. - -Signed-off-by: Anuj Mittal ---- - llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt b/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt -index b8adea5..7d8434c 100644 ---- a/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt -+++ b/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt -@@ -16,5 +16,5 @@ add_llvm_component_library(LLVMInterpreter - ) - - if( LLVM_ENABLE_FFI ) -- target_link_libraries( LLVMInterpreter PRIVATE ${FFI_LIBRARY_PATH} ) -+ target_link_libraries( LLVMInterpreter PRIVATE ffi ) - endif() --- -2.7.4 - diff --git a/recipes-devtools/clang/clang/0025-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch b/recipes-devtools/clang/clang/0025-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch deleted file mode 100644 index 43161c7..0000000 --- a/recipes-devtools/clang/clang/0025-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch +++ /dev/null @@ -1,69 +0,0 @@ -From fcafd24f9062eeecc9c87ac2fe9bce9accbe7534 Mon Sep 17 00:00:00 2001 -From: Oleksandr Ocheretnyi -Date: Wed, 15 Apr 2020 00:08:39 +0300 -Subject: [PATCH] clang: driver: Add dyld-prefix when checking sysroot for ldso - path - - * the dyld-prefix shall be taken into account when the default - path for the dynamic linker has to be checked. - - * this patch shall be used as annex to the next patch: - 'clang: driver: Check sysroot for ldso path' which includes - the usrmerge scenario. - -Signed-off-by: Oleksandr Ocheretnyi ---- - clang/lib/Driver/ToolChains/Linux.cpp | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index fb579e7ad60..4ed5938cc59 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -604,8 +604,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { - LibDir = "lib64"; - Loader = - (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1"; -- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && -- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { -+ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && -+ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { - LibDir = "lib"; - } - break; -@@ -613,8 +613,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { - LibDir = "lib64"; - Loader = - (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2"; -- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && -- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { -+ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && -+ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { - LibDir = "lib"; - } - break; -@@ -638,8 +638,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { - case llvm::Triple::sparcv9: - LibDir = "lib64"; - Loader = "ld-linux.so.2"; -- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && -- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { -+ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && -+ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { - LibDir = "lib"; - } - break; -@@ -656,8 +656,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { - - LibDir = X32 ? "libx32" : "lib64"; - Loader = X32 ? "ld-linux-x32.so.2" : "ld-linux-x86-64.so.2"; -- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && -- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { -+ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && -+ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { - LibDir = "lib"; - } - break; --- -2.17.1 - diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index 6b805a6..2fd2a18 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -24,15 +24,15 @@ SRC_URI = "\ file://0014-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch \ file://0015-clang-scan-view-needs-python-2.x.patch \ file://0016-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch \ - file://0017-libclang-Use-CMAKE_DL_LIBS-for-deducing-libdl.patch \ - file://0018-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch \ - file://0019-Check-for-atomic-double-intrinsics.patch \ - file://0020-clang-Enable-SSP-and-PIE-by-default.patch \ - file://0021-libcxx-Add-compiler-runtime-library-to-link-step-for.patch \ - file://0022-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch \ - file://0023-clang-Fix-resource-dir-location-for-cross-toolchains.patch \ - file://0024-fix-path-to-libffi.patch \ - file://0025-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch \ + file://0017-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch \ + file://0018-Check-for-atomic-double-intrinsics.patch \ + file://0019-clang-Enable-SSP-and-PIE-by-default.patch \ + file://0020-libcxx-Add-compiler-runtime-library-to-link-step-for.patch \ + file://0021-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch \ + file://0022-clang-Fix-resource-dir-location-for-cross-toolchains.patch \ + file://0023-fix-path-to-libffi.patch \ + file://0024-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch \ + file://0025-libcxx-Define-__NR_futex-to-be-__NR_futex_time64-on-.patch \ " # Fallback to no-PIE if not set -- cgit v1.2.3-54-g00ecf