From 596e0e7c195378a1b02e6ebcad0fb98054230e28 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 28 Jan 2021 11:35:50 -0800 Subject: clang: Update to 12.0.0 RC2 Signed-off-by: Khem Raj --- recipes-devtools/clang/clang.inc | 6 +- ...Fix-libclc-to-look-for-python3-explicitly.patch | 29 ------ ...d-lxml2-to-linker-cmdline-of-xml-is-found.patch | 9 +- ...ind-libunwind-headers-when-LIBCXXABI_LIBU.patch | 13 +-- ...er-rt-support-a-new-embedded-linux-target.patch | 13 +-- ...-Simplify-cross-compilation.-Don-t-use-na.patch | 11 +- ...0005-compiler-rt-Disable-tsan-on-OE-glibc.patch | 13 +-- ...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 | 15 ++- ...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 | 11 +- ...inside-the-target-sysroot-for-compiler-ru.patch | 12 +-- ...ang-Define-releative-gcc-installation-dir.patch | 43 +++++--- ...dso-for-musl-on-x86-and-x32-architectures.patch | 13 +-- .../0015-clang-scan-view-needs-python-2.x.patch | 9 +- ...pthread-and-ldl-along-with-lunwind-for-st.patch | 13 +-- ..._EXECUTABLE-when-cross-compiling-for-nati.patch | 10 +- .../0018-Check-for-atomic-double-intrinsics.patch | 12 +-- .../0019-clang-Enable-SSP-and-PIE-by-default.patch | 68 ++++++------ ...compiler-runtime-library-to-link-step-for.patch | 18 ++-- ...cmake-Fix-configure-for-packages-using-fi.patch | 27 +++-- ...esource-dir-location-for-cross-toolchains.patch | 8 +- .../clang/clang/0023-fix-path-to-libffi.patch | 11 +- ...r-Add-dyld-prefix-when-checking-sysroot-f.patch | 19 ++-- .../0025-clang-Use-python3-in-python-scripts.patch | 112 ++++++++++++++++++++ ...ne-__NR_futex-to-be-__NR_futex_time64-on-.patch | 35 ------- ...4-set-Yocto-based-GCC-install-search-path.patch | 65 ++++++++++++ .../0026-clang-Use-python3-in-python-scripts.patch | 115 --------------------- ...4-set-Yocto-based-GCC-install-search-path.patch | 67 ------------ .../clang/0027-compiler-rt-Include-stddef.h.patch | 27 +++++ ...-llvm-Do-not-use-find_library-for-ncurses.patch | 44 ++++++++ .../clang/clang/D95527_against_11.x.patch | 85 --------------- recipes-devtools/clang/clang_git.bb | 4 +- recipes-devtools/clang/common.inc | 10 +- 36 files changed, 432 insertions(+), 573 deletions(-) delete mode 100644 recipes-devtools/clang/clang/0001-Fix-libclc-to-look-for-python3-explicitly.patch create mode 100644 recipes-devtools/clang/clang/0025-clang-Use-python3-in-python-scripts.patch delete mode 100644 recipes-devtools/clang/clang/0025-libcxx-Define-__NR_futex-to-be-__NR_futex_time64-on-.patch create mode 100644 recipes-devtools/clang/clang/0026-For-x86_64-set-Yocto-based-GCC-install-search-path.patch delete mode 100644 recipes-devtools/clang/clang/0026-clang-Use-python3-in-python-scripts.patch delete mode 100644 recipes-devtools/clang/clang/0027-For-x86_64-set-Yocto-based-GCC-install-search-path.patch create mode 100644 recipes-devtools/clang/clang/0027-compiler-rt-Include-stddef.h.patch create mode 100644 recipes-devtools/clang/clang/0028-llvm-Do-not-use-find_library-for-ncurses.patch delete mode 100644 recipes-devtools/clang/clang/D95527_against_11.x.patch (limited to 'recipes-devtools') diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc index e5b6793..df35290 100644 --- a/recipes-devtools/clang/clang.inc +++ b/recipes-devtools/clang/clang.inc @@ -4,11 +4,11 @@ LLVM_DIR = "llvm${LLVM_RELEASE}" LLVM_GIT ?= "git://github.com/llvm" LLVM_GIT_PROTOCOL ?= "https" -MAJOR_VER = "11" -MINOR_VER = "1" +MAJOR_VER = "12" +MINOR_VER = "0" PATCH_VER = "0" -SRCREV ?= "1fdec59bffc11ae37eb51a1b9869f0696bfd5312" +SRCREV ?= "4918a3d138b907a571f496661b5367e090e1e8bb" PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}" BRANCH = "release/${MAJOR_VER}.x" diff --git a/recipes-devtools/clang/clang/0001-Fix-libclc-to-look-for-python3-explicitly.patch b/recipes-devtools/clang/clang/0001-Fix-libclc-to-look-for-python3-explicitly.patch deleted file mode 100644 index 5619944..0000000 --- a/recipes-devtools/clang/clang/0001-Fix-libclc-to-look-for-python3-explicitly.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 419d8e0602401c813fc5a87b6c593ac0598a445f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?= -Date: Fri, 12 Feb 2021 23:56:04 -0500 -Subject: [PATCH] Fix libclc to look for python3 explicitly -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Zoltán Böszörményi ---- - libclc/CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt -index 9472f19..a7908c8 100644 ---- a/libclc/CMakeLists.txt -+++ b/libclc/CMakeLists.txt -@@ -170,7 +170,7 @@ if( ENABLE_RUNTIME_SUBNORMAL ) - DESTINATION ${CMAKE_INSTALL_DATADIR}/clc ) - endif() - --find_program( PYTHON python ) -+find_program( PYTHON python3 ) - file( TO_CMAKE_PATH ${CMAKE_SOURCE_DIR}/generic/lib/gen_convert.py script_loc ) - add_custom_command( - OUTPUT convert.cl --- -1.8.3.1 - diff --git a/recipes-devtools/clang/clang/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch b/recipes-devtools/clang/clang/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch index 9f493ce..b8b56e7 100644 --- a/recipes-devtools/clang/clang/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch +++ b/recipes-devtools/clang/clang/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch @@ -1,7 +1,7 @@ -From 435b79f52c7b20a88a6ec0d9a272a9ffd1b6d80d Mon Sep 17 00:00:00 2001 +From 6bf608a67654eaf3312d8ca4813a19526e35c8b1 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 22 May 2017 17:36:16 -0700 -Subject: [PATCH 01/24] lldb: Add -lxml2 to linker cmdline of xml is found +Subject: [PATCH] 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,7 +23,7 @@ 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 add503a5f36..8ddb874c880 100644 +index 7456cb98bfa1..1a732ec5cb89 100644 --- a/lldb/source/Host/CMakeLists.txt +++ b/lldb/source/Host/CMakeLists.txt @@ -138,7 +138,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "NetBSD") @@ -35,6 +35,3 @@ index add503a5f36..8ddb874c880 100644 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 3291369..4a6d415 100644 --- a/recipes-devtools/clang/clang/0002-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch +++ b/recipes-devtools/clang/clang/0002-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch @@ -1,7 +1,7 @@ -From ed6cff51a51de8a69f3b326bedc7389bc8a74a8f Mon Sep 17 00:00:00 2001 +From 9e5acc06fe366c08a313bb033010f2e56c8cb65d Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 27 Aug 2017 10:37:49 -0700 -Subject: [PATCH 02/24] libcxxabi: Find libunwind headers when +Subject: [PATCH] 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 8881a5018dc..2821d1ad346 100644 +index 426c855288fc..06a62c642898 100644 --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt -@@ -442,14 +442,9 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBCXXABI_C_FLAGS}") +@@ -478,14 +478,9 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBCXXABI_C_FLAGS}") # Setup Source Code #=============================================================================== @@ -36,7 +36,7 @@ index 8881a5018dc..2821d1ad346 100644 PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES} ${LIBCXXABI_LIBUNWIND_PATH}/include ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES} -@@ -460,15 +455,21 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) +@@ -496,15 +491,21 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) NO_CMAKE_FIND_ROOT_PATH ) @@ -62,6 +62,3 @@ index 8881a5018dc..2821d1ad346 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 8689276..250d663 100644 --- a/recipes-devtools/clang/clang/0003-compiler-rt-support-a-new-embedded-linux-target.patch +++ b/recipes-devtools/clang/clang/0003-compiler-rt-support-a-new-embedded-linux-target.patch @@ -1,7 +1,7 @@ -From 7a7a7d6f730ec71b95475855ff216e431c6cfe1f Mon Sep 17 00:00:00 2001 +From f8ec4b59e6ad2a91ded1f05a9e711a68d9897608 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 19 Apr 2015 15:16:23 -0700 -Subject: [PATCH 03/24] compiler-rt: support a new embedded linux target +Subject: [PATCH] compiler-rt: support a new embedded linux target Signed-off-by: Khem Raj --- @@ -13,7 +13,7 @@ Signed-off-by: Khem Raj create mode 100644 compiler-rt/make/platform/clang_linux_embedded_test_input.c diff --git a/compiler-rt/lib/builtins/int_util.c b/compiler-rt/lib/builtins/int_util.c -index 226a6e93440..efc977acbb3 100644 +index 226a6e93440d..efc977acbb39 100644 --- a/compiler-rt/lib/builtins/int_util.c +++ b/compiler-rt/lib/builtins/int_util.c @@ -54,7 +54,7 @@ void __compilerrt_abort_impl(const char *file, int line, const char *function) { @@ -27,7 +27,7 @@ index 226a6e93440..efc977acbb3 100644 __attribute__((weak)) diff --git a/compiler-rt/make/platform/clang_linux_embedded.mk b/compiler-rt/make/platform/clang_linux_embedded.mk new file mode 100644 -index 00000000000..d0a890075a1 +index 000000000000..d0a890075a1c --- /dev/null +++ b/compiler-rt/make/platform/clang_linux_embedded.mk @@ -0,0 +1,286 @@ @@ -319,7 +319,4 @@ index 00000000000..d0a890075a1 +FUNCTIONS.hard_pic.x86_64 := $(FUNCTIONS_X86_64) 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 - +index 000000000000..e69de29bb2d1 diff --git a/recipes-devtools/clang/clang/0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch b/recipes-devtools/clang/clang/0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch index db934c9..820f841 100644 --- a/recipes-devtools/clang/clang/0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch +++ b/recipes-devtools/clang/clang/0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch @@ -1,7 +1,7 @@ -From ccf22e891d6a4b74c9845e9dc03b569694af107c Mon Sep 17 00:00:00 2001 +From 9aaf03ac32985430e5c08347ed4e5d2721d5db1b Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 19 May 2016 23:11:45 -0700 -Subject: [PATCH 04/24] compiler-rt: Simplify cross-compilation. Don't use +Subject: [PATCH] compiler-rt: Simplify cross-compilation. Don't use native-compiled llvm-config. Note: AddLLVM.cmake does not expose the LLVM source directory. @@ -20,10 +20,10 @@ 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 fa62814b635..5948ed6fa5e 100644 +index b44ad2c2118e..ed8f4bd80e93 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt -@@ -74,7 +74,16 @@ set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOL +@@ -72,7 +72,16 @@ set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOL "Build for a bare-metal target.") if (COMPILER_RT_STANDALONE_BUILD) @@ -41,6 +41,3 @@ index fa62814b635..5948ed6fa5e 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 c341d91..d2bd6a4 100644 --- a/recipes-devtools/clang/clang/0005-compiler-rt-Disable-tsan-on-OE-glibc.patch +++ b/recipes-devtools/clang/clang/0005-compiler-rt-Disable-tsan-on-OE-glibc.patch @@ -1,7 +1,7 @@ -From 556e35f02d3e92d149c25547ddc7c7cc8f4cdc84 Mon Sep 17 00:00:00 2001 +From 0565a77f6bd5fdc7a440455fb31ee5f6fd42afff Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 18 Jul 2016 08:05:02 +0000 -Subject: [PATCH 05/24] compiler-rt: Disable tsan on OE/glibc +Subject: [PATCH] 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 2edc1dabd90..ec4b5e7ee93 100644 +index f81b8384cbd5..196aa62fd01c 100644 --- a/compiler-rt/cmake/config-ix.cmake +++ b/compiler-rt/cmake/config-ix.cmake -@@ -692,7 +692,7 @@ else() +@@ -723,7 +723,7 @@ else() endif() if (COMPILER_RT_HAS_SANITIZER_COMMON AND TSAN_SUPPORTED_ARCH AND @@ -26,7 +26,7 @@ index 2edc1dabd90..ec4b5e7ee93 100644 else() set(COMPILER_RT_HAS_TSAN FALSE) diff --git a/compiler-rt/test/sanitizer_common/CMakeLists.txt b/compiler-rt/test/sanitizer_common/CMakeLists.txt -index fcd651ebe42..821de915be8 100644 +index 7f1b0f257716..2caf78be2511 100644 --- a/compiler-rt/test/sanitizer_common/CMakeLists.txt +++ b/compiler-rt/test/sanitizer_common/CMakeLists.txt @@ -11,7 +11,7 @@ set(SANITIZER_COMMON_TESTSUITES) @@ -38,6 +38,3 @@ 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 7990ab0..678e80c 100644 --- a/recipes-devtools/clang/clang/0006-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch +++ b/recipes-devtools/clang/clang/0006-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch @@ -1,8 +1,8 @@ -From 262adc1859d04c5142da4dfc512204564183090b Mon Sep 17 00:00:00 2001 +From 5152fffda4231ad41d81a8fe954adec3b2955ed5 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 21 May 2016 00:33:20 +0000 -Subject: [PATCH 06/24] llvm: TargetLibraryInfo: Undefine libc functions if - they are macros +Subject: [PATCH] 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 3864d495510..cc1b69ef625 100644 +index defc95d0062a..41d2099d0c5b 100644 --- a/llvm/include/llvm/Analysis/TargetLibraryInfo.def +++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.def -@@ -800,6 +800,9 @@ TLI_DEFINE_STRING_INTERNAL("fmodl") +@@ -809,6 +809,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 3864d495510..cc1b69ef625 100644 TLI_DEFINE_ENUM_INTERNAL(fopen64) TLI_DEFINE_STRING_INTERNAL("fopen64") /// int fork(); -@@ -847,6 +850,9 @@ TLI_DEFINE_STRING_INTERNAL("fseek") +@@ -856,6 +859,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 3864d495510..cc1b69ef625 100644 /// int fseeko64(FILE *stream, off64_t offset, int whence) TLI_DEFINE_ENUM_INTERNAL(fseeko64) TLI_DEFINE_STRING_INTERNAL("fseeko64") -@@ -857,6 +863,9 @@ TLI_DEFINE_STRING_INTERNAL("fsetpos") +@@ -866,6 +872,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 3864d495510..cc1b69ef625 100644 TLI_DEFINE_ENUM_INTERNAL(fstat64) TLI_DEFINE_STRING_INTERNAL("fstat64") /// int fstatvfs(int fildes, struct statvfs *buf); -@@ -872,6 +881,9 @@ TLI_DEFINE_STRING_INTERNAL("ftell") +@@ -881,6 +890,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 3864d495510..cc1b69ef625 100644 TLI_DEFINE_ENUM_INTERNAL(ftello64) TLI_DEFINE_STRING_INTERNAL("ftello64") /// int ftrylockfile(FILE *file); -@@ -998,6 +1010,9 @@ TLI_DEFINE_STRING_INTERNAL("logl") +@@ -1007,6 +1019,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 3864d495510..cc1b69ef625 100644 TLI_DEFINE_ENUM_INTERNAL(lstat64) TLI_DEFINE_STRING_INTERNAL("lstat64") /// void *malloc(size_t size); -@@ -1241,6 +1256,9 @@ TLI_DEFINE_STRING_INTERNAL("sscanf") +@@ -1250,6 +1265,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 3864d495510..cc1b69ef625 100644 TLI_DEFINE_ENUM_INTERNAL(stat64) TLI_DEFINE_STRING_INTERNAL("stat64") /// int statvfs(const char *path, struct statvfs *buf); -@@ -1376,6 +1394,9 @@ TLI_DEFINE_STRING_INTERNAL("times") +@@ -1385,6 +1403,9 @@ TLI_DEFINE_STRING_INTERNAL("times") TLI_DEFINE_ENUM_INTERNAL(tmpfile) TLI_DEFINE_STRING_INTERNAL("tmpfile") /// FILE *tmpfile64(void) @@ -86,6 +86,3 @@ index 3864d495510..cc1b69ef625 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 39e6166..d8af3ff 100644 --- a/recipes-devtools/clang/clang/0007-llvm-allow-env-override-of-exe-path.patch +++ b/recipes-devtools/clang/clang/0007-llvm-allow-env-override-of-exe-path.patch @@ -1,7 +1,7 @@ -From fdc01a13dddebef34e5cc037484dd368b9985d63 Mon Sep 17 00:00:00 2001 +From d8875d549490e392fe432de259fb13c00b585598 Mon Sep 17 00:00:00 2001 From: Martin Kelly Date: Fri, 19 May 2017 00:22:57 -0700 -Subject: [PATCH 07/24] llvm: allow env override of exe path +Subject: [PATCH] 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 7e74b7c9081..8aa541aae38 100644 +index 1a2f04552d13..019d8f2b5c5e 100644 --- a/llvm/tools/llvm-config/llvm-config.cpp +++ b/llvm/tools/llvm-config/llvm-config.cpp -@@ -248,6 +248,13 @@ Typical components:\n\ +@@ -247,6 +247,13 @@ Typical components:\n\ /// Compute the path to the main executable. std::string GetExecutablePath(const char *Argv0) { @@ -32,6 +32,3 @@ index 7e74b7c9081..8aa541aae38 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 ec5dc42..3aff19a 100644 --- a/recipes-devtools/clang/clang/0008-clang-driver-Check-sysroot-for-ldso-path.patch +++ b/recipes-devtools/clang/clang/0008-clang-driver-Check-sysroot-for-ldso-path.patch @@ -1,7 +1,7 @@ -From 2b6da98883ad4d97df3016d89edff4c5cf9c1324 Mon Sep 17 00:00:00 2001 +From 09a0e9e8e39b31570f00ac70880e60377ce38973 Mon Sep 17 00:00:00 2001 From: Dan McGregor Date: Wed, 26 Apr 2017 20:29:41 -0600 -Subject: [PATCH 08/24] clang: driver: Check sysroot for ldso path +Subject: [PATCH] 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 180350476c3..8606705b721 100644 +index e17a6bd4bdd2..199d9c867c96 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -499,11 +499,19 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -516,11 +516,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 180350476c3..8606705b721 100644 break; case llvm::Triple::riscv32: { StringRef ABIName = tools::riscv::getRISCVABI(Args, Triple); -@@ -525,6 +533,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -542,6 +550,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 180350476c3..8606705b721 100644 break; case llvm::Triple::systemz: LibDir = "lib"; -@@ -539,6 +551,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -556,6 +568,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"; @@ -59,6 +59,3 @@ index 180350476c3..8606705b721 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 2ab33a3..38c48d3 100644 --- a/recipes-devtools/clang/clang/0009-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch +++ b/recipes-devtools/clang/clang/0009-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch @@ -1,7 +1,7 @@ -From 157f27cb0796c8af04177e8472627207dde0950f Mon Sep 17 00:00:00 2001 +From 88f44c237f409d091966cebfbeff6c089d212b20 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 19 May 2016 21:11:06 -0700 -Subject: [PATCH 09/24] clang: Driver/tools.cpp: Add -lssp_nonshared on musl +Subject: [PATCH] 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 c8a7fce07ef..48723c507a1 100644 +index 1d8a3cdce92a..195a302c8771 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -630,6 +630,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, +@@ -628,6 +628,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, if (IsIAMCU) CmdArgs.push_back("-lgloss"); @@ -29,6 +29,3 @@ index c8a7fce07ef..48723c507a1 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 c402b8b..70cebab 100644 --- a/recipes-devtools/clang/clang/0010-clang-musl-ppc-does-not-support-128-bit-long-double.patch +++ b/recipes-devtools/clang/clang/0010-clang-musl-ppc-does-not-support-128-bit-long-double.patch @@ -1,7 +1,7 @@ -From ae0fcdcf66b3b633dd48a69cf5e0e2e905d184e0 Mon Sep 17 00:00:00 2001 +From 4c5c8ed9d14942e9c16cfdfb39257dc265a007c5 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 10 May 2016 02:00:11 -0700 -Subject: [PATCH 10/24] clang: musl/ppc does not support 128-bit long double +Subject: [PATCH] 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 858059bacb8..1d0d2ee65ea 100644 +index 56c8f33ef221..b7e7edf270be 100644 --- a/clang/lib/Basic/Targets/PPC.h +++ b/clang/lib/Basic/Targets/PPC.h -@@ -382,6 +382,10 @@ public: +@@ -386,6 +386,10 @@ public: LongDoubleFormat = &llvm::APFloat::IEEEdouble(); } @@ -23,6 +23,3 @@ index 858059bacb8..1d0d2ee65ea 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 0692cf6..d9de6bf 100644 --- a/recipes-devtools/clang/clang/0011-clang-Prepend-trailing-to-sysroot.patch +++ b/recipes-devtools/clang/clang/0011-clang-Prepend-trailing-to-sysroot.patch @@ -1,7 +1,7 @@ -From d9abc62bb1e99f56df20194122a1aac5a74d0282 Mon Sep 17 00:00:00 2001 +From 20a2d20cb5c2eaa624a3ac514a663104c62786bf Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 16 Mar 2017 09:02:13 -0700 -Subject: [PATCH 11/24] clang: Prepend trailing '/' to sysroot +Subject: [PATCH] clang: Prepend trailing '/' to sysroot This is needed to handle a case where clang isntall and target sysroot are perilously same @@ -24,10 +24,10 @@ 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 8606705b721..d908e40d86e 100644 +index 199d9c867c96..520ae5a7d2cf 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -214,7 +214,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) +@@ -218,7 +218,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(); @@ -36,6 +36,3 @@ index 8606705b721..d908e40d86e 100644 ToolChain::path_list &PPaths = getProgramPaths(); 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 2889bcf..f84dcaf 100644 --- a/recipes-devtools/clang/clang/0012-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch +++ b/recipes-devtools/clang/clang/0012-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch @@ -1,8 +1,7 @@ -From 30b2a171ab5b3649ae34d1ccab4920435ef4167e Mon Sep 17 00:00:00 2001 +From b1b677981b251e231b863dabbed938b7ece54eef Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 16 Mar 2017 19:06:26 -0700 -Subject: [PATCH 12/24] clang: Look inside the target sysroot for compiler - runtime +Subject: [PATCH] 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 @@ -16,7 +15,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 b8c12fc9241..ee53fd4925f 100644 +index b2ddef141a75..784a946b453f 100644 --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/lib/Driver/ToolChain.cpp @@ -14,6 +14,7 @@ @@ -27,7 +26,7 @@ index b8c12fc9241..ee53fd4925f 100644 #include "clang/Config/config.h" #include "clang/Driver/Action.h" #include "clang/Driver/Driver.h" -@@ -397,7 +398,10 @@ StringRef ToolChain::getOSLibName() const { +@@ -404,7 +405,10 @@ StringRef ToolChain::getOSLibName() const { } std::string ToolChain::getCompilerRTPath() const { @@ -39,6 +38,3 @@ index b8c12fc9241..ee53fd4925f 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 c23c882..47f897b 100644 --- a/recipes-devtools/clang/clang/0013-clang-Define-releative-gcc-installation-dir.patch +++ b/recipes-devtools/clang/clang/0013-clang-Define-releative-gcc-installation-dir.patch @@ -1,7 +1,7 @@ -From 7d7eb4b90e924649f317233fd87c3b700f98d4c0 Mon Sep 17 00:00:00 2001 +From 3658b52189bdbd9e742c0166d9bc919d4195b40e Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 21 May 2017 15:38:25 -0700 -Subject: [PATCH 13/24] clang: Define / releative gcc installation dir +Subject: [PATCH] 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 @@ -10,23 +10,36 @@ installation in OE Signed-off-by: Khem Raj --- - clang/lib/Driver/ToolChains/Gnu.cpp | 3 +++ - 1 file changed, 3 insertions(+) + clang/lib/Driver/ToolChains/Gnu.cpp | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 48723c507a1..d02e644c720 100644 +index 195a302c8771..05d1d3003881 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2481,6 +2481,9 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( - {"gcc-cross/" + CandidateTriple.str(), "../..", - TargetTriple.getOS() != llvm::Triple::Solaris}, - -+ // OE cross-compilers path structures -+ {"/" + CandidateTriple.str(), "..", true}, -+ +@@ -2514,12 +2514,6 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + // Whether this library suffix is relevant for the triple. + bool Active; + } Suffixes[] = { +- // This is the normal place. +- {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists}, +- +- // Debian puts cross-compilers in gcc-cross. +- {"gcc-cross/" + CandidateTriple.str(), "../..", GCCCrossDirExists}, +- // 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 - +@@ -2528,6 +2522,12 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + TargetTriple.getVendor() == llvm::Triple::Freescale || + TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}, + ++ // This is the normal place. ++ {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists}, ++ ++ // Debian puts cross-compilers in gcc-cross. ++ {"gcc-cross/" + CandidateTriple.str(), "../..", GCCCrossDirExists}, ++ + // Natively multiarch systems sometimes put the GCC triple-specific + // directory within their multiarch lib directory, resulting in the + // triple appearing twice. diff --git a/recipes-devtools/clang/clang/0014-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch b/recipes-devtools/clang/clang/0014-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch index c363b15..08f4222 100644 --- a/recipes-devtools/clang/clang/0014-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch +++ b/recipes-devtools/clang/clang/0014-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch @@ -1,7 +1,7 @@ -From 9413eabd3659763c550d6beb2d5290228758a53b Mon Sep 17 00:00:00 2001 +From 7b8ad95e1e5953234df3e06d5d01cbdd1a8c051d Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 16 Aug 2017 15:16:15 -0700 -Subject: [PATCH 14/24] clang: Fix ldso for musl on x86 and x32 architectures +Subject: [PATCH] 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 d908e40d86e..add122d5cc8 100644 +index 520ae5a7d2cf..8b72e8f505fe 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -422,6 +422,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -435,6 +435,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { if (Triple.isMusl()) { std::string ArchName; bool IsArm = false; @@ -25,7 +25,7 @@ index d908e40d86e..add122d5cc8 100644 switch (Arch) { case llvm::Triple::arm: -@@ -434,6 +435,13 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -447,6 +448,13 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { ArchName = "armeb"; IsArm = true; break; @@ -39,6 +39,3 @@ index d908e40d86e..add122d5cc8 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 3cac628..97dc0cc 100644 --- a/recipes-devtools/clang/clang/0015-clang-scan-view-needs-python-2.x.patch +++ b/recipes-devtools/clang/clang/0015-clang-scan-view-needs-python-2.x.patch @@ -1,7 +1,7 @@ -From fa612803a3b55d763ad5498babd2f6bc81c6109b Mon Sep 17 00:00:00 2001 +From 330f45191d4e73ac50131d278fa201b56c173880 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 15 May 2018 10:28:43 -0700 -Subject: [PATCH 15/24] clang: scan-view needs python 2.x +Subject: [PATCH] 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 @@ -13,7 +13,7 @@ Signed-off-by: Khem Raj 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/tools/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view -index 6165432e7af..04ad518a60c 100755 +index 6165432e7af8..04ad518a60cd 100755 --- a/clang/tools/scan-view/bin/scan-view +++ b/clang/tools/scan-view/bin/scan-view @@ -1,4 +1,4 @@ @@ -22,6 +22,3 @@ 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 a57ffb3..4c450ca 100644 --- a/recipes-devtools/clang/clang/0016-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch +++ b/recipes-devtools/clang/clang/0016-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch @@ -1,8 +1,8 @@ -From a1d6f91cac4f24890081be8f594eef7ef09919e3 Mon Sep 17 00:00:00 2001 +From e5457a0d477d7a0f7fffef56670450744881554f Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 31 Jul 2019 22:51:39 -0700 -Subject: [PATCH 16/24] clang: Add -lpthread and -ldl along with -lunwind for - static linking +Subject: [PATCH] clang: Add -lpthread and -ldl along with -lunwind for static + linking When doing static liking with --unwindlib=libunwind -static we encounter undefined symbols @@ -20,10 +20,10 @@ 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 1cac5a0822a..29fe4a33a14 100644 +index bcaea71dca94..95b806e29ef2 100644 --- a/clang/lib/Driver/ToolChains/CommonArgs.cpp +++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp -@@ -1275,8 +1275,13 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D, +@@ -1423,8 +1423,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"); @@ -38,6 +38,3 @@ index 1cac5a0822a..29fe4a33a14 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 index 5b55c4e..e7fffbe 100644 --- a/recipes-devtools/clang/clang/0017-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch +++ b/recipes-devtools/clang/clang/0017-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch @@ -1,8 +1,7 @@ -From f6bbe3e375104b495d7b0340d9df2c08f853c290 Mon Sep 17 00:00:00 2001 +From 20ad7e5562772d10d5edaafc1a054a26e91ccdb5 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 +Subject: [PATCH] Pass PYTHON_EXECUTABLE when cross compiling for native build Signed-off-by: Anuj Mittal Signed-off-by: Khem Raj @@ -11,7 +10,7 @@ Signed-off-by: Khem Raj 1 file changed, 1 insertion(+) diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake -index 01cd3712484..f50be9d967d 100644 +index 01cd37124841..f50be9d967df 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) @@ -22,6 +21,3 @@ index 01cd3712484..f50be9d967d 100644 ${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/0018-Check-for-atomic-double-intrinsics.patch b/recipes-devtools/clang/clang/0018-Check-for-atomic-double-intrinsics.patch index e6df535..3e66ebb 100644 --- a/recipes-devtools/clang/clang/0018-Check-for-atomic-double-intrinsics.patch +++ b/recipes-devtools/clang/clang/0018-Check-for-atomic-double-intrinsics.patch @@ -1,7 +1,7 @@ -From 9f3168a04fcf9b44c7850c5977e8f1dfa2c4a2ff Mon Sep 17 00:00:00 2001 +From 1fbeaabbc22e1f665889a0f3fec5bb435207649b 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 +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 @@ -15,21 +15,19 @@ Signed-off-by: Khem Raj 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 +index 04eed1448482..e890cfecd139 100644 --- a/llvm/cmake/modules/CheckAtomic.cmake +++ b/llvm/cmake/modules/CheckAtomic.cmake -@@ -30,9 +30,10 @@ function(check_working_cxx_atomics64 varname) +@@ -30,10 +30,11 @@ 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); + (void)i; - return 0; + return int(y); } " ${varname}) set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) --- -2.27.0 - diff --git a/recipes-devtools/clang/clang/0019-clang-Enable-SSP-and-PIE-by-default.patch b/recipes-devtools/clang/clang/0019-clang-Enable-SSP-and-PIE-by-default.patch index 5e92940..9f73947 100644 --- a/recipes-devtools/clang/clang/0019-clang-Enable-SSP-and-PIE-by-default.patch +++ b/recipes-devtools/clang/clang/0019-clang-Enable-SSP-and-PIE-by-default.patch @@ -1,7 +1,7 @@ -From c93bfc2e7cf6e4abb077e3b18d8adf0985e707f6 Mon Sep 17 00:00:00 2001 +From 460c9c3c8d6384613f3a12af6f27513d1a2222f0 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 +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 @@ -21,8 +21,8 @@ Taken from ArchLinux - https://git.archlinux.org/svntogit/packages.git/plain/tru Signed-off-by: Khem Raj --- - clang/lib/Driver/ToolChains/Linux.cpp | 14 ++++++++++++-- - clang/lib/Driver/ToolChains/Linux.h | 1 + + clang/lib/Driver/ToolChains/Linux.cpp | 10 ++++++++-- + clang/lib/Driver/ToolChains/Linux.h | 4 ++++ clang/test/Driver/cross-linux.c | 16 ++++++++-------- clang/test/Driver/env.c | 2 +- clang/test/Driver/fsanitize.c | 14 +++++++------- @@ -34,13 +34,13 @@ Signed-off-by: Khem Raj 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(-) + 13 files changed, 42 insertions(+), 30 deletions(-) diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index add122d5cc8..9128d4e0fa0 100644 +index 8b72e8f505fe..98f54a935465 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, +@@ -865,8 +865,14 @@ void Linux::AddIAMCUIncludeArgs(const ArgList &DriverArgs, } bool Linux::isPIEDefault() const { @@ -54,27 +54,26 @@ index add122d5cc8..9128d4e0fa0 100644 + 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 +index 6b16b0e64990..582d4bef81df 100644 --- a/clang/lib/Driver/ToolChains/Linux.h +++ b/clang/lib/Driver/ToolChains/Linux.h -@@ -39,6 +39,7 @@ public: +@@ -39,6 +39,10 @@ public: bool isPIEDefault() const override; bool isNoExecStackDefault() const override; bool IsMathErrnoDefault() const override; -+ unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override; ++ virtual LangOptions::StackProtectorMode ++ GetDefaultStackProtectorLevel(bool KernelOrKext) const override { ++ return LangOptions::SSPStrong; ++ } 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 +index 6c2dab260695..c28c5653e348 100644 --- a/clang/test/Driver/cross-linux.c +++ b/clang/test/Driver/cross-linux.c @@ -42,8 +42,8 @@ @@ -122,7 +121,7 @@ index 6c2dab26069..c28c5653e34 100644 // 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 +index 0371bc91c4a3..ea89f5251217 100644 --- a/clang/test/Driver/env.c +++ b/clang/test/Driver/env.c @@ -20,7 +20,7 @@ @@ -135,10 +134,10 @@ index 0371bc91c4a..ea89f525121 100644 // 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 +index 8926d55a0cf4..40f628ccae45 100644 --- a/clang/test/Driver/fsanitize.c +++ b/clang/test/Driver/fsanitize.c -@@ -329,15 +329,15 @@ +@@ -330,15 +330,15 @@ // RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-sanitize=vptr -fsanitize=undefined,address %s -### 2>&1 // OK @@ -158,7 +157,7 @@ index 7340bfb35e4..681bb90b50e 100644 // CHECK-NO-PIE-NOT: "-pie" // CHECK-NO-PIE: "-mrelocation-model" "static" -@@ -662,12 +662,12 @@ +@@ -667,12 +667,12 @@ // RUN: %clang -fno-sanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NOSP // NOSP-NOT: "-fsanitize=safe-stack" @@ -175,7 +174,7 @@ index 7340bfb35e4..681bb90b50e 100644 // 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 +index 6c872f4255c3..f5006d1dd9ab 100644 --- a/clang/test/Driver/gcc-toolchain.cpp +++ b/clang/test/Driver/gcc-toolchain.cpp @@ -26,6 +26,6 @@ @@ -187,7 +186,7 @@ index 6c872f4255c..f5006d1dd9a 100644 // 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 +index cc11f9fcba9e..1fe8b5db587b 100644 --- a/clang/test/Driver/hexagon-toolchain-elf.c +++ b/clang/test/Driver/hexagon-toolchain-elf.c @@ -487,7 +487,7 @@ @@ -200,7 +199,7 @@ index cc11f9fcba9..1fe8b5db587 100644 // 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 +index 0959bd7ba0a1..4056a672b6f9 100644 --- a/clang/test/Driver/linux-as.c +++ b/clang/test/Driver/linux-as.c @@ -164,7 +164,7 @@ @@ -222,7 +221,7 @@ index 77ac05f3094..cb474f32898 100644 // 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 +index 0b788ffcb852..0ee504cd00e3 100644 --- a/clang/test/Driver/linux-ld.c +++ b/clang/test/Driver/linux-ld.c @@ -1,3 +1,5 @@ @@ -232,28 +231,26 @@ index ec539522c25..caf96020a15 100644 // 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 +index a74a19953ca2..0ba4a14ab74f 100644 --- a/clang/test/Driver/ppc-abi.c +++ b/clang/test/Driver/ppc-abi.c -@@ -32,11 +32,11 @@ +@@ -26,9 +26,9 @@ // 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 +index a5852f5f3997..233d9ef003cf 100644 --- a/clang/test/Driver/riscv32-toolchain.c +++ b/clang/test/Driver/riscv32-toolchain.c -@@ -81,7 +81,7 @@ +@@ -84,7 +84,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" @@ -262,7 +259,7 @@ index b83c9aafcbf..15b6f6496b2 100644 // 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 @@ +@@ -99,7 +99,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" @@ -272,10 +269,10 @@ index b83c9aafcbf..15b6f6496b2 100644 // 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 +index e727f20bb601..a801e5eee462 100644 --- a/clang/test/Driver/riscv64-toolchain.c +++ b/clang/test/Driver/riscv64-toolchain.c -@@ -81,7 +81,7 @@ +@@ -84,7 +84,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" @@ -284,7 +281,7 @@ index 5df069eb9fd..2617551ec35 100644 // 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 @@ +@@ -99,7 +99,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" @@ -294,7 +291,7 @@ index 5df069eb9fd..2617551ec35 100644 // 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 +index a3e40b50eed8..dfffe0d6cf85 100644 --- a/clang/test/Driver/stack-protector.c +++ b/clang/test/Driver/stack-protector.c @@ -3,11 +3,11 @@ @@ -311,6 +308,3 @@ index a3e40b50eed..dfffe0d6cf8 100644 // 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-libcxx-Add-compiler-runtime-library-to-link-step-for.patch b/recipes-devtools/clang/clang/0020-libcxx-Add-compiler-runtime-library-to-link-step-for.patch index afa5325..118742a 100644 --- a/recipes-devtools/clang/clang/0020-libcxx-Add-compiler-runtime-library-to-link-step-for.patch +++ b/recipes-devtools/clang/clang/0020-libcxx-Add-compiler-runtime-library-to-link-step-for.patch @@ -1,8 +1,7 @@ -From 70646ae410a97feb236b84bbb46fa8ff8e7da79a Mon Sep 17 00:00:00 2001 +From 81ece1b8e6762676679106f2c17c5fdd2aad3035 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 +Subject: [PATCH] libcxx: Add compiler runtime library to link step for libcxx This corrects "undefined reference to __divti3" @@ -15,19 +14,19 @@ Signed-off-by: Khem Raj 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt -index 2001c09761d..59ba5f7490c 100644 +index 9965104cb5b2..bee4d80bc67a 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() +@@ -177,7 +177,7 @@ split_list(LIBCXX_LINK_FLAGS) + if (LIBCXX_ENABLE_SHARED) + add_library(cxx_shared SHARED ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS}) 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() +@@ -252,7 +252,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 @@ -36,6 +35,3 @@ index 2001c09761d..59ba5f7490c 100644 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 index 09bc9d8..0ed15f0 100644 --- a/recipes-devtools/clang/clang/0021-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch +++ b/recipes-devtools/clang/clang/0021-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch @@ -1,7 +1,7 @@ -From f48b53ec65d4138139339f4d1cdc12c4e1a1c042 Mon Sep 17 00:00:00 2001 +From 62e0614c52cc2b084d993914451b5290759a1187 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 +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]) @@ -32,7 +32,7 @@ Signed-off-by: Ovidiu Panait 3 files changed, 33 deletions(-) diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake -index 704278a0e93..6ea99c90772 100644 +index 704278a0e93b..6ea99c90772c 100644 --- a/clang/cmake/modules/AddClang.cmake +++ b/clang/cmake/modules/AddClang.cmake @@ -161,15 +161,8 @@ macro(add_clang_tool name) @@ -60,10 +60,10 @@ index 704278a0e93..6ea99c90772 100644 endmacro() diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake -index 333167bfb6b..f00fd98bdb2 100644 +index 97c9980c7de3..2cb2ead31ba0 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake -@@ -1169,15 +1169,8 @@ macro(add_llvm_tool name) +@@ -1210,15 +1210,8 @@ macro(add_llvm_tool name) if ( ${name} IN_LIST LLVM_TOOLCHAIN_TOOLS OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) if( LLVM_BUILD_TOOLS ) @@ -79,7 +79,7 @@ index 333167bfb6b..f00fd98bdb2 100644 RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR} COMPONENT ${name}) -@@ -1188,9 +1181,6 @@ macro(add_llvm_tool name) +@@ -1229,9 +1222,6 @@ macro(add_llvm_tool name) endif() endif() endif() @@ -89,9 +89,9 @@ index 333167bfb6b..f00fd98bdb2 100644 set_target_properties(${name} PROPERTIES FOLDER "Tools") endmacro(add_llvm_tool name) -@@ -1228,15 +1218,8 @@ macro(add_llvm_utility name) +@@ -1269,15 +1259,8 @@ macro(add_llvm_utility name) set_target_properties(${name} PROPERTIES FOLDER "Utils") - if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + if ( ${name} IN_LIST LLVM_TOOLCHAIN_UTILITIES OR 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 @@ -105,7 +105,7 @@ index 333167bfb6b..f00fd98bdb2 100644 RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR} COMPONENT ${name}) -@@ -1245,7 +1228,6 @@ macro(add_llvm_utility name) +@@ -1286,7 +1269,6 @@ macro(add_llvm_utility name) DEPENDS ${name} COMPONENT ${name}) endif() @@ -114,10 +114,10 @@ index 333167bfb6b..f00fd98bdb2 100644 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 +index 5f07acc1f692..47fe887e083b 100644 --- a/llvm/cmake/modules/TableGen.cmake +++ b/llvm/cmake/modules/TableGen.cmake -@@ -183,14 +183,8 @@ macro(add_tablegen target project) +@@ -177,14 +177,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) @@ -132,12 +132,9 @@ index 73c1e96d3d9..7b1c33961c1 100644 COMPONENT ${target} RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR}) if(NOT LLVM_ENABLE_IDE) -@@ -199,5 +193,4 @@ macro(add_tablegen target project) +@@ -193,5 +187,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/0022-clang-Fix-resource-dir-location-for-cross-toolchains.patch b/recipes-devtools/clang/clang/0022-clang-Fix-resource-dir-location-for-cross-toolchains.patch index 85f1d8c..bd5a3a1 100644 --- a/recipes-devtools/clang/clang/0022-clang-Fix-resource-dir-location-for-cross-toolchains.patch +++ b/recipes-devtools/clang/clang/0022-clang-Fix-resource-dir-location-for-cross-toolchains.patch @@ -1,7 +1,7 @@ -From 5fb5780cdf9fe0f26ac1a076d0eaa82de61b5f8b Mon Sep 17 00:00:00 2001 +From 1dcf3b4cd50bfd75f7530a463f818ff2705fdb60 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 +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 @@ -18,9 +18,11 @@ Signed-off-by: Khem Raj 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 418e1d3e8ec9..44c9f6e59d3f 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp -@@ -112,7 +112,13 @@ std::string Driver::GetResourcesPath(Str +@@ -119,7 +119,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. diff --git a/recipes-devtools/clang/clang/0023-fix-path-to-libffi.patch b/recipes-devtools/clang/clang/0023-fix-path-to-libffi.patch index 40c06c1..fbf95a6 100644 --- a/recipes-devtools/clang/clang/0023-fix-path-to-libffi.patch +++ b/recipes-devtools/clang/clang/0023-fix-path-to-libffi.patch @@ -1,7 +1,7 @@ -From 358d0e3732ffa2c7204d20a302c065b71806e3b8 Mon Sep 17 00:00:00 2001 +From d45e47dd0d7fe5e8b179557822292fc312a55cfc 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 +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 @@ -14,16 +14,13 @@ Signed-off-by: Khem Raj 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 +index 976219830d5e..9930e01559e9 100644 --- a/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt +++ b/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt -@@ -16,5 +16,5 @@ add_llvm_component_library(LLVMInterpreter +@@ -22,5 +22,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 index 15dcd13..0e64d17 100644 --- a/recipes-devtools/clang/clang/0024-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch +++ b/recipes-devtools/clang/clang/0024-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch @@ -1,8 +1,8 @@ -From 17e1e38501cb4008c53727d88ef87d2c89182008 Mon Sep 17 00:00:00 2001 +From 6c2721a8ee7f15f3035592dfd0d7983369ffd12a 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 +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. @@ -18,10 +18,10 @@ Signed-off-by: Khem Raj 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 +index 98f54a935465..cab25988e81a 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 { +@@ -524,8 +524,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { LibDir = "lib64"; Loader = (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1"; @@ -32,7 +32,7 @@ index 9128d4e0fa0..7f7d752a9a1 100644 LibDir = "lib"; } break; -@@ -516,8 +516,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -533,8 +533,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { LibDir = "lib64"; Loader = (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2"; @@ -43,7 +43,7 @@ index 9128d4e0fa0..7f7d752a9a1 100644 LibDir = "lib"; } break; -@@ -541,8 +541,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -558,8 +558,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { case llvm::Triple::sparcv9: LibDir = "lib64"; Loader = "ld-linux.so.2"; @@ -54,7 +54,7 @@ index 9128d4e0fa0..7f7d752a9a1 100644 LibDir = "lib"; } break; -@@ -559,8 +559,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { +@@ -576,8 +576,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"; @@ -65,6 +65,3 @@ index 9128d4e0fa0..7f7d752a9a1 100644 LibDir = "lib"; } break; --- -2.27.0 - diff --git a/recipes-devtools/clang/clang/0025-clang-Use-python3-in-python-scripts.patch b/recipes-devtools/clang/clang/0025-clang-Use-python3-in-python-scripts.patch new file mode 100644 index 0000000..331737c --- /dev/null +++ b/recipes-devtools/clang/clang/0025-clang-Use-python3-in-python-scripts.patch @@ -0,0 +1,112 @@ +From c308a31dc960830c7c325f85e0840c3f26b01a34 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 14 Oct 2020 22:19:57 -0700 +Subject: [PATCH] clang: Use python3 in python scripts + +Some scripts ask for python, but they work fine with python3 +and in OE python symlink is not exposed to build, only python3 is + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + .../find-all-symbols/tool/run-find-all-symbols.py | 2 +- + clang-tools-extra/clang-tidy/add_new_check.py | 2 +- + clang-tools-extra/clang-tidy/rename_check.py | 2 +- + clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py | 2 +- + clang-tools-extra/clang-tidy/tool/run-clang-tidy.py | 2 +- + clang/tools/clang-format/clang-format-diff.py | 2 +- + clang/tools/clang-format/git-clang-format | 2 +- + clang/tools/scan-view/bin/scan-view | 2 +- + clang/utils/hmaptool/hmaptool | 2 +- + 9 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py +index 8655af137bb2..e95ba59a421c 100755 +--- a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py ++++ b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + #=- run-find-all-symbols.py - Parallel find-all-symbols runner -*- python -*-=# + # +diff --git a/clang-tools-extra/clang-tidy/add_new_check.py b/clang-tools-extra/clang-tidy/add_new_check.py +index 14fcfe8d49ff..ee7e682690b7 100755 +--- a/clang-tools-extra/clang-tidy/add_new_check.py ++++ b/clang-tools-extra/clang-tidy/add_new_check.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + #===- add_new_check.py - clang-tidy check generator ---------*- python -*--===# + # +diff --git a/clang-tools-extra/clang-tidy/rename_check.py b/clang-tools-extra/clang-tidy/rename_check.py +index 2410041fd5d2..976a02100cd6 100755 +--- a/clang-tools-extra/clang-tidy/rename_check.py ++++ b/clang-tools-extra/clang-tidy/rename_check.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + #===- rename_check.py - clang-tidy check renamer ------------*- python -*--===# + # +diff --git a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py +index 17086d15053e..a20b1f1f46b2 100755 +--- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py ++++ b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + #===- clang-tidy-diff.py - ClangTidy Diff Checker -----------*- python -*--===# + # +diff --git a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py +index 313ecd2f9571..a298e38b1a45 100755 +--- a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py ++++ b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + #===- run-clang-tidy.py - Parallel clang-tidy runner --------*- python -*--===# + # +diff --git a/clang/tools/clang-format/clang-format-diff.py b/clang/tools/clang-format/clang-format-diff.py +index 6e653a134289..1c31192a4562 100755 +--- a/clang/tools/clang-format/clang-format-diff.py ++++ b/clang/tools/clang-format/clang-format-diff.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + #===- clang-format-diff.py - ClangFormat Diff Reformatter ----*- python -*--===# + # +diff --git a/clang/tools/clang-format/git-clang-format b/clang/tools/clang-format/git-clang-format +index ccd2f50fa4ad..cfcfb9fcbaef 100755 +--- a/clang/tools/clang-format/git-clang-format ++++ b/clang/tools/clang-format/git-clang-format +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + #===- git-clang-format - ClangFormat Git Integration ---------*- python -*--===# + # +diff --git a/clang/tools/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view +index 04ad518a60cd..07effbca5969 100755 +--- a/clang/tools/scan-view/bin/scan-view ++++ b/clang/tools/scan-view/bin/scan-view +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python2 ++#!/usr/bin/env python3 + + from __future__ import print_function + +diff --git a/clang/utils/hmaptool/hmaptool b/clang/utils/hmaptool/hmaptool +index e647cde6bc46..7ed2fdf674b1 100755 +--- a/clang/utils/hmaptool/hmaptool ++++ b/clang/utils/hmaptool/hmaptool +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + from __future__ import absolute_import, division, print_function + + import json diff --git a/recipes-devtools/clang/clang/0025-libcxx-Define-__NR_futex-to-be-__NR_futex_time64-on-.patch b/recipes-devtools/clang/clang/0025-libcxx-Define-__NR_futex-to-be-__NR_futex_time64-on-.patch deleted file mode 100644 index 9097047..0000000 --- a/recipes-devtools/clang/clang/0025-libcxx-Define-__NR_futex-to-be-__NR_futex_time64-on-.patch +++ /dev/null @@ -1,35 +0,0 @@ -From e7c1d4b74df67070d3666843caeced417387886e Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sun, 2 Aug 2020 10:11:00 -0700 -Subject: [PATCH 25/26] libcxx: Define __NR_futex to be __NR_futex_time64 on - riscv32 - -RISCV glibc has decided to use 64bit time_t from get go unlike -other 32bit architecture therefore aliasing __NR_futex to -__NR_futex_time64 helps avoid the below errors on rv32 - -Upstream-Status: Submittted [https://reviews.llvm.org/D85095] -Signed-off-by: Khem Raj ---- - libcxx/src/atomic.cpp | 10 ++++++++++ - 1 file changed, 10 insertions(+) - ---- a/libcxx/src/atomic.cpp -+++ b/libcxx/src/atomic.cpp -@@ -21,6 +21,16 @@ - #include - #include - -+// libc++ uses SYS_futex, which it expects from system C library. -+// in glibc (/usr/include/bits/syscall.h defines it in terms of of NR_futex) -+// rv32 is using 64bit time_t from get go unlike other 32bit architectures -+// in glibc, therefore it wont have NR_futex defined but just NR_futex_time64 -+// this aliases it to NR_futex so that SYS_futex is then defined for rv32 -+ -+#if !defined(SYS_futex) && defined(SYS_futex_time64) -+#define SYS_futex SYS_futex_time64 -+#endif -+ - #else // <- Add other operating systems here - - // Baseline needs no new headers diff --git a/recipes-devtools/clang/clang/0026-For-x86_64-set-Yocto-based-GCC-install-search-path.patch b/recipes-devtools/clang/clang/0026-For-x86_64-set-Yocto-based-GCC-install-search-path.patch new file mode 100644 index 0000000..03bc290 --- /dev/null +++ b/recipes-devtools/clang/clang/0026-For-x86_64-set-Yocto-based-GCC-install-search-path.patch @@ -0,0 +1,65 @@ +From 386cec2c3000b398cb0afe9bf9e9d57f7cdfd4eb Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Mon, 25 Jan 2021 16:14:35 +0800 +Subject: [PATCH] For x86_64, set Yocto based GCC install search path + +Under Yocto host, while using clang-native to build, it searches +install host gcc failed which causing the include file not found +[snip] +|clang++ -target x86_64-linux -MMD -MF src/base/files/file_path_constants.o.d -I../../../tools/gn/src -I. \ +-isystem/tmp-glibc/work/x86_64-linux/gn-native/87.0.4280.141-r0/recipe-sysroot-native/usr/include -O2 -pipe \ +-std=c++17 -c ../../../tools/gn/src/base/files/file_path_constants.cc -o src/base/files/file_path_constants.o +|../../../tools/gn/src/base/files/file_path_constants.cc:7:10: fatal error: 'iterator' file not found +|#include +| ^~~~~~~~ +[snip] + +Set three Yocto based GCC triple: poky, oe-core and wind river + +Before aplly the patch +[snip] +$ ../recipe-sysroot-native/usr/bin/clang++ -v +clang version 11.0.1 (https://github.com/llvm/llvm-project 43ff75f2c3feef64f9d73328230d34dac8832a91) +Target: x86_64-unknown-linux-gnu +Thread model: posix +InstalledDir:tmp-glibc/work/x86_64-linux/gn-native/87.0.4280.141-r0/chromium-87.0.4280.141/../recipe-sysroot-native/usr/bin +[snip] + +After aplly the patch: +[snip] +$ ../recipe-sysroot-native/usr/bin/clang++ -v +clang version 11.0.1 (https://github.com/llvm/llvm-project 22c3241ff9a6224261df48d0258957fd8acc3d64) +Target: x86_64-unknown-linux-gnu +Thread model: posix +InstalledDir:tmp-glibc/work/x86_64-linux/gn-native/87.0.4280.141-r0/chromium-87.0.4280.141/../recipe-sysroot-native/usr/bin +Found candidate GCC installation: /usr/lib//x86_64-wrs-linux/10.1.0 +Found candidate GCC installation: /usr/lib/gcc/x86_64-wrs-linux/10.1.0 +Selected GCC installation: /usr/lib//x86_64-wrs-linux/10.1.0 +Candidate multilib: .;@m64 +Selected multilib: .;@m64 +[snip] + +BTW, it is hardly to insert a triple by the replacement of TARGET_SYS +(=${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}), since TARGET_VENDOR +is different between clang and clang-native + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Hongxu Jia +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 05d1d3003881..e56812145e6d 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2109,6 +2109,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( + "x86_64-redhat-linux", "x86_64-suse-linux", + "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", + "x86_64-slackware-linux", "x86_64-unknown-linux", ++ "x86_64-oe-linux", "x86_64-poky-linux", "x86_64-wrs-linux", + "x86_64-amazon-linux", "x86_64-linux-android"}; + static const char *const X32LibDirs[] = {"/libx32"}; + static const char *const X86LibDirs[] = {"/lib32", "/lib"}; diff --git a/recipes-devtools/clang/clang/0026-clang-Use-python3-in-python-scripts.patch b/recipes-devtools/clang/clang/0026-clang-Use-python3-in-python-scripts.patch deleted file mode 100644 index 63e3a64..0000000 --- a/recipes-devtools/clang/clang/0026-clang-Use-python3-in-python-scripts.patch +++ /dev/null @@ -1,115 +0,0 @@ -From dec703abdd0503edcc513bdb45eb36402792b47a Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 14 Oct 2020 22:19:57 -0700 -Subject: [PATCH 26/26] clang: Use python3 in python scripts - -Some scripts ask for python, but they work fine with python3 -and in OE python symlink is not exposed to build, only python3 is - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - .../find-all-symbols/tool/run-find-all-symbols.py | 2 +- - clang-tools-extra/clang-tidy/add_new_check.py | 2 +- - clang-tools-extra/clang-tidy/rename_check.py | 2 +- - clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py | 2 +- - clang-tools-extra/clang-tidy/tool/run-clang-tidy.py | 2 +- - clang/tools/clang-format/clang-format-diff.py | 2 +- - clang/tools/clang-format/git-clang-format | 2 +- - clang/tools/scan-view/bin/scan-view | 2 +- - clang/utils/hmaptool/hmaptool | 2 +- - 9 files changed, 9 insertions(+), 9 deletions(-) - -diff --git a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py -index 8655af137bb..e95ba59a421 100755 ---- a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py -+++ b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # - #=- run-find-all-symbols.py - Parallel find-all-symbols runner -*- python -*-=# - # -diff --git a/clang-tools-extra/clang-tidy/add_new_check.py b/clang-tools-extra/clang-tidy/add_new_check.py -index 231f43c0b8f..fb8477b037a 100755 ---- a/clang-tools-extra/clang-tidy/add_new_check.py -+++ b/clang-tools-extra/clang-tidy/add_new_check.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # - #===- add_new_check.py - clang-tidy check generator ---------*- python -*--===# - # -diff --git a/clang-tools-extra/clang-tidy/rename_check.py b/clang-tools-extra/clang-tidy/rename_check.py -index 4d5311c9a29..c869744dd94 100755 ---- a/clang-tools-extra/clang-tidy/rename_check.py -+++ b/clang-tools-extra/clang-tidy/rename_check.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # - #===- rename_check.py - clang-tidy check renamer ------------*- python -*--===# - # -diff --git a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py -index 17086d15053..a20b1f1f46b 100755 ---- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py -+++ b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # - #===- clang-tidy-diff.py - ClangTidy Diff Checker -----------*- python -*--===# - # -diff --git a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py -index 7e23419cd91..3e5986d0f7d 100755 ---- a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py -+++ b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # - #===- run-clang-tidy.py - Parallel clang-tidy runner --------*- python -*--===# - # -diff --git a/clang/tools/clang-format/clang-format-diff.py b/clang/tools/clang-format/clang-format-diff.py -index c5331202fc1..374253cf234 100755 ---- a/clang/tools/clang-format/clang-format-diff.py -+++ b/clang/tools/clang-format/clang-format-diff.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # - #===- clang-format-diff.py - ClangFormat Diff Reformatter ----*- python -*--===# - # -diff --git a/clang/tools/clang-format/git-clang-format b/clang/tools/clang-format/git-clang-format -index f3cd585e7f4..63899c6f54a 100755 ---- a/clang/tools/clang-format/git-clang-format -+++ b/clang/tools/clang-format/git-clang-format -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # - #===- git-clang-format - ClangFormat Git Integration ---------*- python -*--===# - # -diff --git a/clang/tools/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view -index 04ad518a60c..07effbca596 100755 ---- a/clang/tools/scan-view/bin/scan-view -+++ b/clang/tools/scan-view/bin/scan-view -@@ -1,4 +1,4 @@ --#!/usr/bin/env python2 -+#!/usr/bin/env python3 - - from __future__ import print_function - -diff --git a/clang/utils/hmaptool/hmaptool b/clang/utils/hmaptool/hmaptool -index 58baab2f774..00296f11a16 100755 ---- a/clang/utils/hmaptool/hmaptool -+++ b/clang/utils/hmaptool/hmaptool -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - from __future__ import absolute_import, division, print_function - - import json --- -2.28.0 - diff --git a/recipes-devtools/clang/clang/0027-For-x86_64-set-Yocto-based-GCC-install-search-path.patch b/recipes-devtools/clang/clang/0027-For-x86_64-set-Yocto-based-GCC-install-search-path.patch deleted file mode 100644 index 4ebab1e..0000000 --- a/recipes-devtools/clang/clang/0027-For-x86_64-set-Yocto-based-GCC-install-search-path.patch +++ /dev/null @@ -1,67 +0,0 @@ -From d507046e9deec46f005ad164073d3cae4e0b8a47 Mon Sep 17 00:00:00 2001 -From: Hongxu Jia -Date: Mon, 25 Jan 2021 16:14:35 +0800 -Subject: [PATCH] For x86_64, set Yocto based GCC install search path - -Under Yocto host, while using clang-native to build, it searches -install host gcc failed which causing the include file not found -[snip] -|clang++ -target x86_64-linux -MMD -MF src/base/files/file_path_constants.o.d -I../../../tools/gn/src -I. \ --isystem/tmp-glibc/work/x86_64-linux/gn-native/87.0.4280.141-r0/recipe-sysroot-native/usr/include -O2 -pipe \ --std=c++17 -c ../../../tools/gn/src/base/files/file_path_constants.cc -o src/base/files/file_path_constants.o -|../../../tools/gn/src/base/files/file_path_constants.cc:7:10: fatal error: 'iterator' file not found -|#include -| ^~~~~~~~ -[snip] - -Set three Yocto based GCC triple: poky, oe-core and wind river - -Before aplly the patch -[snip] -$ ../recipe-sysroot-native/usr/bin/clang++ -v -clang version 11.0.1 (https://github.com/llvm/llvm-project 43ff75f2c3feef64f9d73328230d34dac8832a91) -Target: x86_64-unknown-linux-gnu -Thread model: posix -InstalledDir:tmp-glibc/work/x86_64-linux/gn-native/87.0.4280.141-r0/chromium-87.0.4280.141/../recipe-sysroot-native/usr/bin -[snip] - -After aplly the patch: -[snip] -$ ../recipe-sysroot-native/usr/bin/clang++ -v -clang version 11.0.1 (https://github.com/llvm/llvm-project 22c3241ff9a6224261df48d0258957fd8acc3d64) -Target: x86_64-unknown-linux-gnu -Thread model: posix -InstalledDir:tmp-glibc/work/x86_64-linux/gn-native/87.0.4280.141-r0/chromium-87.0.4280.141/../recipe-sysroot-native/usr/bin -Found candidate GCC installation: /usr/lib//x86_64-wrs-linux/10.1.0 -Found candidate GCC installation: /usr/lib/gcc/x86_64-wrs-linux/10.1.0 -Selected GCC installation: /usr/lib//x86_64-wrs-linux/10.1.0 -Candidate multilib: .;@m64 -Selected multilib: .;@m64 -[snip] - -BTW, it is hardly to insert a triple by the replacement of TARGET_SYS -(=${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}), since TARGET_VENDOR -is different between clang and clang-native - -Upstream-Status: Inappropriate [oe specific] - -Signed-off-by: Hongxu Jia ---- - clang/lib/Driver/ToolChains/Gnu.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index d02e644c720b..fdcf6b91ebe1 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2083,6 +2083,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( - "x86_64-redhat-linux", "x86_64-suse-linux", - "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", - "x86_64-slackware-linux", "x86_64-unknown-linux", -+ "x86_64-oe-linux", "x86_64-poky-linux", "x86_64-wrs-linux", - "x86_64-amazon-linux", "x86_64-linux-android"}; - static const char *const X32LibDirs[] = {"/libx32"}; - static const char *const X86LibDirs[] = {"/lib32", "/lib"}; --- -2.18.2 - diff --git a/recipes-devtools/clang/clang/0027-compiler-rt-Include-stddef.h.patch b/recipes-devtools/clang/clang/0027-compiler-rt-Include-stddef.h.patch new file mode 100644 index 0000000..cde8e73 --- /dev/null +++ b/recipes-devtools/clang/clang/0027-compiler-rt-Include-stddef.h.patch @@ -0,0 +1,27 @@ +From cea47d9b88c94d1daf7d4c579e6ca4f9c72dc874 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 6 Feb 2021 12:44:30 -0800 +Subject: [PATCH] compiler-rt: Include stddef.h + +size_t is use in the source needs relevant header to include the +definition, fixes build on musl + +compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp:82:61: error: unknown type name 'size_t'; did you mean 'std::size_t'? + +Signed-off-by: Khem Raj +--- + compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp b/compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp +index b87798603fda..34e11727d77b 100644 +--- a/compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp ++++ b/compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp +@@ -26,6 +26,7 @@ + + #include + #include ++#include // for size_t + #include // for dlsym() + + static void *getFuncAddr(const char *name, uintptr_t wrapper_addr) { diff --git a/recipes-devtools/clang/clang/0028-llvm-Do-not-use-find_library-for-ncurses.patch b/recipes-devtools/clang/clang/0028-llvm-Do-not-use-find_library-for-ncurses.patch new file mode 100644 index 0000000..46898ad --- /dev/null +++ b/recipes-devtools/clang/clang/0028-llvm-Do-not-use-find_library-for-ncurses.patch @@ -0,0 +1,44 @@ +From dcb04ae498c16f90b3a4376ad5674156c3ec0dc6 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 7 Feb 2021 23:58:41 -0800 +Subject: [PATCH] llvm: Do not use find_library for ncurses + +This ensures that it lets OE to decide which lib to link +otherwise it adds absolute paths to linker cmdline and confuses it +horribly with native and target libs when build clang for target + +TOPDIR/build/tmp/work/cortexa57-yoe-linux-musl/clang/12.0.0-r0/recipe-sysroot-native/usr/lib/libtinfo.so: error adding symbols: file in wrong format +clang-12: error: linker command failed with exit code 1 (use -v to see invocation) + +Signed-off-by: Khem Raj +--- + compiler-rt/cmake/config-ix.cmake | 2 +- + llvm/cmake/config-ix.cmake | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake +index 196aa62fd01c..49bbbd257d97 100644 +--- a/compiler-rt/cmake/config-ix.cmake ++++ b/compiler-rt/cmake/config-ix.cmake +@@ -140,7 +140,7 @@ else() + set(MAYBE_REQUIRED) + endif() + if(LLVM_ENABLE_TERMINFO) +- find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED}) ++ set(TERMINFO_LIB tinfo curses ncurses ncursesw) + endif() + if(COMPILER_RT_TERMINFO_LIB) + set(LLVM_ENABLE_TERMINFO 1) +diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake +index 818fafbce148..2f8ad6652334 100644 +--- a/llvm/cmake/config-ix.cmake ++++ b/llvm/cmake/config-ix.cmake +@@ -175,7 +175,7 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*") + set(MAYBE_REQUIRED) + endif() + if(LLVM_ENABLE_TERMINFO) +- find_library(TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED}) ++ set(TERMINFO_LIB tinfo curses ncurses ncursesw) + endif() + if(TERMINFO_LIB) + set(LLVM_ENABLE_TERMINFO 1) diff --git a/recipes-devtools/clang/clang/D95527_against_11.x.patch b/recipes-devtools/clang/clang/D95527_against_11.x.patch deleted file mode 100644 index f96f732..0000000 --- a/recipes-devtools/clang/clang/D95527_against_11.x.patch +++ /dev/null @@ -1,85 +0,0 @@ -commit b08a140a8fe8d0b0d16a93042b4952d6e34ab913 -Author: Piotr Sobczak -Date: Wed Jan 27 16:02:49 2021 +0100 - - [AMDGPU] Avoid an illegal operand in si-shrink-instructions - - Before the patch it was possible to trigger a constant bus - violation when folding immediates into a shrunk instruction. - - The patch adds a check to enforce the legality of the new operand. - - Differential Revision: https://reviews.llvm.org/D95527 - -diff --git a/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp b/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp -index 9c6833a7dab6..6c1b16eddc84 100644 ---- a/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp -+++ b/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp -@@ -84,21 +84,23 @@ static bool foldImmediates(MachineInstr &MI, const SIInstrInfo *TII, - MachineOperand &MovSrc = Def->getOperand(1); - bool ConstantFolded = false; - -- if (MovSrc.isImm() && (isInt<32>(MovSrc.getImm()) || -- isUInt<32>(MovSrc.getImm()))) { -- // It's possible to have only one component of a super-reg defined by -- // a single mov, so we need to clear any subregister flag. -- Src0.setSubReg(0); -- Src0.ChangeToImmediate(MovSrc.getImm()); -- ConstantFolded = true; -- } else if (MovSrc.isFI()) { -- Src0.setSubReg(0); -- Src0.ChangeToFrameIndex(MovSrc.getIndex()); -- ConstantFolded = true; -- } else if (MovSrc.isGlobal()) { -- Src0.ChangeToGA(MovSrc.getGlobal(), MovSrc.getOffset(), -- MovSrc.getTargetFlags()); -- ConstantFolded = true; -+ if (TII->isOperandLegal(MI, Src0Idx, &MovSrc)) { -+ if (MovSrc.isImm() && -+ (isInt<32>(MovSrc.getImm()) || isUInt<32>(MovSrc.getImm()))) { -+ // It's possible to have only one component of a super-reg defined -+ // by a single mov, so we need to clear any subregister flag. -+ Src0.setSubReg(0); -+ Src0.ChangeToImmediate(MovSrc.getImm()); -+ ConstantFolded = true; -+ } else if (MovSrc.isFI()) { -+ Src0.setSubReg(0); -+ Src0.ChangeToFrameIndex(MovSrc.getIndex()); -+ ConstantFolded = true; -+ } else if (MovSrc.isGlobal()) { -+ Src0.ChangeToGA(MovSrc.getGlobal(), MovSrc.getOffset(), -+ MovSrc.getTargetFlags()); -+ ConstantFolded = true; -+ } - } - - if (ConstantFolded) { -diff --git a/llvm/test/CodeGen/AMDGPU/shrink-instructions-illegal-fold.mir b/llvm/test/CodeGen/AMDGPU/shrink-instructions-illegal-fold.mir -new file mode 100644 -index 000000000000..7889f437facf ---- /dev/null -+++ b/llvm/test/CodeGen/AMDGPU/shrink-instructions-illegal-fold.mir -@@ -0,0 +1,23 @@ -+# RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=si-shrink-instructions --verify-machineinstrs %s -o - | FileCheck %s -+ -+# Make sure immediate folding into V_CNDMASK respects constant bus restrictions. -+--- -+ -+name: shrink_cndmask_illegal_imm_folding -+tracksRegLiveness: true -+body: | -+ bb.0: -+ liveins: $vgpr0, $vgpr1 -+ ; CHECK-LABEL: name: shrink_cndmask_illegal_imm_folding -+ ; CHECK: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 -+ ; CHECK: [[MOV:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 32768, implicit $exec -+ ; CHECK: V_CMP_EQ_U32_e32 0, [[COPY]], implicit-def $vcc, implicit $exec -+ ; CHECK: V_CNDMASK_B32_e32 [[MOV]], killed [[COPY]], implicit $vcc, implicit $exec -+ -+ %0:vgpr_32 = COPY $vgpr0 -+ %1:vgpr_32 = V_MOV_B32_e32 32768, implicit $exec -+ V_CMP_EQ_U32_e32 0, %0:vgpr_32, implicit-def $vcc, implicit $exec -+ %2:vgpr_32 = V_CNDMASK_B32_e64 0, %1:vgpr_32, 0, killed %0:vgpr_32, $vcc, implicit $exec -+ S_NOP 0 -+ -+... diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index 9391ca4..f759a70 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb @@ -53,7 +53,7 @@ def get_clang_experimental_target_arch(bb, d): PACKAGECONFIG ??= "compiler-rt libcplusplus shared-libs lldb-wchar \ ${@bb.utils.filter('DISTRO_FEATURES', 'thin-lto lto', d)} \ - rtti eh libedit \ + rtti eh libedit terminfo \ " PACKAGECONFIG_class-native = "rtti eh libedit" PACKAGECONFIG_class-nativesdk = "rtti eh libedit shared-libs ${@bb.utils.filter('DISTRO_FEATURES', 'thin-lto lto', d)}" @@ -64,7 +64,7 @@ PACKAGECONFIG[unwindlib] = "-DCLANG_DEFAULT_UNWINDLIB=libunwind,-DCLANG_DEFAULT_ PACKAGECONFIG[thin-lto] = "-DLLVM_ENABLE_LTO=Thin -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils," PACKAGECONFIG[lto] = "-DLLVM_ENABLE_LTO=Full -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils," PACKAGECONFIG[shared-libs] = "-DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON,,," -PACKAGECONFIG[terminfo] = "-DLLVM_ENABLE_TERMINFO=ON,-DLLVM_ENABLE_TERMINFO=OFF,ncurses," +PACKAGECONFIG[terminfo] = "-DLLVM_ENABLE_TERMINFO=ON -DCOMPILER_RT_TERMINFO_LIB=ON,-DLLVM_ENABLE_TERMINFO=OFF -DCOMPILER_RT_TERMINFO_LIB=OFF,ncurses," PACKAGECONFIG[pfm] = "-DLLVM_ENABLE_LIBPFM=ON,-DLLVM_ENABLE_LIBPFM=OFF,libpfm," PACKAGECONFIG[lldb-wchar] = "-DLLDB_EDITLINE_USE_WCHAR=1,-DLLDB_EDITLINE_USE_WCHAR=0," PACKAGECONFIG[bootstrap] = "-DCLANG_ENABLE_BOOTSTRAP=On -DCLANG_BOOTSTRAP_PASSTHROUGH='${PASSTHROUGH}' -DBOOTSTRAP_LLVM_ENABLE_LTO=Thin -DBOOTSTRAP_LLVM_ENABLE_LLD=ON,,," diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index 8ef6be4..9b54432 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -33,13 +33,11 @@ SRC_URI = "\ 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 \ - file://0026-clang-Use-python3-in-python-scripts.patch \ - file://0027-For-x86_64-set-Yocto-based-GCC-install-search-path.patch \ - file://D95527_against_11.x.patch \ - file://0001-Fix-libclc-to-look-for-python3-explicitly.patch \ + file://0025-clang-Use-python3-in-python-scripts.patch \ + file://0026-For-x86_64-set-Yocto-based-GCC-install-search-path.patch \ + file://0027-compiler-rt-Include-stddef.h.patch \ + file://0028-llvm-Do-not-use-find_library-for-ncurses.patch \ " - # Fallback to no-PIE if not set GCCPIE ??= "" -- cgit v1.2.3-54-g00ecf