From 7bd92153728422fcca645863daf84e87e065db75 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 6 Feb 2019 17:13:41 -0800 Subject: clang: Refresh patches and use static libunwind.a during default link Signed-off-by: Khem Raj --- .../0000-clang-Enable-SSP-and-PIE-by-default.patch | 63 ---- .../0001-clang-Enable-SSP-and-PIE-by-default.patch | 63 ++++ .../0001-clang-driver-Use-lib-for-ldso-on-OE.patch | 56 ---- ...iver-tools.cpp-Add-lssp_nonshared-on-musl.patch | 34 --- .../0002-clang-driver-Use-lib-for-ldso-on-OE.patch | 56 ++++ ...iver-tools.cpp-Add-lssp_nonshared-on-musl.patch | 34 +++ ...-ppc-does-not-support-128-bit-long-double.patch | 27 -- .../0004-clang-Prepend-trailing-to-sysroot.patch | 41 --- ...-ppc-does-not-support-128-bit-long-double.patch | 27 ++ ...inside-the-target-sysroot-for-compiler-ru.patch | 44 --- .../0005-clang-Prepend-trailing-to-sysroot.patch | 41 +++ ...ang-Define-releative-gcc-installation-dir.patch | 32 -- ...inside-the-target-sysroot-for-compiler-ru.patch | 44 +++ ...ang-Define-releative-gcc-installation-dir.patch | 32 ++ ...dso-for-musl-on-x86-and-x32-architectures.patch | 44 --- ...dso-for-musl-on-x86-and-x32-architectures.patch | 44 +++ .../0008-clang-scan-view-needs-python-2.x.patch | 27 -- .../0009-clang-scan-view-needs-python-2.x.patch | 27 ++ ...LibraryInfo-Undefine-libc-functions-if-th.patch | 91 ------ ...pend-libunwind-to-compiler-rt-for-linking.patch | 33 +++ .../0010-llvm-allow-env-override-of-exe-path.patch | 37 --- ...d-lxml2-to-linker-cmdline-of-xml-is-found.patch | 40 --- ...LibraryInfo-Undefine-libc-functions-if-th.patch | 91 ++++++ ...ind-libunwind-headers-when-LIBCXXABI_LIBU.patch | 68 ----- .../0012-llvm-allow-env-override-of-exe-path.patch | 37 +++ ...er-rt-support-a-new-embedded-linux-target.patch | 326 --------------------- ...AARCH64-Add-support-for-.dword-directives.patch | 57 ++++ ...-Simplify-cross-compilation.-Don-t-use-na.patch | 46 --- ...d-lxml2-to-linker-cmdline-of-xml-is-found.patch | 40 +++ ...0015-compiler-rt-Disable-tsan-on-OE-glibc.patch | 42 --- ...ind-libunwind-headers-when-LIBCXXABI_LIBU.patch | 68 +++++ ...pend-libunwind-to-compiler-rt-for-linking.patch | 33 --- ...er-rt-support-a-new-embedded-linux-target.patch | 326 +++++++++++++++++++++ ...-Simplify-cross-compilation.-Don-t-use-na.patch | 46 +++ ...AARCH64-Add-support-for-.dword-directives.patch | 57 ---- ...0018-compiler-rt-Disable-tsan-on-OE-glibc.patch | 42 +++ recipes-devtools/clang/common.inc | 36 +-- 37 files changed, 1126 insertions(+), 1126 deletions(-) delete mode 100644 recipes-devtools/clang/clang/0000-clang-Enable-SSP-and-PIE-by-default.patch create mode 100644 recipes-devtools/clang/clang/0001-clang-Enable-SSP-and-PIE-by-default.patch delete mode 100644 recipes-devtools/clang/clang/0001-clang-driver-Use-lib-for-ldso-on-OE.patch delete mode 100644 recipes-devtools/clang/clang/0002-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch create mode 100644 recipes-devtools/clang/clang/0002-clang-driver-Use-lib-for-ldso-on-OE.patch create mode 100644 recipes-devtools/clang/clang/0003-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch delete mode 100644 recipes-devtools/clang/clang/0003-clang-musl-ppc-does-not-support-128-bit-long-double.patch delete mode 100644 recipes-devtools/clang/clang/0004-clang-Prepend-trailing-to-sysroot.patch create mode 100644 recipes-devtools/clang/clang/0004-clang-musl-ppc-does-not-support-128-bit-long-double.patch delete mode 100644 recipes-devtools/clang/clang/0005-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch create mode 100644 recipes-devtools/clang/clang/0005-clang-Prepend-trailing-to-sysroot.patch delete mode 100644 recipes-devtools/clang/clang/0006-clang-Define-releative-gcc-installation-dir.patch create mode 100644 recipes-devtools/clang/clang/0006-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch create mode 100644 recipes-devtools/clang/clang/0007-clang-Define-releative-gcc-installation-dir.patch delete mode 100644 recipes-devtools/clang/clang/0007-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch create mode 100644 recipes-devtools/clang/clang/0008-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch delete mode 100644 recipes-devtools/clang/clang/0008-clang-scan-view-needs-python-2.x.patch create mode 100644 recipes-devtools/clang/clang/0009-clang-scan-view-needs-python-2.x.patch delete mode 100644 recipes-devtools/clang/clang/0009-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch create mode 100644 recipes-devtools/clang/clang/0010-clang-Append-libunwind-to-compiler-rt-for-linking.patch delete mode 100644 recipes-devtools/clang/clang/0010-llvm-allow-env-override-of-exe-path.patch delete mode 100644 recipes-devtools/clang/clang/0011-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch create mode 100644 recipes-devtools/clang/clang/0011-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch delete mode 100644 recipes-devtools/clang/clang/0012-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch create mode 100644 recipes-devtools/clang/clang/0012-llvm-allow-env-override-of-exe-path.patch delete mode 100644 recipes-devtools/clang/clang/0013-compiler-rt-support-a-new-embedded-linux-target.patch create mode 100644 recipes-devtools/clang/clang/0013-llvm-AARCH64-Add-support-for-.dword-directives.patch delete mode 100644 recipes-devtools/clang/clang/0014-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch create mode 100644 recipes-devtools/clang/clang/0014-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch delete mode 100644 recipes-devtools/clang/clang/0015-compiler-rt-Disable-tsan-on-OE-glibc.patch create mode 100644 recipes-devtools/clang/clang/0015-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch delete mode 100644 recipes-devtools/clang/clang/0016-clang-Append-libunwind-to-compiler-rt-for-linking.patch create mode 100644 recipes-devtools/clang/clang/0016-compiler-rt-support-a-new-embedded-linux-target.patch create mode 100644 recipes-devtools/clang/clang/0017-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch delete mode 100644 recipes-devtools/clang/clang/0017-llvm-AARCH64-Add-support-for-.dword-directives.patch create mode 100644 recipes-devtools/clang/clang/0018-compiler-rt-Disable-tsan-on-OE-glibc.patch diff --git a/recipes-devtools/clang/clang/0000-clang-Enable-SSP-and-PIE-by-default.patch b/recipes-devtools/clang/clang/0000-clang-Enable-SSP-and-PIE-by-default.patch deleted file mode 100644 index d7b76b1..0000000 --- a/recipes-devtools/clang/clang/0000-clang-Enable-SSP-and-PIE-by-default.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 76718d7d905029a2304c1ad275cd528b404dc7d4 Mon Sep 17 00:00:00 2001 -From: Evangelos Foutras -Date: Thu, 20 Sep 2018 06:20:28 +0300 -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) ---- - clang/lib/Driver/ToolChains/Linux.cpp | 14 ++++++++++++-- - clang/lib/Driver/ToolChains/Linux.h | 1 + - 2 files changed, 13 insertions(+), 2 deletions(-) - -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 5dc7b506d6f..4dfef25aa63 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -976,8 +976,18 @@ void Linux::AddIAMCUIncludeArgs(const ArgList &DriverArgs, - } - - bool Linux::isPIEDefault() const { -- return (getTriple().isAndroid() && !getTriple().isAndroidVersionLT(16)) || -- getTriple().isMusl() || getSanitizerArgs().requiresPIE(); -+ const bool IsMips = getTriple().isMIPS(); -+ const bool IsAndroid = getTriple().isAndroid(); -+ -+ if (IsMips || IsAndroid) -+ return (getTriple().isAndroid() && !getTriple().isAndroidVersionLT(16)) || -+ getTriple().isMusl() || getSanitizerArgs().requiresPIE(); -+ -+ return true; -+} -+ -+unsigned Linux::GetDefaultStackProtectorLevel(bool KernelOrKext) const { -+ return 2; - } - - bool Linux::IsMathErrnoDefault() const { -diff --git a/clang/lib/Driver/ToolChains/Linux.h b/clang/lib/Driver/ToolChains/Linux.h -index 4a662cb4b42..2ddd4056573 100644 ---- a/clang/lib/Driver/ToolChains/Linux.h -+++ b/clang/lib/Driver/ToolChains/Linux.h -@@ -39,6 +39,7 @@ public: - llvm::opt::ArgStringList &CC1Args) const override; - CXXStdlibType GetDefaultCXXStdlibType() const override; - bool isPIEDefault() const override; -+ unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override; - bool IsMathErrnoDefault() const override; - SanitizerMask getSupportedSanitizers() const override; - void addProfileRTLibs(const llvm::opt::ArgList &Args, --- -2.20.1 - diff --git a/recipes-devtools/clang/clang/0001-clang-Enable-SSP-and-PIE-by-default.patch b/recipes-devtools/clang/clang/0001-clang-Enable-SSP-and-PIE-by-default.patch new file mode 100644 index 0000000..ac7abed --- /dev/null +++ b/recipes-devtools/clang/clang/0001-clang-Enable-SSP-and-PIE-by-default.patch @@ -0,0 +1,63 @@ +From 400745857bc7bbcc31df9cab36d1fa9816c3c07b Mon Sep 17 00:00:00 2001 +From: Evangelos Foutras +Date: Thu, 20 Sep 2018 06:20:28 +0300 +Subject: [PATCH 01/18] 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) +--- + clang/lib/Driver/ToolChains/Linux.cpp | 14 ++++++++++++-- + clang/lib/Driver/ToolChains/Linux.h | 1 + + 2 files changed, 13 insertions(+), 2 deletions(-) + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index 65ab9b2daf5..5b757b8028c 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -968,8 +968,18 @@ void Linux::AddIAMCUIncludeArgs(const ArgList &DriverArgs, + } + + bool Linux::isPIEDefault() const { +- return (getTriple().isAndroid() && !getTriple().isAndroidVersionLT(16)) || +- getTriple().isMusl() || getSanitizerArgs().requiresPIE(); ++ const bool IsMips = getTriple().isMIPS(); ++ const bool IsAndroid = getTriple().isAndroid(); ++ ++ if (IsMips || IsAndroid) ++ return (getTriple().isAndroid() && !getTriple().isAndroidVersionLT(16)) || ++ getTriple().isMusl() || getSanitizerArgs().requiresPIE(); ++ ++ return true; ++} ++ ++unsigned Linux::GetDefaultStackProtectorLevel(bool KernelOrKext) const { ++ return 2; + } + + bool Linux::IsMathErrnoDefault() const { +diff --git a/clang/lib/Driver/ToolChains/Linux.h b/clang/lib/Driver/ToolChains/Linux.h +index 4a662cb4b42..2ddd4056573 100644 +--- a/clang/lib/Driver/ToolChains/Linux.h ++++ b/clang/lib/Driver/ToolChains/Linux.h +@@ -39,6 +39,7 @@ public: + llvm::opt::ArgStringList &CC1Args) const override; + CXXStdlibType GetDefaultCXXStdlibType() const override; + bool isPIEDefault() const override; ++ unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override; + bool IsMathErrnoDefault() const override; + SanitizerMask getSupportedSanitizers() const override; + void addProfileRTLibs(const llvm::opt::ArgList &Args, +-- +2.20.1 + diff --git a/recipes-devtools/clang/clang/0001-clang-driver-Use-lib-for-ldso-on-OE.patch b/recipes-devtools/clang/clang/0001-clang-driver-Use-lib-for-ldso-on-OE.patch deleted file mode 100644 index 42e920a..0000000 --- a/recipes-devtools/clang/clang/0001-clang-driver-Use-lib-for-ldso-on-OE.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 4fe687292a2b2952a360eecdd6954db11750c903 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 21 May 2016 21:52:36 -0700 -Subject: [PATCH 01/15] clang: driver: Use /lib for ldso on OE - -OE does not follow the default base_libdir -that clang has, therefore adjust it for OE -it wont be able to support multilib since -in multilib case OE switches the base libdir -for 64bit to /lib64 instead of /lib - -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Linux.cpp | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 65ab9b2daf5..33e2fcec299 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -590,12 +590,12 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { - Loader = "ld.so.1"; - break; - case llvm::Triple::ppc64: -- LibDir = "lib64"; -+ LibDir = "lib"; - Loader = - (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1"; - break; - case llvm::Triple::ppc64le: -- LibDir = "lib64"; -+ LibDir = "lib"; - Loader = - (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2"; - break; -@@ -617,7 +617,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { - Loader = "ld-linux.so.2"; - break; - case llvm::Triple::sparcv9: -- LibDir = "lib64"; -+ LibDir = "lib"; - Loader = "ld-linux.so.2"; - break; - case llvm::Triple::systemz: -@@ -631,7 +631,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { - case llvm::Triple::x86_64: { - bool X32 = Triple.getEnvironment() == llvm::Triple::GNUX32; - -- LibDir = X32 ? "libx32" : "lib64"; -+ LibDir = "lib"; - Loader = X32 ? "ld-linux-x32.so.2" : "ld-linux-x86-64.so.2"; - break; - } --- -2.20.1 - diff --git a/recipes-devtools/clang/clang/0002-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch b/recipes-devtools/clang/clang/0002-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch deleted file mode 100644 index 35b3d4f..0000000 --- a/recipes-devtools/clang/clang/0002-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 14a9ed6fa67f7e988d85408554f88a8d72c6a607 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 19 May 2016 21:11:06 -0700 -Subject: [PATCH 02/15] 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 2ad45097dce..c841399193e 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -525,6 +525,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 (Args.hasArg(options::OPT_static)) - CmdArgs.push_back("--end-group"); - else --- -2.20.1 - diff --git a/recipes-devtools/clang/clang/0002-clang-driver-Use-lib-for-ldso-on-OE.patch b/recipes-devtools/clang/clang/0002-clang-driver-Use-lib-for-ldso-on-OE.patch new file mode 100644 index 0000000..9b92b69 --- /dev/null +++ b/recipes-devtools/clang/clang/0002-clang-driver-Use-lib-for-ldso-on-OE.patch @@ -0,0 +1,56 @@ +From 089b7e146cfc86fafe7c21e74238d638ae997df9 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 21 May 2016 21:52:36 -0700 +Subject: [PATCH 02/18] clang: driver: Use /lib for ldso on OE + +OE does not follow the default base_libdir +that clang has, therefore adjust it for OE +it wont be able to support multilib since +in multilib case OE switches the base libdir +for 64bit to /lib64 instead of /lib + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Linux.cpp | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index 5b757b8028c..552d329e7b8 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -590,12 +590,12 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + Loader = "ld.so.1"; + break; + case llvm::Triple::ppc64: +- LibDir = "lib64"; ++ LibDir = "lib"; + Loader = + (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1"; + break; + case llvm::Triple::ppc64le: +- LibDir = "lib64"; ++ LibDir = "lib"; + Loader = + (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2"; + break; +@@ -617,7 +617,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + Loader = "ld-linux.so.2"; + break; + case llvm::Triple::sparcv9: +- LibDir = "lib64"; ++ LibDir = "lib"; + Loader = "ld-linux.so.2"; + break; + case llvm::Triple::systemz: +@@ -631,7 +631,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + case llvm::Triple::x86_64: { + bool X32 = Triple.getEnvironment() == llvm::Triple::GNUX32; + +- LibDir = X32 ? "libx32" : "lib64"; ++ LibDir = "lib"; + Loader = X32 ? "ld-linux-x32.so.2" : "ld-linux-x86-64.so.2"; + break; + } +-- +2.20.1 + diff --git a/recipes-devtools/clang/clang/0003-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch b/recipes-devtools/clang/clang/0003-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch new file mode 100644 index 0000000..217facc --- /dev/null +++ b/recipes-devtools/clang/clang/0003-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch @@ -0,0 +1,34 @@ +From c4e958d8d61d443cb882214993b129c45bd8a21d Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 19 May 2016 21:11:06 -0700 +Subject: [PATCH 03/18] 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 2ad45097dce..c841399193e 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -525,6 +525,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 (Args.hasArg(options::OPT_static)) + CmdArgs.push_back("--end-group"); + else +-- +2.20.1 + diff --git a/recipes-devtools/clang/clang/0003-clang-musl-ppc-does-not-support-128-bit-long-double.patch b/recipes-devtools/clang/clang/0003-clang-musl-ppc-does-not-support-128-bit-long-double.patch deleted file mode 100644 index 80ec006..0000000 --- a/recipes-devtools/clang/clang/0003-clang-musl-ppc-does-not-support-128-bit-long-double.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 0f183864a6e89461143e082d4b7e5df4cd0f4480 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Tue, 10 May 2016 02:00:11 -0700 -Subject: [PATCH 03/15] clang: musl/ppc does not support 128-bit long double - -Signed-off-by: Khem Raj ---- - clang/lib/Basic/Targets/PPC.h | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/clang/lib/Basic/Targets/PPC.h b/clang/lib/Basic/Targets/PPC.h -index 058970a0e09..ba5b941bc08 100644 ---- a/clang/lib/Basic/Targets/PPC.h -+++ b/clang/lib/Basic/Targets/PPC.h -@@ -331,7 +331,8 @@ public: - break; - } - -- if (getTriple().isOSFreeBSD()) { -+ if (getTriple().isOSFreeBSD() -+ || getTriple().isMusl()) { - LongDoubleWidth = LongDoubleAlign = 64; - LongDoubleFormat = &llvm::APFloat::IEEEdouble(); - } --- -2.20.1 - diff --git a/recipes-devtools/clang/clang/0004-clang-Prepend-trailing-to-sysroot.patch b/recipes-devtools/clang/clang/0004-clang-Prepend-trailing-to-sysroot.patch deleted file mode 100644 index 0cb81cd..0000000 --- a/recipes-devtools/clang/clang/0004-clang-Prepend-trailing-to-sysroot.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 792786fb04bf505cdcd39a22744111cfd57a2ac5 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 16 Mar 2017 09:02:13 -0700 -Subject: [PATCH 04/15] 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 33e2fcec299..4dfaf052f86 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -219,7 +219,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() + "/"; - - // Cross-compiling binutils and GCC installations (vanilla and openSUSE at - // least) put various tools in a triple-prefixed directory off of the parent --- -2.20.1 - diff --git a/recipes-devtools/clang/clang/0004-clang-musl-ppc-does-not-support-128-bit-long-double.patch b/recipes-devtools/clang/clang/0004-clang-musl-ppc-does-not-support-128-bit-long-double.patch new file mode 100644 index 0000000..ca4ef9f --- /dev/null +++ b/recipes-devtools/clang/clang/0004-clang-musl-ppc-does-not-support-128-bit-long-double.patch @@ -0,0 +1,27 @@ +From 419cb3ac8f7f23c3f7aa620a93974b366509c2b7 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 10 May 2016 02:00:11 -0700 +Subject: [PATCH 04/18] clang: musl/ppc does not support 128-bit long double + +Signed-off-by: Khem Raj +--- + clang/lib/Basic/Targets/PPC.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/clang/lib/Basic/Targets/PPC.h b/clang/lib/Basic/Targets/PPC.h +index 058970a0e09..ba5b941bc08 100644 +--- a/clang/lib/Basic/Targets/PPC.h ++++ b/clang/lib/Basic/Targets/PPC.h +@@ -331,7 +331,8 @@ public: + break; + } + +- if (getTriple().isOSFreeBSD()) { ++ if (getTriple().isOSFreeBSD() ++ || getTriple().isMusl()) { + LongDoubleWidth = LongDoubleAlign = 64; + LongDoubleFormat = &llvm::APFloat::IEEEdouble(); + } +-- +2.20.1 + diff --git a/recipes-devtools/clang/clang/0005-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch b/recipes-devtools/clang/clang/0005-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch deleted file mode 100644 index 61caa3c..0000000 --- a/recipes-devtools/clang/clang/0005-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 0327863d99125908e209e46e2687e9fb77ff25a7 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 16 Mar 2017 19:06:26 -0700 -Subject: [PATCH 05/15] 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 88a627eab6d..d56b5264b4d 100644 ---- a/clang/lib/Driver/ToolChain.cpp -+++ b/clang/lib/Driver/ToolChain.cpp -@@ -13,6 +13,7 @@ - #include "ToolChains/Clang.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" -@@ -353,7 +354,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 { --- -2.20.1 - diff --git a/recipes-devtools/clang/clang/0005-clang-Prepend-trailing-to-sysroot.patch b/recipes-devtools/clang/clang/0005-clang-Prepend-trailing-to-sysroot.patch new file mode 100644 index 0000000..641ca32 --- /dev/null +++ b/recipes-devtools/clang/clang/0005-clang-Prepend-trailing-to-sysroot.patch @@ -0,0 +1,41 @@ +From dae39fcc475883d6367929d5d4bd39bd82cebb22 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 16 Mar 2017 09:02:13 -0700 +Subject: [PATCH 05/18] 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 552d329e7b8..7d5a85ed744 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -219,7 +219,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() + "/"; + + // Cross-compiling binutils and GCC installations (vanilla and openSUSE at + // least) put various tools in a triple-prefixed directory off of the parent +-- +2.20.1 + diff --git a/recipes-devtools/clang/clang/0006-clang-Define-releative-gcc-installation-dir.patch b/recipes-devtools/clang/clang/0006-clang-Define-releative-gcc-installation-dir.patch deleted file mode 100644 index 92e660c..0000000 --- a/recipes-devtools/clang/clang/0006-clang-Define-releative-gcc-installation-dir.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 15fab22ab9478935b30d55de1d871553991bc3ad Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sun, 21 May 2017 15:38:25 -0700 -Subject: [PATCH 06/15] 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 | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index c841399193e..468ee821a57 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2280,6 +2280,9 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( - {"gcc-cross/" + CandidateTriple.str(), "../..", - TargetTriple.getOS() != llvm::Triple::Solaris}, - -+ // OE cross-compilers path structures -+ {"/" + CandidateTriple.str(), "..", true}, -+ - // The Freescale PPC SDK has the gcc libraries in - // /usr/lib//x.y.z so have a look there as well. Only do - // this on Freescale triples, though, since some systems put a *lot* of --- -2.20.1 - diff --git a/recipes-devtools/clang/clang/0006-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch b/recipes-devtools/clang/clang/0006-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch new file mode 100644 index 0000000..4fd4627 --- /dev/null +++ b/recipes-devtools/clang/clang/0006-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch @@ -0,0 +1,44 @@ +From 258f04d89f8d7cca4fdd1f4d2fba068b090854b3 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 16 Mar 2017 19:06:26 -0700 +Subject: [PATCH 06/18] 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 88a627eab6d..d56b5264b4d 100644 +--- a/clang/lib/Driver/ToolChain.cpp ++++ b/clang/lib/Driver/ToolChain.cpp +@@ -13,6 +13,7 @@ + #include "ToolChains/Clang.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" +@@ -353,7 +354,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 { +-- +2.20.1 + diff --git a/recipes-devtools/clang/clang/0007-clang-Define-releative-gcc-installation-dir.patch b/recipes-devtools/clang/clang/0007-clang-Define-releative-gcc-installation-dir.patch new file mode 100644 index 0000000..707a550 --- /dev/null +++ b/recipes-devtools/clang/clang/0007-clang-Define-releative-gcc-installation-dir.patch @@ -0,0 +1,32 @@ +From b8dbd4166e7ce4d88ca5e6b6da1a07b408a1230d Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 21 May 2017 15:38:25 -0700 +Subject: [PATCH 07/18] 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 | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index c841399193e..468ee821a57 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2280,6 +2280,9 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + {"gcc-cross/" + CandidateTriple.str(), "../..", + TargetTriple.getOS() != llvm::Triple::Solaris}, + ++ // OE cross-compilers path structures ++ {"/" + CandidateTriple.str(), "..", true}, ++ + // The Freescale PPC SDK has the gcc libraries in + // /usr/lib//x.y.z so have a look there as well. Only do + // this on Freescale triples, though, since some systems put a *lot* of +-- +2.20.1 + diff --git a/recipes-devtools/clang/clang/0007-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch b/recipes-devtools/clang/clang/0007-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch deleted file mode 100644 index 7965fc6..0000000 --- a/recipes-devtools/clang/clang/0007-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch +++ /dev/null @@ -1,44 +0,0 @@ -From e2f49f7535aeb72592f8386cddb611f7bcdf2f32 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 16 Aug 2017 15:16:15 -0700 -Subject: [PATCH 07/15] clang: Fix ldso for musl on x86 and x32 architectures - -x32 linker is called ld-musl-x32.so.1 and x86 linker -is called ld-musl-i386.so.1, Currently, linker for -x86 is returned as ld-musl-i586.so.1, when default -arch is i586, which is not the right thing - -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/Linux.cpp | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 4dfaf052f86..5dc7b506d6f 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -516,6 +516,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { - if (Triple.isMusl()) { - std::string ArchName; - bool IsArm = false; -+ bool isX32 = false; - - switch (Arch) { - case llvm::Triple::arm: -@@ -528,6 +529,13 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { - ArchName = "armeb"; - IsArm = true; - break; -+ case llvm::Triple::x86: -+ ArchName = "i386"; -+ break; -+ case llvm::Triple::x86_64: -+ isX32 = Triple.getEnvironment() == llvm::Triple::GNUX32; -+ ArchName = isX32 ? "x32" : Triple.getArchName().str(); -+ break; - default: - ArchName = Triple.getArchName().str(); - } --- -2.20.1 - diff --git a/recipes-devtools/clang/clang/0008-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch b/recipes-devtools/clang/clang/0008-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch new file mode 100644 index 0000000..a223f1a --- /dev/null +++ b/recipes-devtools/clang/clang/0008-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch @@ -0,0 +1,44 @@ +From f7908f063e790b2930d969a382a8aabb83e7e2a2 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 16 Aug 2017 15:16:15 -0700 +Subject: [PATCH 08/18] clang: Fix ldso for musl on x86 and x32 architectures + +x32 linker is called ld-musl-x32.so.1 and x86 linker +is called ld-musl-i386.so.1, Currently, linker for +x86 is returned as ld-musl-i586.so.1, when default +arch is i586, which is not the right thing + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Linux.cpp | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index 7d5a85ed744..4dfef25aa63 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -516,6 +516,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + if (Triple.isMusl()) { + std::string ArchName; + bool IsArm = false; ++ bool isX32 = false; + + switch (Arch) { + case llvm::Triple::arm: +@@ -528,6 +529,13 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + ArchName = "armeb"; + IsArm = true; + break; ++ case llvm::Triple::x86: ++ ArchName = "i386"; ++ break; ++ case llvm::Triple::x86_64: ++ isX32 = Triple.getEnvironment() == llvm::Triple::GNUX32; ++ ArchName = isX32 ? "x32" : Triple.getArchName().str(); ++ break; + default: + ArchName = Triple.getArchName().str(); + } +-- +2.20.1 + diff --git a/recipes-devtools/clang/clang/0008-clang-scan-view-needs-python-2.x.patch b/recipes-devtools/clang/clang/0008-clang-scan-view-needs-python-2.x.patch deleted file mode 100644 index 047c038..0000000 --- a/recipes-devtools/clang/clang/0008-clang-scan-view-needs-python-2.x.patch +++ /dev/null @@ -1,27 +0,0 @@ -From f86a9b4d0b8ee8818a0a86561c33c2dbb1c12535 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Tue, 15 May 2018 10:28:43 -0700 -Subject: [PATCH 08/15] clang: scan-view needs python 2.x - -Some distributions e.g. archlinux have switched to pointing -python to python3, therefore its better to be specific about -python version needed. - -Signed-off-by: Khem Raj ---- - clang/tools/scan-view/bin/scan-view | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/clang/tools/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view -index 6165432e7af..04ad518a60c 100755 ---- 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 python2 - - from __future__ import print_function - --- -2.20.1 - diff --git a/recipes-devtools/clang/clang/0009-clang-scan-view-needs-python-2.x.patch b/recipes-devtools/clang/clang/0009-clang-scan-view-needs-python-2.x.patch new file mode 100644 index 0000000..befbcdc --- /dev/null +++ b/recipes-devtools/clang/clang/0009-clang-scan-view-needs-python-2.x.patch @@ -0,0 +1,27 @@ +From c09c33bec431aa61f36e0ab94bd14c273c5262db Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 15 May 2018 10:28:43 -0700 +Subject: [PATCH 09/18] clang: scan-view needs python 2.x + +Some distributions e.g. archlinux have switched to pointing +python to python3, therefore its better to be specific about +python version needed. + +Signed-off-by: Khem Raj +--- + clang/tools/scan-view/bin/scan-view | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/clang/tools/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view +index 6165432e7af..04ad518a60c 100755 +--- 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 python2 + + from __future__ import print_function + +-- +2.20.1 + diff --git a/recipes-devtools/clang/clang/0009-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch b/recipes-devtools/clang/clang/0009-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch deleted file mode 100644 index 793fbaf..0000000 --- a/recipes-devtools/clang/clang/0009-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch +++ /dev/null @@ -1,91 +0,0 @@ -From da9fe6d6a6160b7eaeef22dff38bbb3f17f26822 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 21 May 2016 00:33:20 +0000 -Subject: [PATCH 09/15] 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 518a85ee1a0..6b4ead4efc6 100644 ---- a/llvm/include/llvm/Analysis/TargetLibraryInfo.def -+++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.def -@@ -731,6 +731,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(); -@@ -778,6 +781,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") -@@ -788,6 +794,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); -@@ -803,6 +812,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); -@@ -929,6 +941,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); -@@ -1154,6 +1169,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); -@@ -1283,6 +1301,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); --- -2.20.1 - diff --git a/recipes-devtools/clang/clang/0010-clang-Append-libunwind-to-compiler-rt-for-linking.patch b/recipes-devtools/clang/clang/0010-clang-Append-libunwind-to-compiler-rt-for-linking.patch new file mode 100644 index 0000000..4f23d69 --- /dev/null +++ b/recipes-devtools/clang/clang/0010-clang-Append-libunwind-to-compiler-rt-for-linking.patch @@ -0,0 +1,33 @@ +From 3ba6f05d35c8b0c405bf62cdd93eecc5a5094165 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 25 Jan 2019 14:39:04 -0800 +Subject: [PATCH 10/18] clang: Append libunwind to compiler-rt for linking + +Some packages which use libgcc tend to use low level unwind functions +too, and they are missing in compiler-rt but provided by llvm libunwind + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/CommonArgs.cpp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp +index d7e316befa6..5f6b24e33eb 100644 +--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp ++++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp +@@ -1191,6 +1191,12 @@ void tools::AddRunTimeLibs(const ToolChain &TC, const Driver &D, + switch (RLT) { + case ToolChain::RLT_CompilerRT: + CmdArgs.push_back(TC.getCompilerRTArgString(Args, "builtins")); ++ CmdArgs.push_back("--as-needed"); ++ CmdArgs.push_back("-l:libunwind.a"); ++ CmdArgs.push_back("-lpthread"); ++ CmdArgs.push_back("-ldl"); ++ CmdArgs.push_back("--no-as-needed"); ++ + break; + case ToolChain::RLT_Libgcc: + // Make sure libgcc is not used under MSVC environment by default +-- +2.20.1 + diff --git a/recipes-devtools/clang/clang/0010-llvm-allow-env-override-of-exe-path.patch b/recipes-devtools/clang/clang/0010-llvm-allow-env-override-of-exe-path.patch deleted file mode 100644 index c28da3c..0000000 --- a/recipes-devtools/clang/clang/0010-llvm-allow-env-override-of-exe-path.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 2af0752ca682d14984aac80e1b84a79b9fa69fb9 Mon Sep 17 00:00:00 2001 -From: Martin Kelly -Date: Fri, 19 May 2017 00:22:57 -0700 -Subject: [PATCH 10/15] 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 bec89fef98c..f9a2862a55d 100644 ---- a/llvm/tools/llvm-config/llvm-config.cpp -+++ b/llvm/tools/llvm-config/llvm-config.cpp -@@ -226,6 +226,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; --- -2.20.1 - diff --git a/recipes-devtools/clang/clang/0011-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch b/recipes-devtools/clang/clang/0011-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch deleted file mode 100644 index 737a053..0000000 --- a/recipes-devtools/clang/clang/0011-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 61d80370805142f531059d3ea58f363aadd1ff06 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Mon, 22 May 2017 17:36:16 -0700 -Subject: [PATCH 11/15] 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 333f109a9a2..a5237c4b779 100644 ---- a/lldb/source/Host/CMakeLists.txt -+++ b/lldb/source/Host/CMakeLists.txt -@@ -148,7 +148,7 @@ if (APPLE) - list(APPEND EXTRA_LIBS xml2) - else () - if (LIBXML2_FOUND) -- list(APPEND EXTRA_LIBS ${LIBXML2_LIBRARIES}) -+ list(APPEND EXTRA_LIBS xml2) - endif() - endif () - if (HAVE_LIBDL) --- -2.20.1 - diff --git a/recipes-devtools/clang/clang/0011-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch b/recipes-devtools/clang/clang/0011-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch new file mode 100644 index 0000000..0316f79 --- /dev/null +++ b/recipes-devtools/clang/clang/0011-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch @@ -0,0 +1,91 @@ +From 4c6422fe53445384c1d9289000cc4c3c7f16e378 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 21 May 2016 00:33:20 +0000 +Subject: [PATCH 11/18] 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 518a85ee1a0..6b4ead4efc6 100644 +--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.def ++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.def +@@ -731,6 +731,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(); +@@ -778,6 +781,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") +@@ -788,6 +794,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); +@@ -803,6 +812,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); +@@ -929,6 +941,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); +@@ -1154,6 +1169,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); +@@ -1283,6 +1301,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); +-- +2.20.1 + diff --git a/recipes-devtools/clang/clang/0012-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch b/recipes-devtools/clang/clang/0012-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch deleted file mode 100644 index 92fe682..0000000 --- a/recipes-devtools/clang/clang/0012-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 058935ad2f27735cedf838b82a8a2d7d1883ab5f Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sun, 27 Aug 2017 10:37:49 -0700 -Subject: [PATCH 12/15] 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 92c7dc5dc55..d67bb43aba3 100644 ---- a/libcxxabi/CMakeLists.txt -+++ b/libcxxabi/CMakeLists.txt -@@ -434,15 +434,10 @@ 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 -+ LIBCXXABI_LIBUNWIND_INCLUDES - libunwind.h - PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES} - ${LIBCXXABI_LIBUNWIND_PATH}/include -@@ -454,15 +449,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) --- -2.20.1 - diff --git a/recipes-devtools/clang/clang/0012-llvm-allow-env-override-of-exe-path.patch b/recipes-devtools/clang/clang/0012-llvm-allow-env-override-of-exe-path.patch new file mode 100644 index 0000000..85d4c85 --- /dev/null +++ b/recipes-devtools/clang/clang/0012-llvm-allow-env-override-of-exe-path.patch @@ -0,0 +1,37 @@ +From 765b7c57c6102d1b1c7fad2e8cd1be78a4a32960 Mon Sep 17 00:00:00 2001 +From: Martin Kelly +Date: Fri, 19 May 2017 00:22:57 -0700 +Subject: [PATCH 12/18] 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 bec89fef98c..f9a2862a55d 100644 +--- a/llvm/tools/llvm-config/llvm-config.cpp ++++ b/llvm/tools/llvm-config/llvm-config.cpp +@@ -226,6 +226,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; +-- +2.20.1 + diff --git a/recipes-devtools/clang/clang/0013-compiler-rt-support-a-new-embedded-linux-target.patch b/recipes-devtools/clang/clang/0013-compiler-rt-support-a-new-embedded-linux-target.patch deleted file mode 100644 index 8951241..0000000 --- a/recipes-devtools/clang/clang/0013-compiler-rt-support-a-new-embedded-linux-target.patch +++ /dev/null @@ -1,326 +0,0 @@ -From b56bc6f9b522b0359cb09e73d719622990dd2c38 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sun, 19 Apr 2015 15:16:23 -0700 -Subject: [PATCH 13/15] compiler-rt: support a new embedded linux target - -Signed-off-by: Khem Raj ---- - compiler-rt/lib/builtins/int_util.c | 3 +- - .../make/platform/clang_linux_embedded.mk | 286 ++++++++++++++++++ - .../clang_linux_embedded_test_input.c | 0 - 3 files changed, 287 insertions(+), 2 deletions(-) - 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/lib/builtins/int_util.c b/compiler-rt/lib/builtins/int_util.c -index 752f2015580..494c870b41d 100644 ---- a/compiler-rt/lib/builtins/int_util.c -+++ b/compiler-rt/lib/builtins/int_util.c -@@ -58,8 +58,7 @@ void __compilerrt_abort_impl(const char *file, int line, const char *function) { - #else - - /* Get the system definition of abort() */ --#include -- -+extern void abort (void) __attribute__ ((__noreturn__)); - #ifndef _WIN32 - __attribute__((weak)) - __attribute__((visibility("hidden"))) -diff --git a/compiler-rt/make/platform/clang_linux_embedded.mk b/compiler-rt/make/platform/clang_linux_embedded.mk -new file mode 100644 -index 00000000000..d0a890075a1 ---- /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 00000000000..e69de29bb2d --- -2.20.1 - diff --git a/recipes-devtools/clang/clang/0013-llvm-AARCH64-Add-support-for-.dword-directives.patch b/recipes-devtools/clang/clang/0013-llvm-AARCH64-Add-support-for-.dword-directives.patch new file mode 100644 index 0000000..542658b --- /dev/null +++ b/recipes-devtools/clang/clang/0013-llvm-AARCH64-Add-support-for-.dword-directives.patch @@ -0,0 +1,57 @@ +From f55e2d5f21917bca619db7aabffd9488748c8165 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 31 Jan 2019 10:53:22 -0800 +Subject: [PATCH 13/18] llvm: [AARCH64] Add support for .dword directives + +This directives is supported in GNU assembler, Add support via addAliasForDirective. +Add a testcase to check for data directives + +Signed-off-by: Khem Raj +--- + .../AArch64/AsmParser/AArch64AsmParser.cpp | 3 ++- + llvm/test/MC/AArch64/data-directives-invalid.s | 16 ++++++++++++++++ + 2 files changed, 18 insertions(+), 1 deletion(-) + create mode 100644 llvm/test/MC/AArch64/data-directives-invalid.s + +diff --git a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp +index 6cc9b67e4d2..c43b9827cbd 100644 +--- a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp ++++ b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp +@@ -244,10 +244,11 @@ public: + + // Alias .hword/.word/xword to the target-independent .2byte/.4byte/.8byte + // directives as they have the same form and semantics: +- /// ::= (.hword | .word | .xword ) [ expression (, expression)* ] ++ /// ::= (.hword | .word | .xword | .dword ) [ expression (, expression)* ] + Parser.addAliasForDirective(".hword", ".2byte"); + Parser.addAliasForDirective(".word", ".4byte"); + Parser.addAliasForDirective(".xword", ".8byte"); ++ Parser.addAliasForDirective(".dword", ".8byte"); + + // Initialize the set of available features. + setAvailableFeatures(ComputeAvailableFeatures(getSTI().getFeatureBits())); +diff --git a/llvm/test/MC/AArch64/data-directives-invalid.s b/llvm/test/MC/AArch64/data-directives-invalid.s +new file mode 100644 +index 00000000000..7b59a2e60fa +--- /dev/null ++++ b/llvm/test/MC/AArch64/data-directives-invalid.s +@@ -0,0 +1,16 @@ ++# RUN: not llvm-mc -triple aarch64 < %s 2>&1 | FileCheck %s ++ ++# CHECK: [[@LINE+1]]:8: error: out of range literal value in '.hword' directive ++.hword 0xffffa ++# CHECK: [[@LINE+1]]:8: error: out of range literal value in '.2byte' directive ++.2byte 0xffffa ++# CHECK: [[@LINE+1]]:7: error: out of range literal value in '.word' directive ++.word 0xffffffffa ++# CHECK: [[@LINE+1]]:8: error: out of range literal value in '.4byte' directive ++.4byte 0xffffffffa ++# CHECK: [[@LINE+1]]:8: error: literal value out of range for directive in '.dword' directive ++.dword 0xffffffffffffffffa ++# CHECK: [[@LINE+1]]:8: error: literal value out of range for directive in '.xword' directive ++.xword 0xffffffffffffffffa ++# CHECK: [[@LINE+1]]:8: error: literal value out of range for directive in '.8byte' directive ++.8byte 0xffffffffffffffffa +-- +2.20.1 + diff --git a/recipes-devtools/clang/clang/0014-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch b/recipes-devtools/clang/clang/0014-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch deleted file mode 100644 index 40168b0..0000000 --- a/recipes-devtools/clang/clang/0014-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch +++ /dev/null @@ -1,46 +0,0 @@ -From a010673fd33c7311763620cf62159993255bb559 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 19 May 2016 23:11:45 -0700 -Subject: [PATCH 14/15] 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 aa360a3ef36..264d39c95c3 100644 ---- a/compiler-rt/CMakeLists.txt -+++ b/compiler-rt/CMakeLists.txt -@@ -66,7 +66,16 @@ set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOLEAN - "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. --- -2.20.1 - diff --git a/recipes-devtools/clang/clang/0014-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch b/recipes-devtools/clang/clang/0014-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch new file mode 100644 index 0000000..980af36 --- /dev/null +++ b/recipes-devtools/clang/clang/0014-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch @@ -0,0 +1,40 @@ +From 392b59a684640eb000dbc4f89dcec44f8e3b4600 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 22 May 2017 17:36:16 -0700 +Subject: [PATCH 14/18] 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 333f109a9a2..a5237c4b779 100644 +--- a/lldb/source/Host/CMakeLists.txt ++++ b/lldb/source/Host/CMakeLists.txt +@@ -148,7 +148,7 @@ if (APPLE) + list(APPEND EXTRA_LIBS xml2) + else () + if (LIBXML2_FOUND) +- list(APPEND EXTRA_LIBS ${LIBXML2_LIBRARIES}) ++ list(APPEND EXTRA_LIBS xml2) + endif() + endif () + if (HAVE_LIBDL) +-- +2.20.1 + diff --git a/recipes-devtools/clang/clang/0015-compiler-rt-Disable-tsan-on-OE-glibc.patch b/recipes-devtools/clang/clang/0015-compiler-rt-Disable-tsan-on-OE-glibc.patch deleted file mode 100644 index f6a8743..0000000 --- a/recipes-devtools/clang/clang/0015-compiler-rt-Disable-tsan-on-OE-glibc.patch +++ /dev/null @@ -1,42 +0,0 @@ -From e166d4e3568de2718b687c046b1d8b89504d1451 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Mon, 18 Jul 2016 08:05:02 +0000 -Subject: [PATCH 15/15] compiler-rt: Disable tsan on OE/glibc - -It does not build see -http://lists.llvm.org/pipermail/llvm-dev/2016-July/102235.html - -Signed-off-by: Khem Raj ---- - compiler-rt/cmake/config-ix.cmake | 2 +- - compiler-rt/test/sanitizer_common/CMakeLists.txt | 1 - - 2 files changed, 1 insertion(+), 2 deletions(-) - -diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake -index db5c4645dc0..83ebc95fc98 100644 ---- a/compiler-rt/cmake/config-ix.cmake -+++ b/compiler-rt/cmake/config-ix.cmake -@@ -593,7 +593,7 @@ else() - endif() - - if (COMPILER_RT_HAS_SANITIZER_COMMON AND TSAN_SUPPORTED_ARCH AND -- OS_NAME MATCHES "Darwin|Linux|FreeBSD|Android|NetBSD") -+ OS_NAME MATCHES "Darwin|FreeBSD|Android|NetBSD") - set(COMPILER_RT_HAS_TSAN TRUE) - else() - set(COMPILER_RT_HAS_TSAN FALSE) -diff --git a/compiler-rt/test/sanitizer_common/CMakeLists.txt b/compiler-rt/test/sanitizer_common/CMakeLists.txt -index 23292e54820..cae7e010885 100644 ---- a/compiler-rt/test/sanitizer_common/CMakeLists.txt -+++ b/compiler-rt/test/sanitizer_common/CMakeLists.txt -@@ -8,7 +8,6 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux|FreeBSD|NetBSD|SunOS") - list(APPEND SUPPORTED_TOOLS asan) - endif() - if(CMAKE_SYSTEM_NAME MATCHES "NetBSD" OR (CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT ANDROID)) -- list(APPEND SUPPORTED_TOOLS tsan) - list(APPEND SUPPORTED_TOOLS msan) - list(APPEND SUPPORTED_TOOLS ubsan) - endif() --- -2.20.1 - diff --git a/recipes-devtools/clang/clang/0015-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch b/recipes-devtools/clang/clang/0015-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch new file mode 100644 index 0000000..7ea17e4 --- /dev/null +++ b/recipes-devtools/clang/clang/0015-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch @@ -0,0 +1,68 @@ +From da86f4425f23511b6af49b10c532a9c7788017a9 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 27 Aug 2017 10:37:49 -0700 +Subject: [PATCH 15/18] 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 92c7dc5dc55..d67bb43aba3 100644 +--- a/libcxxabi/CMakeLists.txt ++++ b/libcxxabi/CMakeLists.txt +@@ -434,15 +434,10 @@ 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 ++ LIBCXXABI_LIBUNWIND_INCLUDES + libunwind.h + PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES} + ${LIBCXXABI_LIBUNWIND_PATH}/include +@@ -454,15 +449,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) +-- +2.20.1 + diff --git a/recipes-devtools/clang/clang/0016-clang-Append-libunwind-to-compiler-rt-for-linking.patch b/recipes-devtools/clang/clang/0016-clang-Append-libunwind-to-compiler-rt-for-linking.patch deleted file mode 100644 index 7fc5795..0000000 --- a/recipes-devtools/clang/clang/0016-clang-Append-libunwind-to-compiler-rt-for-linking.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 89c9b5e2bec26bad047a60bd08722ff138cb7cb3 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Fri, 25 Jan 2019 14:39:04 -0800 -Subject: [PATCH] clang: Append libunwind to compiler-rt for linking - -Some packages which use libgcc tend to use low level unwind functions -too, and they are missing in compiler-rt but provided by llvm libunwind - -Signed-off-by: Khem Raj ---- - clang/lib/Driver/ToolChains/CommonArgs.cpp | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp -index d7e316befa6..72226dd09ce 100644 ---- a/clang/lib/Driver/ToolChains/CommonArgs.cpp -+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp -@@ -1191,6 +1191,12 @@ void tools::AddRunTimeLibs(const ToolChain &TC, const Driver &D, - switch (RLT) { - case ToolChain::RLT_CompilerRT: - CmdArgs.push_back(TC.getCompilerRTArgString(Args, "builtins")); -+ CmdArgs.push_back("--as-needed"); -+ CmdArgs.push_back("-lunwind"); -+ CmdArgs.push_back("-lpthread"); -+ CmdArgs.push_back("-ldl"); -+ CmdArgs.push_back("--no-as-needed"); -+ - break; - case ToolChain::RLT_Libgcc: - // Make sure libgcc is not used under MSVC environment by default --- -2.20.1 - diff --git a/recipes-devtools/clang/clang/0016-compiler-rt-support-a-new-embedded-linux-target.patch b/recipes-devtools/clang/clang/0016-compiler-rt-support-a-new-embedded-linux-target.patch new file mode 100644 index 0000000..0c93b47 --- /dev/null +++ b/recipes-devtools/clang/clang/0016-compiler-rt-support-a-new-embedded-linux-target.patch @@ -0,0 +1,326 @@ +From 6c509374a016e149c06d7cf8db6032864197f89c Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 19 Apr 2015 15:16:23 -0700 +Subject: [PATCH 16/18] compiler-rt: support a new embedded linux target + +Signed-off-by: Khem Raj +--- + compiler-rt/lib/builtins/int_util.c | 3 +- + .../make/platform/clang_linux_embedded.mk | 286 ++++++++++++++++++ + .../clang_linux_embedded_test_input.c | 0 + 3 files changed, 287 insertions(+), 2 deletions(-) + 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/lib/builtins/int_util.c b/compiler-rt/lib/builtins/int_util.c +index 752f2015580..494c870b41d 100644 +--- a/compiler-rt/lib/builtins/int_util.c ++++ b/compiler-rt/lib/builtins/int_util.c +@@ -58,8 +58,7 @@ void __compilerrt_abort_impl(const char *file, int line, const char *function) { + #else + + /* Get the system definition of abort() */ +-#include +- ++extern void abort (void) __attribute__ ((__noreturn__)); + #ifndef _WIN32 + __attribute__((weak)) + __attribute__((visibility("hidden"))) +diff --git a/compiler-rt/make/platform/clang_linux_embedded.mk b/compiler-rt/make/platform/clang_linux_embedded.mk +new file mode 100644 +index 00000000000..d0a890075a1 +--- /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 00000000000..e69de29bb2d +-- +2.20.1 + diff --git a/recipes-devtools/clang/clang/0017-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch b/recipes-devtools/clang/clang/0017-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch new file mode 100644 index 0000000..d7d57f7 --- /dev/null +++ b/recipes-devtools/clang/clang/0017-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch @@ -0,0 +1,46 @@ +From bdd021f901d8bc4ed9f09fa53902674e1517662c Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 19 May 2016 23:11:45 -0700 +Subject: [PATCH 17/18] 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 aa360a3ef36..264d39c95c3 100644 +--- a/compiler-rt/CMakeLists.txt ++++ b/compiler-rt/CMakeLists.txt +@@ -66,7 +66,16 @@ set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOLEAN + "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. +-- +2.20.1 + diff --git a/recipes-devtools/clang/clang/0017-llvm-AARCH64-Add-support-for-.dword-directives.patch b/recipes-devtools/clang/clang/0017-llvm-AARCH64-Add-support-for-.dword-directives.patch deleted file mode 100644 index 4ac102d..0000000 --- a/recipes-devtools/clang/clang/0017-llvm-AARCH64-Add-support-for-.dword-directives.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 2c85adc50b677e9094932828aa7a51affde892fb Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 31 Jan 2019 10:53:22 -0800 -Subject: [PATCH] llvm: [AARCH64] Add support for .dword directives - -This directives is supported in GNU assembler, Add support via addAliasForDirective. -Add a testcase to check for data directives - -Signed-off-by: Khem Raj ---- - .../AArch64/AsmParser/AArch64AsmParser.cpp | 3 ++- - llvm/test/MC/AArch64/data-directives-invalid.s | 16 ++++++++++++++++ - 2 files changed, 18 insertions(+), 1 deletion(-) - create mode 100644 llvm/test/MC/AArch64/data-directives-invalid.s - -diff --git a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp -index 6cc9b67e4d2..c43b9827cbd 100644 ---- a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp -+++ b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp -@@ -244,10 +244,11 @@ public: - - // Alias .hword/.word/xword to the target-independent .2byte/.4byte/.8byte - // directives as they have the same form and semantics: -- /// ::= (.hword | .word | .xword ) [ expression (, expression)* ] -+ /// ::= (.hword | .word | .xword | .dword ) [ expression (, expression)* ] - Parser.addAliasForDirective(".hword", ".2byte"); - Parser.addAliasForDirective(".word", ".4byte"); - Parser.addAliasForDirective(".xword", ".8byte"); -+ Parser.addAliasForDirective(".dword", ".8byte"); - - // Initialize the set of available features. - setAvailableFeatures(ComputeAvailableFeatures(getSTI().getFeatureBits())); -diff --git a/llvm/test/MC/AArch64/data-directives-invalid.s b/llvm/test/MC/AArch64/data-directives-invalid.s -new file mode 100644 -index 00000000000..7b59a2e60fa ---- /dev/null -+++ b/llvm/test/MC/AArch64/data-directives-invalid.s -@@ -0,0 +1,16 @@ -+# RUN: not llvm-mc -triple aarch64 < %s 2>&1 | FileCheck %s -+ -+# CHECK: [[@LINE+1]]:8: error: out of range literal value in '.hword' directive -+.hword 0xffffa -+# CHECK: [[@LINE+1]]:8: error: out of range literal value in '.2byte' directive -+.2byte 0xffffa -+# CHECK: [[@LINE+1]]:7: error: out of range literal value in '.word' directive -+.word 0xffffffffa -+# CHECK: [[@LINE+1]]:8: error: out of range literal value in '.4byte' directive -+.4byte 0xffffffffa -+# CHECK: [[@LINE+1]]:8: error: literal value out of range for directive in '.dword' directive -+.dword 0xffffffffffffffffa -+# CHECK: [[@LINE+1]]:8: error: literal value out of range for directive in '.xword' directive -+.xword 0xffffffffffffffffa -+# CHECK: [[@LINE+1]]:8: error: literal value out of range for directive in '.8byte' directive -+.8byte 0xffffffffffffffffa --- -2.20.1 - diff --git a/recipes-devtools/clang/clang/0018-compiler-rt-Disable-tsan-on-OE-glibc.patch b/recipes-devtools/clang/clang/0018-compiler-rt-Disable-tsan-on-OE-glibc.patch new file mode 100644 index 0000000..4c64d04 --- /dev/null +++ b/recipes-devtools/clang/clang/0018-compiler-rt-Disable-tsan-on-OE-glibc.patch @@ -0,0 +1,42 @@ +From 4a9f02d94f311a866b663d5ff163bbea8fde490e Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 18 Jul 2016 08:05:02 +0000 +Subject: [PATCH 18/18] compiler-rt: Disable tsan on OE/glibc + +It does not build see +http://lists.llvm.org/pipermail/llvm-dev/2016-July/102235.html + +Signed-off-by: Khem Raj +--- + compiler-rt/cmake/config-ix.cmake | 2 +- + compiler-rt/test/sanitizer_common/CMakeLists.txt | 1 - + 2 files changed, 1 insertion(+), 2 deletions(-) + +diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake +index 5b943387717..151b6069e16 100644 +--- a/compiler-rt/cmake/config-ix.cmake ++++ b/compiler-rt/cmake/config-ix.cmake +@@ -594,7 +594,7 @@ else() + endif() + + if (COMPILER_RT_HAS_SANITIZER_COMMON AND TSAN_SUPPORTED_ARCH AND +- OS_NAME MATCHES "Darwin|Linux|FreeBSD|Android|NetBSD") ++ OS_NAME MATCHES "Darwin|FreeBSD|Android|NetBSD") + set(COMPILER_RT_HAS_TSAN TRUE) + else() + set(COMPILER_RT_HAS_TSAN FALSE) +diff --git a/compiler-rt/test/sanitizer_common/CMakeLists.txt b/compiler-rt/test/sanitizer_common/CMakeLists.txt +index 23292e54820..cae7e010885 100644 +--- a/compiler-rt/test/sanitizer_common/CMakeLists.txt ++++ b/compiler-rt/test/sanitizer_common/CMakeLists.txt +@@ -8,7 +8,6 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux|FreeBSD|NetBSD|SunOS") + list(APPEND SUPPORTED_TOOLS asan) + endif() + if(CMAKE_SYSTEM_NAME MATCHES "NetBSD" OR (CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT ANDROID)) +- list(APPEND SUPPORTED_TOOLS tsan) + list(APPEND SUPPORTED_TOOLS msan) + list(APPEND SUPPORTED_TOOLS ubsan) + endif() +-- +2.20.1 + diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index 65589f9..f2c5d74 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -8,24 +8,24 @@ LICENSE = "NCSA" BASEURI ??= "${LLVM_GIT}/llvm-project;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH}" SRC_URI = "\ ${BASEURI} \ - ${@'file://0000-clang-Enable-SSP-and-PIE-by-default.patch' if '${GCCPIE}' else ''} \ - file://0001-clang-driver-Use-lib-for-ldso-on-OE.patch \ - file://0002-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch \ - file://0003-clang-musl-ppc-does-not-support-128-bit-long-double.patch \ - file://0004-clang-Prepend-trailing-to-sysroot.patch \ - file://0005-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch \ - file://0006-clang-Define-releative-gcc-installation-dir.patch \ - file://0007-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch \ - file://0008-clang-scan-view-needs-python-2.x.patch \ - file://0009-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch \ - file://0010-llvm-allow-env-override-of-exe-path.patch \ - file://0011-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch \ - file://0012-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch \ - file://0013-compiler-rt-support-a-new-embedded-linux-target.patch \ - file://0014-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch \ - file://0015-compiler-rt-Disable-tsan-on-OE-glibc.patch \ - file://0016-clang-Append-libunwind-to-compiler-rt-for-linking.patch \ - file://0017-llvm-AARCH64-Add-support-for-.dword-directives.patch \ + ${@'file://0001-clang-Enable-SSP-and-PIE-by-default.patch' if '${GCCPIE}' else ''} \ + file://0002-clang-driver-Use-lib-for-ldso-on-OE.patch \ + file://0003-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch \ + file://0004-clang-musl-ppc-does-not-support-128-bit-long-double.patch \ + file://0005-clang-Prepend-trailing-to-sysroot.patch \ + file://0006-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch \ + file://0007-clang-Define-releative-gcc-installation-dir.patch \ + file://0008-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch \ + file://0009-clang-scan-view-needs-python-2.x.patch \ + file://0010-clang-Append-libunwind-to-compiler-rt-for-linking.patch \ + file://0011-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch \ + file://0012-llvm-allow-env-override-of-exe-path.patch \ + file://0013-llvm-AARCH64-Add-support-for-.dword-directives.patch \ + file://0014-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch \ + file://0015-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch \ + file://0016-compiler-rt-support-a-new-embedded-linux-target.patch \ + file://0017-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch \ + file://0018-compiler-rt-Disable-tsan-on-OE-glibc.patch \ " # Fallback to no-PIE if not set -- cgit v1.2.3-54-g00ecf