From 2c82d7395b331dd6c147366faf6e0f117c857900 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 4 Feb 2022 09:08:36 -0800 Subject: clang: Upgrade to upcoming clang14 release branch Signed-off-by: Khem Raj (cherry picked from commit 6b79646f85f3293e0fbedf07592a94860d659053) --- conf/layer.conf | 2 +- recipes-devtools/clang/clang.inc | 8 +- ...ind-libunwind-headers-when-LIBCXXABI_LIBU.patch | 64 ++++ ...d-lxml2-to-linker-cmdline-of-xml-is-found.patch | 37 --- ...er-rt-support-a-new-embedded-linux-target.patch | 308 ++++++++++++++++++++ ...ind-libunwind-headers-when-LIBCXXABI_LIBU.patch | 64 ---- ...-Simplify-cross-compilation.-Don-t-use-na.patch | 43 +++ ...er-rt-support-a-new-embedded-linux-target.patch | 308 -------------------- ...-Simplify-cross-compilation.-Don-t-use-na.patch | 43 --- ...LibraryInfo-Undefine-libc-functions-if-th.patch | 88 ++++++ ...LibraryInfo-Undefine-libc-functions-if-th.patch | 88 ------ .../0005-llvm-allow-env-override-of-exe-path.patch | 34 +++ ...-clang-driver-Check-sysroot-for-ldso-path.patch | 61 ++++ .../0006-llvm-allow-env-override-of-exe-path.patch | 34 --- ...iver-tools.cpp-Add-lssp_nonshared-on-musl.patch | 31 ++ ...-clang-driver-Check-sysroot-for-ldso-path.patch | 61 ---- ...iver-tools.cpp-Add-lssp_nonshared-on-musl.patch | 31 -- ...-ppc-does-not-support-128-bit-long-double.patch | 25 ++ .../0009-clang-Prepend-trailing-to-sysroot.patch | 38 +++ ...-ppc-does-not-support-128-bit-long-double.patch | 25 -- ...inside-the-target-sysroot-for-compiler-ru.patch | 40 +++ .../0010-clang-Prepend-trailing-to-sysroot.patch | 38 --- ...ang-Define-releative-gcc-installation-dir.patch | 46 +++ ...inside-the-target-sysroot-for-compiler-ru.patch | 40 --- ...pthread-and-ldl-along-with-lunwind-for-st.patch | 34 +++ ...ang-Define-releative-gcc-installation-dir.patch | 46 --- ..._EXECUTABLE-when-cross-compiling-for-nati.patch | 23 ++ ...pthread-and-ldl-along-with-lunwind-for-st.patch | 34 --- .../0014-Check-for-atomic-double-intrinsics.patch | 33 +++ ..._EXECUTABLE-when-cross-compiling-for-nati.patch | 23 -- .../0015-Check-for-atomic-double-intrinsics.patch | 33 --- ...compiler-runtime-library-to-link-step-for.patch | 37 +++ .../0016-clang-Enable-SSP-and-PIE-by-default.patch | 312 -------------------- ...cmake-Fix-configure-for-packages-using-fi.patch | 116 ++++++++ ...esource-dir-location-for-cross-toolchains.patch | 39 +++ ...compiler-runtime-library-to-link-step-for.patch | 37 --- ...r-Add-dyld-prefix-when-checking-sysroot-f.patch | 67 +++++ ...cmake-Fix-configure-for-packages-using-fi.patch | 116 -------- ...esource-dir-location-for-cross-toolchains.patch | 39 --- .../0019-clang-Use-python3-in-python-scripts.patch | 90 ++++++ ...4-set-Yocto-based-GCC-install-search-path.patch | 70 +++++ .../clang/clang/0020-fix-path-to-libffi.patch | 26 -- ...r-Add-dyld-prefix-when-checking-sysroot-f.patch | 67 ----- ...-llvm-Do-not-use-find_library-for-ncurses.patch | 44 +++ .../0022-clang-Use-python3-in-python-scripts.patch | 101 ------- ...-anchor-for-adding-OE-distro-vendor-names.patch | 32 ++ ...4-set-Yocto-based-GCC-install-search-path.patch | 70 ----- ...ompiler-rt-Use-mcr-based-barrier-on-armv6.patch | 71 +++++ ...-Do-not-use-backtrace-APIs-on-non-glibc-l.patch | 68 +++++ ...-llvm-Do-not-use-find_library-for-ncurses.patch | 44 --- ...86-triple-for-non-debian-multiarch-linux-.patch | 27 ++ ...-anchor-for-adding-OE-distro-vendor-names.patch | 32 -- ...-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch | 28 ++ ...ompiler-rt-Use-mcr-based-barrier-on-armv6.patch | 71 ----- ...h-defaults-to-dwarf-5-debug-info-on-Linux.patch | 28 -- ...-Link-scudo-standalone-with-libatomic-on-.patch | 29 ++ ...-Do-not-use-backtrace-APIs-on-non-glibc-l.patch | 68 ----- ...0028-libunwind-Added-unw_backtrace-method.patch | 55 ++++ .../0029-Do-not-force-thumb-mode-directive.patch | 46 +++ ...86-triple-for-non-debian-multiarch-linux-.patch | 27 -- ...-Do-not-use-install-relative-libc-headers.patch | 32 ++ ...-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch | 28 -- ...ow-driver-finds-GCC-installation-path-on-.patch | 97 +++++++ ...-Link-scudo-standalone-with-libatomic-on-.patch | 29 -- .../0032-Fix-lib-paths-for-OpenEmbedded-Host.patch | 79 +++++ ...0032-libunwind-Added-unw_backtrace-method.patch | 55 ---- ...library-search-path-for-OpenEmbedded-Host.patch | 84 ++++++ ...-rt-Use-uintptr_t-instead-of-_Unwind_Word.patch | 35 --- ...llable-find-modules-for-terminfo-and-libf.patch | 321 --------------------- ...iler-rt-Do-not-force-thumb-mode-directive.patch | 46 --- .../0034-lldb-Link-with-libatomic-on-x86.patch | 33 +++ ...-Do-not-use-install-relative-libc-headers.patch | 32 -- ...de-openembedded-distributions-from-settin.patch | 35 +++ ...-use-standard-search-paths-in-find_librar.patch | 27 -- ...ow-driver-finds-GCC-installation-path-on-.patch | 97 ------- .../0037-Fix-lib-paths-for-OpenEmbedded-Host.patch | 81 ------ ...library-search-path-for-OpenEmbedded-Host.patch | 86 ------ .../0039-run-clang-tidy-on-unique-files-only.patch | 31 -- recipes-devtools/clang/clang_git.bb | 20 +- recipes-devtools/clang/common.inc | 75 +++-- recipes-devtools/clang/openmp_git.bb | 4 +- 81 files changed, 2105 insertions(+), 2862 deletions(-) create mode 100644 recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch delete mode 100644 recipes-devtools/clang/clang/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch create mode 100644 recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch delete mode 100644 recipes-devtools/clang/clang/0002-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch create mode 100644 recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch delete mode 100644 recipes-devtools/clang/clang/0003-compiler-rt-support-a-new-embedded-linux-target.patch delete mode 100644 recipes-devtools/clang/clang/0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch create mode 100644 recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch delete mode 100644 recipes-devtools/clang/clang/0005-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch create mode 100644 recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-path.patch create mode 100644 recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch delete mode 100644 recipes-devtools/clang/clang/0006-llvm-allow-env-override-of-exe-path.patch create mode 100644 recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch delete mode 100644 recipes-devtools/clang/clang/0007-clang-driver-Check-sysroot-for-ldso-path.patch delete mode 100644 recipes-devtools/clang/clang/0008-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch create mode 100644 recipes-devtools/clang/clang/0008-clang-musl-ppc-does-not-support-128-bit-long-double.patch create mode 100644 recipes-devtools/clang/clang/0009-clang-Prepend-trailing-to-sysroot.patch delete mode 100644 recipes-devtools/clang/clang/0009-clang-musl-ppc-does-not-support-128-bit-long-double.patch create mode 100644 recipes-devtools/clang/clang/0010-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch delete mode 100644 recipes-devtools/clang/clang/0010-clang-Prepend-trailing-to-sysroot.patch create mode 100644 recipes-devtools/clang/clang/0011-clang-Define-releative-gcc-installation-dir.patch delete mode 100644 recipes-devtools/clang/clang/0011-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch create mode 100644 recipes-devtools/clang/clang/0012-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch delete mode 100644 recipes-devtools/clang/clang/0012-clang-Define-releative-gcc-installation-dir.patch create mode 100644 recipes-devtools/clang/clang/0013-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch delete mode 100644 recipes-devtools/clang/clang/0013-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch create mode 100644 recipes-devtools/clang/clang/0014-Check-for-atomic-double-intrinsics.patch delete mode 100644 recipes-devtools/clang/clang/0014-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch delete mode 100644 recipes-devtools/clang/clang/0015-Check-for-atomic-double-intrinsics.patch create mode 100644 recipes-devtools/clang/clang/0015-libcxx-Add-compiler-runtime-library-to-link-step-for.patch delete mode 100644 recipes-devtools/clang/clang/0016-clang-Enable-SSP-and-PIE-by-default.patch create mode 100644 recipes-devtools/clang/clang/0016-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch create mode 100644 recipes-devtools/clang/clang/0017-clang-Fix-resource-dir-location-for-cross-toolchains.patch delete mode 100644 recipes-devtools/clang/clang/0017-libcxx-Add-compiler-runtime-library-to-link-step-for.patch create mode 100644 recipes-devtools/clang/clang/0018-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch delete mode 100644 recipes-devtools/clang/clang/0018-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch delete mode 100644 recipes-devtools/clang/clang/0019-clang-Fix-resource-dir-location-for-cross-toolchains.patch create mode 100644 recipes-devtools/clang/clang/0019-clang-Use-python3-in-python-scripts.patch create mode 100644 recipes-devtools/clang/clang/0020-For-x86_64-set-Yocto-based-GCC-install-search-path.patch delete mode 100644 recipes-devtools/clang/clang/0020-fix-path-to-libffi.patch delete mode 100644 recipes-devtools/clang/clang/0021-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch create mode 100644 recipes-devtools/clang/clang/0021-llvm-Do-not-use-find_library-for-ncurses.patch delete mode 100644 recipes-devtools/clang/clang/0022-clang-Use-python3-in-python-scripts.patch create mode 100644 recipes-devtools/clang/clang/0022-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch delete mode 100644 recipes-devtools/clang/clang/0023-For-x86_64-set-Yocto-based-GCC-install-search-path.patch create mode 100644 recipes-devtools/clang/clang/0023-compiler-rt-Use-mcr-based-barrier-on-armv6.patch create mode 100644 recipes-devtools/clang/clang/0024-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch delete mode 100644 recipes-devtools/clang/clang/0024-llvm-Do-not-use-find_library-for-ncurses.patch create mode 100644 recipes-devtools/clang/clang/0025-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch delete mode 100644 recipes-devtools/clang/clang/0025-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch create mode 100644 recipes-devtools/clang/clang/0026-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch delete mode 100644 recipes-devtools/clang/clang/0026-compiler-rt-Use-mcr-based-barrier-on-armv6.patch delete mode 100644 recipes-devtools/clang/clang/0027-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch create mode 100644 recipes-devtools/clang/clang/0027-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch delete mode 100644 recipes-devtools/clang/clang/0028-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch create mode 100644 recipes-devtools/clang/clang/0028-libunwind-Added-unw_backtrace-method.patch create mode 100644 recipes-devtools/clang/clang/0029-Do-not-force-thumb-mode-directive.patch delete mode 100644 recipes-devtools/clang/clang/0029-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch create mode 100644 recipes-devtools/clang/clang/0030-clang-Do-not-use-install-relative-libc-headers.patch delete mode 100644 recipes-devtools/clang/clang/0030-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch create mode 100644 recipes-devtools/clang/clang/0031-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch delete mode 100644 recipes-devtools/clang/clang/0031-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch create mode 100644 recipes-devtools/clang/clang/0032-Fix-lib-paths-for-OpenEmbedded-Host.patch delete mode 100644 recipes-devtools/clang/clang/0032-libunwind-Added-unw_backtrace-method.patch create mode 100644 recipes-devtools/clang/clang/0033-Correct-library-search-path-for-OpenEmbedded-Host.patch delete mode 100644 recipes-devtools/clang/clang/0033-compiler-rt-Use-uintptr_t-instead-of-_Unwind_Word.patch delete mode 100644 recipes-devtools/clang/clang/0034-CMake-Installable-find-modules-for-terminfo-and-libf.patch delete mode 100644 recipes-devtools/clang/clang/0034-compiler-rt-Do-not-force-thumb-mode-directive.patch create mode 100644 recipes-devtools/clang/clang/0034-lldb-Link-with-libatomic-on-x86.patch delete mode 100644 recipes-devtools/clang/clang/0035-clang-Do-not-use-install-relative-libc-headers.patch create mode 100644 recipes-devtools/clang/clang/0035-clang-exclude-openembedded-distributions-from-settin.patch delete mode 100644 recipes-devtools/clang/clang/0035-llvm-Do-not-use-standard-search-paths-in-find_librar.patch delete mode 100644 recipes-devtools/clang/clang/0036-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch delete mode 100644 recipes-devtools/clang/clang/0037-Fix-lib-paths-for-OpenEmbedded-Host.patch delete mode 100644 recipes-devtools/clang/clang/0038-Correct-library-search-path-for-OpenEmbedded-Host.patch delete mode 100644 recipes-devtools/clang/clang/0039-run-clang-tidy-on-unique-files-only.patch diff --git a/conf/layer.conf b/conf/layer.conf index 2b81b64..718a345 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -32,7 +32,7 @@ INHERIT += "clang" # Do not include clang in SDK unless user wants to CLANGSDK ??= "0" -LLVMVERSION = "13.0.1" +LLVMVERSION = "14.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 8b1cc80..7e90e2d 100644 --- a/recipes-devtools/clang/clang.inc +++ b/recipes-devtools/clang/clang.inc @@ -4,14 +4,14 @@ LLVM_DIR = "llvm${LLVM_RELEASE}" LLVM_GIT ?= "git://github.com/llvm" LLVM_GIT_PROTOCOL ?= "https" -MAJOR_VER = "13" +MAJOR_VER = "14" MINOR_VER = "0" -PATCH_VER = "1" +PATCH_VER = "0" -SRCREV ?= "75e33f71c2dae584b13a7d1186ae0a038ba98838" +SRCREV ?= "b2ca48a8412270e323ac8441772d0d69190a8417" PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}" -BRANCH = "release/13.x" +BRANCH = "release/14.x" LLVMMD5SUM = "8a15a0759ef07f2682d2ba4b893c9afe" CLANGMD5SUM = "ff42885ed2ab98f1ecb8c1fc41205343" diff --git a/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch b/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch new file mode 100644 index 0000000..1bf7480 --- /dev/null +++ b/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch @@ -0,0 +1,64 @@ +From 5b502aa8a8a8e33082912e46e48ba43d7eb0f196 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 + LIBCXXABI_LIBUNWIND_INCLUDES is set + +Currently, when LIBCXXABI_LIBUNWIND_INCLUDES is set via CMake arguments +then it ends up not searching the specified dir and unwind.h is not found +especially for ARM targets + +This patch makes the searching synthesized directories and then set +LIBCXXABI_LIBUNWIND_INCLUDES if its there in environment + +Signed-off-by: Khem Raj +--- + libcxxabi/CMakeLists.txt | 21 +++++++++++---------- + 1 file changed, 11 insertions(+), 10 deletions(-) + +diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt +index 58c21059c602..7709aedf0bde 100644 +--- a/libcxxabi/CMakeLists.txt ++++ b/libcxxabi/CMakeLists.txt +@@ -525,14 +525,9 @@ endif() + # Setup Source Code + #=============================================================================== + +-set(LIBCXXABI_LIBUNWIND_INCLUDES "${LIBCXXABI_LIBUNWIND_INCLUDES}" CACHE PATH +- "Specify path to libunwind includes." FORCE) +-set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH +- "Specify path to libunwind source." FORCE) +- + include_directories(include) + if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) +- find_path(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL libunwind.h ++ find_path(LIBCXXABI_LIBUNWIND_INCLUDES libunwind.h + PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES} + ${LIBCXXABI_LIBUNWIND_PATH}/include + ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES} +@@ -543,15 +538,21 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) + NO_CMAKE_FIND_ROOT_PATH + ) + +- if (LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL-NOTFOUND") +- set(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL "") ++ if (LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES-NOTFOUND") ++ set(LIBCXXABI_LIBUNWIND_INCLUDES "") + endif() + +- if (NOT LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "") +- include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}") ++ if (NOT LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "") ++ include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES}") + endif() + endif() + ++set(LIBCXXABI_LIBUNWIND_INCLUDES "${LIBCXXABI_LIBUNWIND_INCLUDES}" CACHE PATH ++ "Specify path to libunwind includes." FORCE) ++set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH ++ "Specify path to libunwind source." FORCE) ++ ++ + # Add source code. This also contains all of the logic for deciding linker flags + # soname, etc... + add_subdirectory(src) 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 deleted file mode 100644 index 999bc5e..0000000 --- a/recipes-devtools/clang/clang/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 1b71b8fb344a065903ac2fc5b7680e99742be721 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 - -When cross compiling for systems where static libs -for libxml are not available cmake's detection mechanism -resort to linking with libxml.so but doesnt use -lxml2 -liblldbHost.a however requires libxml on linker -cmdline _after_ itself so its use of symbols from libxml2 -can be resolved. Here check for libxml2 being detected and -add it if its found. - -Fixes - -| ../../../../lib/liblldbHost.a(XML.cpp.o): In function `lldb_private::XMLDocument::Clear()': -| /usr/src/debug/lldb/5.0.0+gitAUTOINC+69edad7913_08d6b47db9_cf6c5b3386-r0/git/tools/lldb/source/Host/common/XML.cpp:29: undefined reference to `xmlFreeDoc' -| /usr/src/debug/lldb/5.0.0+gitAUTOINC+69edad7913_08d6b47db9_cf6c5b3386-r0/git/tools/lldb/source/Host/common/XML.cpp:29: undefined reference to `xmlFreeDoc' - -Signed-off-by: Khem Raj ---- - lldb/source/Host/CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lldb/source/Host/CMakeLists.txt b/lldb/source/Host/CMakeLists.txt -index a018fd6c183d..936bdd461350 100644 ---- a/lldb/source/Host/CMakeLists.txt -+++ b/lldb/source/Host/CMakeLists.txt -@@ -137,7 +137,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}) diff --git a/recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch b/recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch new file mode 100644 index 0000000..89ac3d1 --- /dev/null +++ b/recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch @@ -0,0 +1,308 @@ +From a21dbb76c8ef5812b2e05cf93682da02650b6166 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 + +Signed-off-by: Khem Raj +--- + .../make/platform/clang_linux_embedded.mk | 286 ++++++++++++++++++ + .../clang_linux_embedded_test_input.c | 0 + 2 files changed, 286 insertions(+) + create mode 100644 compiler-rt/make/platform/clang_linux_embedded.mk + create mode 100644 compiler-rt/make/platform/clang_linux_embedded_test_input.c + +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 000000000000..d0a890075a1c +--- /dev/null ++++ b/compiler-rt/make/platform/clang_linux_embedded.mk +@@ -0,0 +1,286 @@ ++# These are the functions which clang needs when it is targeting a previous ++# version of the OS. The issue is that the backend may use functions which were ++# not present in the libgcc that shipped on the platform. In such cases, we link ++# with a version of the library which contains private_extern definitions of all ++# the extra functions which might be referenced. ++ ++Description := Static runtime libraries for embedded clang/Linux ++ ++# A function that ensures we don't try to build for architectures that we ++# don't have working toolchains for. ++CheckArches = \ ++ $(shell \ ++ result=""; \ ++ for arch in $(1); do \ ++ if $(CC) -arch $$arch -c \ ++ -integrated-as \ ++ $(ProjSrcRoot)/make/platform/clang_linux_embedded_test_input.c \ ++ -o /dev/null > /dev/null 2> /dev/null; then \ ++ result="$$result$$arch "; \ ++ else \ ++ printf 1>&2 \ ++ "warning: clang_linux_embedded.mk: dropping arch '$$arch' from lib '$(2)'\n"; \ ++ fi; \ ++ done; \ ++ echo $$result) ++ ++XCRun = \ ++ $(shell \ ++ result=`xcrun -find $(1) 2> /dev/null`; \ ++ if [ "$$?" != "0" ]; then result=$(1); fi; \ ++ echo $$result) ++ ++### ++ ++CC := $(call XCRun,clang) ++AR := $(call XCRun,ar) ++RANLIB := $(call XCRun,ranlib) ++STRIP := $(call XCRun,strip) ++LIPO := $(call XCRun,lipo) ++DSYMUTIL := $(call XCRun,dsymutil) ++Configs := ++UniversalArchs := ++ ++# Soft-float version of the runtime. No floating-point instructions will be used ++# and the ABI (out of necessity) passes floating values in normal registers: ++# non-VFP variant of the AAPCS. ++UniversalArchs.soft_static := $(call CheckArches,arm armv7m armv7em armv7,soft_static) ++Configs += $(if $(UniversalArchs.soft_static),soft_static) ++ ++# Hard-float version of the runtime. On ARM VFP instructions and registers are ++# allowed, and floating point values get passed in them. VFP variant of the ++# AAPCS. ++UniversalArchs.hard_static := $(call CheckArches,armv7em armv7 i386 x86_64,hard_static) ++Configs += $(if $(UniversalArchs.hard_static),hard_static) ++ ++UniversalArchs.soft_pic := $(call CheckArches,armv6m armv7m armv7em armv7,soft_pic) ++Configs += $(if $(UniversalArchs.soft_pic),soft_pic) ++ ++UniversalArchs.hard_pic := $(call CheckArches,armv7em armv7 i386 x86_64,hard_pic) ++Configs += $(if $(UniversalArchs.hard_pic),hard_pic) ++ ++CFLAGS := -Wall -Werror -Oz -fomit-frame-pointer -ffreestanding ++ ++PIC_CFLAGS := -fPIC ++STATIC_CFLAGS := -static ++ ++CFLAGS_SOFT := -mfloat-abi=soft ++CFLAGS_HARD := -mfloat-abi=hard ++ ++CFLAGS_I386 := -march=pentium ++ ++CFLAGS.soft_static := $(CFLAGS) $(STATIC_CFLAGS) $(CFLAGS_SOFT) ++CFLAGS.hard_static := $(CFLAGS) $(STATIC_CFLAGS) $(CFLAGS_HARD) ++CFLAGS.soft_pic := $(CFLAGS) $(PIC_CFLAGS) $(CFLAGS_SOFT) ++CFLAGS.hard_pic := $(CFLAGS) $(PIC_CFLAGS) $(CFLAGS_HARD) ++ ++CFLAGS.soft_static.armv7 := $(CFLAGS.soft_static) $(CFLAGS_ARMV7) ++CFLAGS.hard_static.armv7 := $(CFLAGS.hard_static) $(CFLAGS_ARMV7) ++CFLAGS.soft_pic.armv7 := $(CFLAGS.soft_pic) $(CFLAGS_ARMV7) ++CFLAGS.hard_pic.armv7 := $(CFLAGS.hard_pic) $(CFLAGS_ARMV7) ++ ++# x86 platforms ignore -mfloat-abi options and complain about doing so. Despite ++# this they're hard-float. ++CFLAGS.hard_static.i386 := $(CFLAGS) $(STATIC_CFLAGS) $(CFLAGS_I386) ++CFLAGS.hard_pic.i386 := $(CFLAGS) $(PIC_CFLAGS) $(CFLAGS_I386) ++CFLAGS.hard_static.x86_64 := $(CFLAGS) $(STATIC_CFLAGS) ++CFLAGS.hard_pic.x86_64 := $(CFLAGS) $(PIC_CFLAGS) ++ ++# Functions not wanted: ++# + eprintf is obsolete anyway ++# + *vfp: designed for Thumb1 CPUs with VFPv2 ++ ++COMMON_FUNCTIONS := \ ++ absvdi2 \ ++ absvsi2 \ ++ addvdi3 \ ++ addvsi3 \ ++ ashldi3 \ ++ ashrdi3 \ ++ bswapdi2 \ ++ bswapsi2 \ ++ clzdi2 \ ++ clzsi2 \ ++ cmpdi2 \ ++ ctzdi2 \ ++ ctzsi2 \ ++ divdc3 \ ++ divdi3 \ ++ divsc3 \ ++ divmodsi4 \ ++ udivmodsi4 \ ++ do_global_dtors \ ++ ffsdi2 \ ++ fixdfdi \ ++ fixsfdi \ ++ fixunsdfdi \ ++ fixunsdfsi \ ++ fixunssfdi \ ++ fixunssfsi \ ++ floatdidf \ ++ floatdisf \ ++ floatundidf \ ++ floatundisf \ ++ gcc_bcmp \ ++ lshrdi3 \ ++ moddi3 \ ++ muldc3 \ ++ muldi3 \ ++ mulsc3 \ ++ mulvdi3 \ ++ mulvsi3 \ ++ negdi2 \ ++ negvdi2 \ ++ negvsi2 \ ++ paritydi2 \ ++ paritysi2 \ ++ popcountdi2 \ ++ popcountsi2 \ ++ powidf2 \ ++ powisf2 \ ++ subvdi3 \ ++ subvsi3 \ ++ ucmpdi2 \ ++ udiv_w_sdiv \ ++ udivdi3 \ ++ udivmoddi4 \ ++ umoddi3 \ ++ adddf3 \ ++ addsf3 \ ++ cmpdf2 \ ++ cmpsf2 \ ++ div0 \ ++ divdf3 \ ++ divsf3 \ ++ divsi3 \ ++ extendsfdf2 \ ++ ffssi2 \ ++ fixdfsi \ ++ fixsfsi \ ++ floatsidf \ ++ floatsisf \ ++ floatunsidf \ ++ floatunsisf \ ++ comparedf2 \ ++ comparesf2 \ ++ modsi3 \ ++ muldf3 \ ++ mulsf3 \ ++ negdf2 \ ++ negsf2 \ ++ subdf3 \ ++ subsf3 \ ++ truncdfsf2 \ ++ udivsi3 \ ++ umodsi3 \ ++ unorddf2 \ ++ unordsf2 ++ ++ARM_FUNCTIONS := \ ++ aeabi_cdcmpeq \ ++ aeabi_cdrcmple \ ++ aeabi_cfcmpeq \ ++ aeabi_cfrcmple \ ++ aeabi_dcmpeq \ ++ aeabi_dcmpge \ ++ aeabi_dcmpgt \ ++ aeabi_dcmple \ ++ aeabi_dcmplt \ ++ aeabi_drsub \ ++ aeabi_fcmpeq \ ++ aeabi_fcmpge \ ++ aeabi_fcmpgt \ ++ aeabi_fcmple \ ++ aeabi_fcmplt \ ++ aeabi_frsub \ ++ aeabi_idivmod \ ++ aeabi_uidivmod \ ++ ++# ARM Assembly implementation which requires Thumb2 (i.e. won't work on v6M). ++THUMB2_FUNCTIONS := \ ++ switch16 \ ++ switch32 \ ++ switch8 \ ++ switchu8 \ ++ sync_fetch_and_add_4 \ ++ sync_fetch_and_sub_4 \ ++ sync_fetch_and_and_4 \ ++ sync_fetch_and_or_4 \ ++ sync_fetch_and_xor_4 \ ++ sync_fetch_and_nand_4 \ ++ sync_fetch_and_max_4 \ ++ sync_fetch_and_umax_4 \ ++ sync_fetch_and_min_4 \ ++ sync_fetch_and_umin_4 \ ++ sync_fetch_and_add_8 \ ++ sync_fetch_and_sub_8 \ ++ sync_fetch_and_and_8 \ ++ sync_fetch_and_or_8 \ ++ sync_fetch_and_xor_8 \ ++ sync_fetch_and_nand_8 \ ++ sync_fetch_and_max_8 \ ++ sync_fetch_and_umax_8 \ ++ sync_fetch_and_min_8 \ ++ sync_fetch_and_umin_8 ++ ++I386_FUNCTIONS := \ ++ i686.get_pc_thunk.eax \ ++ i686.get_pc_thunk.ebp \ ++ i686.get_pc_thunk.ebx \ ++ i686.get_pc_thunk.ecx \ ++ i686.get_pc_thunk.edi \ ++ i686.get_pc_thunk.edx \ ++ i686.get_pc_thunk.esi ++ ++# FIXME: Currently, compiler-rt is missing implementations for a number of the ++# functions. Filter them out for now. ++MISSING_FUNCTIONS := \ ++ cmpdf2 cmpsf2 div0 \ ++ ffssi2 \ ++ udiv_w_sdiv unorddf2 unordsf2 bswapdi2 \ ++ bswapsi2 \ ++ gcc_bcmp \ ++ do_global_dtors \ ++ i686.get_pc_thunk.eax i686.get_pc_thunk.ebp i686.get_pc_thunk.ebx \ ++ i686.get_pc_thunk.ecx i686.get_pc_thunk.edi i686.get_pc_thunk.edx \ ++ i686.get_pc_thunk.esi \ ++ aeabi_cdcmpeq aeabi_cdrcmple aeabi_cfcmpeq aeabi_cfrcmple aeabi_dcmpeq \ ++ aeabi_dcmpge aeabi_dcmpgt aeabi_dcmple aeabi_dcmplt aeabi_drsub \ ++ aeabi_fcmpeq \ aeabi_fcmpge aeabi_fcmpgt aeabi_fcmple aeabi_fcmplt \ ++ aeabi_frsub aeabi_idivmod aeabi_uidivmod ++ ++FUNCTIONS_ARMV6M := $(COMMON_FUNCTIONS) $(ARM_FUNCTIONS) ++FUNCTIONS_ARM_ALL := $(COMMON_FUNCTIONS) $(ARM_FUNCTIONS) $(THUMB2_FUNCTIONS) ++FUNCTIONS_I386 := $(COMMON_FUNCTIONS) $(I386_FUNCTIONS) ++FUNCTIONS_X86_64 := $(COMMON_FUNCTIONS) ++ ++FUNCTIONS_ARMV6M := \ ++ $(filter-out $(MISSING_FUNCTIONS),$(FUNCTIONS_ARMV6M)) ++FUNCTIONS_ARM_ALL := \ ++ $(filter-out $(MISSING_FUNCTIONS),$(FUNCTIONS_ARM_ALL)) ++FUNCTIONS_I386 := \ ++ $(filter-out $(MISSING_FUNCTIONS),$(FUNCTIONS_I386)) ++FUNCTIONS_X86_64 := \ ++ $(filter-out $(MISSING_FUNCTIONS),$(FUNCTIONS_X86_64)) ++ ++FUNCTIONS.soft_static.armv6m := $(FUNCTIONS_ARMV6M) ++FUNCTIONS.soft_pic.armv6m := $(FUNCTIONS_ARMV6M) ++ ++FUNCTIONS.soft_static.armv7m := $(FUNCTIONS_ARM_ALL) ++FUNCTIONS.soft_pic.armv7m := $(FUNCTIONS_ARM_ALL) ++ ++FUNCTIONS.soft_static.armv7em := $(FUNCTIONS_ARM_ALL) ++FUNCTIONS.hard_static.armv7em := $(FUNCTIONS_ARM_ALL) ++FUNCTIONS.soft_pic.armv7em := $(FUNCTIONS_ARM_ALL) ++FUNCTIONS.hard_pic.armv7em := $(FUNCTIONS_ARM_ALL) ++ ++FUNCTIONS.soft_static.armv7 := $(FUNCTIONS_ARM_ALL) ++FUNCTIONS.hard_static.armv7 := $(FUNCTIONS_ARM_ALL) ++FUNCTIONS.soft_pic.armv7 := $(FUNCTIONS_ARM_ALL) ++FUNCTIONS.hard_pic.armv7 := $(FUNCTIONS_ARM_ALL) ++ ++FUNCTIONS.hard_static.i386 := $(FUNCTIONS_I386) ++FUNCTIONS.hard_pic.i386 := $(FUNCTIONS_I386) ++ ++FUNCTIONS.hard_static.x86_64 := $(FUNCTIONS_X86_64) ++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 000000000000..e69de29bb2d1 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 deleted file mode 100644 index 0829f18..0000000 --- a/recipes-devtools/clang/clang/0002-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 581275e8e40784c6a3f30e69bb5cc7513fe3b475 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 - LIBCXXABI_LIBUNWIND_INCLUDES is set - -Currently, when LIBCXXABI_LIBUNWIND_INCLUDES is set via CMake arguments -then it ends up not searching the specified dir and unwind.h is not found -especially for ARM targets - -This patch makes the searching synthesized directories and then set -LIBCXXABI_LIBUNWIND_INCLUDES if its there in environment - -Signed-off-by: Khem Raj ---- - libcxxabi/CMakeLists.txt | 21 +++++++++++---------- - 1 file changed, 11 insertions(+), 10 deletions(-) - -diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt -index f3060a5d1f93..bca2178f3203 100644 ---- a/libcxxabi/CMakeLists.txt -+++ b/libcxxabi/CMakeLists.txt -@@ -511,14 +511,9 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBCXXABI_C_FLAGS}") - # Setup Source Code - #=============================================================================== - --set(LIBCXXABI_LIBUNWIND_INCLUDES "${LIBCXXABI_LIBUNWIND_INCLUDES}" CACHE PATH -- "Specify path to libunwind includes." FORCE) --set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH -- "Specify path to libunwind source." FORCE) -- - include_directories(include) - if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) -- find_path(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL libunwind.h -+ find_path(LIBCXXABI_LIBUNWIND_INCLUDES libunwind.h - PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES} - ${LIBCXXABI_LIBUNWIND_PATH}/include - ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES} -@@ -529,15 +524,21 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) - NO_CMAKE_FIND_ROOT_PATH - ) - -- if (LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL-NOTFOUND") -- set(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL "") -+ if (LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES-NOTFOUND") -+ set(LIBCXXABI_LIBUNWIND_INCLUDES "") - endif() - -- if (NOT LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "") -- include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}") -+ if (NOT LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "") -+ include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES}") - endif() - endif() - -+set(LIBCXXABI_LIBUNWIND_INCLUDES "${LIBCXXABI_LIBUNWIND_INCLUDES}" CACHE PATH -+ "Specify path to libunwind includes." FORCE) -+set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH -+ "Specify path to libunwind source." FORCE) -+ -+ - # Add source code. This also contains all of the logic for deciding linker flags - # soname, etc... - add_subdirectory(src) diff --git a/recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch b/recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch new file mode 100644 index 0000000..b573ad8 --- /dev/null +++ b/recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch @@ -0,0 +1,43 @@ +From 1a7e174cddac6738c5bc28fd642be8cc687138bf 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 + native-compiled llvm-config. + + Note: AddLLVM.cmake does not expose the LLVM source directory. + So if you want to run the test suite, you need to either: + + 1) set LLVM_MAIN_SRC_DIR explicitly (to find lit.py) + 2) change AddLLVM.cmake to point to an installed 'lit'. + 3) add_subdirectory(compiler-rt/test) from clang instead of compiler-rt. + +https://us.codeaurora.org/patches/quic/llvm/50683/compiler-rt-cross-compilation.patch + +Signed-off-by: Greg Fitzgerald +Signed-off-by: Khem Raj +--- + compiler-rt/CMakeLists.txt | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt +index 3a41aa43e406..3bbfbca1f645 100644 +--- a/compiler-rt/CMakeLists.txt ++++ b/compiler-rt/CMakeLists.txt +@@ -67,7 +67,16 @@ set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOL + "Build for a bare-metal target.") + + if (COMPILER_RT_STANDALONE_BUILD) +- load_llvm_config() ++ find_package(LLVM REQUIRED) ++ list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}") ++ ++ # Variables that AddLLVM.cmake depends on (included by AddCompilerRT) ++ set(LLVM_TOOLS_BINARY_DIR "${LLVM_INSTALL_PREFIX}/bin") ++ set(LLVM_LIBRARY_DIR "${LLVM_INSTALL_PREFIX}/lib") ++ ++ set(LLVM_LIBRARY_OUTPUT_INTDIR ++ ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) ++ + if (TARGET intrinsics_gen) + # Loading the llvm config causes this target to be imported so place it + # under the appropriate folder in an IDE. 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 deleted file mode 100644 index 10124a6..0000000 --- a/recipes-devtools/clang/clang/0003-compiler-rt-support-a-new-embedded-linux-target.patch +++ /dev/null @@ -1,308 +0,0 @@ -From f02e1904c58e43119ba49c9c8f5831b47e5d6ebe 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 - -Signed-off-by: Khem Raj ---- - .../make/platform/clang_linux_embedded.mk | 286 ++++++++++++++++++ - .../clang_linux_embedded_test_input.c | 0 - 2 files changed, 286 insertions(+) - create mode 100644 compiler-rt/make/platform/clang_linux_embedded.mk - create mode 100644 compiler-rt/make/platform/clang_linux_embedded_test_input.c - -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 000000000000..d0a890075a1c ---- /dev/null -+++ b/compiler-rt/make/platform/clang_linux_embedded.mk -@@ -0,0 +1,286 @@ -+# These are the functions which clang needs when it is targeting a previous -+# version of the OS. The issue is that the backend may use functions which were -+# not present in the libgcc that shipped on the platform. In such cases, we link -+# with a version of the library which contains private_extern definitions of all -+# the extra functions which might be referenced. -+ -+Description := Static runtime libraries for embedded clang/Linux -+ -+# A function that ensures we don't try to build for architectures that we -+# don't have working toolchains for. -+CheckArches = \ -+ $(shell \ -+ result=""; \ -+ for arch in $(1); do \ -+ if $(CC) -arch $$arch -c \ -+ -integrated-as \ -+ $(ProjSrcRoot)/make/platform/clang_linux_embedded_test_input.c \ -+ -o /dev/null > /dev/null 2> /dev/null; then \ -+ result="$$result$$arch "; \ -+ else \ -+ printf 1>&2 \ -+ "warning: clang_linux_embedded.mk: dropping arch '$$arch' from lib '$(2)'\n"; \ -+ fi; \ -+ done; \ -+ echo $$result) -+ -+XCRun = \ -+ $(shell \ -+ result=`xcrun -find $(1) 2> /dev/null`; \ -+ if [ "$$?" != "0" ]; then result=$(1); fi; \ -+ echo $$result) -+ -+### -+ -+CC := $(call XCRun,clang) -+AR := $(call XCRun,ar) -+RANLIB := $(call XCRun,ranlib) -+STRIP := $(call XCRun,strip) -+LIPO := $(call XCRun,lipo) -+DSYMUTIL := $(call XCRun,dsymutil) -+Configs := -+UniversalArchs := -+ -+# Soft-float version of the runtime. No floating-point instructions will be used -+# and the ABI (out of necessity) passes floating values in normal registers: -+# non-VFP variant of the AAPCS. -+UniversalArchs.soft_static := $(call CheckArches,arm armv7m armv7em armv7,soft_static) -+Configs += $(if $(UniversalArchs.soft_static),soft_static) -+ -+# Hard-float version of the runtime. On ARM VFP instructions and registers are -+# allowed, and floating point values get passed in them. VFP variant of the -+# AAPCS. -+UniversalArchs.hard_static := $(call CheckArches,armv7em armv7 i386 x86_64,hard_static) -+Configs += $(if $(UniversalArchs.hard_static),hard_static) -+ -+UniversalArchs.soft_pic := $(call CheckArches,armv6m armv7m armv7em armv7,soft_pic) -+Configs += $(if $(UniversalArchs.soft_pic),soft_pic) -+ -+UniversalArchs.hard_pic := $(call CheckArches,armv7em armv7 i386 x86_64,hard_pic) -+Configs += $(if $(UniversalArchs.hard_pic),hard_pic) -+ -+CFLAGS := -Wall -Werror -Oz -fomit-frame-pointer -ffreestanding -+ -+PIC_CFLAGS := -fPIC -+STATIC_CFLAGS := -static -+ -+CFLAGS_SOFT := -mfloat-abi=soft -+CFLAGS_HARD := -mfloat-abi=hard -+ -+CFLAGS_I386 := -march=pentium -+ -+CFLAGS.soft_static := $(CFLAGS) $(STATIC_CFLAGS) $(CFLAGS_SOFT) -+CFLAGS.hard_static := $(CFLAGS) $(STATIC_CFLAGS) $(CFLAGS_HARD) -+CFLAGS.soft_pic := $(CFLAGS) $(PIC_CFLAGS) $(CFLAGS_SOFT) -+CFLAGS.hard_pic := $(CFLAGS) $(PIC_CFLAGS) $(CFLAGS_HARD) -+ -+CFLAGS.soft_static.armv7 := $(CFLAGS.soft_static) $(CFLAGS_ARMV7) -+CFLAGS.hard_static.armv7 := $(CFLAGS.hard_static) $(CFLAGS_ARMV7) -+CFLAGS.soft_pic.armv7 := $(CFLAGS.soft_pic) $(CFLAGS_ARMV7) -+CFLAGS.hard_pic.armv7 := $(CFLAGS.hard_pic) $(CFLAGS_ARMV7) -+ -+# x86 platforms ignore -mfloat-abi options and complain about doing so. Despite -+# this they're hard-float. -+CFLAGS.hard_static.i386 := $(CFLAGS) $(STATIC_CFLAGS) $(CFLAGS_I386) -+CFLAGS.hard_pic.i386 := $(CFLAGS) $(PIC_CFLAGS) $(CFLAGS_I386) -+CFLAGS.hard_static.x86_64 := $(CFLAGS) $(STATIC_CFLAGS) -+CFLAGS.hard_pic.x86_64 := $(CFLAGS) $(PIC_CFLAGS) -+ -+# Functions not wanted: -+# + eprintf is obsolete anyway -+# + *vfp: designed for Thumb1 CPUs with VFPv2 -+ -+COMMON_FUNCTIONS := \ -+ absvdi2 \ -+ absvsi2 \ -+ addvdi3 \ -+ addvsi3 \ -+ ashldi3 \ -+ ashrdi3 \ -+ bswapdi2 \ -+ bswapsi2 \ -+ clzdi2 \ -+ clzsi2 \ -+ cmpdi2 \ -+ ctzdi2 \ -+ ctzsi2 \ -+ divdc3 \ -+ divdi3 \ -+ divsc3 \ -+ divmodsi4 \ -+ udivmodsi4 \ -+ do_global_dtors \ -+ ffsdi2 \ -+ fixdfdi \ -+ fixsfdi \ -+ fixunsdfdi \ -+ fixunsdfsi \ -+ fixunssfdi \ -+ fixunssfsi \ -+ floatdidf \ -+ floatdisf \ -+ floatundidf \ -+ floatundisf \ -+ gcc_bcmp \ -+ lshrdi3 \ -+ moddi3 \ -+ muldc3 \ -+ muldi3 \ -+ mulsc3 \ -+ mulvdi3 \ -+ mulvsi3 \ -+ negdi2 \ -+ negvdi2 \ -+ negvsi2 \ -+ paritydi2 \ -+ paritysi2 \ -+ popcountdi2 \ -+ popcountsi2 \ -+ powidf2 \ -+ powisf2 \ -+ subvdi3 \ -+ subvsi3 \ -+ ucmpdi2 \ -+ udiv_w_sdiv \ -+ udivdi3 \ -+ udivmoddi4 \ -+ umoddi3 \ -+ adddf3 \ -+ addsf3 \ -+ cmpdf2 \ -+ cmpsf2 \ -+ div0 \ -+ divdf3 \ -+ divsf3 \ -+ divsi3 \ -+ extendsfdf2 \ -+ ffssi2 \ -+ fixdfsi \ -+ fixsfsi \ -+ floatsidf \ -+ floatsisf \ -+ floatunsidf \ -+ floatunsisf \ -+ comparedf2 \ -+ comparesf2 \ -+ modsi3 \ -+ muldf3 \ -+ mulsf3 \ -+ negdf2 \ -+ negsf2 \ -+ subdf3 \ -+ subsf3 \ -+ truncdfsf2 \ -+ udivsi3 \ -+ umodsi3 \ -+ unorddf2 \ -+ unordsf2 -+ -+ARM_FUNCTIONS := \ -+ aeabi_cdcmpeq \ -+ aeabi_cdrcmple \ -+ aeabi_cfcmpeq \ -+ aeabi_cfrcmple \ -+ aeabi_dcmpeq \ -+ aeabi_dcmpge \ -+ aeabi_dcmpgt \ -+ aeabi_dcmple \ -+ aeabi_dcmplt \ -+ aeabi_drsub \ -+ aeabi_fcmpeq \ -+ aeabi_fcmpge \ -+ aeabi_fcmpgt \ -+ aeabi_fcmple \ -+ aeabi_fcmplt \ -+ aeabi_frsub \ -+ aeabi_idivmod \ -+ aeabi_uidivmod \ -+ -+# ARM Assembly implementation which requires Thumb2 (i.e. won't work on v6M). -+THUMB2_FUNCTIONS := \ -+ switch16 \ -+ switch32 \ -+ switch8 \ -+ switchu8 \ -+ sync_fetch_and_add_4 \ -+ sync_fetch_and_sub_4 \ -+ sync_fetch_and_and_4 \ -+ sync_fetch_and_or_4 \ -+ sync_fetch_and_xor_4 \ -+ sync_fetch_and_nand_4 \ -+ sync_fetch_and_max_4 \ -+ sync_fetch_and_umax_4 \ -+ sync_fetch_and_min_4 \ -+ sync_fetch_and_umin_4 \ -+ sync_fetch_and_add_8 \ -+ sync_fetch_and_sub_8 \ -+ sync_fetch_and_and_8 \ -+ sync_fetch_and_or_8 \ -+ sync_fetch_and_xor_8 \ -+ sync_fetch_and_nand_8 \ -+ sync_fetch_and_max_8 \ -+ sync_fetch_and_umax_8 \ -+ sync_fetch_and_min_8 \ -+ sync_fetch_and_umin_8 -+ -+I386_FUNCTIONS := \ -+ i686.get_pc_thunk.eax \ -+ i686.get_pc_thunk.ebp \ -+ i686.get_pc_thunk.ebx \ -+ i686.get_pc_thunk.ecx \ -+ i686.get_pc_thunk.edi \ -+ i686.get_pc_thunk.edx \ -+ i686.get_pc_thunk.esi -+ -+# FIXME: Currently, compiler-rt is missing implementations for a number of the -+# functions. Filter them out for now. -+MISSING_FUNCTIONS := \ -+ cmpdf2 cmpsf2 div0 \ -+ ffssi2 \ -+ udiv_w_sdiv unorddf2 unordsf2 bswapdi2 \ -+ bswapsi2 \ -+ gcc_bcmp \ -+ do_global_dtors \ -+ i686.get_pc_thunk.eax i686.get_pc_thunk.ebp i686.get_pc_thunk.ebx \ -+ i686.get_pc_thunk.ecx i686.get_pc_thunk.edi i686.get_pc_thunk.edx \ -+ i686.get_pc_thunk.esi \ -+ aeabi_cdcmpeq aeabi_cdrcmple aeabi_cfcmpeq aeabi_cfrcmple aeabi_dcmpeq \ -+ aeabi_dcmpge aeabi_dcmpgt aeabi_dcmple aeabi_dcmplt aeabi_drsub \ -+ aeabi_fcmpeq \ aeabi_fcmpge aeabi_fcmpgt aeabi_fcmple aeabi_fcmplt \ -+ aeabi_frsub aeabi_idivmod aeabi_uidivmod -+ -+FUNCTIONS_ARMV6M := $(COMMON_FUNCTIONS) $(ARM_FUNCTIONS) -+FUNCTIONS_ARM_ALL := $(COMMON_FUNCTIONS) $(ARM_FUNCTIONS) $(THUMB2_FUNCTIONS) -+FUNCTIONS_I386 := $(COMMON_FUNCTIONS) $(I386_FUNCTIONS) -+FUNCTIONS_X86_64 := $(COMMON_FUNCTIONS) -+ -+FUNCTIONS_ARMV6M := \ -+ $(filter-out $(MISSING_FUNCTIONS),$(FUNCTIONS_ARMV6M)) -+FUNCTIONS_ARM_ALL := \ -+ $(filter-out $(MISSING_FUNCTIONS),$(FUNCTIONS_ARM_ALL)) -+FUNCTIONS_I386 := \ -+ $(filter-out $(MISSING_FUNCTIONS),$(FUNCTIONS_I386)) -+FUNCTIONS_X86_64 := \ -+ $(filter-out $(MISSING_FUNCTIONS),$(FUNCTIONS_X86_64)) -+ -+FUNCTIONS.soft_static.armv6m := $(FUNCTIONS_ARMV6M) -+FUNCTIONS.soft_pic.armv6m := $(FUNCTIONS_ARMV6M) -+ -+FUNCTIONS.soft_static.armv7m := $(FUNCTIONS_ARM_ALL) -+FUNCTIONS.soft_pic.armv7m := $(FUNCTIONS_ARM_ALL) -+ -+FUNCTIONS.soft_static.armv7em := $(FUNCTIONS_ARM_ALL) -+FUNCTIONS.hard_static.armv7em := $(FUNCTIONS_ARM_ALL) -+FUNCTIONS.soft_pic.armv7em := $(FUNCTIONS_ARM_ALL) -+FUNCTIONS.hard_pic.armv7em := $(FUNCTIONS_ARM_ALL) -+ -+FUNCTIONS.soft_static.armv7 := $(FUNCTIONS_ARM_ALL) -+FUNCTIONS.hard_static.armv7 := $(FUNCTIONS_ARM_ALL) -+FUNCTIONS.soft_pic.armv7 := $(FUNCTIONS_ARM_ALL) -+FUNCTIONS.hard_pic.armv7 := $(FUNCTIONS_ARM_ALL) -+ -+FUNCTIONS.hard_static.i386 := $(FUNCTIONS_I386) -+FUNCTIONS.hard_pic.i386 := $(FUNCTIONS_I386) -+ -+FUNCTIONS.hard_static.x86_64 := $(FUNCTIONS_X86_64) -+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 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 deleted file mode 100644 index 5717dce..0000000 --- a/recipes-devtools/clang/clang/0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 02d7443ec851ccdd64953ec49b12018c1f66a292 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 - native-compiled llvm-config. - - Note: AddLLVM.cmake does not expose the LLVM source directory. - So if you want to run the test suite, you need to either: - - 1) set LLVM_MAIN_SRC_DIR explicitly (to find lit.py) - 2) change AddLLVM.cmake to point to an installed 'lit'. - 3) add_subdirectory(compiler-rt/test) from clang instead of compiler-rt. - -https://us.codeaurora.org/patches/quic/llvm/50683/compiler-rt-cross-compilation.patch - -Signed-off-by: Greg Fitzgerald -Signed-off-by: Khem Raj ---- - compiler-rt/CMakeLists.txt | 11 ++++++++++- - 1 file changed, 10 insertions(+), 1 deletion(-) - -diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt -index e12d1eb1cebf..522a3a6a421c 100644 ---- a/compiler-rt/CMakeLists.txt -+++ b/compiler-rt/CMakeLists.txt -@@ -78,7 +78,16 @@ set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOL - "Build for a bare-metal target.") - - if (COMPILER_RT_STANDALONE_BUILD) -- load_llvm_config() -+ find_package(LLVM REQUIRED) -+ list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}") -+ -+ # Variables that AddLLVM.cmake depends on (included by AddCompilerRT) -+ set(LLVM_TOOLS_BINARY_DIR "${LLVM_INSTALL_PREFIX}/bin") -+ set(LLVM_LIBRARY_DIR "${LLVM_INSTALL_PREFIX}/lib") -+ -+ set(LLVM_LIBRARY_OUTPUT_INTDIR -+ ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) -+ - if (TARGET intrinsics_gen) - # Loading the llvm config causes this target to be imported so place it - # under the appropriate folder in an IDE. diff --git a/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch b/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch new file mode 100644 index 0000000..897b4c3 --- /dev/null +++ b/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch @@ -0,0 +1,88 @@ +From cac469f7a8ea6fe4bfb4e6151a5dd058dfa62947 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 + +musl defines some functions as macros and not inline functions +if this is the case then make sure to undefine them + +Signed-off-by: Khem Raj +--- + .../llvm/Analysis/TargetLibraryInfo.def | 21 +++++++++++++++++++ + 1 file changed, 21 insertions(+) + +diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.def b/llvm/include/llvm/Analysis/TargetLibraryInfo.def +index 9c1abef33b28..29d2a79ddecc 100644 +--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.def ++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.def +@@ -815,6 +815,9 @@ TLI_DEFINE_STRING_INTERNAL("fmodl") + TLI_DEFINE_ENUM_INTERNAL(fopen) + TLI_DEFINE_STRING_INTERNAL("fopen") + /// FILE *fopen64(const char *filename, const char *opentype) ++#ifdef fopen64 ++#undef fopen64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(fopen64) + TLI_DEFINE_STRING_INTERNAL("fopen64") + /// int fork(); +@@ -862,6 +865,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") ++#ifdef fseeko64 ++#undef fseeko64 ++#endif + /// int fseeko64(FILE *stream, off64_t offset, int whence) + TLI_DEFINE_ENUM_INTERNAL(fseeko64) + TLI_DEFINE_STRING_INTERNAL("fseeko64") +@@ -872,6 +878,9 @@ TLI_DEFINE_STRING_INTERNAL("fsetpos") + TLI_DEFINE_ENUM_INTERNAL(fstat) + TLI_DEFINE_STRING_INTERNAL("fstat") + /// int fstat64(int filedes, struct stat64 *buf) ++#ifdef fstat64 ++#undef fstat64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(fstat64) + TLI_DEFINE_STRING_INTERNAL("fstat64") + /// int fstatvfs(int fildes, struct statvfs *buf); +@@ -887,6 +896,9 @@ TLI_DEFINE_STRING_INTERNAL("ftell") + TLI_DEFINE_ENUM_INTERNAL(ftello) + TLI_DEFINE_STRING_INTERNAL("ftello") + /// off64_t ftello64(FILE *stream) ++#ifdef ftello64 ++#undef ftello64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(ftello64) + TLI_DEFINE_STRING_INTERNAL("ftello64") + /// int ftrylockfile(FILE *file); +@@ -1013,6 +1025,9 @@ TLI_DEFINE_STRING_INTERNAL("logl") + TLI_DEFINE_ENUM_INTERNAL(lstat) + TLI_DEFINE_STRING_INTERNAL("lstat") + /// int lstat64(const char *path, struct stat64 *buf); ++#ifdef lstat64 ++#undef lstat64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(lstat64) + TLI_DEFINE_STRING_INTERNAL("lstat64") + /// void *malloc(size_t size); +@@ -1262,6 +1277,9 @@ TLI_DEFINE_STRING_INTERNAL("sscanf") + TLI_DEFINE_ENUM_INTERNAL(stat) + TLI_DEFINE_STRING_INTERNAL("stat") + /// int stat64(const char *path, struct stat64 *buf); ++#ifdef stat64 ++#undef stat64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(stat64) + TLI_DEFINE_STRING_INTERNAL("stat64") + /// int statvfs(const char *path, struct statvfs *buf); +@@ -1397,6 +1415,9 @@ TLI_DEFINE_STRING_INTERNAL("times") + TLI_DEFINE_ENUM_INTERNAL(tmpfile) + TLI_DEFINE_STRING_INTERNAL("tmpfile") + /// FILE *tmpfile64(void) ++#ifdef tmpfile64 ++#undef tmpfile64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(tmpfile64) + TLI_DEFINE_STRING_INTERNAL("tmpfile64") + /// int toascii(int c); diff --git a/recipes-devtools/clang/clang/0005-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch b/recipes-devtools/clang/clang/0005-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch deleted file mode 100644 index 6d58e94..0000000 --- a/recipes-devtools/clang/clang/0005-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 57cc5e82da381cc6a69376dcf9398caa82a59648 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 - -musl defines some functions as macros and not inline functions -if this is the case then make sure to undefine them - -Signed-off-by: Khem Raj ---- - .../llvm/Analysis/TargetLibraryInfo.def | 21 +++++++++++++++++++ - 1 file changed, 21 insertions(+) - -diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.def b/llvm/include/llvm/Analysis/TargetLibraryInfo.def -index ded53617b304..da612e9b4352 100644 ---- a/llvm/include/llvm/Analysis/TargetLibraryInfo.def -+++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.def -@@ -815,6 +815,9 @@ TLI_DEFINE_STRING_INTERNAL("fmodl") - TLI_DEFINE_ENUM_INTERNAL(fopen) - TLI_DEFINE_STRING_INTERNAL("fopen") - /// FILE *fopen64(const char *filename, const char *opentype) -+#ifdef fopen64 -+#undef fopen64 -+#endif - TLI_DEFINE_ENUM_INTERNAL(fopen64) - TLI_DEFINE_STRING_INTERNAL("fopen64") - /// int fork(); -@@ -862,6 +865,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") -+#ifdef fseeko64 -+#undef fseeko64 -+#endif - /// int fseeko64(FILE *stream, off64_t offset, int whence) - TLI_DEFINE_ENUM_INTERNAL(fseeko64) - TLI_DEFINE_STRING_INTERNAL("fseeko64") -@@ -872,6 +878,9 @@ TLI_DEFINE_STRING_INTERNAL("fsetpos") - TLI_DEFINE_ENUM_INTERNAL(fstat) - TLI_DEFINE_STRING_INTERNAL("fstat") - /// int fstat64(int filedes, struct stat64 *buf) -+#ifdef fstat64 -+#undef fstat64 -+#endif - TLI_DEFINE_ENUM_INTERNAL(fstat64) - TLI_DEFINE_STRING_INTERNAL("fstat64") - /// int fstatvfs(int fildes, struct statvfs *buf); -@@ -887,6 +896,9 @@ TLI_DEFINE_STRING_INTERNAL("ftell") - TLI_DEFINE_ENUM_INTERNAL(ftello) - TLI_DEFINE_STRING_INTERNAL("ftello") - /// off64_t ftello64(FILE *stream) -+#ifdef ftello64 -+#undef ftello64 -+#endif - TLI_DEFINE_ENUM_INTERNAL(ftello64) - TLI_DEFINE_STRING_INTERNAL("ftello64") - /// int ftrylockfile(FILE *file); -@@ -1013,6 +1025,9 @@ TLI_DEFINE_STRING_INTERNAL("logl") - TLI_DEFINE_ENUM_INTERNAL(lstat) - TLI_DEFINE_STRING_INTERNAL("lstat") - /// int lstat64(const char *path, struct stat64 *buf); -+#ifdef lstat64 -+#undef lstat64 -+#endif - TLI_DEFINE_ENUM_INTERNAL(lstat64) - TLI_DEFINE_STRING_INTERNAL("lstat64") - /// void *malloc(size_t size); -@@ -1256,6 +1271,9 @@ TLI_DEFINE_STRING_INTERNAL("sscanf") - TLI_DEFINE_ENUM_INTERNAL(stat) - TLI_DEFINE_STRING_INTERNAL("stat") - /// int stat64(const char *path, struct stat64 *buf); -+#ifdef stat64 -+#undef stat64 -+#endif - TLI_DEFINE_ENUM_INTERNAL(stat64) - TLI_DEFINE_STRING_INTERNAL("stat64") - /// int statvfs(const char *path, struct statvfs *buf); -@@ -1391,6 +1409,9 @@ TLI_DEFINE_STRING_INTERNAL("times") - TLI_DEFINE_ENUM_INTERNAL(tmpfile) - TLI_DEFINE_STRING_INTERNAL("tmpfile") - /// FILE *tmpfile64(void) -+#ifdef tmpfile64 -+#undef tmpfile64 -+#endif - TLI_DEFINE_ENUM_INTERNAL(tmpfile64) - TLI_DEFINE_STRING_INTERNAL("tmpfile64") - /// int toascii(int c); diff --git a/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-path.patch b/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-path.patch new file mode 100644 index 0000000..beb0091 --- /dev/null +++ b/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-path.patch @@ -0,0 +1,34 @@ +From 8402337515bc0c75af621551dca9eb1cfc4ae611 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 + +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 +than from the native sysroot. Thus provide an env override for calling +llvm-config from a target sysroot. + +Signed-off-by: Martin Kelly +Signed-off-by: Khem Raj +--- + llvm/tools/llvm-config/llvm-config.cpp | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp +index 8ed88f33ead4..0b9ee0ee0008 100644 +--- a/llvm/tools/llvm-config/llvm-config.cpp ++++ b/llvm/tools/llvm-config/llvm-config.cpp +@@ -247,6 +247,13 @@ Typical components:\n\ + + /// Compute the path to the main executable. + std::string GetExecutablePath(const char *Argv0) { ++ // Hack for Yocto: we need to override the root path when we are using ++ // llvm-config from within a target sysroot. ++ const char *Sysroot = std::getenv("YOCTO_ALTERNATE_EXE_PATH"); ++ if (Sysroot != nullptr) { ++ return Sysroot; ++ } ++ + // 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; diff --git a/recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch b/recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch new file mode 100644 index 0000000..b32f18e --- /dev/null +++ b/recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch @@ -0,0 +1,61 @@ +From 5c8b6edfe03a72a75e698db7cbc7c409f08e3c45 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 + +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 +there, check /lib. + +Signed-off-by: Dan McGregor +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Linux.cpp | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index f85c04df4f6c..97e987c37e4a 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -493,11 +493,19 @@ 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)) { ++ LibDir = "lib"; ++ } + break; + case llvm::Triple::ppc64le: + 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)) { ++ LibDir = "lib"; ++ } + break; + case llvm::Triple::riscv32: { + StringRef ABIName = tools::riscv::getRISCVABI(Args, Triple); +@@ -519,6 +527,10 @@ 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)) { ++ LibDir = "lib"; ++ } + break; + case llvm::Triple::systemz: + LibDir = "lib"; +@@ -533,6 +545,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"; ++ if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ LibDir = "lib"; ++ } + break; + } + case llvm::Triple::ve: diff --git a/recipes-devtools/clang/clang/0006-llvm-allow-env-override-of-exe-path.patch b/recipes-devtools/clang/clang/0006-llvm-allow-env-override-of-exe-path.patch deleted file mode 100644 index 9923b54..0000000 --- a/recipes-devtools/clang/clang/0006-llvm-allow-env-override-of-exe-path.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 5d8ea7590df4cb9d1973a137ddf260e1df137010 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 - -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 -than from the native sysroot. Thus provide an env override for calling -llvm-config from a target sysroot. - -Signed-off-by: Martin Kelly -Signed-off-by: Khem Raj ---- - llvm/tools/llvm-config/llvm-config.cpp | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp -index 1a2f04552d13..019d8f2b5c5e 100644 ---- a/llvm/tools/llvm-config/llvm-config.cpp -+++ b/llvm/tools/llvm-config/llvm-config.cpp -@@ -247,6 +247,13 @@ Typical components:\n\ - - /// Compute the path to the main executable. - std::string GetExecutablePath(const char *Argv0) { -+ // Hack for Yocto: we need to override the root path when we are using -+ // llvm-config from within a target sysroot. -+ const char *Sysroot = std::getenv("YOCTO_ALTERNATE_EXE_PATH"); -+ if (Sysroot != nullptr) { -+ return Sysroot; -+ } -+ - // 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; diff --git a/recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch b/recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch new file mode 100644 index 0000000..fccc41d --- /dev/null +++ b/recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch @@ -0,0 +1,31 @@ +From 00484dc7cdf327f97fe09389fe5fe2ebd9e8fba4 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 + +musl driver will need to add ssp_nonshared for stack_check_local +on the linker cmdline when using stack protector commands on +compiler cmdline + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 7a9570a686f4..633daa58590d 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -622,6 +622,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, + if (IsIAMCU) + CmdArgs.push_back("-lgloss"); + ++ if (ToolChain.getTriple().isMusl() && ++ (Args.hasArg(options::OPT_fstack_protector) || ++ Args.hasArg(options::OPT_fstack_protector_strong) || ++ Args.hasArg(options::OPT_fstack_protector_all))) { ++ CmdArgs.push_back("-lssp_nonshared"); ++ } + if (IsStatic || IsStaticPIE) + CmdArgs.push_back("--end-group"); + else diff --git a/recipes-devtools/clang/clang/0007-clang-driver-Check-sysroot-for-ldso-path.patch b/recipes-devtools/clang/clang/0007-clang-driver-Check-sysroot-for-ldso-path.patch deleted file mode 100644 index 61d4761..0000000 --- a/recipes-devtools/clang/clang/0007-clang-driver-Check-sysroot-for-ldso-path.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 964f0d68fe16e003c42c75ebfc17fbd01676f652 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 - -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 -there, check /lib. - -Signed-off-by: Dan McGregor -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Linux.cpp | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) - -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index c9360fc67165..4b1d6bff7231 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -476,11 +476,19 @@ 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)) { -+ LibDir = "lib"; -+ } - break; - case llvm::Triple::ppc64le: - 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)) { -+ LibDir = "lib"; -+ } - break; - case llvm::Triple::riscv32: { - StringRef ABIName = tools::riscv::getRISCVABI(Args, Triple); -@@ -502,6 +510,10 @@ 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)) { -+ LibDir = "lib"; -+ } - break; - case llvm::Triple::systemz: - LibDir = "lib"; -@@ -516,6 +528,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"; -+ if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && -+ getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { -+ LibDir = "lib"; -+ } - break; - } - case llvm::Triple::ve: diff --git a/recipes-devtools/clang/clang/0008-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch b/recipes-devtools/clang/clang/0008-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch deleted file mode 100644 index 2c29869..0000000 --- a/recipes-devtools/clang/clang/0008-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 7cf3b10fa0664d856d65ac0ad991e1875ac28be5 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 - -musl driver will need to add ssp_nonshared for stack_check_local -on the linker cmdline when using stack protector commands on -compiler cmdline - -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Gnu.cpp | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index da39f29e4619..9103b153d461 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, - if (IsIAMCU) - CmdArgs.push_back("-lgloss"); - -+ if (ToolChain.getTriple().isMusl() && -+ (Args.hasArg(options::OPT_fstack_protector) || -+ Args.hasArg(options::OPT_fstack_protector_strong) || -+ Args.hasArg(options::OPT_fstack_protector_all))) { -+ CmdArgs.push_back("-lssp_nonshared"); -+ } - if (IsStatic || IsStaticPIE) - CmdArgs.push_back("--end-group"); - else diff --git a/recipes-devtools/clang/clang/0008-clang-musl-ppc-does-not-support-128-bit-long-double.patch b/recipes-devtools/clang/clang/0008-clang-musl-ppc-does-not-support-128-bit-long-double.patch new file mode 100644 index 0000000..a8f6335 --- /dev/null +++ b/recipes-devtools/clang/clang/0008-clang-musl-ppc-does-not-support-128-bit-long-double.patch @@ -0,0 +1,25 @@ +From bcf28119ce4c70e6d9c140d3393d556af897ddce 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 + +Signed-off-by: Khem Raj +--- + clang/lib/Basic/Targets/PPC.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/clang/lib/Basic/Targets/PPC.h b/clang/lib/Basic/Targets/PPC.h +index ac52eb219f54..ff2eb80b7d64 100644 +--- a/clang/lib/Basic/Targets/PPC.h ++++ b/clang/lib/Basic/Targets/PPC.h +@@ -395,6 +395,10 @@ public: + LongDoubleFormat = &llvm::APFloat::IEEEdouble(); + } + ++ if (getTriple().isMusl()) { ++ LongDoubleWidth = LongDoubleAlign = 64; ++ LongDoubleFormat = &llvm::APFloat::IEEEdouble(); ++ } + // PPC32 supports atomics up to 4 bytes. + MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32; + } diff --git a/recipes-devtools/clang/clang/0009-clang-Prepend-trailing-to-sysroot.patch b/recipes-devtools/clang/clang/0009-clang-Prepend-trailing-to-sysroot.patch new file mode 100644 index 0000000..5f41f6a --- /dev/null +++ b/recipes-devtools/clang/clang/0009-clang-Prepend-trailing-to-sysroot.patch @@ -0,0 +1,38 @@ +From 6ee100ac3386d411e03855c5cdb9df7545a127de 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 + +This is needed to handle a case where clang +isntall and target sysroot are perilously same + +e.g. + +sysroot = /mnt/clang/recipe-sysroot +clang install = /mnt/clang/recipe-sysroot-native + +in this case it will mistakenly assume that +clang is installed under the same sysroot dir +and it will try to add relative ../lib paths +to linker steps which would then be wrong +since they will become relative to clang +installation and not sysroot + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Linux.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index 97e987c37e4a..f9e233f15dfc 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -181,7 +181,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(); + + Generic_GCC::PushPPaths(PPaths); diff --git a/recipes-devtools/clang/clang/0009-clang-musl-ppc-does-not-support-128-bit-long-double.patch b/recipes-devtools/clang/clang/0009-clang-musl-ppc-does-not-support-128-bit-long-double.patch deleted file mode 100644 index 81d18dd..0000000 --- a/recipes-devtools/clang/clang/0009-clang-musl-ppc-does-not-support-128-bit-long-double.patch +++ /dev/null @@ -1,25 +0,0 @@ -From db02270329248b6af2e174f12532245eb7f6aaa0 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 - -Signed-off-by: Khem Raj ---- - clang/lib/Basic/Targets/PPC.h | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/clang/lib/Basic/Targets/PPC.h b/clang/lib/Basic/Targets/PPC.h -index 7c14a4eb9410..b182ef53348f 100644 ---- a/clang/lib/Basic/Targets/PPC.h -+++ b/clang/lib/Basic/Targets/PPC.h -@@ -392,6 +392,10 @@ public: - LongDoubleFormat = &llvm::APFloat::IEEEdouble(); - } - -+ if (getTriple().isMusl()) { -+ LongDoubleWidth = LongDoubleAlign = 64; -+ LongDoubleFormat = &llvm::APFloat::IEEEdouble(); -+ } - // PPC32 supports atomics up to 4 bytes. - MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32; - } diff --git a/recipes-devtools/clang/clang/0010-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch b/recipes-devtools/clang/clang/0010-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch new file mode 100644 index 0000000..c735b40 --- /dev/null +++ b/recipes-devtools/clang/clang/0010-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch @@ -0,0 +1,40 @@ +From 17bf3579a12359af825ca2815e273470a483ebb7 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 + +In OE compiler-rt and libc++ are built and staged into target +sysroot and not into resourcedir which is relative to clang +driver installation where the libraries are not instlled + +Specific to cross compiling the way yocto/OE works + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChain.cpp | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp +index d657d21bfcdb..e83a556b708c 100644 +--- a/clang/lib/Driver/ToolChain.cpp ++++ b/clang/lib/Driver/ToolChain.cpp +@@ -13,6 +13,7 @@ + #include "ToolChains/InterfaceStubs.h" + #include "clang/Basic/ObjCRuntime.h" + #include "clang/Basic/Sanitizers.h" ++#include "clang/Basic/Version.h" + #include "clang/Config/config.h" + #include "clang/Driver/Action.h" + #include "clang/Driver/Driver.h" +@@ -419,7 +420,10 @@ StringRef ToolChain::getOSLibName() const { + } + + std::string ToolChain::getCompilerRTPath() const { +- SmallString<128> Path(getDriver().ResourceDir); ++ SmallString<128> Path(getDriver().SysRoot); ++ StringRef ClangLibdirSuffix(CLANG_LIBDIR_SUFFIX); ++ llvm::sys::path::append(Path, "/usr/", Twine("lib") + ClangLibdirSuffix, "clang", ++ CLANG_VERSION_STRING); + if (Triple.isOSUnknown()) { + llvm::sys::path::append(Path, "lib"); + } else { diff --git a/recipes-devtools/clang/clang/0010-clang-Prepend-trailing-to-sysroot.patch b/recipes-devtools/clang/clang/0010-clang-Prepend-trailing-to-sysroot.patch deleted file mode 100644 index 964ecdb..0000000 --- a/recipes-devtools/clang/clang/0010-clang-Prepend-trailing-to-sysroot.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 9a6c282dd14e88b477593a185822635fee21330e 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 - -This is needed to handle a case where clang -isntall and target sysroot are perilously same - -e.g. - -sysroot = /mnt/clang/recipe-sysroot -clang install = /mnt/clang/recipe-sysroot-native - -in this case it will mistakenly assume that -clang is installed under the same sysroot dir -and it will try to add relative ../lib paths -to linker steps which would then be wrong -since they will become relative to clang -installation and not sysroot - -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Linux.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 4b1d6bff7231..9daf35aefc4e 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -181,7 +181,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(); - - Generic_GCC::PushPPaths(PPaths); diff --git a/recipes-devtools/clang/clang/0011-clang-Define-releative-gcc-installation-dir.patch b/recipes-devtools/clang/clang/0011-clang-Define-releative-gcc-installation-dir.patch new file mode 100644 index 0000000..bbe4eb7 --- /dev/null +++ b/recipes-devtools/clang/clang/0011-clang-Define-releative-gcc-installation-dir.patch @@ -0,0 +1,46 @@ +From 8f44109cb3b837966d401233daf2887a0a0d579b Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 20 Mar 2021 16:09:16 -0700 +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 +and other standard headers and libraries from gcc +installation in OE + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 633daa58590d..d22eaf698eb8 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2517,19 +2517,19 @@ 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 + // files in that location, not just GCC installation data. + {CandidateTriple.str(), "..", + TargetTriple.getVendor() == llvm::Triple::Freescale || +- TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}}; ++ 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}}; + + for (auto &Suffix : Suffixes) { + if (!Suffix.Active) diff --git a/recipes-devtools/clang/clang/0011-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch b/recipes-devtools/clang/clang/0011-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch deleted file mode 100644 index fefa00c..0000000 --- a/recipes-devtools/clang/clang/0011-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch +++ /dev/null @@ -1,40 +0,0 @@ -From c85d06487d397894aa0fd14ff210789b453d78fc 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 - -In OE compiler-rt and libc++ are built and staged into target -sysroot and not into resourcedir which is relative to clang -driver installation where the libraries are not instlled - -Specific to cross compiling the way yocto/OE works - -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChain.cpp | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp -index 6c1b88141c45..ee6a257a6cb4 100644 ---- a/clang/lib/Driver/ToolChain.cpp -+++ b/clang/lib/Driver/ToolChain.cpp -@@ -13,6 +13,7 @@ - #include "ToolChains/Flang.h" - #include "clang/Basic/ObjCRuntime.h" - #include "clang/Basic/Sanitizers.h" -+#include "clang/Basic/Version.h" - #include "clang/Config/config.h" - #include "clang/Driver/Action.h" - #include "clang/Driver/Driver.h" -@@ -410,7 +411,10 @@ StringRef ToolChain::getOSLibName() const { - } - - std::string ToolChain::getCompilerRTPath() const { -- SmallString<128> Path(getDriver().ResourceDir); -+ SmallString<128> Path(getDriver().SysRoot); -+ StringRef ClangLibdirSuffix(CLANG_LIBDIR_SUFFIX); -+ llvm::sys::path::append(Path, "/usr/", Twine("lib") + ClangLibdirSuffix, "clang", -+ CLANG_VERSION_STRING); - if (Triple.isOSUnknown()) { - llvm::sys::path::append(Path, "lib"); - } else { diff --git a/recipes-devtools/clang/clang/0012-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch b/recipes-devtools/clang/clang/0012-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch new file mode 100644 index 0000000..4d91a7a --- /dev/null +++ b/recipes-devtools/clang/clang/0012-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch @@ -0,0 +1,34 @@ +From 7d99f8a3c0ddd74d188d54f82f957843456bcdde 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 + +When doing static liking with --unwindlib=libunwind -static we encounter +undefined symbols +libunwind/src/RWMutex.hpp:68: undefined reference to `pthread_rwlock_wrlock' + +and + +libunwind/src/AddressSpace.hpp:597: undefined reference to `dladdr' + +therefore we need to link in libpthread and libdl to fill these symbols + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/CommonArgs.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp +index 6364cd133e0b..60ba461ea0f5 100644 +--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp ++++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp +@@ -1472,6 +1472,8 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D, + CmdArgs.push_back("-lunwind"); + } else if (LGT == LibGccType::StaticLibGcc) { + CmdArgs.push_back("-l:libunwind.a"); ++ CmdArgs.push_back("-lpthread"); ++ CmdArgs.push_back("-ldl"); + } else if (TC.getTriple().isOSCygMing()) { + if (LGT == LibGccType::SharedLibGcc) + CmdArgs.push_back("-l:libunwind.dll.a"); diff --git a/recipes-devtools/clang/clang/0012-clang-Define-releative-gcc-installation-dir.patch b/recipes-devtools/clang/clang/0012-clang-Define-releative-gcc-installation-dir.patch deleted file mode 100644 index d1a572e..0000000 --- a/recipes-devtools/clang/clang/0012-clang-Define-releative-gcc-installation-dir.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 71e923b1d1b611ce3a4ae2a08408059a0162b99f Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 20 Mar 2021 16:09:16 -0700 -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 -and other standard headers and libraries from gcc -installation in OE - -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Gnu.cpp | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 9103b153d461..4f12262bbf47 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2529,19 +2529,19 @@ 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 - // files in that location, not just GCC installation data. - {CandidateTriple.str(), "..", - TargetTriple.getVendor() == llvm::Triple::Freescale || -- TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}}; -+ 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}}; - - for (auto &Suffix : Suffixes) { - if (!Suffix.Active) diff --git a/recipes-devtools/clang/clang/0013-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch b/recipes-devtools/clang/clang/0013-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch new file mode 100644 index 0000000..4bbe6b5 --- /dev/null +++ b/recipes-devtools/clang/clang/0013-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch @@ -0,0 +1,23 @@ +From b6b764295a5d003264dd5b843ff1f513a3c40991 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 2a39b6a40a28..8a441729c943 100644 +--- a/llvm/cmake/modules/CrossCompile.cmake ++++ b/llvm/cmake/modules/CrossCompile.cmake +@@ -84,6 +84,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype) + -DLLVM_ENABLE_RUNTIMES="${llvm_enable_runtimes_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/0013-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch b/recipes-devtools/clang/clang/0013-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch deleted file mode 100644 index baa612c..0000000 --- a/recipes-devtools/clang/clang/0013-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch +++ /dev/null @@ -1,34 +0,0 @@ -From f033f7183eb509f3b99d8f197eb5d5159f961c0b 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 - -When doing static liking with --unwindlib=libunwind -static we encounter -undefined symbols -libunwind/src/RWMutex.hpp:68: undefined reference to `pthread_rwlock_wrlock' - -and - -libunwind/src/AddressSpace.hpp:597: undefined reference to `dladdr' - -therefore we need to link in libpthread and libdl to fill these symbols - -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/CommonArgs.cpp | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp -index 0ffe95795381..358eb98cf528 100644 ---- a/clang/lib/Driver/ToolChains/CommonArgs.cpp -+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp -@@ -1450,6 +1450,8 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D, - CmdArgs.push_back("-lunwind"); - } else if (LGT == LibGccType::StaticLibGcc) { - CmdArgs.push_back("-l:libunwind.a"); -+ CmdArgs.push_back("-lpthread"); -+ CmdArgs.push_back("-ldl"); - } else if (TC.getTriple().isOSCygMing()) { - if (LGT == LibGccType::SharedLibGcc) - CmdArgs.push_back("-l:libunwind.dll.a"); diff --git a/recipes-devtools/clang/clang/0014-Check-for-atomic-double-intrinsics.patch b/recipes-devtools/clang/clang/0014-Check-for-atomic-double-intrinsics.patch new file mode 100644 index 0000000..4e5ad63 --- /dev/null +++ b/recipes-devtools/clang/clang/0014-Check-for-atomic-double-intrinsics.patch @@ -0,0 +1,33 @@ +From 1b1bcc66f885233a3378ba9819c9a20323490cea 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 3c5ba72993a3..34a1b950bbed 100644 +--- a/llvm/cmake/modules/CheckAtomic.cmake ++++ b/llvm/cmake/modules/CheckAtomic.cmake +@@ -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}) diff --git a/recipes-devtools/clang/clang/0014-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch b/recipes-devtools/clang/clang/0014-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch deleted file mode 100644 index e6998fb..0000000 --- a/recipes-devtools/clang/clang/0014-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 6e6960945953dead105f229da0cd34d860ebfe6c 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 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) - -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/0015-Check-for-atomic-double-intrinsics.patch b/recipes-devtools/clang/clang/0015-Check-for-atomic-double-intrinsics.patch deleted file mode 100644 index 04e8abc..0000000 --- a/recipes-devtools/clang/clang/0015-Check-for-atomic-double-intrinsics.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 806b95e07916c0647957e7ed1ee1d4d6bcf55bc9 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 04eed1448482..e890cfecd139 100644 ---- a/llvm/cmake/modules/CheckAtomic.cmake -+++ b/llvm/cmake/modules/CheckAtomic.cmake -@@ -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}) diff --git a/recipes-devtools/clang/clang/0015-libcxx-Add-compiler-runtime-library-to-link-step-for.patch b/recipes-devtools/clang/clang/0015-libcxx-Add-compiler-runtime-library-to-link-step-for.patch new file mode 100644 index 0000000..cc22366 --- /dev/null +++ b/recipes-devtools/clang/clang/0015-libcxx-Add-compiler-runtime-library-to-link-step-for.patch @@ -0,0 +1,37 @@ +From cc0a281fbf68db9fadc74cee24d63b12a0b4d1eb 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 12dcdf954405..54e446e2aecd 100644 +--- a/libcxx/src/CMakeLists.txt ++++ b/libcxx/src/CMakeLists.txt +@@ -212,7 +212,7 @@ if (LIBCXX_ENABLE_SHARED) + add_library(cxx_shared SHARED ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS}) + target_include_directories(cxx_shared PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + 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}" +@@ -290,7 +290,7 @@ if (LIBCXX_ENABLE_STATIC) + add_library(cxx_static STATIC ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS}) + target_include_directories(cxx_static PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + target_link_libraries(cxx_static PUBLIC cxx-headers +- PRIVATE ${LIBCXX_LIBRARIES}) ++ PRIVATE ${LIBCXX_LIBRARIES} "$$($$CC --print-libgcc-file-name)") + set_target_properties(cxx_static + PROPERTIES + COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}" diff --git a/recipes-devtools/clang/clang/0016-clang-Enable-SSP-and-PIE-by-default.patch b/recipes-devtools/clang/clang/0016-clang-Enable-SSP-and-PIE-by-default.patch deleted file mode 100644 index e1e7cbf..0000000 --- a/recipes-devtools/clang/clang/0016-clang-Enable-SSP-and-PIE-by-default.patch +++ /dev/null @@ -1,312 +0,0 @@ -From 64d8a913cfee1e8d0cf4019a18ead5edaadb6303 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 | 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 +++++++------- - 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, 42 insertions(+), 30 deletions(-) - -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 9daf35aefc4e..8c6102f47192 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -668,8 +668,14 @@ 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; - } - - bool Linux::IsAArch64OutlineAtomicsDefault(const ArgList &Args) const { -diff --git a/clang/lib/Driver/ToolChains/Linux.h b/clang/lib/Driver/ToolChains/Linux.h -index 169a37c44072..b3544a0c7681 100644 ---- a/clang/lib/Driver/ToolChains/Linux.h -+++ b/clang/lib/Driver/ToolChains/Linux.h -@@ -46,6 +46,10 @@ public: - bool isPIEDefault() const override; - bool isNoExecStackDefault() const override; - bool IsMathErrnoDefault() 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 59f5a97d2d9d..8d0e9e724aa0 100644 ---- a/clang/test/Driver/cross-linux.c -+++ b/clang/test/Driver/cross-linux.c -@@ -43,8 +43,8 @@ - // CHECK-MULTI32-I386: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/10.2.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/10.2.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/10.2.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" -@@ -61,8 +61,8 @@ - // CHECK-MULTI32-X86-64: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/10.2.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/10.2.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/10.2.0]]/64" - // CHECK-MULTI32-X86-64: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib/../lib64" - // CHECK-MULTI32-X86-64: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib" - // CHECK-MULTI32-X86-64: "-L[[sysroot]]/lib" -@@ -79,8 +79,8 @@ - // CHECK-MULTI64-I386: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/10.2.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/10.2.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/10.2.0]]/32" - // CHECK-MULTI64-I386: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib/../lib32" - // CHECK-MULTI64-I386: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib" - // CHECK-MULTI64-I386: "-L[[sysroot]]/lib" -@@ -97,8 +97,8 @@ - // CHECK-MULTI64-X86-64: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/10.2.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/10.2.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/10.2.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 e9b86cbcf428..47f304c0420d 100644 ---- a/clang/test/Driver/env.c -+++ b/clang/test/Driver/env.c -@@ -22,7 +22,7 @@ - // - // CHECK-LD-32-NOT: warning: - // CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" --// CHECK-LD-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/10.2.0{{/|\\\\}}crtbegin.o" -+// CHECK-LD-32: "crtbeginS.o" - // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/10.2.0" - // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/10.2.0/../../../../i386-unknown-linux/lib" - // CHECK-LD-32: "-L[[SYSROOT]]/lib" -diff --git a/clang/test/Driver/fsanitize.c b/clang/test/Driver/fsanitize.c -index b7d61abe7ec5..461b69b0ac15 100644 ---- a/clang/test/Driver/fsanitize.c -+++ b/clang/test/Driver/fsanitize.c -@@ -344,15 +344,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" -@@ -687,12 +687,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 7cdba0841b8c..e2b3c6b04f08 100644 ---- a/clang/test/Driver/gcc-toolchain.cpp -+++ b/clang/test/Driver/gcc-toolchain.cpp -@@ -23,7 +23,7 @@ - // 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-SAME: "{{[^"]*}}/usr/lib/gcc/x86_64-linux-gnu/4.8{{/|\\\\}}crtbegin.o" -+// CHECK-SAME: "crtbeginS.o" - // CHECK-SAME: "-L[[TOOLCHAIN]]/usr/lib/gcc/x86_64-linux-gnu/4.8" - /// On x86_64, there is an extra usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu but we should not test it. - -diff --git a/clang/test/Driver/hexagon-toolchain-elf.c b/clang/test/Driver/hexagon-toolchain-elf.c -index cc11f9fcba9e..1fe8b5db587b 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 0959bd7ba0a1..4056a672b6f9 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 cc505588331b..c7f81d2c5e49 100644 ---- a/clang/test/Driver/linux-ld.c -+++ b/clang/test/Driver/linux-ld.c -@@ -1,4 +1,6 @@ - // UNSUPPORTED: system-windows -+// 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 a74a19953ca2..0ba4a14ab74f 100644 ---- a/clang/test/Driver/ppc-abi.c -+++ b/clang/test/Driver/ppc-abi.c -@@ -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-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 a5852f5f3997..233d9ef003cf 100644 ---- a/clang/test/Driver/riscv32-toolchain.c -+++ b/clang/test/Driver/riscv32-toolchain.c -@@ -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" --// 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" -@@ -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" --// 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 e727f20bb601..a801e5eee462 100644 ---- a/clang/test/Driver/riscv64-toolchain.c -+++ b/clang/test/Driver/riscv64-toolchain.c -@@ -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" --// 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" -@@ -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" --// 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 a3e40b50eed8..dfffe0d6cf85 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/0016-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch b/recipes-devtools/clang/clang/0016-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch new file mode 100644 index 0000000..ba988e0 --- /dev/null +++ b/recipes-devtools/clang/clang/0016-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch @@ -0,0 +1,116 @@ +From ce947e2ae1759e393b387ac115d5540ec6f471f1 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 | 2 -- + llvm/cmake/modules/AddLLVM.cmake | 6 ------ + llvm/cmake/modules/TableGen.cmake | 7 ------- + 3 files changed, 15 deletions(-) + +diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake +index 9bbbfc032b7d..7ee5170bbc71 100644 +--- a/clang/cmake/modules/AddClang.cmake ++++ b/clang/cmake/modules/AddClang.cmake +@@ -159,7 +159,6 @@ macro(add_clang_tool name) + if (CLANG_BUILD_TOOLS) + get_target_export_arg(${name} Clang export_to_clangtargets) + install(TARGETS ${name} +- ${export_to_clangtargets} + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + COMPONENT ${name}) + +@@ -168,7 +167,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 37bc98f9e021..d34083fa52ec 100644 +--- a/llvm/cmake/modules/AddLLVM.cmake ++++ b/llvm/cmake/modules/AddLLVM.cmake +@@ -1251,7 +1251,6 @@ macro(add_llvm_tool name) + if( LLVM_BUILD_TOOLS ) + get_target_export_arg(${name} LLVM export_to_llvmexports) + install(TARGETS ${name} +- ${export_to_llvmexports} + RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR} + COMPONENT ${name}) + +@@ -1262,9 +1261,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) + +@@ -1304,7 +1300,6 @@ macro(add_llvm_utility name) + if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS) + get_target_export_arg(${name} LLVM export_to_llvmexports) + install(TARGETS ${name} +- ${export_to_llvmexports} + RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR} + COMPONENT ${name}) + +@@ -1313,7 +1308,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 59fd0d3b0733..3b9ac56ed37f 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() diff --git a/recipes-devtools/clang/clang/0017-clang-Fix-resource-dir-location-for-cross-toolchains.patch b/recipes-devtools/clang/clang/0017-clang-Fix-resource-dir-location-for-cross-toolchains.patch new file mode 100644 index 0000000..3a2b179 --- /dev/null +++ b/recipes-devtools/clang/clang/0017-clang-Fix-resource-dir-location-for-cross-toolchains.patch @@ -0,0 +1,39 @@ +From 85a600c78bcb5befd0f51e5551d0dd2f4c6b6f54 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 +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 3bfddeefc7b2..8a806efb292b 100644 +--- a/clang/lib/Driver/Driver.cpp ++++ b/clang/lib/Driver/Driver.cpp +@@ -176,7 +176,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 = 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/0017-libcxx-Add-compiler-runtime-library-to-link-step-for.patch b/recipes-devtools/clang/clang/0017-libcxx-Add-compiler-runtime-library-to-link-step-for.patch deleted file mode 100644 index e089ebb..0000000 --- a/recipes-devtools/clang/clang/0017-libcxx-Add-compiler-runtime-library-to-link-step-for.patch +++ /dev/null @@ -1,37 +0,0 @@ -From ddbda1f2de59192ff883ba49c68dfac8e2fb98b3 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 496429f3841e..99ca892533b1 100644 ---- a/libcxx/src/CMakeLists.txt -+++ b/libcxx/src/CMakeLists.txt -@@ -194,7 +194,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}" -@@ -272,7 +272,7 @@ set(CMAKE_STATIC_LIBRARY_PREFIX "lib") - 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_target_properties(cxx_static - PROPERTIES - COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}" diff --git a/recipes-devtools/clang/clang/0018-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch b/recipes-devtools/clang/clang/0018-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch new file mode 100644 index 0000000..70de0a3 --- /dev/null +++ b/recipes-devtools/clang/clang/0018-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch @@ -0,0 +1,67 @@ +From 26c596cf7f4c3fbac5df62a8f19ebca083fd4d2c 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 +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 f9e233f15dfc..bf73b1ef27db 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -493,8 +493,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; +@@ -502,8 +502,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; +@@ -527,8 +527,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; +@@ -545,8 +545,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; diff --git a/recipes-devtools/clang/clang/0018-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch b/recipes-devtools/clang/clang/0018-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch deleted file mode 100644 index 1c342c6..0000000 --- a/recipes-devtools/clang/clang/0018-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch +++ /dev/null @@ -1,116 +0,0 @@ -From 4c9bb41e62058144e041a0f850a6d2ad5df03e0d 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 | 2 -- - llvm/cmake/modules/AddLLVM.cmake | 6 ------ - llvm/cmake/modules/TableGen.cmake | 7 ------- - 3 files changed, 15 deletions(-) - -diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake -index 5752f4277444..f40ea35faf46 100644 ---- a/clang/cmake/modules/AddClang.cmake -+++ b/clang/cmake/modules/AddClang.cmake -@@ -158,7 +158,6 @@ macro(add_clang_tool name) - if (CLANG_BUILD_TOOLS) - get_target_export_arg(${name} Clang export_to_clangtargets) - install(TARGETS ${name} -- ${export_to_clangtargets} - RUNTIME DESTINATION bin - COMPONENT ${name}) - -@@ -167,7 +166,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 5a9480aa6768..0f199f91e67c 100644 ---- a/llvm/cmake/modules/AddLLVM.cmake -+++ b/llvm/cmake/modules/AddLLVM.cmake -@@ -1233,7 +1233,6 @@ macro(add_llvm_tool name) - if( LLVM_BUILD_TOOLS ) - get_target_export_arg(${name} LLVM export_to_llvmexports) - install(TARGETS ${name} -- ${export_to_llvmexports} - RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR} - COMPONENT ${name}) - -@@ -1244,9 +1243,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) - -@@ -1286,7 +1282,6 @@ macro(add_llvm_utility name) - if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS) - get_target_export_arg(${name} LLVM export_to_llvmexports) - install(TARGETS ${name} -- ${export_to_llvmexports} - RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR} - COMPONENT ${name}) - -@@ -1295,7 +1290,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 5e9e2674405e..3c72df35b308 100644 ---- a/llvm/cmake/modules/TableGen.cmake -+++ b/llvm/cmake/modules/TableGen.cmake -@@ -179,14 +179,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) -@@ -195,5 +189,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/0019-clang-Fix-resource-dir-location-for-cross-toolchains.patch b/recipes-devtools/clang/clang/0019-clang-Fix-resource-dir-location-for-cross-toolchains.patch deleted file mode 100644 index f1cc2a3..0000000 --- a/recipes-devtools/clang/clang/0019-clang-Fix-resource-dir-location-for-cross-toolchains.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 3bb1761c3685792ccbcb96a9106dab6595ea11d2 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 -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 94a7553e273b..5b353e6670f0 100644 ---- a/clang/lib/Driver/Driver.cpp -+++ b/clang/lib/Driver/Driver.cpp -@@ -122,7 +122,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 = 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/0019-clang-Use-python3-in-python-scripts.patch b/recipes-devtools/clang/clang/0019-clang-Use-python3-in-python-scripts.patch new file mode 100644 index 0000000..078bc61 --- /dev/null +++ b/recipes-devtools/clang/clang/0019-clang-Use-python3-in-python-scripts.patch @@ -0,0 +1,90 @@ +From df4a3eb433329f68dc6ba74b9bd03664c3a62299 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/git-clang-format | 2 +- + clang/tools/scan-view/bin/scan-view | 2 +- + 7 files changed, 7 insertions(+), 7 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 50a220b3f975..ea40cbc48dd2 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 9c2021751e0e..4bb9af8cbe0a 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 6bd05531333b..9e134123ef44 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 e6cff6a7414d..582c113fb173 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/git-clang-format b/clang/tools/clang-format/git-clang-format +index 7968c4387574..268e4dd14782 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 6165432e7af8..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 python ++#!/usr/bin/env python3 + + from __future__ import print_function + diff --git a/recipes-devtools/clang/clang/0020-For-x86_64-set-Yocto-based-GCC-install-search-path.patch b/recipes-devtools/clang/clang/0020-For-x86_64-set-Yocto-based-GCC-install-search-path.patch new file mode 100644 index 0000000..640562f --- /dev/null +++ b/recipes-devtools/clang/clang/0020-For-x86_64-set-Yocto-based-GCC-install-search-path.patch @@ -0,0 +1,70 @@ +From abd7f4b0e7e10c7102685012cb9db0551be7037c 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 + +The //CLANG_EXTRA_OE_VENDORS_TRIPLES string is replaced with list of +additional triples based on CLANG_EXTRA_OE_VENDORS variable in +recipes-devtools/clang/llvm-project-source.inc:add_more_target_vendors() + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Martin Jansa +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 d22eaf698eb8..6fcd5abe7211 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2105,6 +2105,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",//CLANG_EXTRA_OE_VENDORS_TRIPLES + "x86_64-amazon-linux"}; + static const char *const X32Triples[] = {"x86_64-linux-gnux32", + "x86_64-pc-linux-gnux32"}; diff --git a/recipes-devtools/clang/clang/0020-fix-path-to-libffi.patch b/recipes-devtools/clang/clang/0020-fix-path-to-libffi.patch deleted file mode 100644 index 54c9382..0000000 --- a/recipes-devtools/clang/clang/0020-fix-path-to-libffi.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 4b2b4a51abcc347176f8c1c6bdfa28e1a2c9e57b 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 -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 976219830d5e..9930e01559e9 100644 ---- a/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt -+++ b/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt -@@ -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() diff --git a/recipes-devtools/clang/clang/0021-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch b/recipes-devtools/clang/clang/0021-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch deleted file mode 100644 index 5ddc7d6..0000000 --- a/recipes-devtools/clang/clang/0021-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 2d6e13dbd89ab50125e86ef8f240e50d0c8dd576 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 -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 8c6102f47192..4b39c2bdf14d 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -476,8 +476,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; -@@ -485,8 +485,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; -@@ -510,8 +510,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; -@@ -528,8 +528,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; diff --git a/recipes-devtools/clang/clang/0021-llvm-Do-not-use-find_library-for-ncurses.patch b/recipes-devtools/clang/clang/0021-llvm-Do-not-use-find_library-for-ncurses.patch new file mode 100644 index 0000000..28ef7ab --- /dev/null +++ b/recipes-devtools/clang/clang/0021-llvm-Do-not-use-find_library-for-ncurses.patch @@ -0,0 +1,44 @@ +From e06d9bce947249e18bd17f55852dad4e3ea671ac 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/modules/FindTerminfo.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 4299a0589a7b..cb53b6fd14bd 100644 +--- a/compiler-rt/cmake/config-ix.cmake ++++ b/compiler-rt/cmake/config-ix.cmake +@@ -149,7 +149,7 @@ else() + set(MAYBE_REQUIRED) + endif() + if(LLVM_ENABLE_TERMINFO) +- find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED}) ++ find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + endif() + if(COMPILER_RT_TERMINFO_LIB) + set(LLVM_ENABLE_TERMINFO 1) +diff --git a/llvm/cmake/modules/FindTerminfo.cmake b/llvm/cmake/modules/FindTerminfo.cmake +index 65edb80fa69a..a58180be8926 100644 +--- a/llvm/cmake/modules/FindTerminfo.cmake ++++ b/llvm/cmake/modules/FindTerminfo.cmake +@@ -11,7 +11,7 @@ + # Additionally, the following import target will be defined: + # Terminfo::terminfo + +-find_library(Terminfo_LIBRARIES NAMES terminfo tinfo curses ncurses ncursesw) ++find_library(Terminfo_LIBRARIES NAMES terminfo tinfo curses ncurses ncursesw NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + + if(Terminfo_LIBRARIES) + include(CMakePushCheckState) diff --git a/recipes-devtools/clang/clang/0022-clang-Use-python3-in-python-scripts.patch b/recipes-devtools/clang/clang/0022-clang-Use-python3-in-python-scripts.patch deleted file mode 100644 index ac014b1..0000000 --- a/recipes-devtools/clang/clang/0022-clang-Use-python3-in-python-scripts.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 40138d88b4371d1e253dc5a86fe517bceba655aa 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/git-clang-format | 2 +- - clang/tools/scan-view/bin/scan-view | 2 +- - clang/utils/hmaptool/hmaptool | 2 +- - 8 files changed, 8 insertions(+), 8 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 6bd05531333b..9e134123ef44 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 acd1ed6979c0..12bd7f9c7dc3 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/git-clang-format b/clang/tools/clang-format/git-clang-format -index 0233ceb3a868..16bc55f98762 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 6165432e7af8..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 python -+#!/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/0022-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch b/recipes-devtools/clang/clang/0022-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch new file mode 100644 index 0000000..c0d2b6d --- /dev/null +++ b/recipes-devtools/clang/clang/0022-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch @@ -0,0 +1,32 @@ +From 4a0571cc9e2401504c0675051c3e66143d0d87f6 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 11 Feb 2021 16:42:49 -0800 +Subject: [PATCH] llvm: Insert anchor for adding OE distro vendor names + +This helps in making right detection for OE built gcc toolchains + +The //CLANG_EXTRA_OE_VENDORS_CASES string is replaced with list of +additional Ceses based on CLANG_EXTRA_OE_VENDORS variable in +recipes-devtools/clang/llvm-project-source.inc:add_more_target_vendors() + +Upstream-Status: Inappropriate [OE-specific] + +Signed-off-by: Khem Raj +Signed-off-by: Martin Jansa +--- + llvm/lib/Support/Triple.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp +index a9afcc9db96a..dc48caf02616 100644 +--- a/llvm/lib/Support/Triple.cpp ++++ b/llvm/lib/Support/Triple.cpp +@@ -506,7 +506,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) { + .Case("amd", Triple::AMD) + .Case("mesa", Triple::Mesa) + .Case("suse", Triple::SUSE) +- .Case("oe", Triple::OpenEmbedded) ++ .Case("oe", Triple::OpenEmbedded)//CLANG_EXTRA_OE_VENDORS_CASES + .Default(Triple::UnknownVendor); + } + diff --git a/recipes-devtools/clang/clang/0023-For-x86_64-set-Yocto-based-GCC-install-search-path.patch b/recipes-devtools/clang/clang/0023-For-x86_64-set-Yocto-based-GCC-install-search-path.patch deleted file mode 100644 index c46e3dd..0000000 --- a/recipes-devtools/clang/clang/0023-For-x86_64-set-Yocto-based-GCC-install-search-path.patch +++ /dev/null @@ -1,70 +0,0 @@ -From c23934d24ed6cbb08e3ce6c67c458509c6d46291 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 - -The //CLANG_EXTRA_OE_VENDORS_TRIPLES string is replaced with list of -additional triples based on CLANG_EXTRA_OE_VENDORS variable in -recipes-devtools/clang/llvm-project-source.inc:add_more_target_vendors() - -Upstream-Status: Inappropriate [oe specific] - -Signed-off-by: Martin Jansa -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 4f12262bbf47..9750c42e1f56 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2111,6 +2111,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",//CLANG_EXTRA_OE_VENDORS_TRIPLES - "x86_64-amazon-linux", "x86_64-linux-android"}; - static const char *const X32Triples[] = {"x86_64-linux-gnux32", - "x86_64-pc-linux-gnux32"}; diff --git a/recipes-devtools/clang/clang/0023-compiler-rt-Use-mcr-based-barrier-on-armv6.patch b/recipes-devtools/clang/clang/0023-compiler-rt-Use-mcr-based-barrier-on-armv6.patch new file mode 100644 index 0000000..b67d8d2 --- /dev/null +++ b/recipes-devtools/clang/clang/0023-compiler-rt-Use-mcr-based-barrier-on-armv6.patch @@ -0,0 +1,71 @@ +From c4a8eebdbaea9eef3f4422497196627485de920e Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 24 Mar 2021 00:32:09 -0700 +Subject: [PATCH] compiler-rt: Use mcr based barrier on armv6 + +dsb is an armv7 instruction and wont work when we are building for armv6. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + compiler-rt/lib/builtins/arm/sync-ops.h | 8 ++++---- + compiler-rt/lib/builtins/assembly.h | 8 ++++++++ + 2 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/compiler-rt/lib/builtins/arm/sync-ops.h b/compiler-rt/lib/builtins/arm/sync-ops.h +index c9623249e5d2..7a26170741ad 100644 +--- a/compiler-rt/lib/builtins/arm/sync-ops.h ++++ b/compiler-rt/lib/builtins/arm/sync-ops.h +@@ -19,14 +19,14 @@ + .thumb; \ + .syntax unified; \ + DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ +- dmb; \ ++ DMB; \ + mov r12, r0; \ + LOCAL_LABEL(tryatomic_##op) : ldrex r0, [r12]; \ + op(r2, r0, r1); \ + strex r3, r2, [r12]; \ + cmp r3, #0; \ + bne LOCAL_LABEL(tryatomic_##op); \ +- dmb; \ ++ DMB; \ + bx lr + + #define SYNC_OP_8(op) \ +@@ -35,14 +35,14 @@ + .syntax unified; \ + DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ + push {r4, r5, r6, lr}; \ +- dmb; \ ++ DMB; \ + mov r12, r0; \ + LOCAL_LABEL(tryatomic_##op) : ldrexd r0, r1, [r12]; \ + op(r4, r5, r0, r1, r2, r3); \ + strexd r6, r4, r5, [r12]; \ + cmp r6, #0; \ + bne LOCAL_LABEL(tryatomic_##op); \ +- dmb; \ ++ DMB; \ + pop { r4, r5, r6, pc } + + #define MINMAX_4(rD, rN, rM, cmp_kind) \ +diff --git a/compiler-rt/lib/builtins/assembly.h b/compiler-rt/lib/builtins/assembly.h +index 69a3d8620f92..60bac86df218 100644 +--- a/compiler-rt/lib/builtins/assembly.h ++++ b/compiler-rt/lib/builtins/assembly.h +@@ -189,6 +189,14 @@ + JMP(ip) + #endif + ++#if __ARM_ARCH >= 7 ++#define DMB dmb ++#elif __ARM_ARCH >= 6 ++#define DMB mcr p15, #0, r0, c7, c10, #5 ++#else ++#error Only use this with ARMv6+ ++#endif ++ + #if defined(USE_THUMB_2) + #define WIDE(op) op.w + #else diff --git a/recipes-devtools/clang/clang/0024-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch b/recipes-devtools/clang/clang/0024-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch new file mode 100644 index 0000000..639563d --- /dev/null +++ b/recipes-devtools/clang/clang/0024-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch @@ -0,0 +1,68 @@ +From 5ffa9adacd28053b6ff42d30907991fedb2ce75a Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 19 May 2021 17:32:13 -0700 +Subject: [PATCH] compiler-rt: Do not use backtrace APIs on non-glibc linux + +musl e.g. does not provide backtrace APIs + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + .../lib/gwp_asan/optional/backtrace_linux_libc.cpp | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp b/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp +index ea8e72be287d..0344074dd254 100644 +--- a/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp ++++ b/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp +@@ -7,7 +7,9 @@ + //===----------------------------------------------------------------------===// + + #include ++#ifdef __GLIBC__ + #include ++#endif + #include + #include + #include +@@ -21,8 +23,11 @@ + namespace { + size_t Backtrace(uintptr_t *TraceBuffer, size_t Size) { + static_assert(sizeof(uintptr_t) == sizeof(void *), "uintptr_t is not void*"); +- ++#ifdef __GLIBC__ + return backtrace(reinterpret_cast(TraceBuffer), Size); ++#else ++ return -1; ++#endif + } + + // We don't need any custom handling for the Segv backtrace - the libc unwinder +@@ -30,7 +35,11 @@ size_t Backtrace(uintptr_t *TraceBuffer, size_t Size) { + // to avoid the additional frame. + GWP_ASAN_ALWAYS_INLINE size_t SegvBacktrace(uintptr_t *TraceBuffer, size_t Size, + void * /*Context*/) { ++#ifdef __GLIBC__ + return Backtrace(TraceBuffer, Size); ++#else ++ return -1; ++#endif + } + + static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, +@@ -40,6 +49,7 @@ static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, + return; + } + ++#ifdef __GLIBC__ + char **BacktraceSymbols = + backtrace_symbols(reinterpret_cast(Trace), TraceLength); + +@@ -53,6 +63,7 @@ static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, + Printf("\n"); + if (BacktraceSymbols) + free(BacktraceSymbols); ++#endif + } + } // anonymous namespace + diff --git a/recipes-devtools/clang/clang/0024-llvm-Do-not-use-find_library-for-ncurses.patch b/recipes-devtools/clang/clang/0024-llvm-Do-not-use-find_library-for-ncurses.patch deleted file mode 100644 index caaf668..0000000 --- a/recipes-devtools/clang/clang/0024-llvm-Do-not-use-find_library-for-ncurses.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 5d9680264c351bc98b1ae385f129deef48ed12a1 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 39b9120f00ad..8ac28303b8ad 100644 ---- a/compiler-rt/cmake/config-ix.cmake -+++ b/compiler-rt/cmake/config-ix.cmake -@@ -141,7 +141,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 dd0aaadb47c7..66a50cf01230 100644 ---- a/llvm/cmake/config-ix.cmake -+++ b/llvm/cmake/config-ix.cmake -@@ -176,7 +176,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/0025-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch b/recipes-devtools/clang/clang/0025-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch new file mode 100644 index 0000000..56c97b6 --- /dev/null +++ b/recipes-devtools/clang/clang/0025-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch @@ -0,0 +1,27 @@ +From a92c1148c71e0152d6b2027bf59c8eb46ecee800 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 19 May 2021 17:56:03 -0700 +Subject: [PATCH] clang: Fix x86 triple for non-debian multiarch linux distros + +OpenEmbedded does not hardcode mutli-arch like debian therefore ensure +that it still uses the proper tuple + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Linux.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index bf73b1ef27db..eb92a037c930 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -636,6 +636,9 @@ void Linux::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, + GCCInstallation.getTriple().getArch() == llvm::Triple::x86 + ? "i386-linux-gnu" + : TripleStr; ++ // OpenEmbedded does not hardcode the triple to i386-linux-gnu like debian ++ if (GCCInstallation.getTriple().getVendor() == llvm::Triple::OpenEmbedded) ++ DebianMultiarch = TripleStr; + + // Try generic GCC detection first. + if (Generic_GCC::addGCCLibStdCxxIncludePaths(DriverArgs, CC1Args, diff --git a/recipes-devtools/clang/clang/0025-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch b/recipes-devtools/clang/clang/0025-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch deleted file mode 100644 index baf4f1f..0000000 --- a/recipes-devtools/clang/clang/0025-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 5fd5e653e9662971e62c03353cc7981ab387d5c7 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 11 Feb 2021 16:42:49 -0800 -Subject: [PATCH] llvm: Insert anchor for adding OE distro vendor names - -This helps in making right detection for OE built gcc toolchains - -The //CLANG_EXTRA_OE_VENDORS_CASES string is replaced with list of -additional Ceses based on CLANG_EXTRA_OE_VENDORS variable in -recipes-devtools/clang/llvm-project-source.inc:add_more_target_vendors() - -Upstream-Status: Inappropriate [OE-specific] - -Signed-off-by: Khem Raj -Signed-off-by: Martin Jansa ---- - llvm/lib/Support/Triple.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp -index 88311546354b..8b2745deae88 100644 ---- a/llvm/lib/Support/Triple.cpp -+++ b/llvm/lib/Support/Triple.cpp -@@ -496,7 +496,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) { - .Case("amd", Triple::AMD) - .Case("mesa", Triple::Mesa) - .Case("suse", Triple::SUSE) -- .Case("oe", Triple::OpenEmbedded) -+ .Case("oe", Triple::OpenEmbedded)//CLANG_EXTRA_OE_VENDORS_CASES - .Default(Triple::UnknownVendor); - } - diff --git a/recipes-devtools/clang/clang/0026-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch b/recipes-devtools/clang/clang/0026-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch new file mode 100644 index 0000000..da038e2 --- /dev/null +++ b/recipes-devtools/clang/clang/0026-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch @@ -0,0 +1,28 @@ +From 1caf16b9a0a6d195bc66da996d6bcd3f66eeff07 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 19 May 2021 21:49:18 -0700 +Subject: [PATCH] compiler-rt: Link scudo with SANITIZER_CXX_ABI_LIBRARIES + +If SANITIZER_CXX_ABI_LIBRARIES is set then link scudo with it, this +fixes build time errors like + +projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.armhf.dir/sanitizer_posix_libcdep.cpp.o: in function `__sanitizer::UnsetAlternateSignalStack()': +| sanitizer_posix_libcdep.cpp:(.text+0x3d2): undefined reference to `__cxa_guard_acquire' + +Signed-off-by: Khem Raj +--- + compiler-rt/lib/scudo/CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/compiler-rt/lib/scudo/CMakeLists.txt b/compiler-rt/lib/scudo/CMakeLists.txt +index 995e853e2a4d..25b79a8d17e8 100644 +--- a/compiler-rt/lib/scudo/CMakeLists.txt ++++ b/compiler-rt/lib/scudo/CMakeLists.txt +@@ -15,6 +15,7 @@ append_list_if(COMPILER_RT_HAS_LIBDL dl SCUDO_MINIMAL_DYNAMIC_LIBS) + append_list_if(COMPILER_RT_HAS_LIBRT rt SCUDO_MINIMAL_DYNAMIC_LIBS) + append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread SCUDO_MINIMAL_DYNAMIC_LIBS) + append_list_if(COMPILER_RT_HAS_LIBLOG log SCUDO_MINIMAL_DYNAMIC_LIBS) ++append_list_if(SANITIZER_CXX_ABI_LIBRARIES ${SANITIZER_CXX_ABI_LIBRARIES} SCUDO_MINIMAL_DYNAMIC_LIBS) + append_list_if(COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG -fno-omit-frame-pointer + SCUDO_CFLAGS) + diff --git a/recipes-devtools/clang/clang/0026-compiler-rt-Use-mcr-based-barrier-on-armv6.patch b/recipes-devtools/clang/clang/0026-compiler-rt-Use-mcr-based-barrier-on-armv6.patch deleted file mode 100644 index cb5397c..0000000 --- a/recipes-devtools/clang/clang/0026-compiler-rt-Use-mcr-based-barrier-on-armv6.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 9053e875d68b32c56398a1e07c06cc8575ef6533 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 24 Mar 2021 00:32:09 -0700 -Subject: [PATCH] compiler-rt: Use mcr based barrier on armv6 - -dsb is an armv7 instruction and wont work when we are building for armv6. - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - compiler-rt/lib/builtins/arm/sync-ops.h | 8 ++++---- - compiler-rt/lib/builtins/assembly.h | 8 ++++++++ - 2 files changed, 12 insertions(+), 4 deletions(-) - -diff --git a/compiler-rt/lib/builtins/arm/sync-ops.h b/compiler-rt/lib/builtins/arm/sync-ops.h -index c9623249e5d2..7a26170741ad 100644 ---- a/compiler-rt/lib/builtins/arm/sync-ops.h -+++ b/compiler-rt/lib/builtins/arm/sync-ops.h -@@ -19,14 +19,14 @@ - .thumb; \ - .syntax unified; \ - DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ -- dmb; \ -+ DMB; \ - mov r12, r0; \ - LOCAL_LABEL(tryatomic_##op) : ldrex r0, [r12]; \ - op(r2, r0, r1); \ - strex r3, r2, [r12]; \ - cmp r3, #0; \ - bne LOCAL_LABEL(tryatomic_##op); \ -- dmb; \ -+ DMB; \ - bx lr - - #define SYNC_OP_8(op) \ -@@ -35,14 +35,14 @@ - .syntax unified; \ - DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ - push {r4, r5, r6, lr}; \ -- dmb; \ -+ DMB; \ - mov r12, r0; \ - LOCAL_LABEL(tryatomic_##op) : ldrexd r0, r1, [r12]; \ - op(r4, r5, r0, r1, r2, r3); \ - strexd r6, r4, r5, [r12]; \ - cmp r6, #0; \ - bne LOCAL_LABEL(tryatomic_##op); \ -- dmb; \ -+ DMB; \ - pop { r4, r5, r6, pc } - - #define MINMAX_4(rD, rN, rM, cmp_kind) \ -diff --git a/compiler-rt/lib/builtins/assembly.h b/compiler-rt/lib/builtins/assembly.h -index 9c015059af5a..aec4ff59beb7 100644 ---- a/compiler-rt/lib/builtins/assembly.h -+++ b/compiler-rt/lib/builtins/assembly.h -@@ -183,6 +183,14 @@ - JMP(ip) - #endif - -+#if __ARM_ARCH >= 7 -+#define DMB dmb -+#elif __ARM_ARCH >= 6 -+#define DMB mcr p15, #0, r0, c7, c10, #5 -+#else -+#error Only use this with ARMv6+ -+#endif -+ - #if defined(USE_THUMB_2) - #define WIDE(op) op.w - #else diff --git a/recipes-devtools/clang/clang/0027-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch b/recipes-devtools/clang/clang/0027-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch deleted file mode 100644 index af3a940..0000000 --- a/recipes-devtools/clang/clang/0027-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch +++ /dev/null @@ -1,28 +0,0 @@ -From e636f163882891bc71e45f6cf4051e9909fe624c Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 15 Apr 2021 18:58:07 -0700 -Subject: [PATCH] clang: Switch defaults to dwarf-5 debug info on Linux - -GCC 11 has defaulted to DWARF-5 as well, this matches -debug info formats, so mix and match of components with GCC 11 -works. - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Linux.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/clang/lib/Driver/ToolChains/Linux.h b/clang/lib/Driver/ToolChains/Linux.h -index b3544a0c7681..ae421580a017 100644 ---- a/clang/lib/Driver/ToolChains/Linux.h -+++ b/clang/lib/Driver/ToolChains/Linux.h -@@ -65,6 +65,8 @@ public: - const llvm::opt::ArgList &DriverArgs, const JobAction &JA, - const llvm::fltSemantics *FPType = nullptr) const override; - -+ unsigned GetDefaultDwarfVersion() const override { return 5; } -+ - protected: - Tool *buildAssembler() const override; - Tool *buildLinker() const override; diff --git a/recipes-devtools/clang/clang/0027-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch b/recipes-devtools/clang/clang/0027-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch new file mode 100644 index 0000000..4585eed --- /dev/null +++ b/recipes-devtools/clang/clang/0027-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch @@ -0,0 +1,29 @@ +From 8653885e3f7f0a90fe49b8d0bfbffc011ff44407 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 21 May 2021 08:14:29 -0700 +Subject: [PATCH] compiler-rt: Link scudo standalone with libatomic on mips + +clang on mips generate atomic built-ins which should be provided by +libatomic + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + compiler-rt/lib/scudo/standalone/CMakeLists.txt | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/compiler-rt/lib/scudo/standalone/CMakeLists.txt b/compiler-rt/lib/scudo/standalone/CMakeLists.txt +index 739f131bdefd..5862545b842b 100644 +--- a/compiler-rt/lib/scudo/standalone/CMakeLists.txt ++++ b/compiler-rt/lib/scudo/standalone/CMakeLists.txt +@@ -137,6 +137,10 @@ append_list_if(COMPILER_RT_HAS_LIBPTHREAD -pthread SCUDO_LINK_FLAGS) + + append_list_if(FUCHSIA zircon SCUDO_LINK_LIBS) + ++if (CMAKE_SYSTEM_PROCESSOR MATCHES "mips" AND CMAKE_SYSTEM_NAME MATCHES "Linux") ++ list(APPEND SCUDO_LINK_LIBS atomic) ++endif() ++ + if(COMPILER_RT_HAS_SCUDO_STANDALONE) + add_compiler_rt_object_libraries(RTScudoStandalone + ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH} diff --git a/recipes-devtools/clang/clang/0028-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch b/recipes-devtools/clang/clang/0028-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch deleted file mode 100644 index 731df51..0000000 --- a/recipes-devtools/clang/clang/0028-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch +++ /dev/null @@ -1,68 +0,0 @@ -From a1bd4222dea53463bd2c15c6a98842be715a7b8f Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 19 May 2021 17:32:13 -0700 -Subject: [PATCH] compiler-rt: Do not use backtrace APIs on non-glibc linux - -musl e.g. does not provide backtrace APIs - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - .../lib/gwp_asan/optional/backtrace_linux_libc.cpp | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) - -diff --git a/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp b/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp -index ea8e72be287d..0344074dd254 100644 ---- a/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp -+++ b/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp -@@ -7,7 +7,9 @@ - //===----------------------------------------------------------------------===// - - #include -+#ifdef __GLIBC__ - #include -+#endif - #include - #include - #include -@@ -21,8 +23,11 @@ - namespace { - size_t Backtrace(uintptr_t *TraceBuffer, size_t Size) { - static_assert(sizeof(uintptr_t) == sizeof(void *), "uintptr_t is not void*"); -- -+#ifdef __GLIBC__ - return backtrace(reinterpret_cast(TraceBuffer), Size); -+#else -+ return -1; -+#endif - } - - // We don't need any custom handling for the Segv backtrace - the libc unwinder -@@ -30,7 +35,11 @@ size_t Backtrace(uintptr_t *TraceBuffer, size_t Size) { - // to avoid the additional frame. - GWP_ASAN_ALWAYS_INLINE size_t SegvBacktrace(uintptr_t *TraceBuffer, size_t Size, - void * /*Context*/) { -+#ifdef __GLIBC__ - return Backtrace(TraceBuffer, Size); -+#else -+ return -1; -+#endif - } - - static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, -@@ -40,6 +49,7 @@ static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, - return; - } - -+#ifdef __GLIBC__ - char **BacktraceSymbols = - backtrace_symbols(reinterpret_cast(Trace), TraceLength); - -@@ -53,6 +63,7 @@ static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, - Printf("\n"); - if (BacktraceSymbols) - free(BacktraceSymbols); -+#endif - } - } // anonymous namespace - diff --git a/recipes-devtools/clang/clang/0028-libunwind-Added-unw_backtrace-method.patch b/recipes-devtools/clang/clang/0028-libunwind-Added-unw_backtrace-method.patch new file mode 100644 index 0000000..f4a7c09 --- /dev/null +++ b/recipes-devtools/clang/clang/0028-libunwind-Added-unw_backtrace-method.patch @@ -0,0 +1,55 @@ +From 2ee8622a6471cfd38878e8f83f72338c275cee8b Mon Sep 17 00:00:00 2001 +From: Maksim Kita +Date: Sun, 23 May 2021 10:27:29 +0000 +Subject: [PATCH] libunwind: Added unw_backtrace method + +Source: https://github.com/ClickHouse-Extras/libunwind/commit/52f0f7861926cbfaef7e6c97d8a6d7ba2a1f6747#diff-a82fc885e2e4facf4b92d26171c13aa4aa5db296f77e1158ba2f8664e3bd1f5c +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + libunwind/include/libunwind.h | 1 + + libunwind/src/libunwind.cpp | 18 ++++++++++++++++++ + 2 files changed, 19 insertions(+) + +diff --git a/libunwind/include/libunwind.h b/libunwind/include/libunwind.h +index 9a74faa48d6f..f7480c9cf27a 100644 +--- a/libunwind/include/libunwind.h ++++ b/libunwind/include/libunwind.h +@@ -127,6 +127,7 @@ extern int unw_is_fpreg(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL; + extern int unw_is_signal_frame(unw_cursor_t *) LIBUNWIND_AVAIL; + extern int unw_get_proc_name(unw_cursor_t *, char *, size_t, unw_word_t *) LIBUNWIND_AVAIL; + //extern int unw_get_save_loc(unw_cursor_t*, int, unw_save_loc_t*); ++extern int unw_backtrace(void **, int) LIBUNWIND_AVAIL; + + extern unw_addr_space_t unw_local_addr_space; + +diff --git a/libunwind/src/libunwind.cpp b/libunwind/src/libunwind.cpp +index 03f8b75b5bba..730e2393a8f8 100644 +--- a/libunwind/src/libunwind.cpp ++++ b/libunwind/src/libunwind.cpp +@@ -326,7 +326,25 @@ void __unw_remove_dynamic_eh_frame_section(unw_word_t eh_frame_start) { + #endif // defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) + #endif // !defined(__USING_SJLJ_EXCEPTIONS__) + ++int unw_backtrace(void **buffer, int size) { ++ unw_context_t context; ++ unw_cursor_t cursor; ++ if (unw_getcontext(&context) || unw_init_local(&cursor, &context)) { ++ return 0; ++ } ++ ++ unw_word_t ip; ++ int current = 0; ++ while (unw_step(&cursor) > 0) { ++ if (current >= size || unw_get_reg(&cursor, UNW_REG_IP, &ip)) { ++ break; ++ } + ++ buffer[current++] = reinterpret_cast(static_cast(ip)); ++ } ++ ++ return current; ++} + + // Add logging hooks in Debug builds only + #ifndef NDEBUG diff --git a/recipes-devtools/clang/clang/0029-Do-not-force-thumb-mode-directive.patch b/recipes-devtools/clang/clang/0029-Do-not-force-thumb-mode-directive.patch new file mode 100644 index 0000000..f22fd5c --- /dev/null +++ b/recipes-devtools/clang/clang/0029-Do-not-force-thumb-mode-directive.patch @@ -0,0 +1,46 @@ +From 026dc43875ab8c0c3a28ae4650c5685cd530bb37 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 12 Jun 2021 08:42:36 -0700 +Subject: [PATCH] Do not force thumb mode directive + +.thumb_func was not switching mode until [1] +so it did not show up but now that .thumb_func (without argument) is +switching mode, its causing build failures on armv6 ( rpi0 ) even when +build is explicitly asking for this file to be built with -marm (ARM +mode), therefore use DEFINE_COMPILERRT_FUNCTION macro to add function +header which considers arch and mode from compiler cmdline to decide if +the function is built using thumb mode or arm mode. + +[1] https://reviews.llvm.org/D101975 + +Signed-off-by: Khem Raj +--- + compiler-rt/lib/builtins/arm/sync-ops.h | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/compiler-rt/lib/builtins/arm/sync-ops.h b/compiler-rt/lib/builtins/arm/sync-ops.h +index 7a26170741ad..d914f9d3a109 100644 +--- a/compiler-rt/lib/builtins/arm/sync-ops.h ++++ b/compiler-rt/lib/builtins/arm/sync-ops.h +@@ -16,9 +16,8 @@ + + #define SYNC_OP_4(op) \ + .p2align 2; \ +- .thumb; \ + .syntax unified; \ +- DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ ++ DEFINE_COMPILERRT_FUNCTION(__sync_fetch_and_##op) \ + DMB; \ + mov r12, r0; \ + LOCAL_LABEL(tryatomic_##op) : ldrex r0, [r12]; \ +@@ -31,9 +30,8 @@ + + #define SYNC_OP_8(op) \ + .p2align 2; \ +- .thumb; \ + .syntax unified; \ +- DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ ++ DEFINE_COMPILERRT_FUNCTION(__sync_fetch_and_##op) \ + push {r4, r5, r6, lr}; \ + DMB; \ + mov r12, r0; \ diff --git a/recipes-devtools/clang/clang/0029-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch b/recipes-devtools/clang/clang/0029-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch deleted file mode 100644 index d58ea76..0000000 --- a/recipes-devtools/clang/clang/0029-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 24ace165961972b9c228cd580eb5cacfde006c4c Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 19 May 2021 17:56:03 -0700 -Subject: [PATCH] clang: Fix x86 triple for non-debian multiarch linux distros - -OpenEmbedded does not hardcode mutli-arch like debian therefore ensure -that it still uses the proper tuple - -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Linux.cpp | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 4b39c2bdf14d..46c83b002e6c 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -619,6 +619,9 @@ void Linux::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, - GCCInstallation.getTriple().getArch() == llvm::Triple::x86 - ? "i386-linux-gnu" - : TripleStr; -+ // OpenEmbedded does not hardcode the triple to i386-linux-gnu like debian -+ if (GCCInstallation.getTriple().getVendor() == llvm::Triple::OpenEmbedded) -+ DebianMultiarch = TripleStr; - - // Try generic GCC detection first. - if (Generic_GCC::addGCCLibStdCxxIncludePaths(DriverArgs, CC1Args, diff --git a/recipes-devtools/clang/clang/0030-clang-Do-not-use-install-relative-libc-headers.patch b/recipes-devtools/clang/clang/0030-clang-Do-not-use-install-relative-libc-headers.patch new file mode 100644 index 0000000..6f17144 --- /dev/null +++ b/recipes-devtools/clang/clang/0030-clang-Do-not-use-install-relative-libc-headers.patch @@ -0,0 +1,32 @@ +From d60663adf9941780ed5365a5a919cbcd8946ff74 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 11 Aug 2021 18:37:11 -0700 +Subject: [PATCH] clang: Do not use install relative libc++ headers + +In OE we use same clang for native and cross builds, therefore we need +to ensure that native sysroot install of libc++ is not searched for +headers when doing cross compile instead it searches the target sysroot +this is especially troublesome when libcxx-native is staged along with +libcxx e.g. chromium + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 6fcd5abe7211..0d04a199a7af 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2919,7 +2919,9 @@ Generic_GCC::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, + + // Android never uses the libc++ headers installed alongside the toolchain, + // which are generally incompatible with the NDK libraries anyway. +- if (!getTriple().isAndroid()) ++ // And also do not add it when --sysroot is specified, since it would expect ++ // libc++ headers from sysroot ++ if (!getTriple().isAndroid() && SysRoot.empty()) + if (AddIncludePath(getDriver().Dir + "/../include")) + return; + // If this is a development, non-installed, clang, libcxx will diff --git a/recipes-devtools/clang/clang/0030-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch b/recipes-devtools/clang/clang/0030-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch deleted file mode 100644 index 8c0eaa4..0000000 --- a/recipes-devtools/clang/clang/0030-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch +++ /dev/null @@ -1,28 +0,0 @@ -From adbadcc16f0dc7c323644bfc2f0e5752644f9e4c Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 19 May 2021 21:49:18 -0700 -Subject: [PATCH] compiler-rt: Link scudo with SANITIZER_CXX_ABI_LIBRARIES - -If SANITIZER_CXX_ABI_LIBRARIES is set then link scudo with it, this -fixes build time errors like - -projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.armhf.dir/sanitizer_posix_libcdep.cpp.o: in function `__sanitizer::UnsetAlternateSignalStack()': -| sanitizer_posix_libcdep.cpp:(.text+0x3d2): undefined reference to `__cxa_guard_acquire' - -Signed-off-by: Khem Raj ---- - compiler-rt/lib/scudo/CMakeLists.txt | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/compiler-rt/lib/scudo/CMakeLists.txt b/compiler-rt/lib/scudo/CMakeLists.txt -index e580d6d1408b..c14d7636e291 100644 ---- a/compiler-rt/lib/scudo/CMakeLists.txt -+++ b/compiler-rt/lib/scudo/CMakeLists.txt -@@ -12,6 +12,7 @@ append_list_if(COMPILER_RT_HAS_LIBDL dl SCUDO_MINIMAL_DYNAMIC_LIBS) - append_list_if(COMPILER_RT_HAS_LIBRT rt SCUDO_MINIMAL_DYNAMIC_LIBS) - append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread SCUDO_MINIMAL_DYNAMIC_LIBS) - append_list_if(COMPILER_RT_HAS_LIBLOG log SCUDO_MINIMAL_DYNAMIC_LIBS) -+append_list_if(SANITIZER_CXX_ABI_LIBRARIES ${SANITIZER_CXX_ABI_LIBRARIES} SCUDO_MINIMAL_DYNAMIC_LIBS) - append_list_if(COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG -fno-omit-frame-pointer - SCUDO_CFLAGS) - diff --git a/recipes-devtools/clang/clang/0031-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch b/recipes-devtools/clang/clang/0031-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch new file mode 100644 index 0000000..8bc5dee --- /dev/null +++ b/recipes-devtools/clang/clang/0031-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch @@ -0,0 +1,97 @@ +From 9b9306ec9e11864631d64d8717763eaec4e25e8f Mon Sep 17 00:00:00 2001 +From: David Abdurachmanov +Date: Wed, 20 Oct 2021 17:30:36 -0700 +Subject: [PATCH] clang: Fix how driver finds GCC installation path on + OpenEmbedded + +Fix how Clang Driver finds GCC installation path on OpenEmbedded + +- For RISCV (riscv{32,64}) we define new two multi-lib options without any + subdirectories (e.g., lib32/ilp32d or lib64/lp64d). OpenEmbedded GCC + builds don't use them. +- Modify how Clang Driver finds GCC installation path. This is important + because GCC files on OpenEmbedded are in two different directories: + (1) /usr/bin/../lib/gcc/riscv64-oe-linux/9.2.0 + (2) /usr/lib/riscv64-oe-linux/9.2.0 + +Clang Driver will check (1) first. The directory exist, but will produce +no valid multi-libs and there will be no multi-lib selected. (2) contains +actual GCC run-time objects/libraries, but because the path has exact +same GCC version (9.2.0) it will be skipped. + +We modify the approach by allowing to check other directories with the same +GCC version. We also avoid picking GCC installation path if it results in +an empty multi-lib list. + +Upstream-Status: Pending +Signed-off-by: David Abdurachmanov +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 39 +++++++++++++++++++++-------- + 1 file changed, 28 insertions(+), 11 deletions(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 0d04a199a7af..1e5a3cc2c1f1 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -1641,18 +1641,29 @@ static void findRISCVMultilibs(const Driver &D, + return findRISCVBareMetalMultilibs(D, TargetTriple, Path, Args, Result); + + FilterNonExistent NonExistent(Path, "/crtbegin.o", D.getVFS()); +- Multilib Ilp32 = makeMultilib("lib32/ilp32").flag("+m32").flag("+mabi=ilp32"); +- Multilib Ilp32f = ++ MultilibSet RISCVMultilibs; ++ ++ if (TargetTriple.getVendor() == llvm::Triple::OpenEmbedded) { ++ Multilib OpenEmbeddedIlp32d = makeMultilib("").flag("+m32").flag("+mabi=ilp32d"); ++ Multilib OpenEmbeddedLp64d = makeMultilib("").flag("+m64").flag("+mabi=lp64d"); ++ RISCVMultilibs = ++ MultilibSet() ++ .Either({OpenEmbeddedIlp32d, OpenEmbeddedLp64d}) ++ .FilterOut(NonExistent); ++ } else { ++ Multilib Ilp32 = makeMultilib("lib32/ilp32").flag("+m32").flag("+mabi=ilp32"); ++ Multilib Ilp32f = + makeMultilib("lib32/ilp32f").flag("+m32").flag("+mabi=ilp32f"); +- Multilib Ilp32d = ++ Multilib Ilp32d = + makeMultilib("lib32/ilp32d").flag("+m32").flag("+mabi=ilp32d"); +- Multilib Lp64 = makeMultilib("lib64/lp64").flag("+m64").flag("+mabi=lp64"); +- Multilib Lp64f = makeMultilib("lib64/lp64f").flag("+m64").flag("+mabi=lp64f"); +- Multilib Lp64d = makeMultilib("lib64/lp64d").flag("+m64").flag("+mabi=lp64d"); +- MultilibSet RISCVMultilibs = +- MultilibSet() +- .Either({Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d}) +- .FilterOut(NonExistent); ++ Multilib Lp64 = makeMultilib("lib64/lp64").flag("+m64").flag("+mabi=lp64"); ++ Multilib Lp64f = makeMultilib("lib64/lp64f").flag("+m64").flag("+mabi=lp64f"); ++ Multilib Lp64d = makeMultilib("lib64/lp64d").flag("+m64").flag("+mabi=lp64d"); ++ RISCVMultilibs = ++ MultilibSet() ++ .Either({Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d}) ++ .FilterOut(NonExistent); ++ } + + Multilib::flags_list Flags; + bool IsRV64 = TargetTriple.getArch() == llvm::Triple::riscv64; +@@ -2549,13 +2560,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + continue; // Saw this path before; no need to look at it again. + if (CandidateVersion.isOlderThan(4, 1, 1)) + continue; +- if (CandidateVersion <= Version) ++ if (CandidateVersion < Version) + continue; + + if (!ScanGCCForMultilibs(TargetTriple, Args, LI->path(), + NeedsBiarchSuffix)) + continue; + ++ // We might have found existing directory with GCCVersion, but it ++ // might not have GCC libraries we are looking for (i.e. return an ++ // empty Mulilibs) ++ if (Multilibs.size() == 0) ++ continue; ++ + Version = CandidateVersion; + GCCTriple.setTriple(CandidateTriple); + // FIXME: We hack together the directory name here instead of diff --git a/recipes-devtools/clang/clang/0031-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch b/recipes-devtools/clang/clang/0031-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch deleted file mode 100644 index 94f9272..0000000 --- a/recipes-devtools/clang/clang/0031-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 019c9ff3e7ae0d5710618d1562995359805f9aea Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Fri, 21 May 2021 08:14:29 -0700 -Subject: [PATCH] compiler-rt: Link scudo standalone with libatomic on mips - -clang on mips generate atomic built-ins which should be provided by -libatomic - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - compiler-rt/lib/scudo/standalone/CMakeLists.txt | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/compiler-rt/lib/scudo/standalone/CMakeLists.txt b/compiler-rt/lib/scudo/standalone/CMakeLists.txt -index d6ffa448d7e0..22caf11f6223 100644 ---- a/compiler-rt/lib/scudo/standalone/CMakeLists.txt -+++ b/compiler-rt/lib/scudo/standalone/CMakeLists.txt -@@ -137,6 +137,10 @@ append_list_if(COMPILER_RT_HAS_LIBPTHREAD -pthread SCUDO_LINK_FLAGS) - - append_list_if(FUCHSIA zircon SCUDO_LINK_LIBS) - -+if (CMAKE_SYSTEM_PROCESSOR MATCHES "mips" AND CMAKE_SYSTEM_NAME MATCHES "Linux") -+ list(APPEND SCUDO_LINK_LIBS atomic) -+endif() -+ - if(COMPILER_RT_HAS_SCUDO_STANDALONE) - add_compiler_rt_object_libraries(RTScudoStandalone - ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH} diff --git a/recipes-devtools/clang/clang/0032-Fix-lib-paths-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0032-Fix-lib-paths-for-OpenEmbedded-Host.patch new file mode 100644 index 0000000..1668dd5 --- /dev/null +++ b/recipes-devtools/clang/clang/0032-Fix-lib-paths-for-OpenEmbedded-Host.patch @@ -0,0 +1,79 @@ +From 6c066a1d1930ddaa95b0530c678bac71f47378b5 Mon Sep 17 00:00:00 2001 +From: Changqing Li +Date: Tue, 7 Dec 2021 04:08:22 +0000 +Subject: [PATCH] Fix lib paths for OpenEmbedded Host + +Under OpenEmbedded Host, while building with clang-native, it cannot find +the GCCInstallPath, which causing following error: +[snip] +compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang +-target x86_64-linux +-isystem/path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/include +-O2 -pipe +/path/to/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/share/cmake-3.21/Modules/CMakeCCompilerABI.c` +hosttools/ld: cannot find crtbeginS.o: No such file or directory +[snip] + +Before this patch: +compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang +clang version 13.0.1 (https://github.com/llvm/llvm-project 08e3a5ccd952edee36b3c002e3a29c6b1b5153de) +Target: x86_64-unknown-linux-gnu +Thread model: posix +InstalledDir: /build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin +Found candidate GCC installation: /usr/lib/gcc/x86_64-wrs-linux/10.2.0 + +After this patch: +compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang +clang version 13.0.1 (https://github.com/llvm/llvm-project 08e3a5ccd952edee36b3c002e3a29c6b1b5153de) +Thread model: posix +InstalledDir: /build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin +Found candidate GCC installation: /usr/lib/gcc/x86_64-wrs-linux/10.2.0 +Found candidate GCC installation: /usr/lib/x86_64-wrs-linux/10.2.0 +Selected GCC installation: /usr/lib/x86_64-wrs-linux/10.2.0 +Candidate multilib: .;@m64 +Selected multilib: .;@m64 + +Summary: +For OpenEmbedded Host, sysroots are of the form/usr/lib//x.y.z. +Take x86-64 as example, the default triple is x86_64-unknown-linux-gnu. +For clang-native, the target vendor is '-unknown', need to test current distro +to follow above form. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Changqing Li +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 1e5a3cc2c1f1..d3574b86cb26 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -22,6 +22,7 @@ + #include "clang/Driver/Options.h" + #include "clang/Driver/Tool.h" + #include "clang/Driver/ToolChain.h" ++#include "clang/Driver/Distro.h" + #include "llvm/Option/ArgList.h" + #include "llvm/Support/CodeGen.h" + #include "llvm/Support/Path.h" +@@ -2518,6 +2519,7 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + const llvm::Triple &TargetTriple, const ArgList &Args, + const std::string &LibDir, StringRef CandidateTriple, + bool NeedsBiarchSuffix, bool GCCDirExists, bool GCCCrossDirExists) { ++ Distro Distro(D.getVFS(), TargetTriple); + // Locations relative to the system lib directory where GCC's triple-specific + // directories might reside. + struct GCCLibSuffix { +@@ -2535,7 +2537,8 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + // files in that location, not just GCC installation data. + {CandidateTriple.str(), "..", + TargetTriple.getVendor() == llvm::Triple::Freescale || +- TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}, ++ TargetTriple.getVendor() == llvm::Triple::OpenEmbedded || ++ Distro.IsOpenEmbedded()}, + + // This is the normal place. + {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists}, diff --git a/recipes-devtools/clang/clang/0032-libunwind-Added-unw_backtrace-method.patch b/recipes-devtools/clang/clang/0032-libunwind-Added-unw_backtrace-method.patch deleted file mode 100644 index 5a99074..0000000 --- a/recipes-devtools/clang/clang/0032-libunwind-Added-unw_backtrace-method.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 014e2f701a92e9cd82a1f1dbccb0037057825ac4 Mon Sep 17 00:00:00 2001 -From: Maksim Kita -Date: Sun, 23 May 2021 10:27:29 +0000 -Subject: [PATCH] libunwind: Added unw_backtrace method - -Source: https://github.com/ClickHouse-Extras/libunwind/commit/52f0f7861926cbfaef7e6c97d8a6d7ba2a1f6747#diff-a82fc885e2e4facf4b92d26171c13aa4aa5db296f77e1158ba2f8664e3bd1f5c -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - libunwind/include/libunwind.h | 1 + - libunwind/src/libunwind.cpp | 18 ++++++++++++++++++ - 2 files changed, 19 insertions(+) - -diff --git a/libunwind/include/libunwind.h b/libunwind/include/libunwind.h -index 0feecd7bd6fc..670cfa3ed71d 100644 ---- a/libunwind/include/libunwind.h -+++ b/libunwind/include/libunwind.h -@@ -127,6 +127,7 @@ extern int unw_is_fpreg(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL; - extern int unw_is_signal_frame(unw_cursor_t *) LIBUNWIND_AVAIL; - extern int unw_get_proc_name(unw_cursor_t *, char *, size_t, unw_word_t *) LIBUNWIND_AVAIL; - //extern int unw_get_save_loc(unw_cursor_t*, int, unw_save_loc_t*); -+extern int unw_backtrace(void **, int) LIBUNWIND_AVAIL; - - extern unw_addr_space_t unw_local_addr_space; - -diff --git a/libunwind/src/libunwind.cpp b/libunwind/src/libunwind.cpp -index 1faf000ce44a..1edbdea6a19e 100644 ---- a/libunwind/src/libunwind.cpp -+++ b/libunwind/src/libunwind.cpp -@@ -295,7 +295,25 @@ void __unw_remove_dynamic_fde(unw_word_t fde) { - #endif // defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) - #endif // !defined(__USING_SJLJ_EXCEPTIONS__) - -+int unw_backtrace(void **buffer, int size) { -+ unw_context_t context; -+ unw_cursor_t cursor; -+ if (unw_getcontext(&context) || unw_init_local(&cursor, &context)) { -+ return 0; -+ } -+ -+ unw_word_t ip; -+ int current = 0; -+ while (unw_step(&cursor) > 0) { -+ if (current >= size || unw_get_reg(&cursor, UNW_REG_IP, &ip)) { -+ break; -+ } - -+ buffer[current++] = reinterpret_cast(static_cast(ip)); -+ } -+ -+ return current; -+} - - // Add logging hooks in Debug builds only - #ifndef NDEBUG diff --git a/recipes-devtools/clang/clang/0033-Correct-library-search-path-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0033-Correct-library-search-path-for-OpenEmbedded-Host.patch new file mode 100644 index 0000000..4c365dd --- /dev/null +++ b/recipes-devtools/clang/clang/0033-Correct-library-search-path-for-OpenEmbedded-Host.patch @@ -0,0 +1,84 @@ +From 504d643d31a52421c6dc03f617c17e287a1c4ff0 Mon Sep 17 00:00:00 2001 +From: Changqing Li +Date: Tue, 7 Dec 2021 04:55:48 +0000 +Subject: [PATCH] Correct library search path for OpenEmbedded Host + +For OpenEmbedded Host, the gcc install path is +/usr/lib/x86_64-[distroname]-linux/[gcc-version]. +So the library search path is not found with default triple +'x86_64-linux-gnu' for x86_64. Causing following error: +[snip] +compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang +-target x86_64-linux +-isystem/path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/include +-O2 -pipe +/path/to/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/share/cmake-3.21/Modules/CMakeCCompilerABI.c` +| /build/tmp-glibc/hosttools/ld: cannot find -lgcc +| /build/tmp-glibc/hosttools/ld: cannot find -lgcc +| clang-13: error: linker command failed with exit code 1 (use -v to see invocation) +[snip] + +before this patch: +b59da142f2b0:$ /path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --print-search-dirs +programs: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin +libraries: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/lib/clang/13.0.1:/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/../lib://lib://usr/lib + +after this patch: +b59da142f2b0:$ /path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --print-search-dirs +programs: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin +libraries: =/build/tmp-glibc/work/x84_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/lib/clang/13.0.1:/usr/lib/x86_64-wrs-linux/10.2.0://lib/x86_64-wrs-linux://usr/lib/x86_64-wrs-linux:/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/../lib://lib://usr/lib + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Changqing Li +Signed-off-by: Khem Raj +--- + clang/include/clang/Driver/Distro.h | 2 ++ + clang/lib/Driver/Distro.cpp | 1 + + clang/lib/Driver/ToolChains/Linux.cpp | 1 + + 3 files changed, 4 insertions(+) + +diff --git a/clang/include/clang/Driver/Distro.h b/clang/include/clang/Driver/Distro.h +index 2723f75e8945..cd43e8f11574 100644 +--- a/clang/include/clang/Driver/Distro.h ++++ b/clang/include/clang/Driver/Distro.h +@@ -44,6 +44,7 @@ public: + RHEL7, + Fedora, + Gentoo, ++ //CLANG_EXTRA_OE_DISTRO_NAME + OpenSUSE, + UbuntuHardy, + UbuntuIntrepid, +@@ -132,6 +133,7 @@ public: + + bool IsGentoo() const { return DistroVal == Gentoo; } + ++ //CLANG_EXTRA_OE_DISTRO_CHECK + /// @} + }; + +diff --git a/clang/lib/Driver/Distro.cpp b/clang/lib/Driver/Distro.cpp +index 5ac38c34d112..f20dd4b526e5 100644 +--- a/clang/lib/Driver/Distro.cpp ++++ b/clang/lib/Driver/Distro.cpp +@@ -44,6 +44,7 @@ static Distro::DistroType DetectOsRelease(llvm::vfs::FileSystem &VFS) { + .Case("sles", Distro::OpenSUSE) + .Case("opensuse", Distro::OpenSUSE) + .Case("exherbo", Distro::Exherbo) ++ //CLANG_EXTRA_OE_DISTRO_CASE + .Default(Distro::UnknownDistro); + return Version; + } +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index eb92a037c930..c92cef442005 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -77,6 +77,7 @@ std::string Linux::getMultiarchTriple(const Driver &D, + return "x86_64-linux-android"; + if (TargetEnvironment == llvm::Triple::GNUX32) + return "x86_64-linux-gnux32"; ++ //CLANG_EXTRA_OE_DISTRO_TRIPLE + return "x86_64-linux-gnu"; + case llvm::Triple::aarch64: + if (IsAndroid) diff --git a/recipes-devtools/clang/clang/0033-compiler-rt-Use-uintptr_t-instead-of-_Unwind_Word.patch b/recipes-devtools/clang/clang/0033-compiler-rt-Use-uintptr_t-instead-of-_Unwind_Word.patch deleted file mode 100644 index 0651406..0000000 --- a/recipes-devtools/clang/clang/0033-compiler-rt-Use-uintptr_t-instead-of-_Unwind_Word.patch +++ /dev/null @@ -1,35 +0,0 @@ -From ad072b670c36eb51cfc20daa53cfe7ba4cd19e25 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 29 May 2021 13:42:25 -0700 -Subject: [PATCH] compiler-rt: Use uintptr_t instead of _Unwind_Word - -_Unwind_Word is defined in compiler specific unwind.h but not in -libunwind provided unwind.h header, it works in most cases because -compilers search compiler headers ahead of system headers but for some -systems e.g. musl bases systems the compiler provided versions are not -preferred over system headers and therefore relying on _Unwind_Word -means its expecting this define in all unwind.h headers which is not the -case, using uintptr_t means we don't need this from unwind.h - -See https://reviews.llvm.org/D65699 - -Signed-off-by: Khem Raj ---- - compiler-rt/lib/hwasan/hwasan_exceptions.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/compiler-rt/lib/hwasan/hwasan_exceptions.cpp b/compiler-rt/lib/hwasan/hwasan_exceptions.cpp -index 169e7876cb58..6ed1da335428 100644 ---- a/compiler-rt/lib/hwasan/hwasan_exceptions.cpp -+++ b/compiler-rt/lib/hwasan/hwasan_exceptions.cpp -@@ -29,8 +29,8 @@ typedef _Unwind_Reason_Code PersonalityFn(int version, _Unwind_Action actions, - // is statically linked and the sanitizer runtime and the program are linked - // against different unwinders. The _Unwind_Context data structure is opaque so - // it may be incompatible between unwinders. --typedef _Unwind_Word GetGRFn(_Unwind_Context* context, int index); --typedef _Unwind_Word GetCFAFn(_Unwind_Context* context); -+typedef uintptr_t GetGRFn(_Unwind_Context* context, int index); -+typedef uintptr_t GetCFAFn(_Unwind_Context* context); - - extern "C" SANITIZER_INTERFACE_ATTRIBUTE _Unwind_Reason_Code - __hwasan_personality_wrapper(int version, _Unwind_Action actions, diff --git a/recipes-devtools/clang/clang/0034-CMake-Installable-find-modules-for-terminfo-and-libf.patch b/recipes-devtools/clang/clang/0034-CMake-Installable-find-modules-for-terminfo-and-libf.patch deleted file mode 100644 index 68b8e44..0000000 --- a/recipes-devtools/clang/clang/0034-CMake-Installable-find-modules-for-terminfo-and-libf.patch +++ /dev/null @@ -1,321 +0,0 @@ -From 81360dd267eae6c34c4ab1000a1343b6488d84d5 Mon Sep 17 00:00:00 2001 -From: Jack Andersen -Date: Sun, 5 Dec 2021 14:45:33 -0500 -Subject: [PATCH] Installable find modules for terminfo and libffi - -Improves cross-distro portability of LLVM cmake package by resolving paths for -terminfo and libffi via import targets. - -When LLVMExports.cmake is generated for installation, it contains absolute -library paths which are likely to be a common cause of portability issues. To -mitigate this, the discovery logic for these dependencies is refactored into -find modules which get installed alongside LLVMConfig.cmake. The result is -cleaner, cmake-friendly management of these dependencies that respect the -environment of the LLVM package importer. - -Reviewed By: JDevlieghere - -Differential Revision: https://reviews.llvm.org/D114327 - ---- - llvm/cmake/config-ix.cmake | 50 +++--------- - llvm/cmake/modules/FindFFI.cmake | 81 +++++++++++++++++++ - llvm/cmake/modules/FindTerminfo.cmake | 43 ++++++++++ - llvm/cmake/modules/LLVMConfig.cmake.in | 11 +++ - .../Interpreter/CMakeLists.txt | 10 +-- - llvm/lib/Support/CMakeLists.txt | 7 +- - 6 files changed, 154 insertions(+), 48 deletions(-) - create mode 100644 llvm/cmake/modules/FindFFI.cmake - create mode 100644 llvm/cmake/modules/FindTerminfo.cmake - -diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake -index a320cf97b306..21cadf1893c6 100644 ---- a/llvm/cmake/config-ix.cmake -+++ b/llvm/cmake/config-ix.cmake -@@ -169,18 +169,13 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*") - else() - set(HAVE_LIBEDIT 0) - endif() -- if(LLVM_ENABLE_TERMINFO STREQUAL FORCE_ON) -- set(MAYBE_REQUIRED REQUIRED) -- else() -- set(MAYBE_REQUIRED) -- endif() - if(LLVM_ENABLE_TERMINFO) -- set(TERMINFO_LIB tinfo curses ncurses ncursesw) -- endif() -- if(TERMINFO_LIB) -- set(LLVM_ENABLE_TERMINFO 1) -- else() -- set(LLVM_ENABLE_TERMINFO 0) -+ if(LLVM_ENABLE_TERMINFO STREQUAL FORCE_ON) -+ find_package(Terminfo REQUIRED) -+ else() -+ find_package(Terminfo) -+ endif() -+ set(LLVM_ENABLE_TERMINFO "${Terminfo_FOUND}") - endif() - else() - set(LLVM_ENABLE_TERMINFO 0) -@@ -325,38 +320,19 @@ if (LLVM_ENABLE_DOXYGEN) - llvm_find_program(dot) - endif () - --if( LLVM_ENABLE_FFI ) -- find_path(FFI_INCLUDE_PATH ffi.h PATHS ${FFI_INCLUDE_DIR}) -- if( EXISTS "${FFI_INCLUDE_PATH}/ffi.h" ) -- set(FFI_HEADER ffi.h CACHE INTERNAL "") -- set(HAVE_FFI_H 1 CACHE INTERNAL "") -+if(LLVM_ENABLE_FFI) -+ set(FFI_REQUIRE_INCLUDE On) -+ if(LLVM_ENABLE_FFI STREQUAL FORCE_ON) -+ find_package(FFI REQUIRED) - else() -- find_path(FFI_INCLUDE_PATH ffi/ffi.h PATHS ${FFI_INCLUDE_DIR}) -- if( EXISTS "${FFI_INCLUDE_PATH}/ffi/ffi.h" ) -- set(FFI_HEADER ffi/ffi.h CACHE INTERNAL "") -- set(HAVE_FFI_FFI_H 1 CACHE INTERNAL "") -- endif() -+ find_package(FFI) - endif() -- -- if( NOT FFI_HEADER ) -- message(FATAL_ERROR "libffi includes are not found.") -- endif() -- -- find_library(FFI_LIBRARY_PATH ffi PATHS ${FFI_LIBRARY_DIR}) -- if( NOT FFI_LIBRARY_PATH ) -- message(FATAL_ERROR "libffi is not found.") -- endif() -- -- list(APPEND CMAKE_REQUIRED_LIBRARIES ${FFI_LIBRARY_PATH}) -- list(APPEND CMAKE_REQUIRED_INCLUDES ${FFI_INCLUDE_PATH}) -- check_symbol_exists(ffi_call ${FFI_HEADER} HAVE_FFI_CALL) -- list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${FFI_INCLUDE_PATH}) -- list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${FFI_LIBRARY_PATH}) -+ set(LLVM_ENABLE_FFI "${FFI_FOUND}") - else() - unset(HAVE_FFI_FFI_H CACHE) - unset(HAVE_FFI_H CACHE) - unset(HAVE_FFI_CALL CACHE) --endif( LLVM_ENABLE_FFI ) -+endif() - - check_symbol_exists(proc_pid_rusage "libproc.h" HAVE_PROC_PID_RUSAGE) - -diff --git a/llvm/cmake/modules/FindFFI.cmake b/llvm/cmake/modules/FindFFI.cmake -new file mode 100644 -index 000000000000..b0d859af8959 ---- /dev/null -+++ b/llvm/cmake/modules/FindFFI.cmake -@@ -0,0 +1,81 @@ -+# Attempts to discover ffi library with a linkable ffi_call function. -+# -+# Example usage: -+# -+# find_package(FFI) -+# -+# FFI_REQUIRE_INCLUDE may be set to consider ffi found if the includes -+# are present in addition to the library. This is useful to keep off -+# for the imported package on platforms that install the library but -+# not the headers. -+# -+# FFI_LIBRARY_DIR may be set to define search paths for the ffi library. -+# -+# If successful, the following variables will be defined: -+# FFI_FOUND -+# FFI_INCLUDE_DIRS -+# FFI_LIBRARIES -+# HAVE_FFI_CALL -+# -+# HAVE_FFI_H or HAVE_FFI_FFI_H is defined depending on the ffi.h include path. -+# -+# Additionally, the following import target will be defined: -+# FFI::ffi -+ -+find_path(FFI_INCLUDE_DIRS ffi.h PATHS ${FFI_INCLUDE_DIR}) -+if( EXISTS "${FFI_INCLUDE_DIRS}/ffi.h" ) -+ set(FFI_HEADER ffi.h CACHE INTERNAL "") -+ set(HAVE_FFI_H 1 CACHE INTERNAL "") -+else() -+ find_path(FFI_INCLUDE_DIRS ffi/ffi.h PATHS ${FFI_INCLUDE_DIR}) -+ if( EXISTS "${FFI_INCLUDE_DIRS}/ffi/ffi.h" ) -+ set(FFI_HEADER ffi/ffi.h CACHE INTERNAL "") -+ set(HAVE_FFI_FFI_H 1 CACHE INTERNAL "") -+ endif() -+endif() -+ -+find_library(FFI_LIBRARIES ffi PATHS ${FFI_LIBRARY_DIR}) -+ -+if(FFI_LIBRARIES) -+ include(CMakePushCheckState) -+ include(CheckCSourceCompiles) -+ cmake_push_check_state() -+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${FFI_LIBRARIES}) -+ check_c_source_compiles(" -+ struct ffi_cif; -+ typedef struct ffi_cif ffi_cif; -+ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue); -+ int main() { ffi_call(0, 0, 0, 0); }" -+ HAVE_FFI_CALL) -+ cmake_pop_check_state() -+endif() -+ -+unset(required_includes) -+if(FFI_REQUIRE_INCLUDE) -+ set(required_includes FFI_INCLUDE_DIRS) -+endif() -+ -+include(FindPackageHandleStandardArgs) -+find_package_handle_standard_args(FFI -+ FOUND_VAR -+ FFI_FOUND -+ REQUIRED_VARS -+ FFI_LIBRARIES -+ ${required_includes} -+ HAVE_FFI_CALL) -+mark_as_advanced(FFI_LIBRARIES -+ FFI_INCLUDE_DIRS -+ HAVE_FFI_CALL -+ FFI_HEADER -+ HAVE_FFI_H -+ HAVE_FFI_FFI_H) -+ -+if(FFI_FOUND) -+ if(NOT TARGET FFI::ffi) -+ add_library(FFI::ffi UNKNOWN IMPORTED) -+ set_target_properties(FFI::ffi PROPERTIES IMPORTED_LOCATION "${FFI_LIBRARIES}") -+ if(FFI_INCLUDE_DIRS) -+ set_target_properties(FFI::ffi PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${FFI_INCLUDE_DIRS}") -+ endif() -+ endif() -+endif() -diff --git a/llvm/cmake/modules/FindTerminfo.cmake b/llvm/cmake/modules/FindTerminfo.cmake -new file mode 100644 -index 000000000000..65edb80fa69a ---- /dev/null -+++ b/llvm/cmake/modules/FindTerminfo.cmake -@@ -0,0 +1,43 @@ -+# Attempts to discover terminfo library with a linkable setupterm function. -+# -+# Example usage: -+# -+# find_package(Terminfo) -+# -+# If successful, the following variables will be defined: -+# Terminfo_FOUND -+# Terminfo_LIBRARIES -+# -+# Additionally, the following import target will be defined: -+# Terminfo::terminfo -+ -+find_library(Terminfo_LIBRARIES NAMES terminfo tinfo curses ncurses ncursesw) -+ -+if(Terminfo_LIBRARIES) -+ include(CMakePushCheckState) -+ include(CheckCSourceCompiles) -+ cmake_push_check_state() -+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${Terminfo_LIBRARIES}) -+ check_c_source_compiles(" -+ int setupterm(char *term, int filedes, int *errret); -+ int main() { return setupterm(0, 0, 0); }" -+ Terminfo_LINKABLE) -+ cmake_pop_check_state() -+endif() -+ -+include(FindPackageHandleStandardArgs) -+find_package_handle_standard_args(Terminfo -+ FOUND_VAR -+ Terminfo_FOUND -+ REQUIRED_VARS -+ Terminfo_LIBRARIES -+ Terminfo_LINKABLE) -+mark_as_advanced(Terminfo_LIBRARIES -+ Terminfo_LINKABLE) -+ -+if(Terminfo_FOUND) -+ if(NOT TARGET Terminfo::terminfo) -+ add_library(Terminfo::terminfo UNKNOWN IMPORTED) -+ set_target_properties(Terminfo::terminfo PROPERTIES IMPORTED_LOCATION "${Terminfo_LIBRARIES}") -+ endif() -+endif() -diff --git a/llvm/cmake/modules/LLVMConfig.cmake.in b/llvm/cmake/modules/LLVMConfig.cmake.in -index a71bef19fd0c..5a2fea5be399 100644 ---- a/llvm/cmake/modules/LLVMConfig.cmake.in -+++ b/llvm/cmake/modules/LLVMConfig.cmake.in -@@ -2,6 +2,9 @@ - - @LLVM_CONFIG_CODE@ - -+# For finding self-installed Find*.cmake packages. -+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") -+ - set(LLVM_VERSION_MAJOR @LLVM_VERSION_MAJOR@) - set(LLVM_VERSION_MINOR @LLVM_VERSION_MINOR@) - set(LLVM_VERSION_PATCH @LLVM_VERSION_PATCH@) -@@ -46,9 +49,17 @@ set(LLVM_ENABLE_ASSERTIONS @LLVM_ENABLE_ASSERTIONS@) - - set(LLVM_ENABLE_EH @LLVM_ENABLE_EH@) - -+set(LLVM_ENABLE_FFI @LLVM_ENABLE_FFI@) -+if(LLVM_ENABLE_FFI) -+ find_package(FFI) -+endif() -+ - set(LLVM_ENABLE_RTTI @LLVM_ENABLE_RTTI@) - - set(LLVM_ENABLE_TERMINFO @LLVM_ENABLE_TERMINFO@) -+if(LLVM_ENABLE_TERMINFO) -+ find_package(Terminfo) -+endif() - - set(LLVM_ENABLE_THREADS @LLVM_ENABLE_THREADS@) - -diff --git a/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt b/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt -index 9930e01559e9..14522ba2a1bf 100644 ---- a/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt -+++ b/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt -@@ -1,11 +1,3 @@ --# Make sure that the path to libffi headers is on the command --# line. That path can be a compiler's non-default path even when --# FFI_INCLUDE_DIR was not used, because cmake has its own paths for --# searching for headers (CMAKE_SYSTEM_INCLUDE_PATH, for instance): --if( FFI_INCLUDE_PATH ) -- include_directories( ${FFI_INCLUDE_PATH} ) --endif() -- - add_llvm_component_library(LLVMInterpreter - Execution.cpp - ExternalFunctions.cpp -@@ -22,5 +14,5 @@ add_llvm_component_library(LLVMInterpreter - ) - - if( LLVM_ENABLE_FFI ) -- target_link_libraries( LLVMInterpreter PRIVATE ffi ) -+ target_link_libraries( LLVMInterpreter PRIVATE FFI::ffi ) - endif() -diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt -index 2242b0ec60ab..5cf80c1bb59d 100644 ---- a/llvm/lib/Support/CMakeLists.txt -+++ b/llvm/lib/Support/CMakeLists.txt -@@ -24,7 +24,7 @@ elseif( CMAKE_HOST_UNIX ) - set(system_libs ${system_libs} ${Backtrace_LIBFILE}) - endif() - if( LLVM_ENABLE_TERMINFO ) -- set(imported_libs ${imported_libs} "${TERMINFO_LIB}") -+ set(imported_libs ${imported_libs} Terminfo::terminfo) - endif() - if( LLVM_ENABLE_THREADS AND (HAVE_LIBATOMIC OR HAVE_CXX_LIBATOMICS64) ) - set(system_libs ${system_libs} atomic) -@@ -256,7 +256,10 @@ if(LLVM_ENABLE_ZLIB) - endif() - - if(LLVM_ENABLE_TERMINFO) -- get_library_name(${TERMINFO_LIB} terminfo_library) -+ if(NOT terminfo_library) -+ get_property(terminfo_library TARGET Terminfo::terminfo PROPERTY LOCATION) -+ endif() -+ get_library_name(${terminfo_library} terminfo_library) - set(llvm_system_libs ${llvm_system_libs} "${terminfo_library}") - endif() - diff --git a/recipes-devtools/clang/clang/0034-compiler-rt-Do-not-force-thumb-mode-directive.patch b/recipes-devtools/clang/clang/0034-compiler-rt-Do-not-force-thumb-mode-directive.patch deleted file mode 100644 index 515f980..0000000 --- a/recipes-devtools/clang/clang/0034-compiler-rt-Do-not-force-thumb-mode-directive.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 16736f026aeb9db163fb296e088316252f2578e0 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 12 Jun 2021 08:42:36 -0700 -Subject: [PATCH] compiler-rt: Do not force thumb mode directive - -.thumb_func was not switching mode until [1] -so it did not show up but now that .thumb_func (without argument) is -switching mode, its causing build failures on armv6 ( rpi0 ) even when -build is explicitly asking for this file to be built with -marm (ARM -mode), therefore use DEFINE_COMPILERRT_FUNCTION macro to add function -header which considers arch and mode from compiler cmdline to decide if -the function is built using thumb mode or arm mode. - -[1] https://reviews.llvm.org/D101975 - -Signed-off-by: Khem Raj ---- - compiler-rt/lib/builtins/arm/sync-ops.h | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - -diff --git a/compiler-rt/lib/builtins/arm/sync-ops.h b/compiler-rt/lib/builtins/arm/sync-ops.h -index 7a26170741ad..d914f9d3a109 100644 ---- a/compiler-rt/lib/builtins/arm/sync-ops.h -+++ b/compiler-rt/lib/builtins/arm/sync-ops.h -@@ -16,9 +16,8 @@ - - #define SYNC_OP_4(op) \ - .p2align 2; \ -- .thumb; \ - .syntax unified; \ -- DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ -+ DEFINE_COMPILERRT_FUNCTION(__sync_fetch_and_##op) \ - DMB; \ - mov r12, r0; \ - LOCAL_LABEL(tryatomic_##op) : ldrex r0, [r12]; \ -@@ -31,9 +30,8 @@ - - #define SYNC_OP_8(op) \ - .p2align 2; \ -- .thumb; \ - .syntax unified; \ -- DEFINE_COMPILERRT_THUMB_FUNCTION(__sync_fetch_and_##op) \ -+ DEFINE_COMPILERRT_FUNCTION(__sync_fetch_and_##op) \ - push {r4, r5, r6, lr}; \ - DMB; \ - mov r12, r0; \ diff --git a/recipes-devtools/clang/clang/0034-lldb-Link-with-libatomic-on-x86.patch b/recipes-devtools/clang/clang/0034-lldb-Link-with-libatomic-on-x86.patch new file mode 100644 index 0000000..9b142b5 --- /dev/null +++ b/recipes-devtools/clang/clang/0034-lldb-Link-with-libatomic-on-x86.patch @@ -0,0 +1,33 @@ +From 31902cb8d8d5df41295b489a47a6010e05a02ad7 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 8 Feb 2022 01:31:26 -0800 +Subject: [PATCH] lldb: Link with libatomic on x86 + +cmake atomic check is not sufficient for i686 target where clang14 still +generates __atomic_store calls but the check does not entail this +function and happily thinks that compiler can resolve all atomic via intrinsics +on i686, but thats not the case, ideally the check for determining +atomic operation should be make more robust but until then lets ask to +link with libatomic on i686/linux + +Upstream-Status: Inappropriate [OE-Specific] +Signed-off-by: Khem Raj +--- + lldb/source/Utility/CMakeLists.txt | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/lldb/source/Utility/CMakeLists.txt b/lldb/source/Utility/CMakeLists.txt +index cc0bf5fdb61a..5228bf01c276 100644 +--- a/lldb/source/Utility/CMakeLists.txt ++++ b/lldb/source/Utility/CMakeLists.txt +@@ -19,6 +19,10 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows") + list(APPEND LLDB_SYSTEM_LIBS ws2_32 rpcrt4) + endif () + ++if (CMAKE_SYSTEM_PROCESSOR MATCHES "i686" AND CMAKE_SYSTEM_NAME MATCHES "Linux") ++ list(APPEND LLDB_SYSTEM_LIBS atomic) ++endif() ++ + if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB ) + list(APPEND LLDB_SYSTEM_LIBS atomic) + endif() diff --git a/recipes-devtools/clang/clang/0035-clang-Do-not-use-install-relative-libc-headers.patch b/recipes-devtools/clang/clang/0035-clang-Do-not-use-install-relative-libc-headers.patch deleted file mode 100644 index f17c35f..0000000 --- a/recipes-devtools/clang/clang/0035-clang-Do-not-use-install-relative-libc-headers.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 75fbe5c2c8f4798dbffca047d18e5831de61aef5 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 11 Aug 2021 18:37:11 -0700 -Subject: [PATCH] clang: Do not use install relative libc++ headers - -In OE we use same clang for native and cross builds, therefore we need -to ensure that native sysroot install of libc++ is not searched for -headers when doing cross compile instead it searches the target sysroot -this is especially troublesome when libcxx-native is staged along with -libcxx e.g. chromium - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Gnu.cpp | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 9750c42e1f56..553cb985737f 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2928,7 +2928,9 @@ Generic_GCC::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, - - // Android never uses the libc++ headers installed alongside the toolchain, - // which are generally incompatible with the NDK libraries anyway. -- if (!getTriple().isAndroid()) -+ // And also do not add it when --sysroot is specified, since it would expect -+ // libc++ headers from sysroot -+ if (!getTriple().isAndroid() && SysRoot.empty()) - if (AddIncludePath(getDriver().Dir + "/../include")) - return; - // If this is a development, non-installed, clang, libcxx will diff --git a/recipes-devtools/clang/clang/0035-clang-exclude-openembedded-distributions-from-settin.patch b/recipes-devtools/clang/clang/0035-clang-exclude-openembedded-distributions-from-settin.patch new file mode 100644 index 0000000..3c2f314 --- /dev/null +++ b/recipes-devtools/clang/clang/0035-clang-exclude-openembedded-distributions-from-settin.patch @@ -0,0 +1,35 @@ +From ff6112490dcfa323f8ffe36d822fda2025003b6e Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 11 Feb 2022 12:29:14 -0800 +Subject: [PATCH] clang: exclude openembedded distributions from setting rpath + on openmp executables + +OpenEmbedded based SDKs stage toolchains outsides the target rootfs and +libomp.so is part of the target rootfs and not part of compiler +toolchain install or relative to it. It finds the libraries via +--sysroot during compile. This ensures that -rpath is not added for such +systems, since it is adding cross-compile paths to rpath which is not +correct when the binaries are run on real targets. + +Upstream-Status: Submitted [https://reviews.llvm.org/D119590] +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/CommonArgs.cpp | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp +index 60ba461ea0f5..67d446c0998a 100644 +--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp ++++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp +@@ -648,6 +648,11 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args, + void tools::addOpenMPRuntimeSpecificRPath(const ToolChain &TC, + const ArgList &Args, + ArgStringList &CmdArgs) { ++ // OpenEmbedded/Yocto installs libomp.so into /usr/lib ++ // therefore using -rpath is not needed, on the contrary it adds ++ // paths from cross compiler install location which is not correct ++ if (TC.getTriple().getVendor() == llvm::Triple::OpenEmbedded) ++ return; + + if (Args.hasFlag(options::OPT_fopenmp_implicit_rpath, + options::OPT_fno_openmp_implicit_rpath, true)) { diff --git a/recipes-devtools/clang/clang/0035-llvm-Do-not-use-standard-search-paths-in-find_librar.patch b/recipes-devtools/clang/clang/0035-llvm-Do-not-use-standard-search-paths-in-find_librar.patch deleted file mode 100644 index 0bd32d1..0000000 --- a/recipes-devtools/clang/clang/0035-llvm-Do-not-use-standard-search-paths-in-find_librar.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 78560720a00c1a9b9e8ab416c4cae0eb1f2d1352 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Tue, 27 Sep 2022 12:03:15 -0700 -Subject: [PATCH] llvm: Do not use standard search paths in find_library for - ncurses - -This helps it find it in yocto sysroots - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - llvm/cmake/modules/FindTerminfo.cmake | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/llvm/cmake/modules/FindTerminfo.cmake b/llvm/cmake/modules/FindTerminfo.cmake -index 65edb80fa69a..a58180be8926 100644 ---- a/llvm/cmake/modules/FindTerminfo.cmake -+++ b/llvm/cmake/modules/FindTerminfo.cmake -@@ -11,7 +11,7 @@ - # Additionally, the following import target will be defined: - # Terminfo::terminfo - --find_library(Terminfo_LIBRARIES NAMES terminfo tinfo curses ncurses ncursesw) -+find_library(Terminfo_LIBRARIES NAMES terminfo tinfo curses ncurses ncursesw NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - - if(Terminfo_LIBRARIES) - include(CMakePushCheckState) diff --git a/recipes-devtools/clang/clang/0036-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch b/recipes-devtools/clang/clang/0036-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch deleted file mode 100644 index 43efcfb..0000000 --- a/recipes-devtools/clang/clang/0036-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 46b27761196036bc0d076bfe31636bdb43f4df6b Mon Sep 17 00:00:00 2001 -From: David Abdurachmanov -Date: Wed, 20 Oct 2021 17:30:36 -0700 -Subject: [PATCH] clang: Fix how driver finds GCC installation path on - OpenEmbedded - -Fix how Clang Driver finds GCC installation path on OpenEmbedded - -- For RISCV (riscv{32,64}) we define new two multi-lib options without any - subdirectories (e.g., lib32/ilp32d or lib64/lp64d). OpenEmbedded GCC - builds don't use them. -- Modify how Clang Driver finds GCC installation path. This is important - because GCC files on OpenEmbedded are in two different directories: - (1) /usr/bin/../lib/gcc/riscv64-oe-linux/9.2.0 - (2) /usr/lib/riscv64-oe-linux/9.2.0 - -Clang Driver will check (1) first. The directory exist, but will produce -no valid multi-libs and there will be no multi-lib selected. (2) contains -actual GCC run-time objects/libraries, but because the path has exact -same GCC version (9.2.0) it will be skipped. - -We modify the approach by allowing to check other directories with the same -GCC version. We also avoid picking GCC installation path if it results in -an empty multi-lib list. - -Upstream-Status: Pending -Signed-off-by: David Abdurachmanov -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Gnu.cpp | 39 +++++++++++++++++++++-------- - 1 file changed, 28 insertions(+), 11 deletions(-) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 553cb985737f..355c7798a7aa 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -1652,18 +1652,29 @@ static void findRISCVMultilibs(const Driver &D, - return findRISCVBareMetalMultilibs(D, TargetTriple, Path, Args, Result); - - FilterNonExistent NonExistent(Path, "/crtbegin.o", D.getVFS()); -- Multilib Ilp32 = makeMultilib("lib32/ilp32").flag("+m32").flag("+mabi=ilp32"); -- Multilib Ilp32f = -+ MultilibSet RISCVMultilibs; -+ -+ if (TargetTriple.getVendor() == llvm::Triple::OpenEmbedded) { -+ Multilib OpenEmbeddedIlp32d = makeMultilib("").flag("+m32").flag("+mabi=ilp32d"); -+ Multilib OpenEmbeddedLp64d = makeMultilib("").flag("+m64").flag("+mabi=lp64d"); -+ RISCVMultilibs = -+ MultilibSet() -+ .Either({OpenEmbeddedIlp32d, OpenEmbeddedLp64d}) -+ .FilterOut(NonExistent); -+ } else { -+ Multilib Ilp32 = makeMultilib("lib32/ilp32").flag("+m32").flag("+mabi=ilp32"); -+ Multilib Ilp32f = - makeMultilib("lib32/ilp32f").flag("+m32").flag("+mabi=ilp32f"); -- Multilib Ilp32d = -+ Multilib Ilp32d = - makeMultilib("lib32/ilp32d").flag("+m32").flag("+mabi=ilp32d"); -- Multilib Lp64 = makeMultilib("lib64/lp64").flag("+m64").flag("+mabi=lp64"); -- Multilib Lp64f = makeMultilib("lib64/lp64f").flag("+m64").flag("+mabi=lp64f"); -- Multilib Lp64d = makeMultilib("lib64/lp64d").flag("+m64").flag("+mabi=lp64d"); -- MultilibSet RISCVMultilibs = -- MultilibSet() -- .Either({Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d}) -- .FilterOut(NonExistent); -+ Multilib Lp64 = makeMultilib("lib64/lp64").flag("+m64").flag("+mabi=lp64"); -+ Multilib Lp64f = makeMultilib("lib64/lp64f").flag("+m64").flag("+mabi=lp64f"); -+ Multilib Lp64d = makeMultilib("lib64/lp64d").flag("+m64").flag("+mabi=lp64d"); -+ RISCVMultilibs = -+ MultilibSet() -+ .Either({Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d}) -+ .FilterOut(NonExistent); -+ } - - Multilib::flags_list Flags; - bool IsRV64 = TargetTriple.getArch() == llvm::Triple::riscv64; -@@ -2561,13 +2572,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( - continue; // Saw this path before; no need to look at it again. - if (CandidateVersion.isOlderThan(4, 1, 1)) - continue; -- if (CandidateVersion <= Version) -+ if (CandidateVersion < Version) - continue; - - if (!ScanGCCForMultilibs(TargetTriple, Args, LI->path(), - NeedsBiarchSuffix)) - continue; - -+ // We might have found existing directory with GCCVersion, but it -+ // might not have GCC libraries we are looking for (i.e. return an -+ // empty Mulilibs) -+ if (Multilibs.size() == 0) -+ continue; -+ - Version = CandidateVersion; - GCCTriple.setTriple(CandidateTriple); - // FIXME: We hack together the directory name here instead of diff --git a/recipes-devtools/clang/clang/0037-Fix-lib-paths-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0037-Fix-lib-paths-for-OpenEmbedded-Host.patch deleted file mode 100644 index 2a2fff3..0000000 --- a/recipes-devtools/clang/clang/0037-Fix-lib-paths-for-OpenEmbedded-Host.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 76e66abe135908b9d987e9a96aab0176391ee38a Mon Sep 17 00:00:00 2001 -From: Changqing Li -Date: Tue, 7 Dec 2021 04:08:22 +0000 -Subject: [PATCH] Fix lib paths for OpenEmbedded Host - -Under OpenEmbedded Host, while building with clang-native, it cannot find -the GCCInstallPath, which causing following error: -[snip] -compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --target x86_64-linux --isystem/path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/include --O2 -pipe -/path/to/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/share/cmake-3.21/Modules/CMakeCCompilerABI.c` -hosttools/ld: cannot find crtbeginS.o: No such file or directory -[snip] - -Before this patch: -compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang -clang version 13.0.1 (https://github.com/llvm/llvm-project 08e3a5ccd952edee36b3c002e3a29c6b1b5153de) -Target: x86_64-unknown-linux-gnu -Thread model: posix -InstalledDir: /build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin -Found candidate GCC installation: /usr/lib/gcc/x86_64-wrs-linux/10.2.0 - -After this patch: -compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang -clang version 13.0.1 (https://github.com/llvm/llvm-project 08e3a5ccd952edee36b3c002e3a29c6b1b5153de) -Thread model: posix -InstalledDir: /build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin -Found candidate GCC installation: /usr/lib/gcc/x86_64-wrs-linux/10.2.0 -Found candidate GCC installation: /usr/lib/x86_64-wrs-linux/10.2.0 -Selected GCC installation: /usr/lib/x86_64-wrs-linux/10.2.0 -Candidate multilib: .;@m64 -Selected multilib: .;@m64 - -Summary: -For OpenEmbedded Host, sysroots are of the form/usr/lib//x.y.z. -Take x86-64 as example, the default triple is x86_64-unknown-linux-gnu. -For clang-native, the target vendor is '-unknown', need to test current distro -to follow above form. - -Upstream-Status: Inappropriate [oe specific] - -Signed-off-by: Changqing Li ---- - clang/lib/Driver/ToolChains/Gnu.cpp | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 3350bda709f5..c03a839d1c72 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -22,6 +22,7 @@ - #include "clang/Driver/Options.h" - #include "clang/Driver/Tool.h" - #include "clang/Driver/ToolChain.h" -+#include "clang/Driver/Distro.h" - #include "llvm/Option/ArgList.h" - #include "llvm/Support/CodeGen.h" - #include "llvm/Support/Path.h" -@@ -2530,6 +2531,7 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( - const llvm::Triple &TargetTriple, const ArgList &Args, - const std::string &LibDir, StringRef CandidateTriple, - bool NeedsBiarchSuffix, bool GCCDirExists, bool GCCCrossDirExists) { -+ Distro Distro(D.getVFS(), TargetTriple); - // Locations relative to the system lib directory where GCC's triple-specific - // directories might reside. - struct GCCLibSuffix { -@@ -2547,7 +2549,8 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( - // files in that location, not just GCC installation data. - {CandidateTriple.str(), "..", - TargetTriple.getVendor() == llvm::Triple::Freescale || -- TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}, -+ TargetTriple.getVendor() == llvm::Triple::OpenEmbedded || -+ Distro.IsOpenEmbedded()}, - - // This is the normal place. - {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists}, --- -2.32.0 - diff --git a/recipes-devtools/clang/clang/0038-Correct-library-search-path-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0038-Correct-library-search-path-for-OpenEmbedded-Host.patch deleted file mode 100644 index b114483..0000000 --- a/recipes-devtools/clang/clang/0038-Correct-library-search-path-for-OpenEmbedded-Host.patch +++ /dev/null @@ -1,86 +0,0 @@ -From f790cf664e6d7ac2da4bf24caa82e7f166d592d8 Mon Sep 17 00:00:00 2001 -From: Changqing Li -Date: Tue, 7 Dec 2021 04:55:48 +0000 -Subject: [PATCH] Correct library search path for OpenEmbedded Host - -For OpenEmbedded Host, the gcc install path is -/usr/lib/x86_64-[distroname]-linux/[gcc-version]. -So the library search path is not found with default triple -'x86_64-linux-gnu' for x86_64. Causing following error: -[snip] -compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --target x86_64-linux --isystem/path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/include --O2 -pipe -/path/to/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/share/cmake-3.21/Modules/CMakeCCompilerABI.c` -| /build/tmp-glibc/hosttools/ld: cannot find -lgcc -| /build/tmp-glibc/hosttools/ld: cannot find -lgcc -| clang-13: error: linker command failed with exit code 1 (use -v to see invocation) -[snip] - -before this patch: -b59da142f2b0:$ /path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --print-search-dirs -programs: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin -libraries: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/lib/clang/13.0.1:/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/../lib://lib://usr/lib - -after this patch: -b59da142f2b0:$ /path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --print-search-dirs -programs: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin -libraries: =/build/tmp-glibc/work/x84_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/lib/clang/13.0.1:/usr/lib/x86_64-wrs-linux/10.2.0://lib/x86_64-wrs-linux://usr/lib/x86_64-wrs-linux:/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/../lib://lib://usr/lib - -Upstream-Status: Inappropriate [oe specific] - -Signed-off-by: Changqing Li ---- - clang/include/clang/Driver/Distro.h | 2 ++ - clang/lib/Driver/Distro.cpp | 1 + - clang/lib/Driver/ToolChains/Linux.cpp | 1 + - 3 files changed, 4 insertions(+) - -diff --git a/clang/include/clang/Driver/Distro.h b/clang/include/clang/Driver/Distro.h -index 0d2a0939639e..5556f473899f 100644 ---- a/clang/include/clang/Driver/Distro.h -+++ b/clang/include/clang/Driver/Distro.h -@@ -43,6 +43,7 @@ public: - RHEL7, - Fedora, - Gentoo, -+ //CLANG_EXTRA_OE_DISTRO_NAME - OpenSUSE, - UbuntuHardy, - UbuntuIntrepid, -@@ -130,6 +131,7 @@ public: - - bool IsGentoo() const { return DistroVal == Gentoo; } - -+ //CLANG_EXTRA_OE_DISTRO_CHECK - /// @} - }; - -diff --git a/clang/lib/Driver/Distro.cpp b/clang/lib/Driver/Distro.cpp -index c4cf4e48b5b8..2695c0ab85c2 100644 ---- a/clang/lib/Driver/Distro.cpp -+++ b/clang/lib/Driver/Distro.cpp -@@ -44,6 +44,7 @@ static Distro::DistroType DetectOsRelease(llvm::vfs::FileSystem &VFS) { - .Case("sles", Distro::OpenSUSE) - .Case("opensuse", Distro::OpenSUSE) - .Case("exherbo", Distro::Exherbo) -+ //CLANG_EXTRA_OE_DISTRO_CASE - .Default(Distro::UnknownDistro); - return Version; - } -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 46c83b002e6c..e356616229c1 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -77,6 +77,7 @@ std::string Linux::getMultiarchTriple(const Driver &D, - return "x86_64-linux-android"; - if (TargetEnvironment == llvm::Triple::GNUX32) - return "x86_64-linux-gnux32"; -+ //CLANG_EXTRA_OE_DISTRO_TRIPLE - return "x86_64-linux-gnu"; - case llvm::Triple::aarch64: - if (IsAndroid) --- -2.32.0 - diff --git a/recipes-devtools/clang/clang/0039-run-clang-tidy-on-unique-files-only.patch b/recipes-devtools/clang/clang/0039-run-clang-tidy-on-unique-files-only.patch deleted file mode 100644 index 500be31..0000000 --- a/recipes-devtools/clang/clang/0039-run-clang-tidy-on-unique-files-only.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0dc856ed20e0fb64dd7cb0a10db35c58c3ef95e6 Mon Sep 17 00:00:00 2001 -From: Serikzhan Kazi -Date: Sat, 6 Nov 2021 19:53:18 +1300 -Subject: [PATCH] [clang-tidy] run-clang-tidy.py: analyze unique files only - -The files in compile-commands.json can potentially include duplicates. -Change run-clang-tidy.py so that it does not run on the duplicate entries. - -Differential Revision: https://reviews.llvm.org/D112926 ---- - clang-tools-extra/clang-tidy/tool/run-clang-tidy.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -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 acd1ed6979c0..e6cff6a7414d 100755 ---- a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py -+++ b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py -@@ -273,8 +273,8 @@ def main(): - - # Load the database and extract all files. - database = json.load(open(os.path.join(build_path, db_path))) -- files = [make_absolute(entry['file'], entry['directory']) -- for entry in database] -+ files = set([make_absolute(entry['file'], entry['directory']) -+ for entry in database]) - - max_task = args.j - if max_task == 0: --- -2.34.1 - diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index 0201d44..b282d83 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb @@ -90,8 +90,8 @@ LLVM_ENABLE_RTTI;LLVM_ENABLE_EH;LLVM_BUILD_EXTERNAL_COMPILER_RT;CMAKE_SYSTEM_NAM CMAKE_BUILD_TYPE;BUILD_SHARED_LIBS;LLVM_ENABLE_PROJECTS;LLVM_BINUTILS_INCDIR;\ LLVM_TARGETS_TO_BUILD;LLVM_EXPERIMENTAL_TARGETS_TO_BUILD;PYTHON_EXECUTABLE;\ PYTHON_LIBRARY;PYTHON_INCLUDE_DIR;LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN;LLDB_EDITLINE_USE_WCHAR;\ -LLVM_ENABLE_LIBEDIT;LLDB_ENABLE_LIBEDIT;LLDB_PYTHON_RELATIVE_PATH;\ -CMAKE_C_FLAGS_RELEASE;CMAKE_CXX_FLAGS_RELEASE;CMAKE_ASM_FLAGS_RELEASE;\ +LLVM_ENABLE_LIBEDIT;LLDB_ENABLE_LIBEDIT;LLDB_PYTHON_RELATIVE_PATH;LLDB_PYTHON_EXE_RELATIVE_PATH;\ +LLDB_PYTHON_EXT_SUFFIX;CMAKE_C_FLAGS_RELEASE;CMAKE_CXX_FLAGS_RELEASE;CMAKE_ASM_FLAGS_RELEASE;\ CLANG_DEFAULT_CXX_STDLIB;CLANG_DEFAULT_RTLIB;CLANG_DEFAULT_UNWINDLIB;\ CLANG_DEFAULT_OPENMP_RUNTIME;\ " @@ -116,6 +116,9 @@ LLDB:riscv64 = "" LLDB:mips = "" LLDB:mipsel = "" +# linux hosts (.so) on Windows .pyd +SOLIBSDEV:mingw32 = ".pyd" + #CMAKE_VERBOSE = "VERBOSE=1" EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \ @@ -144,7 +147,10 @@ EXTRA_OECMAKE:append:class-native = "\ " EXTRA_OECMAKE:append:class-nativesdk = "\ -DCMAKE_CROSSCOMPILING:BOOL=ON \ - -DCROSS_TOOLCHAIN_FLAGS_NATIVE='-DLLDB_PYTHON_RELATIVE_PATH=${PYTHON_SITEPACKAGES_DIR} -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain-native.cmake' \ + -DCROSS_TOOLCHAIN_FLAGS_NATIVE='-DLLDB_PYTHON_RELATIVE_PATH=${PYTHON_SITEPACKAGES_DIR} \ + -DLLDB_PYTHON_EXE_RELATIVE_PATH=${PYTHON} \ + -DLLDB_PYTHON_EXT_SUFFIX=${SOLIBSDEV} \ + -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain-native.cmake' \ -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ @@ -154,12 +160,16 @@ EXTRA_OECMAKE:append:class-nativesdk = "\ -DLLDB_TABLEGEN=${STAGING_BINDIR_NATIVE}/lldb-tblgen \ -DPYTHON_LIBRARY=${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so \ -DLLDB_PYTHON_RELATIVE_PATH=${PYTHON_SITEPACKAGES_DIR} \ + -DLLDB_PYTHON_EXE_RELATIVE_PATH=${PYTHON} \ + -DLLDB_PYTHON_EXT_SUFFIX=${SOLIBSDEV} \ -DPYTHON_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} \ -DPYTHON_EXECUTABLE='${PYTHON}' \ " EXTRA_OECMAKE:append:class-target = "\ -DCMAKE_CROSSCOMPILING:BOOL=ON \ - -DCROSS_TOOLCHAIN_FLAGS_NATIVE='-DLLDB_PYTHON_RELATIVE_PATH=${PYTHON_SITEPACKAGES_DIR}' \ + -DCROSS_TOOLCHAIN_FLAGS_NATIVE='-DLLDB_PYTHON_RELATIVE_PATH=${PYTHON_SITEPACKAGES_DIR} \ + -DLLDB_PYTHON_EXT_SUFFIX=${SOLIBSDEV} \ + -DLLDB_PYTHON_EXE_RELATIVE_PATH=${PYTHON}' \ -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \ -DCLANG_TABLEGEN=${STAGING_BINDIR_NATIVE}/clang-tblgen \ -DLLDB_TABLEGEN=${STAGING_BINDIR_NATIVE}/lldb-tblgen \ @@ -171,6 +181,8 @@ EXTRA_OECMAKE:append:class-target = "\ -DLLVM_DEFAULT_TARGET_TRIPLE=${TARGET_SYS}${HF} \ -DLLVM_HOST_TRIPLE=${TARGET_SYS}${HF} \ -DLLDB_PYTHON_RELATIVE_PATH=${PYTHON_SITEPACKAGES_DIR} \ + -DLLDB_PYTHON_EXE_RELATIVE_PATH=${PYTHON} \ + -DLLDB_PYTHON_EXT_SUFFIX=${SOLIBSDEV} \ -DPYTHON_LIBRARY=${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so \ -DPYTHON_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} \ -DLLVM_LIBDIR_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \ diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index 8b827d4..b8489eb 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -10,46 +10,41 @@ SRC_URI = "\ ${BASEURI} \ file://llvm-config \ file://libunwind.pc.in \ - file://0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch \ - file://0002-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch \ - file://0003-compiler-rt-support-a-new-embedded-linux-target.patch \ - file://0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch \ - file://0005-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch \ - file://0006-llvm-allow-env-override-of-exe-path.patch \ - file://0007-clang-driver-Check-sysroot-for-ldso-path.patch \ - file://0008-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch \ - file://0009-clang-musl-ppc-does-not-support-128-bit-long-double.patch \ - file://0010-clang-Prepend-trailing-to-sysroot.patch \ - file://0011-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch \ - file://0012-clang-Define-releative-gcc-installation-dir.patch \ - file://0013-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch \ - file://0014-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch \ - file://0015-Check-for-atomic-double-intrinsics.patch \ - file://0016-clang-Enable-SSP-and-PIE-by-default.patch \ - file://0017-libcxx-Add-compiler-runtime-library-to-link-step-for.patch \ - file://0018-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch \ - file://0019-clang-Fix-resource-dir-location-for-cross-toolchains.patch \ - file://0020-fix-path-to-libffi.patch \ - file://0021-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch \ - file://0022-clang-Use-python3-in-python-scripts.patch \ - file://0023-For-x86_64-set-Yocto-based-GCC-install-search-path.patch \ - file://0024-llvm-Do-not-use-find_library-for-ncurses.patch \ - file://0025-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch \ - file://0026-compiler-rt-Use-mcr-based-barrier-on-armv6.patch \ - file://0027-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch \ - file://0028-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch \ - file://0029-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch \ - file://0030-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch \ - file://0031-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch \ - file://0032-libunwind-Added-unw_backtrace-method.patch \ - file://0033-compiler-rt-Use-uintptr_t-instead-of-_Unwind_Word.patch \ - file://0034-compiler-rt-Do-not-force-thumb-mode-directive.patch \ - file://0035-clang-Do-not-use-install-relative-libc-headers.patch \ - file://0036-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch \ - file://0037-Fix-lib-paths-for-OpenEmbedded-Host.patch \ - file://0038-Correct-library-search-path-for-OpenEmbedded-Host.patch \ - file://0034-CMake-Installable-find-modules-for-terminfo-and-libf.patch \ - file://0035-llvm-Do-not-use-standard-search-paths-in-find_librar.patch \ + file://0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch \ + file://0002-compiler-rt-support-a-new-embedded-linux-target.patch \ + file://0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch \ + file://0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch \ + file://0005-llvm-allow-env-override-of-exe-path.patch \ + file://0006-clang-driver-Check-sysroot-for-ldso-path.patch \ + file://0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch \ + file://0008-clang-musl-ppc-does-not-support-128-bit-long-double.patch \ + file://0009-clang-Prepend-trailing-to-sysroot.patch \ + file://0010-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch \ + file://0011-clang-Define-releative-gcc-installation-dir.patch \ + file://0012-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch \ + file://0013-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch \ + file://0014-Check-for-atomic-double-intrinsics.patch \ + file://0015-libcxx-Add-compiler-runtime-library-to-link-step-for.patch \ + file://0016-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch \ + file://0017-clang-Fix-resource-dir-location-for-cross-toolchains.patch \ + file://0018-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch \ + file://0019-clang-Use-python3-in-python-scripts.patch \ + file://0020-For-x86_64-set-Yocto-based-GCC-install-search-path.patch \ + file://0021-llvm-Do-not-use-find_library-for-ncurses.patch \ + file://0022-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch \ + file://0023-compiler-rt-Use-mcr-based-barrier-on-armv6.patch \ + file://0024-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch \ + file://0025-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch \ + file://0026-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch \ + file://0027-compiler-rt-Link-scudo-standalone-with-libatomic-on-.patch \ + file://0028-libunwind-Added-unw_backtrace-method.patch \ + file://0029-Do-not-force-thumb-mode-directive.patch \ + file://0030-clang-Do-not-use-install-relative-libc-headers.patch \ + file://0031-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch \ + file://0032-Fix-lib-paths-for-OpenEmbedded-Host.patch \ + file://0033-Correct-library-search-path-for-OpenEmbedded-Host.patch \ + file://0034-lldb-Link-with-libatomic-on-x86.patch \ + file://0035-clang-exclude-openembedded-distributions-from-settin.patch \ " # Fallback to no-PIE if not set GCCPIE ??= "" diff --git a/recipes-devtools/clang/openmp_git.bb b/recipes-devtools/clang/openmp_git.bb index 7ce89eb..b1f1a8d 100644 --- a/recipes-devtools/clang/openmp_git.bb +++ b/recipes-devtools/clang/openmp_git.bb @@ -35,10 +35,10 @@ PACKAGECONFIG[ompt-tools] = "-DOPENMP_ENABLE_OMPT_TOOLS=ON,-DOPENMP_ENABLE_OMPT_ PACKAGECONFIG[aliases] = "-DLIBOMP_INSTALL_ALIASES=ON,-DLIBOMP_INSTALL_ALIASES=OFF," PACKAGECONFIG[offloading-plugin] = ",,elfutils libffi,libelf libffi" -PACKAGES += "${PN}-libomptarget-amdgcn" +PACKAGES += "${PN}-libomptarget" FILES_SOLIBSDEV = "" FILES:${PN} += "${libdir}/lib*${SOLIBSDEV}" -FILES:${PN}-libomptarget-amdgcn = "${libdir}/libomptarget-amdgcn-*.bc" +FILES:${PN}-libomptarget = "${libdir}/libomptarget-*.bc" INSANE_SKIP:${PN} = "dev-so" COMPATIBLE_HOST:mips64 = "null" -- cgit v1.2.3-54-g00ecf