diff options
author | Khem Raj <raj.khem@gmail.com> | 2019-01-16 20:01:04 -0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2019-01-18 09:32:26 -0800 |
commit | 5144eca22c717eb73ac95eae7bf1ffaf55e8acbf (patch) | |
tree | a60a0b23bf71318669b599ed9b6d44b8649dcd34 | |
parent | e82ff43b2f361a36d18ac9d09f119f02ca2ac989 (diff) | |
download | meta-clang-5144eca22c717eb73ac95eae7bf1ffaf55e8acbf.tar.gz |
clang: Switch to upcoming 8.0 release branch
Clang 8.0 is going to be released in Feb-March 2019
so here we switch to release/8.x branch a bit early
so we can provide some feedback for release to be good on
OE
If one needs to use stable 7.0.1 release please use thud branch
clang 8.0 does have RISC-V backend, enable it
clang: Add building experimental targets e.g. riscv
Signed-off-by: Khem Raj <raj.khem@gmail.com>
23 files changed, 263 insertions, 634 deletions
diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc index 63c702c..8e29301 100644 --- a/recipes-devtools/clang/clang.inc +++ b/recipes-devtools/clang/clang.inc | |||
@@ -4,11 +4,11 @@ LLVM_DIR = "llvm${LLVM_RELEASE}" | |||
4 | LLVM_GIT ?= "git://github.com/llvm" | 4 | LLVM_GIT ?= "git://github.com/llvm" |
5 | LLVM_GIT_PROTOCOL ?= "https" | 5 | LLVM_GIT_PROTOCOL ?= "https" |
6 | 6 | ||
7 | MAJOR_VER = "7" | 7 | MAJOR_VER = "8" |
8 | MINOR_VER = "0" | 8 | MINOR_VER = "0" |
9 | PATCH_VER = "1" | 9 | PATCH_VER = "0" |
10 | 10 | ||
11 | SRCREV ?= "d0d8eb2e5415b8be29343e3c17a18e49e67b5551" | 11 | SRCREV ?= "e264daec97935db606c312b10e43f4e35ac39b58" |
12 | 12 | ||
13 | PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}" | 13 | PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}" |
14 | BRANCH = "release/${MAJOR_VER}.x" | 14 | BRANCH = "release/${MAJOR_VER}.x" |
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 new file mode 100644 index 0000000..d7b76b1 --- /dev/null +++ b/recipes-devtools/clang/clang/0000-clang-Enable-SSP-and-PIE-by-default.patch | |||
@@ -0,0 +1,63 @@ | |||
1 | From 76718d7d905029a2304c1ad275cd528b404dc7d4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Evangelos Foutras <evangelos@foutrelis.com> | ||
3 | Date: Thu, 20 Sep 2018 06:20:28 +0300 | ||
4 | Subject: [PATCH] clang: Enable SSP and PIE by default | ||
5 | |||
6 | This is a minimal set of changes needed to make clang use SSP and PIE by | ||
7 | default on Arch Linux. Tests that were easy to adjust have been changed | ||
8 | accordingly; only test/Driver/linux-ld.c has been marked as "expected | ||
9 | failure" due to the number of changes it would require (mostly replacing | ||
10 | crtbegin.o with crtbeginS.o). | ||
11 | |||
12 | Doing so is needed in order to align clang with the new default GCC | ||
13 | behavior in Arch which generates PIE executables by default and also | ||
14 | defaults to -fstack-protector-strong. It is not meant to be a long term | ||
15 | solution, but a simple temporary fix. | ||
16 | |||
17 | Hopefully these changes will be obsoleted by the introduction upstream | ||
18 | of a compile-time option (https://bugs.llvm.org/show_bug.cgi?id=13410) | ||
19 | --- | ||
20 | clang/lib/Driver/ToolChains/Linux.cpp | 14 ++++++++++++-- | ||
21 | clang/lib/Driver/ToolChains/Linux.h | 1 + | ||
22 | 2 files changed, 13 insertions(+), 2 deletions(-) | ||
23 | |||
24 | diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp | ||
25 | index 5dc7b506d6f..4dfef25aa63 100644 | ||
26 | --- a/clang/lib/Driver/ToolChains/Linux.cpp | ||
27 | +++ b/clang/lib/Driver/ToolChains/Linux.cpp | ||
28 | @@ -976,8 +976,18 @@ void Linux::AddIAMCUIncludeArgs(const ArgList &DriverArgs, | ||
29 | } | ||
30 | |||
31 | bool Linux::isPIEDefault() const { | ||
32 | - return (getTriple().isAndroid() && !getTriple().isAndroidVersionLT(16)) || | ||
33 | - getTriple().isMusl() || getSanitizerArgs().requiresPIE(); | ||
34 | + const bool IsMips = getTriple().isMIPS(); | ||
35 | + const bool IsAndroid = getTriple().isAndroid(); | ||
36 | + | ||
37 | + if (IsMips || IsAndroid) | ||
38 | + return (getTriple().isAndroid() && !getTriple().isAndroidVersionLT(16)) || | ||
39 | + getTriple().isMusl() || getSanitizerArgs().requiresPIE(); | ||
40 | + | ||
41 | + return true; | ||
42 | +} | ||
43 | + | ||
44 | +unsigned Linux::GetDefaultStackProtectorLevel(bool KernelOrKext) const { | ||
45 | + return 2; | ||
46 | } | ||
47 | |||
48 | bool Linux::IsMathErrnoDefault() const { | ||
49 | diff --git a/clang/lib/Driver/ToolChains/Linux.h b/clang/lib/Driver/ToolChains/Linux.h | ||
50 | index 4a662cb4b42..2ddd4056573 100644 | ||
51 | --- a/clang/lib/Driver/ToolChains/Linux.h | ||
52 | +++ b/clang/lib/Driver/ToolChains/Linux.h | ||
53 | @@ -39,6 +39,7 @@ public: | ||
54 | llvm::opt::ArgStringList &CC1Args) const override; | ||
55 | CXXStdlibType GetDefaultCXXStdlibType() const override; | ||
56 | bool isPIEDefault() const override; | ||
57 | + unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override; | ||
58 | bool IsMathErrnoDefault() const override; | ||
59 | SanitizerMask getSupportedSanitizers() const override; | ||
60 | void addProfileRTLibs(const llvm::opt::ArgList &Args, | ||
61 | -- | ||
62 | 2.20.1 | ||
63 | |||
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 index 2b06da2..42e920a 100644 --- 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 | |||
@@ -1,7 +1,7 @@ | |||
1 | From 06033c7fa2d575a9a68b377f5ce9324433c23806 Mon Sep 17 00:00:00 2001 | 1 | From 4fe687292a2b2952a360eecdd6954db11750c903 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Sat, 21 May 2016 21:52:36 -0700 | 3 | Date: Sat, 21 May 2016 21:52:36 -0700 |
4 | Subject: [PATCH 1/8] clang: driver: Use /lib for ldso on OE | 4 | Subject: [PATCH 01/15] clang: driver: Use /lib for ldso on OE |
5 | 5 | ||
6 | OE does not follow the default base_libdir | 6 | OE does not follow the default base_libdir |
7 | that clang has, therefore adjust it for OE | 7 | that clang has, therefore adjust it for OE |
@@ -11,14 +11,14 @@ for 64bit to /lib64 instead of /lib | |||
11 | 11 | ||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
13 | --- | 13 | --- |
14 | lib/Driver/ToolChains/Linux.cpp | 8 ++++---- | 14 | clang/lib/Driver/ToolChains/Linux.cpp | 8 ++++---- |
15 | 1 file changed, 4 insertions(+), 4 deletions(-) | 15 | 1 file changed, 4 insertions(+), 4 deletions(-) |
16 | 16 | ||
17 | diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp | 17 | diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp |
18 | index f8f3623918..e662b6b262 100644 | 18 | index 65ab9b2daf5..33e2fcec299 100644 |
19 | --- a/lib/Driver/ToolChains/Linux.cpp | 19 | --- a/clang/lib/Driver/ToolChains/Linux.cpp |
20 | +++ b/lib/Driver/ToolChains/Linux.cpp | 20 | +++ b/clang/lib/Driver/ToolChains/Linux.cpp |
21 | @@ -566,12 +566,12 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { | 21 | @@ -590,12 +590,12 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { |
22 | Loader = "ld.so.1"; | 22 | Loader = "ld.so.1"; |
23 | break; | 23 | break; |
24 | case llvm::Triple::ppc64: | 24 | case llvm::Triple::ppc64: |
@@ -33,7 +33,7 @@ index f8f3623918..e662b6b262 100644 | |||
33 | Loader = | 33 | Loader = |
34 | (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2"; | 34 | (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2"; |
35 | break; | 35 | break; |
36 | @@ -593,7 +593,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { | 36 | @@ -617,7 +617,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { |
37 | Loader = "ld-linux.so.2"; | 37 | Loader = "ld-linux.so.2"; |
38 | break; | 38 | break; |
39 | case llvm::Triple::sparcv9: | 39 | case llvm::Triple::sparcv9: |
@@ -42,7 +42,7 @@ index f8f3623918..e662b6b262 100644 | |||
42 | Loader = "ld-linux.so.2"; | 42 | Loader = "ld-linux.so.2"; |
43 | break; | 43 | break; |
44 | case llvm::Triple::systemz: | 44 | case llvm::Triple::systemz: |
45 | @@ -607,7 +607,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { | 45 | @@ -631,7 +631,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { |
46 | case llvm::Triple::x86_64: { | 46 | case llvm::Triple::x86_64: { |
47 | bool X32 = Triple.getEnvironment() == llvm::Triple::GNUX32; | 47 | bool X32 = Triple.getEnvironment() == llvm::Triple::GNUX32; |
48 | 48 | ||
@@ -52,5 +52,5 @@ index f8f3623918..e662b6b262 100644 | |||
52 | break; | 52 | break; |
53 | } | 53 | } |
54 | -- | 54 | -- |
55 | 2.18.0 | 55 | 2.20.1 |
56 | 56 | ||
diff --git a/recipes-devtools/clang/clang/0001-lldb-Include-limits.h-for-PATH_MAX-definition.patch b/recipes-devtools/clang/clang/0001-lldb-Include-limits.h-for-PATH_MAX-definition.patch deleted file mode 100644 index 1c42931..0000000 --- a/recipes-devtools/clang/clang/0001-lldb-Include-limits.h-for-PATH_MAX-definition.patch +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | From ff8d7137ed4d62e9db6d31581822a2ce06d5cbc6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Thu, 18 May 2017 23:12:34 -0700 | ||
4 | Subject: [PATCH 1/2] lldb: Include limits.h for PATH_MAX definition | ||
5 | |||
6 | Helps compiling on musl targets | ||
7 | |||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | --- | ||
10 | source/Utility/FileSpec.cpp | 2 +- | ||
11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/source/Utility/FileSpec.cpp b/source/Utility/FileSpec.cpp | ||
14 | index b6952f7e3..2cedf5d90 100644 | ||
15 | --- a/source/Utility/FileSpec.cpp | ||
16 | +++ b/source/Utility/FileSpec.cpp | ||
17 | @@ -29,7 +29,7 @@ | ||
18 | #include <assert.h> // for assert | ||
19 | #include <stdio.h> // for size_t, NULL, snpr... | ||
20 | #include <string.h> // for strcmp | ||
21 | - | ||
22 | +#include <limits.h> // for PATH_MAX | ||
23 | using namespace lldb; | ||
24 | using namespace lldb_private; | ||
25 | |||
26 | -- | ||
27 | 2.20.1 | ||
28 | |||
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 index f73b1c0..35b3d4f 100644 --- 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 | |||
@@ -1,7 +1,7 @@ | |||
1 | From fc628b03a5ac41a446fd2dfea0ecbe03331e54d8 Mon Sep 17 00:00:00 2001 | 1 | From 14a9ed6fa67f7e988d85408554f88a8d72c6a607 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Thu, 19 May 2016 21:11:06 -0700 | 3 | Date: Thu, 19 May 2016 21:11:06 -0700 |
4 | Subject: [PATCH 2/8] clang: Driver/tools.cpp: Add -lssp_nonshared on musl | 4 | Subject: [PATCH 02/15] clang: Driver/tools.cpp: Add -lssp_nonshared on musl |
5 | 5 | ||
6 | musl driver will need to add ssp_nonshared for stack_check_local | 6 | musl driver will need to add ssp_nonshared for stack_check_local |
7 | on the linker cmdline when using stack protector commands on | 7 | on the linker cmdline when using stack protector commands on |
@@ -9,14 +9,14 @@ compiler cmdline | |||
9 | 9 | ||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
11 | --- | 11 | --- |
12 | lib/Driver/ToolChains/Gnu.cpp | 6 ++++++ | 12 | clang/lib/Driver/ToolChains/Gnu.cpp | 6 ++++++ |
13 | 1 file changed, 6 insertions(+) | 13 | 1 file changed, 6 insertions(+) |
14 | 14 | ||
15 | diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp | 15 | diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp |
16 | index 3755673250..766c650b3c 100644 | 16 | index 2ad45097dce..c841399193e 100644 |
17 | --- a/lib/Driver/ToolChains/Gnu.cpp | 17 | --- a/clang/lib/Driver/ToolChains/Gnu.cpp |
18 | +++ b/lib/Driver/ToolChains/Gnu.cpp | 18 | +++ b/clang/lib/Driver/ToolChains/Gnu.cpp |
19 | @@ -503,6 +503,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, | 19 | @@ -525,6 +525,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, |
20 | if (IsIAMCU) | 20 | if (IsIAMCU) |
21 | CmdArgs.push_back("-lgloss"); | 21 | CmdArgs.push_back("-lgloss"); |
22 | 22 | ||
@@ -30,5 +30,5 @@ index 3755673250..766c650b3c 100644 | |||
30 | CmdArgs.push_back("--end-group"); | 30 | CmdArgs.push_back("--end-group"); |
31 | else | 31 | else |
32 | -- | 32 | -- |
33 | 2.18.0 | 33 | 2.20.1 |
34 | 34 | ||
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 index 868fc3b..80ec006 100644 --- 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 | |||
@@ -1,27 +1,27 @@ | |||
1 | From 48fa180df65f7ee63a85dd69fd2c1382609c5e95 Mon Sep 17 00:00:00 2001 | 1 | From 0f183864a6e89461143e082d4b7e5df4cd0f4480 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Tue, 10 May 2016 02:00:11 -0700 | 3 | Date: Tue, 10 May 2016 02:00:11 -0700 |
4 | Subject: [PATCH 3/8] clang: musl/ppc does not support 128-bit long double | 4 | Subject: [PATCH 03/15] clang: musl/ppc does not support 128-bit long double |
5 | 5 | ||
6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
7 | --- | 7 | --- |
8 | lib/Basic/Targets/PPC.h | 3 ++- | 8 | clang/lib/Basic/Targets/PPC.h | 3 ++- |
9 | 1 file changed, 2 insertions(+), 1 deletion(-) | 9 | 1 file changed, 2 insertions(+), 1 deletion(-) |
10 | 10 | ||
11 | diff --git a/lib/Basic/Targets/PPC.h b/lib/Basic/Targets/PPC.h | 11 | diff --git a/clang/lib/Basic/Targets/PPC.h b/clang/lib/Basic/Targets/PPC.h |
12 | index 439c73a0e3..8da698ee21 100644 | 12 | index 058970a0e09..ba5b941bc08 100644 |
13 | --- a/lib/Basic/Targets/PPC.h | 13 | --- a/clang/lib/Basic/Targets/PPC.h |
14 | +++ b/lib/Basic/Targets/PPC.h | 14 | +++ b/clang/lib/Basic/Targets/PPC.h |
15 | @@ -328,7 +328,8 @@ public: | 15 | @@ -331,7 +331,8 @@ public: |
16 | break; | 16 | break; |
17 | } | 17 | } |
18 | 18 | ||
19 | - if (getTriple().getOS() == llvm::Triple::FreeBSD) { | 19 | - if (getTriple().isOSFreeBSD()) { |
20 | + if (getTriple().getOS() == llvm::Triple::FreeBSD | 20 | + if (getTriple().isOSFreeBSD() |
21 | + || getTriple().isMusl()) { | 21 | + || getTriple().isMusl()) { |
22 | LongDoubleWidth = LongDoubleAlign = 64; | 22 | LongDoubleWidth = LongDoubleAlign = 64; |
23 | LongDoubleFormat = &llvm::APFloat::IEEEdouble(); | 23 | LongDoubleFormat = &llvm::APFloat::IEEEdouble(); |
24 | } | 24 | } |
25 | -- | 25 | -- |
26 | 2.18.0 | 26 | 2.20.1 |
27 | 27 | ||
diff --git a/recipes-devtools/clang/clang/0003-llvm-Disable-calls-to-_finite-and-other-glibc-only-f.patch b/recipes-devtools/clang/clang/0003-llvm-Disable-calls-to-_finite-and-other-glibc-only-f.patch deleted file mode 100644 index 9f665e3..0000000 --- a/recipes-devtools/clang/clang/0003-llvm-Disable-calls-to-_finite-and-other-glibc-only-f.patch +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | From cb1b6f021d2ce82d7d0084758b7efaa3917640f5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sun, 26 Aug 2018 22:43:19 -0700 | ||
4 | Subject: [PATCH 3/3] llvm: Disable calls to *_finite and other glibc-only | ||
5 | functions on Musl. | ||
6 | |||
7 | glibc's finite lib calls are generated when possible. | ||
8 | However, they are not supported on Musl/linux. This change also | ||
9 | disables other functions not available on Musl. | ||
10 | |||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | lib/Analysis/TargetLibraryInfo.cpp | 29 +++++++++++++++-------------- | ||
14 | 1 file changed, 15 insertions(+), 14 deletions(-) | ||
15 | |||
16 | diff --git a/lib/Analysis/TargetLibraryInfo.cpp b/lib/Analysis/TargetLibraryInfo.cpp | ||
17 | index 102135fbf31..5bc4d2b47f5 100644 | ||
18 | --- a/lib/Analysis/TargetLibraryInfo.cpp | ||
19 | +++ b/lib/Analysis/TargetLibraryInfo.cpp | ||
20 | @@ -415,27 +415,28 @@ static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T, | ||
21 | |||
22 | // The following functions are available on Linux, | ||
23 | // but Android uses bionic instead of glibc. | ||
24 | - if (!T.isOSLinux() || T.isAndroid()) { | ||
25 | + if (!T.isOSLinux() || T.isAndroid() || T.isMusl()) { | ||
26 | TLI.setUnavailable(LibFunc_dunder_strdup); | ||
27 | TLI.setUnavailable(LibFunc_dunder_strtok_r); | ||
28 | TLI.setUnavailable(LibFunc_dunder_isoc99_scanf); | ||
29 | TLI.setUnavailable(LibFunc_dunder_isoc99_sscanf); | ||
30 | TLI.setUnavailable(LibFunc_under_IO_getc); | ||
31 | TLI.setUnavailable(LibFunc_under_IO_putc); | ||
32 | - // But, Android has memalign. | ||
33 | - if (!T.isAndroid()) | ||
34 | + // But, Android/Musl has memalign. | ||
35 | + if (!T.isAndroid() || !T.isMusl() ) | ||
36 | TLI.setUnavailable(LibFunc_memalign); | ||
37 | - TLI.setUnavailable(LibFunc_fopen64); | ||
38 | - TLI.setUnavailable(LibFunc_fseeko64); | ||
39 | - TLI.setUnavailable(LibFunc_fstat64); | ||
40 | - TLI.setUnavailable(LibFunc_fstatvfs64); | ||
41 | - TLI.setUnavailable(LibFunc_ftello64); | ||
42 | - TLI.setUnavailable(LibFunc_lstat64); | ||
43 | - TLI.setUnavailable(LibFunc_open64); | ||
44 | - TLI.setUnavailable(LibFunc_stat64); | ||
45 | - TLI.setUnavailable(LibFunc_statvfs64); | ||
46 | - TLI.setUnavailable(LibFunc_tmpfile64); | ||
47 | - | ||
48 | + if (!T.isMusl()) { | ||
49 | + TLI.setUnavailable(LibFunc_fopen64); | ||
50 | + TLI.setUnavailable(LibFunc_fseeko64); | ||
51 | + TLI.setUnavailable(LibFunc_fstat64); | ||
52 | + TLI.setUnavailable(LibFunc_fstatvfs64); | ||
53 | + TLI.setUnavailable(LibFunc_ftello64); | ||
54 | + TLI.setUnavailable(LibFunc_lstat64); | ||
55 | + TLI.setUnavailable(LibFunc_open64); | ||
56 | + TLI.setUnavailable(LibFunc_stat64); | ||
57 | + TLI.setUnavailable(LibFunc_statvfs64); | ||
58 | + TLI.setUnavailable(LibFunc_tmpfile64); | ||
59 | + } | ||
60 | // Relaxed math functions are included in math-finite.h on Linux (GLIBC). | ||
61 | TLI.setUnavailable(LibFunc_acos_finite); | ||
62 | TLI.setUnavailable(LibFunc_acosf_finite); | ||
63 | -- | ||
64 | 2.18.0 | ||
65 | |||
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 index 03c6bab..0cb81cd 100644 --- a/recipes-devtools/clang/clang/0004-clang-Prepend-trailing-to-sysroot.patch +++ b/recipes-devtools/clang/clang/0004-clang-Prepend-trailing-to-sysroot.patch | |||
@@ -1,7 +1,7 @@ | |||
1 | From 4764d8f8b613631de2e3c9a3614427d07c599017 Mon Sep 17 00:00:00 2001 | 1 | From 792786fb04bf505cdcd39a22744111cfd57a2ac5 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Thu, 16 Mar 2017 09:02:13 -0700 | 3 | Date: Thu, 16 Mar 2017 09:02:13 -0700 |
4 | Subject: [PATCH 4/8] clang: Prepend trailing '/' to sysroot | 4 | Subject: [PATCH 04/15] clang: Prepend trailing '/' to sysroot |
5 | 5 | ||
6 | This is needed to handle a case where clang | 6 | This is needed to handle a case where clang |
7 | isntall and target sysroot are perilously same | 7 | isntall and target sysroot are perilously same |
@@ -20,16 +20,16 @@ installation and not sysroot | |||
20 | 20 | ||
21 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 21 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
22 | --- | 22 | --- |
23 | lib/Driver/ToolChains/Linux.cpp | 2 +- | 23 | clang/lib/Driver/ToolChains/Linux.cpp | 2 +- |
24 | 1 file changed, 1 insertion(+), 1 deletion(-) | 24 | 1 file changed, 1 insertion(+), 1 deletion(-) |
25 | 25 | ||
26 | diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp | 26 | diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp |
27 | index e662b6b262..5bca972cc2 100644 | 27 | index 33e2fcec299..4dfaf052f86 100644 |
28 | --- a/lib/Driver/ToolChains/Linux.cpp | 28 | --- a/clang/lib/Driver/ToolChains/Linux.cpp |
29 | +++ b/lib/Driver/ToolChains/Linux.cpp | 29 | +++ b/clang/lib/Driver/ToolChains/Linux.cpp |
30 | @@ -211,7 +211,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) | 30 | @@ -219,7 +219,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) |
31 | GCCInstallation.init(Triple, Args); | ||
32 | Multilibs = GCCInstallation.getMultilibs(); | 31 | Multilibs = GCCInstallation.getMultilibs(); |
32 | SelectedMultilib = GCCInstallation.getMultilib(); | ||
33 | llvm::Triple::ArchType Arch = Triple.getArch(); | 33 | llvm::Triple::ArchType Arch = Triple.getArch(); |
34 | - std::string SysRoot = computeSysRoot(); | 34 | - std::string SysRoot = computeSysRoot(); |
35 | + std::string SysRoot = computeSysRoot() + "/"; | 35 | + std::string SysRoot = computeSysRoot() + "/"; |
@@ -37,5 +37,5 @@ index e662b6b262..5bca972cc2 100644 | |||
37 | // Cross-compiling binutils and GCC installations (vanilla and openSUSE at | 37 | // Cross-compiling binutils and GCC installations (vanilla and openSUSE at |
38 | // least) put various tools in a triple-prefixed directory off of the parent | 38 | // least) put various tools in a triple-prefixed directory off of the parent |
39 | -- | 39 | -- |
40 | 2.18.0 | 40 | 2.20.1 |
41 | 41 | ||
diff --git a/recipes-devtools/clang/clang/0004-compiler-rt-cmake-mips-Do-not-specify-target-with-OE.patch b/recipes-devtools/clang/clang/0004-compiler-rt-cmake-mips-Do-not-specify-target-with-OE.patch deleted file mode 100644 index 0356e2a..0000000 --- a/recipes-devtools/clang/clang/0004-compiler-rt-cmake-mips-Do-not-specify-target-with-OE.patch +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | From b29deaeb42a8f56bb5dd72b5a8c3e2c755a6bb9e Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 11 Feb 2017 17:54:33 +0000 | ||
4 | Subject: [PATCH 4/4] compiler-rt: cmake/mips: Do not specify --target with OE | ||
5 | |||
6 | OE already specifies cross compiler correctly, adding this additional | ||
7 | --target confuses the clang driver and it resorts to invoke host assembler | ||
8 | when using -no-integrated-as | ||
9 | |||
10 | Fixes errors e.g. | ||
11 | | Assembler messages: | ||
12 | | | ||
13 | | Fatal error: invalid -march= option: `mips32r2' | ||
14 | | | ||
15 | | clang-4.0: error: assembler command failed with exit code 1 | ||
16 | |||
17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
18 | --- | ||
19 | cmake/base-config-ix.cmake | 8 ++++---- | ||
20 | 1 file changed, 4 insertions(+), 4 deletions(-) | ||
21 | |||
22 | diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake | ||
23 | index 91fe2494b..789b80628 100644 | ||
24 | --- a/cmake/base-config-ix.cmake | ||
25 | +++ b/cmake/base-config-ix.cmake | ||
26 | @@ -191,11 +191,11 @@ macro(test_targets) | ||
27 | # clang's default CPU's. In the 64-bit case, we must also specify the ABI | ||
28 | # since the default ABI differs between gcc and clang. | ||
29 | # FIXME: Ideally, we would build the N32 library too. | ||
30 | - test_target_arch(mipsel "" "-mips32r2" "--target=mipsel-linux-gnu") | ||
31 | - test_target_arch(mips64el "" "-mips64r2" "--target=mips64el-linux-gnu" "-mabi=64") | ||
32 | + test_target_arch(mipsel "" "-mips32r2") | ||
33 | + test_target_arch(mips64el "" "-mips64r2" "-mabi=64") | ||
34 | elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "mips") | ||
35 | - test_target_arch(mips "" "-mips32r2" "--target=mips-linux-gnu") | ||
36 | - test_target_arch(mips64 "" "-mips64r2" "--target=mips64-linux-gnu" "-mabi=64") | ||
37 | + test_target_arch(mips "" "-mips32r2") | ||
38 | + test_target_arch(mips64 "" "-mips64r2" "-mabi=64") | ||
39 | elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "arm") | ||
40 | if(WIN32) | ||
41 | test_target_arch(arm "" "" "") | ||
42 | -- | ||
43 | 2.20.1 | ||
44 | |||
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 index 8425f8d..61caa3c 100644 --- 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 | |||
@@ -1,7 +1,7 @@ | |||
1 | From e02d9f3e1c724a4161709952a3ef59f81432fc06 Mon Sep 17 00:00:00 2001 | 1 | From 0327863d99125908e209e46e2687e9fb77ff25a7 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Thu, 16 Mar 2017 19:06:26 -0700 | 3 | Date: Thu, 16 Mar 2017 19:06:26 -0700 |
4 | Subject: [PATCH 5/8] clang: Look inside the target sysroot for compiler | 4 | Subject: [PATCH 05/15] clang: Look inside the target sysroot for compiler |
5 | runtime | 5 | runtime |
6 | 6 | ||
7 | In OE compiler-rt and libc++ are built and staged into target | 7 | In OE compiler-rt and libc++ are built and staged into target |
@@ -12,22 +12,22 @@ Specific to cross compiling the way yocto/OE works | |||
12 | 12 | ||
13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
14 | --- | 14 | --- |
15 | lib/Driver/ToolChain.cpp | 6 +++++- | 15 | clang/lib/Driver/ToolChain.cpp | 6 +++++- |
16 | 1 file changed, 5 insertions(+), 1 deletion(-) | 16 | 1 file changed, 5 insertions(+), 1 deletion(-) |
17 | 17 | ||
18 | diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp | 18 | diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp |
19 | index cf3db34688..dae3178380 100644 | 19 | index 88a627eab6d..d56b5264b4d 100644 |
20 | --- a/lib/Driver/ToolChain.cpp | 20 | --- a/clang/lib/Driver/ToolChain.cpp |
21 | +++ b/lib/Driver/ToolChain.cpp | 21 | +++ b/clang/lib/Driver/ToolChain.cpp |
22 | @@ -13,6 +13,7 @@ | 22 | @@ -13,6 +13,7 @@ |
23 | #include "ToolChains/Clang.h" | 23 | #include "ToolChains/Clang.h" |
24 | #include "clang/Basic/ObjCRuntime.h" | 24 | #include "clang/Basic/ObjCRuntime.h" |
25 | #include "clang/Basic/Sanitizers.h" | 25 | #include "clang/Basic/Sanitizers.h" |
26 | +#include "clang/Basic/Version.h" | 26 | +#include "clang/Basic/Version.h" |
27 | #include "clang/Basic/VirtualFileSystem.h" | ||
28 | #include "clang/Config/config.h" | 27 | #include "clang/Config/config.h" |
29 | #include "clang/Driver/Action.h" | 28 | #include "clang/Driver/Action.h" |
30 | @@ -343,7 +344,10 @@ StringRef ToolChain::getOSLibName() const { | 29 | #include "clang/Driver/Driver.h" |
30 | @@ -353,7 +354,10 @@ StringRef ToolChain::getOSLibName() const { | ||
31 | } | 31 | } |
32 | 32 | ||
33 | std::string ToolChain::getCompilerRTPath() const { | 33 | std::string ToolChain::getCompilerRTPath() const { |
@@ -40,5 +40,5 @@ index cf3db34688..dae3178380 100644 | |||
40 | llvm::sys::path::append(Path, "lib"); | 40 | llvm::sys::path::append(Path, "lib"); |
41 | } else { | 41 | } else { |
42 | -- | 42 | -- |
43 | 2.18.0 | 43 | 2.20.1 |
44 | 44 | ||
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 index b611dd5..92e660c 100644 --- 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 | |||
@@ -1,7 +1,7 @@ | |||
1 | From e6232d22df73b80ced3784fd85166ebe24e6c31b Mon Sep 17 00:00:00 2001 | 1 | From 15fab22ab9478935b30d55de1d871553991bc3ad Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Sun, 21 May 2017 15:38:25 -0700 | 3 | Date: Sun, 21 May 2017 15:38:25 -0700 |
4 | Subject: [PATCH 6/8] clang: Define / releative gcc installation dir | 4 | Subject: [PATCH 06/15] clang: Define / releative gcc installation dir |
5 | 5 | ||
6 | This is required for OE gcc installation to work. | 6 | This is required for OE gcc installation to work. |
7 | Without this its not able to find the paths for libgcc | 7 | Without this its not able to find the paths for libgcc |
@@ -10,14 +10,14 @@ installation in OE | |||
10 | 10 | ||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
12 | --- | 12 | --- |
13 | lib/Driver/ToolChains/Gnu.cpp | 3 +++ | 13 | clang/lib/Driver/ToolChains/Gnu.cpp | 3 +++ |
14 | 1 file changed, 3 insertions(+) | 14 | 1 file changed, 3 insertions(+) |
15 | 15 | ||
16 | diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp | 16 | diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp |
17 | index 766c650b3c..777526e063 100644 | 17 | index c841399193e..468ee821a57 100644 |
18 | --- a/lib/Driver/ToolChains/Gnu.cpp | 18 | --- a/clang/lib/Driver/ToolChains/Gnu.cpp |
19 | +++ b/lib/Driver/ToolChains/Gnu.cpp | 19 | +++ b/clang/lib/Driver/ToolChains/Gnu.cpp |
20 | @@ -2190,6 +2190,9 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( | 20 | @@ -2280,6 +2280,9 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( |
21 | {"gcc-cross/" + CandidateTriple.str(), "../..", | 21 | {"gcc-cross/" + CandidateTriple.str(), "../..", |
22 | TargetTriple.getOS() != llvm::Triple::Solaris}, | 22 | TargetTriple.getOS() != llvm::Triple::Solaris}, |
23 | 23 | ||
@@ -28,5 +28,5 @@ index 766c650b3c..777526e063 100644 | |||
28 | // <sysroot>/usr/lib/<triple>/x.y.z so have a look there as well. Only do | 28 | // <sysroot>/usr/lib/<triple>/x.y.z so have a look there as well. Only do |
29 | // this on Freescale triples, though, since some systems put a *lot* of | 29 | // this on Freescale triples, though, since some systems put a *lot* of |
30 | -- | 30 | -- |
31 | 2.18.0 | 31 | 2.20.1 |
32 | 32 | ||
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 index b456a59..7965fc6 100644 --- 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 | |||
@@ -1,7 +1,7 @@ | |||
1 | From 5840f5a6756f8f67dbba1b47015e75c8c3264b2b Mon Sep 17 00:00:00 2001 | 1 | From e2f49f7535aeb72592f8386cddb611f7bcdf2f32 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Wed, 16 Aug 2017 15:16:15 -0700 | 3 | Date: Wed, 16 Aug 2017 15:16:15 -0700 |
4 | Subject: [PATCH 7/8] clang: Fix ldso for musl on x86 and x32 architectures | 4 | Subject: [PATCH 07/15] clang: Fix ldso for musl on x86 and x32 architectures |
5 | 5 | ||
6 | x32 linker is called ld-musl-x32.so.1 and x86 linker | 6 | x32 linker is called ld-musl-x32.so.1 and x86 linker |
7 | is called ld-musl-i386.so.1, Currently, linker for | 7 | is called ld-musl-i386.so.1, Currently, linker for |
@@ -10,14 +10,14 @@ arch is i586, which is not the right thing | |||
10 | 10 | ||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
12 | --- | 12 | --- |
13 | lib/Driver/ToolChains/Linux.cpp | 8 ++++++++ | 13 | clang/lib/Driver/ToolChains/Linux.cpp | 8 ++++++++ |
14 | 1 file changed, 8 insertions(+) | 14 | 1 file changed, 8 insertions(+) |
15 | 15 | ||
16 | diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp | 16 | diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp |
17 | index 5bca972cc2..2ca285679c 100644 | 17 | index 4dfaf052f86..5dc7b506d6f 100644 |
18 | --- a/lib/Driver/ToolChains/Linux.cpp | 18 | --- a/clang/lib/Driver/ToolChains/Linux.cpp |
19 | +++ b/lib/Driver/ToolChains/Linux.cpp | 19 | +++ b/clang/lib/Driver/ToolChains/Linux.cpp |
20 | @@ -492,6 +492,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { | 20 | @@ -516,6 +516,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { |
21 | if (Triple.isMusl()) { | 21 | if (Triple.isMusl()) { |
22 | std::string ArchName; | 22 | std::string ArchName; |
23 | bool IsArm = false; | 23 | bool IsArm = false; |
@@ -25,7 +25,7 @@ index 5bca972cc2..2ca285679c 100644 | |||
25 | 25 | ||
26 | switch (Arch) { | 26 | switch (Arch) { |
27 | case llvm::Triple::arm: | 27 | case llvm::Triple::arm: |
28 | @@ -504,6 +505,13 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { | 28 | @@ -528,6 +529,13 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { |
29 | ArchName = "armeb"; | 29 | ArchName = "armeb"; |
30 | IsArm = true; | 30 | IsArm = true; |
31 | break; | 31 | break; |
@@ -40,5 +40,5 @@ index 5bca972cc2..2ca285679c 100644 | |||
40 | ArchName = Triple.getArchName().str(); | 40 | ArchName = Triple.getArchName().str(); |
41 | } | 41 | } |
42 | -- | 42 | -- |
43 | 2.18.0 | 43 | 2.20.1 |
44 | 44 | ||
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 index c55b309..047c038 100644 --- 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 | |||
@@ -1,7 +1,7 @@ | |||
1 | From 846e59787ec12b6cd817640151d1f23d3b78d6b5 Mon Sep 17 00:00:00 2001 | 1 | From f86a9b4d0b8ee8818a0a86561c33c2dbb1c12535 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Tue, 15 May 2018 10:28:43 -0700 | 3 | Date: Tue, 15 May 2018 10:28:43 -0700 |
4 | Subject: [PATCH 8/8] clang: scan-view needs python 2.x | 4 | Subject: [PATCH 08/15] clang: scan-view needs python 2.x |
5 | 5 | ||
6 | Some distributions e.g. archlinux have switched to pointing | 6 | Some distributions e.g. archlinux have switched to pointing |
7 | python to python3, therefore its better to be specific about | 7 | python to python3, therefore its better to be specific about |
@@ -9,19 +9,19 @@ python version needed. | |||
9 | 9 | ||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
11 | --- | 11 | --- |
12 | tools/scan-view/bin/scan-view | 2 +- | 12 | clang/tools/scan-view/bin/scan-view | 2 +- |
13 | 1 file changed, 1 insertion(+), 1 deletion(-) | 13 | 1 file changed, 1 insertion(+), 1 deletion(-) |
14 | 14 | ||
15 | diff --git a/tools/scan-view/bin/scan-view b/tools/scan-view/bin/scan-view | 15 | diff --git a/clang/tools/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view |
16 | index 1b6e8ba90d..7c5867d1be 100755 | 16 | index 6165432e7af..04ad518a60c 100755 |
17 | --- a/tools/scan-view/bin/scan-view | 17 | --- a/clang/tools/scan-view/bin/scan-view |
18 | +++ b/tools/scan-view/bin/scan-view | 18 | +++ b/clang/tools/scan-view/bin/scan-view |
19 | @@ -1,4 +1,4 @@ | 19 | @@ -1,4 +1,4 @@ |
20 | -#!/usr/bin/env python | 20 | -#!/usr/bin/env python |
21 | +#!/usr/bin/env python2 | 21 | +#!/usr/bin/env python2 |
22 | 22 | ||
23 | """The clang static analyzer results viewer. | 23 | from __future__ import print_function |
24 | """ | 24 | |
25 | -- | 25 | -- |
26 | 2.18.0 | 26 | 2.20.1 |
27 | 27 | ||
diff --git a/recipes-devtools/clang/clang/0009-clang-Enable-SSP-and-PIE-by-default.patch b/recipes-devtools/clang/clang/0009-clang-Enable-SSP-and-PIE-by-default.patch deleted file mode 100644 index d7b61bb..0000000 --- a/recipes-devtools/clang/clang/0009-clang-Enable-SSP-and-PIE-by-default.patch +++ /dev/null | |||
@@ -1,284 +0,0 @@ | |||
1 | From 594abc54ce652e0490860c96038513cfb576bb92 Mon Sep 17 00:00:00 2001 | ||
2 | From: Evangelos Foutras <evangelos@foutrelis.com> | ||
3 | Date: Thu, 20 Sep 2018 06:20:28 +0300 | ||
4 | Subject: [PATCH 9/9] clang: Enable SSP and PIE by default | ||
5 | |||
6 | This is a minimal set of changes needed to make clang use SSP and PIE by | ||
7 | default on Arch Linux. Tests that were easy to adjust have been changed | ||
8 | accordingly; only test/Driver/linux-ld.c has been marked as "expected | ||
9 | failure" due to the number of changes it would require (mostly replacing | ||
10 | crtbegin.o with crtbeginS.o). | ||
11 | |||
12 | Doing so is needed in order to align clang with the new default GCC | ||
13 | behavior in Arch which generates PIE executables by default and also | ||
14 | defaults to -fstack-protector-strong. It is not meant to be a long term | ||
15 | solution, but a simple temporary fix. | ||
16 | |||
17 | Hopefully these changes will be obsoleted by the introduction upstream | ||
18 | of a compile-time option (https://bugs.llvm.org/show_bug.cgi?id=13410) | ||
19 | --- | ||
20 | lib/Driver/ToolChains/Linux.cpp | 14 ++++++++++++-- | ||
21 | lib/Driver/ToolChains/Linux.h | 1 + | ||
22 | test/Driver/clang-offload-bundler.c | 2 +- | ||
23 | test/Driver/cross-linux.c | 16 ++++++++-------- | ||
24 | test/Driver/env.c | 2 +- | ||
25 | test/Driver/fsanitize.c | 14 +++++++------- | ||
26 | test/Driver/gcc-toolchain.cpp | 2 +- | ||
27 | test/Driver/hexagon-toolchain-elf.c | 2 +- | ||
28 | test/Driver/linux-as.c | 4 ++-- | ||
29 | test/Driver/linux-ld.c | 2 ++ | ||
30 | test/Driver/riscv32-toolchain.c | 4 ++-- | ||
31 | test/Driver/stack-protector.c | 4 ++-- | ||
32 | 12 files changed, 40 insertions(+), 27 deletions(-) | ||
33 | |||
34 | diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp | ||
35 | index 2ca285679c..22f1a1da6d 100644 | ||
36 | --- a/lib/Driver/ToolChains/Linux.cpp | ||
37 | +++ b/lib/Driver/ToolChains/Linux.cpp | ||
38 | @@ -911,8 +911,18 @@ void Linux::AddIAMCUIncludeArgs(const ArgList &DriverArgs, | ||
39 | } | ||
40 | |||
41 | bool Linux::isPIEDefault() const { | ||
42 | - return (getTriple().isAndroid() && !getTriple().isAndroidVersionLT(16)) || | ||
43 | - getTriple().isMusl() || getSanitizerArgs().requiresPIE(); | ||
44 | + const bool IsMips = getTriple().isMIPS(); | ||
45 | + const bool IsAndroid = getTriple().isAndroid(); | ||
46 | + | ||
47 | + if (IsMips || IsAndroid) | ||
48 | + return (getTriple().isAndroid() && !getTriple().isAndroidVersionLT(16)) || | ||
49 | + getTriple().isMusl() || getSanitizerArgs().requiresPIE(); | ||
50 | + | ||
51 | + return true; | ||
52 | +} | ||
53 | + | ||
54 | +unsigned Linux::GetDefaultStackProtectorLevel(bool KernelOrKext) const { | ||
55 | + return 2; | ||
56 | } | ||
57 | |||
58 | SanitizerMask Linux::getSupportedSanitizers() const { | ||
59 | diff --git a/lib/Driver/ToolChains/Linux.h b/lib/Driver/ToolChains/Linux.h | ||
60 | index 22dbbecf6b..ba0d5587e0 100644 | ||
61 | --- a/lib/Driver/ToolChains/Linux.h | ||
62 | +++ b/lib/Driver/ToolChains/Linux.h | ||
63 | @@ -38,6 +38,7 @@ public: | ||
64 | void AddIAMCUIncludeArgs(const llvm::opt::ArgList &DriverArgs, | ||
65 | llvm::opt::ArgStringList &CC1Args) const override; | ||
66 | bool isPIEDefault() const override; | ||
67 | + unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override; | ||
68 | SanitizerMask getSupportedSanitizers() const override; | ||
69 | void addProfileRTLibs(const llvm::opt::ArgList &Args, | ||
70 | llvm::opt::ArgStringList &CmdArgs) const override; | ||
71 | diff --git a/test/Driver/clang-offload-bundler.c b/test/Driver/clang-offload-bundler.c | ||
72 | index adf13f59d4..fd2f6e5d8c 100644 | ||
73 | --- a/test/Driver/clang-offload-bundler.c | ||
74 | +++ b/test/Driver/clang-offload-bundler.c | ||
75 | @@ -115,7 +115,7 @@ | ||
76 | // CK-TEXTI: // __CLANG_OFFLOAD_BUNDLE____END__ openmp-x86_64-pc-linux-gnu | ||
77 | |||
78 | // CK-TEXTLL: ; __CLANG_OFFLOAD_BUNDLE____START__ host-powerpc64le-ibm-linux-gnu | ||
79 | -// CK-TEXTLL: @A = global i32 0 | ||
80 | +// CK-TEXTLL: @A = {{(dso_local )?}}global i32 0 | ||
81 | // CK-TEXTLL: define {{.*}}@test_func() | ||
82 | // CK-TEXTLL: ; __CLANG_OFFLOAD_BUNDLE____END__ host-powerpc64le-ibm-linux-gnu | ||
83 | // CK-TEXTLL: ; __CLANG_OFFLOAD_BUNDLE____START__ openmp-powerpc64le-ibm-linux-gnu | ||
84 | diff --git a/test/Driver/cross-linux.c b/test/Driver/cross-linux.c | ||
85 | index a5ea832e77..1949c05a60 100644 | ||
86 | --- a/test/Driver/cross-linux.c | ||
87 | +++ b/test/Driver/cross-linux.c | ||
88 | @@ -42,8 +42,8 @@ | ||
89 | // CHECK-MULTI32-I386: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\\\}}ld" | ||
90 | // CHECK-MULTI32-I386: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" | ||
91 | // CHECK-MULTI32-I386: "-m" "elf_i386" | ||
92 | -// CHECK-MULTI32-I386: "crti.o" "[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]{{/|\\\\}}crtbegin.o" | ||
93 | -// CHECK-MULTI32-I386: "-L[[gcc_install]]" | ||
94 | +// CHECK-MULTI32-I386: "crti.o" "crtbeginS.o" | ||
95 | +// CHECK-MULTI32-I386: "-L[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]" | ||
96 | // CHECK-MULTI32-I386: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib/../lib32" | ||
97 | // CHECK-MULTI32-I386: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib" | ||
98 | // CHECK-MULTI32-I386: "-L[[sysroot]]/lib" | ||
99 | @@ -59,8 +59,8 @@ | ||
100 | // CHECK-MULTI32-X86-64: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\\\}}ld" | ||
101 | // CHECK-MULTI32-X86-64: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" | ||
102 | // CHECK-MULTI32-X86-64: "-m" "elf_x86_64" | ||
103 | -// CHECK-MULTI32-X86-64: "crti.o" "[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]/64{{/|\\\\}}crtbegin.o" | ||
104 | -// CHECK-MULTI32-X86-64: "-L[[gcc_install]]/64" | ||
105 | +// CHECK-MULTI32-X86-64: "crti.o" "crtbeginS.o" | ||
106 | +// CHECK-MULTI32-X86-64: "-L[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]/64" | ||
107 | // CHECK-MULTI32-X86-64: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib/../lib64" | ||
108 | // CHECK-MULTI32-X86-64: "-L[[gcc_install]]" | ||
109 | // CHECK-MULTI32-X86-64: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib" | ||
110 | @@ -77,8 +77,8 @@ | ||
111 | // CHECK-MULTI64-I386: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\\\}}ld" | ||
112 | // CHECK-MULTI64-I386: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" | ||
113 | // CHECK-MULTI64-I386: "-m" "elf_i386" | ||
114 | -// CHECK-MULTI64-I386: "crti.o" "[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]/32{{/|\\\\}}crtbegin.o" | ||
115 | -// CHECK-MULTI64-I386: "-L[[gcc_install]]/32" | ||
116 | +// CHECK-MULTI64-I386: "crti.o" "crtbeginS.o" | ||
117 | +// CHECK-MULTI64-I386: "-L[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]/32" | ||
118 | // CHECK-MULTI64-I386: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib/../lib32" | ||
119 | // CHECK-MULTI64-I386: "-L[[gcc_install]]" | ||
120 | // CHECK-MULTI64-I386: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib" | ||
121 | @@ -95,8 +95,8 @@ | ||
122 | // CHECK-MULTI64-X86-64: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\\\}}ld" | ||
123 | // CHECK-MULTI64-X86-64: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]" | ||
124 | // CHECK-MULTI64-X86-64: "-m" "elf_x86_64" | ||
125 | -// CHECK-MULTI64-X86-64: "crti.o" "[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]{{/|\\\\}}crtbegin.o" | ||
126 | -// CHECK-MULTI64-X86-64: "-L[[gcc_install]]" | ||
127 | +// CHECK-MULTI64-X86-64: "crti.o" "crtbeginS.o" | ||
128 | +// CHECK-MULTI64-X86-64: "-L[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]" | ||
129 | // CHECK-MULTI64-X86-64: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib/../lib64" | ||
130 | // CHECK-MULTI64-X86-64: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib" | ||
131 | // CHECK-MULTI64-X86-64: "-L[[sysroot]]/lib" | ||
132 | diff --git a/test/Driver/env.c b/test/Driver/env.c | ||
133 | index 0371bc91c4..ea89f52512 100644 | ||
134 | --- a/test/Driver/env.c | ||
135 | +++ b/test/Driver/env.c | ||
136 | @@ -20,7 +20,7 @@ | ||
137 | // | ||
138 | // CHECK-LD-32-NOT: warning: | ||
139 | // CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" | ||
140 | -// CHECK-LD-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o" | ||
141 | +// CHECK-LD-32: "crtbeginS.o" | ||
142 | // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0" | ||
143 | // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib" | ||
144 | // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.." | ||
145 | diff --git a/test/Driver/fsanitize.c b/test/Driver/fsanitize.c | ||
146 | index 304e759302..c157f9fc48 100644 | ||
147 | --- a/test/Driver/fsanitize.c | ||
148 | +++ b/test/Driver/fsanitize.c | ||
149 | @@ -238,15 +238,15 @@ | ||
150 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-sanitize=vptr -fsanitize=undefined,address %s -### 2>&1 | ||
151 | // OK | ||
152 | |||
153 | -// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE | ||
154 | -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE | ||
155 | +// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE | ||
156 | +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE | ||
157 | // RUN: %clang -target x86_64-unknown-freebsd -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE | ||
158 | // RUN: %clang -target aarch64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE | ||
159 | // RUN: %clang -target arm-linux-androideabi -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIC-NO-PIE | ||
160 | // RUN: %clang -target arm-linux-androideabi24 -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE | ||
161 | // RUN: %clang -target aarch64-linux-android -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE | ||
162 | -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE | ||
163 | -// RUN: %clang -target i386-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE | ||
164 | +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE | ||
165 | +// RUN: %clang -target i386-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE | ||
166 | |||
167 | // CHECK-NO-PIE-NOT: "-pie" | ||
168 | // CHECK-NO-PIE: "-mrelocation-model" "static" | ||
169 | @@ -585,12 +585,12 @@ | ||
170 | // RUN: %clang -fno-sanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NOSP | ||
171 | // NOSP-NOT: "-fsanitize=safe-stack" | ||
172 | |||
173 | -// RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP | ||
174 | +// RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP | ||
175 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=address,safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP-ASAN | ||
176 | // RUN: %clang -target x86_64-linux-gnu -fstack-protector -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP | ||
177 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -fstack-protector-all -### %s 2>&1 | FileCheck %s -check-prefix=SP | ||
178 | -// RUN: %clang -target arm-linux-androideabi -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP | ||
179 | -// RUN: %clang -target aarch64-linux-android -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP | ||
180 | +// RUN: %clang -target arm-linux-androideabi -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP | ||
181 | +// RUN: %clang -target aarch64-linux-android -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP | ||
182 | // RUN: %clang -target i386-contiki-unknown -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP | ||
183 | // NO-SP-NOT: stack-protector | ||
184 | // NO-SP: "-fsanitize=safe-stack" | ||
185 | diff --git a/test/Driver/gcc-toolchain.cpp b/test/Driver/gcc-toolchain.cpp | ||
186 | index ca96757a2b..ae1c25e989 100644 | ||
187 | --- a/test/Driver/gcc-toolchain.cpp | ||
188 | +++ b/test/Driver/gcc-toolchain.cpp | ||
189 | @@ -24,6 +24,6 @@ | ||
190 | // the same precise formatting of the path as the '-internal-system' flags | ||
191 | // above, so we just blanket wildcard match the 'crtbegin.o'. | ||
192 | // CHECK: "{{[^"]*}}ld{{(.exe)?}}" | ||
193 | -// CHECK: "{{[^"]*}}/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5{{/|\\\\}}crtbegin.o" | ||
194 | +// CHECK: "crtbeginS.o" | ||
195 | // CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5" | ||
196 | // CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../.." | ||
197 | diff --git a/test/Driver/hexagon-toolchain-elf.c b/test/Driver/hexagon-toolchain-elf.c | ||
198 | index 8f4c320ce4..a4d9ae502b 100644 | ||
199 | --- a/test/Driver/hexagon-toolchain-elf.c | ||
200 | +++ b/test/Driver/hexagon-toolchain-elf.c | ||
201 | @@ -457,7 +457,7 @@ | ||
202 | // RUN: %s 2>&1 \ | ||
203 | // RUN: | FileCheck -check-prefix=CHECK042 %s | ||
204 | // CHECK042: "-cc1" | ||
205 | -// CHECK042: "-mrelocation-model" "static" | ||
206 | +// CHECK042: "-mrelocation-model" "pic" | ||
207 | // CHECK042: "-mllvm" "-hexagon-small-data-threshold=8" | ||
208 | // CHECK042-NEXT: llvm-mc | ||
209 | // CHECK042: "-gpsize=8" | ||
210 | diff --git a/test/Driver/linux-as.c b/test/Driver/linux-as.c | ||
211 | index 68cf403d97..92b556db73 100644 | ||
212 | --- a/test/Driver/linux-as.c | ||
213 | +++ b/test/Driver/linux-as.c | ||
214 | @@ -133,7 +133,7 @@ | ||
215 | // CHECK-PPC-NO-MCPU-NOT: as{{.*}} "-mcpu=invalid-cpu" | ||
216 | // | ||
217 | // RUN: %clang -target sparc64-linux -mcpu=invalid-cpu -### \ | ||
218 | -// RUN: -no-integrated-as -c %s 2>&1 \ | ||
219 | +// RUN: -no-integrated-as -fno-pic -c %s 2>&1 \ | ||
220 | // RUN: | FileCheck -check-prefix=CHECK-SPARCV9 %s | ||
221 | // CHECK-SPARCV9: as | ||
222 | // CHECK-SPARCV9: -64 | ||
223 | @@ -142,7 +142,7 @@ | ||
224 | // CHECK-SPARCV9: -o | ||
225 | // | ||
226 | // RUN: %clang -target sparc64-linux -mcpu=invalid-cpu -### \ | ||
227 | -// RUN: -no-integrated-as -fpic -c %s 2>&1 \ | ||
228 | +// RUN: -no-integrated-as -c %s 2>&1 \ | ||
229 | // RUN: | FileCheck -check-prefix=CHECK-SPARCV9PIC %s | ||
230 | // CHECK-SPARCV9PIC: as | ||
231 | // CHECK-SPARCV9PIC: -64 | ||
232 | diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c | ||
233 | index 787013931a..cba173b354 100644 | ||
234 | --- a/test/Driver/linux-ld.c | ||
235 | +++ b/test/Driver/linux-ld.c | ||
236 | @@ -1,3 +1,5 @@ | ||
237 | +// XFAIL: linux | ||
238 | + | ||
239 | // General tests that ld invocations on Linux targets sane. Note that we use | ||
240 | // sysroot to make these tests independent of the host system. | ||
241 | // | ||
242 | diff --git a/test/Driver/riscv32-toolchain.c b/test/Driver/riscv32-toolchain.c | ||
243 | index 1e0c750a3f..563493a33b 100644 | ||
244 | --- a/test/Driver/riscv32-toolchain.c | ||
245 | +++ b/test/Driver/riscv32-toolchain.c | ||
246 | @@ -44,7 +44,7 @@ | ||
247 | // C-RV32-LINUX-MULTI-ILP32: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" | ||
248 | // C-RV32-LINUX-MULTI-ILP32: "-m" "elf32lriscv" | ||
249 | // C-RV32-LINUX-MULTI-ILP32: "-dynamic-linker" "/lib/ld-linux-riscv32-ilp32.so.1" | ||
250 | -// C-RV32-LINUX-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32{{/|\\\\}}crtbegin.o" | ||
251 | +// C-RV32-LINUX-MULTI-ILP32: "crtbeginS.o" | ||
252 | // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32" | ||
253 | // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib32/ilp32" | ||
254 | // C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib32/ilp32" | ||
255 | @@ -59,7 +59,7 @@ | ||
256 | // C-RV32-LINUX-MULTI-ILP32D: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot" | ||
257 | // C-RV32-LINUX-MULTI-ILP32D: "-m" "elf32lriscv" | ||
258 | // C-RV32-LINUX-MULTI-ILP32D: "-dynamic-linker" "/lib/ld-linux-riscv32-ilp32d.so.1" | ||
259 | -// C-RV32-LINUX-MULTI-ILP32D: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32d{{/|\\\\}}crtbegin.o" | ||
260 | +// C-RV32-LINUX-MULTI-ILP32D: "crtbeginS.o" | ||
261 | // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/lib32/ilp32d" | ||
262 | // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib32/ilp32d" | ||
263 | // C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib32/ilp32d" | ||
264 | diff --git a/test/Driver/stack-protector.c b/test/Driver/stack-protector.c | ||
265 | index a3e40b50ee..dfffe0d6cf 100644 | ||
266 | --- a/test/Driver/stack-protector.c | ||
267 | +++ b/test/Driver/stack-protector.c | ||
268 | @@ -3,11 +3,11 @@ | ||
269 | // NOSSP-NOT: "-stack-protector-buffer-size" | ||
270 | |||
271 | // RUN: %clang -target i386-unknown-linux -fstack-protector -### %s 2>&1 | FileCheck %s -check-prefix=SSP | ||
272 | -// SSP: "-stack-protector" "1" | ||
273 | +// SSP: "-stack-protector" "2" | ||
274 | // SSP-NOT: "-stack-protector-buffer-size" | ||
275 | |||
276 | // RUN: %clang -target i386-unknown-linux -fstack-protector --param ssp-buffer-size=16 -### %s 2>&1 | FileCheck %s -check-prefix=SSP-BUF | ||
277 | -// SSP-BUF: "-stack-protector" "1" | ||
278 | +// SSP-BUF: "-stack-protector" "2" | ||
279 | // SSP-BUF: "-stack-protector-buffer-size" "16" | ||
280 | |||
281 | // RUN: %clang -target i386-pc-openbsd -### %s 2>&1 | FileCheck %s -check-prefix=OPENBSD | ||
282 | -- | ||
283 | 2.19.2 | ||
284 | |||
diff --git a/recipes-devtools/clang/clang/0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch b/recipes-devtools/clang/clang/0009-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch index de8da74..793fbaf 100644 --- a/recipes-devtools/clang/clang/0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch +++ b/recipes-devtools/clang/clang/0009-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch | |||
@@ -1,22 +1,22 @@ | |||
1 | From fc9904be5d4ee1d1e92a1ff86b01218fbf91b12f Mon Sep 17 00:00:00 2001 | 1 | From da9fe6d6a6160b7eaeef22dff38bbb3f17f26822 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Sat, 21 May 2016 00:33:20 +0000 | 3 | Date: Sat, 21 May 2016 00:33:20 +0000 |
4 | Subject: [PATCH 1/3] llvm: TargetLibraryInfo: Undefine libc functions if they | 4 | Subject: [PATCH 09/15] llvm: TargetLibraryInfo: Undefine libc functions if |
5 | are macros | 5 | they are macros |
6 | 6 | ||
7 | musl defines some functions as macros and not inline functions | 7 | musl defines some functions as macros and not inline functions |
8 | if this is the case then make sure to undefine them | 8 | if this is the case then make sure to undefine them |
9 | 9 | ||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
11 | --- | 11 | --- |
12 | include/llvm/Analysis/TargetLibraryInfo.def | 21 +++++++++++++++++++++ | 12 | .../llvm/Analysis/TargetLibraryInfo.def | 21 +++++++++++++++++++ |
13 | 1 file changed, 21 insertions(+) | 13 | 1 file changed, 21 insertions(+) |
14 | 14 | ||
15 | diff --git a/include/llvm/Analysis/TargetLibraryInfo.def b/include/llvm/Analysis/TargetLibraryInfo.def | 15 | diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.def b/llvm/include/llvm/Analysis/TargetLibraryInfo.def |
16 | index f94debba9c5..e92dbc98c55 100644 | 16 | index 518a85ee1a0..6b4ead4efc6 100644 |
17 | --- a/include/llvm/Analysis/TargetLibraryInfo.def | 17 | --- a/llvm/include/llvm/Analysis/TargetLibraryInfo.def |
18 | +++ b/include/llvm/Analysis/TargetLibraryInfo.def | 18 | +++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.def |
19 | @@ -707,6 +707,9 @@ TLI_DEFINE_STRING_INTERNAL("fmodl") | 19 | @@ -731,6 +731,9 @@ TLI_DEFINE_STRING_INTERNAL("fmodl") |
20 | TLI_DEFINE_ENUM_INTERNAL(fopen) | 20 | TLI_DEFINE_ENUM_INTERNAL(fopen) |
21 | TLI_DEFINE_STRING_INTERNAL("fopen") | 21 | TLI_DEFINE_STRING_INTERNAL("fopen") |
22 | /// FILE *fopen64(const char *filename, const char *opentype) | 22 | /// FILE *fopen64(const char *filename, const char *opentype) |
@@ -25,8 +25,8 @@ index f94debba9c5..e92dbc98c55 100644 | |||
25 | +#endif | 25 | +#endif |
26 | TLI_DEFINE_ENUM_INTERNAL(fopen64) | 26 | TLI_DEFINE_ENUM_INTERNAL(fopen64) |
27 | TLI_DEFINE_STRING_INTERNAL("fopen64") | 27 | TLI_DEFINE_STRING_INTERNAL("fopen64") |
28 | /// int fprintf(FILE *stream, const char *format, ...); | 28 | /// int fork(); |
29 | @@ -751,6 +754,9 @@ TLI_DEFINE_STRING_INTERNAL("fseek") | 29 | @@ -778,6 +781,9 @@ TLI_DEFINE_STRING_INTERNAL("fseek") |
30 | /// int fseeko(FILE *stream, off_t offset, int whence); | 30 | /// int fseeko(FILE *stream, off_t offset, int whence); |
31 | TLI_DEFINE_ENUM_INTERNAL(fseeko) | 31 | TLI_DEFINE_ENUM_INTERNAL(fseeko) |
32 | TLI_DEFINE_STRING_INTERNAL("fseeko") | 32 | TLI_DEFINE_STRING_INTERNAL("fseeko") |
@@ -36,7 +36,7 @@ index f94debba9c5..e92dbc98c55 100644 | |||
36 | /// int fseeko64(FILE *stream, off64_t offset, int whence) | 36 | /// int fseeko64(FILE *stream, off64_t offset, int whence) |
37 | TLI_DEFINE_ENUM_INTERNAL(fseeko64) | 37 | TLI_DEFINE_ENUM_INTERNAL(fseeko64) |
38 | TLI_DEFINE_STRING_INTERNAL("fseeko64") | 38 | TLI_DEFINE_STRING_INTERNAL("fseeko64") |
39 | @@ -761,6 +767,9 @@ TLI_DEFINE_STRING_INTERNAL("fsetpos") | 39 | @@ -788,6 +794,9 @@ TLI_DEFINE_STRING_INTERNAL("fsetpos") |
40 | TLI_DEFINE_ENUM_INTERNAL(fstat) | 40 | TLI_DEFINE_ENUM_INTERNAL(fstat) |
41 | TLI_DEFINE_STRING_INTERNAL("fstat") | 41 | TLI_DEFINE_STRING_INTERNAL("fstat") |
42 | /// int fstat64(int filedes, struct stat64 *buf) | 42 | /// int fstat64(int filedes, struct stat64 *buf) |
@@ -46,7 +46,7 @@ index f94debba9c5..e92dbc98c55 100644 | |||
46 | TLI_DEFINE_ENUM_INTERNAL(fstat64) | 46 | TLI_DEFINE_ENUM_INTERNAL(fstat64) |
47 | TLI_DEFINE_STRING_INTERNAL("fstat64") | 47 | TLI_DEFINE_STRING_INTERNAL("fstat64") |
48 | /// int fstatvfs(int fildes, struct statvfs *buf); | 48 | /// int fstatvfs(int fildes, struct statvfs *buf); |
49 | @@ -776,6 +785,9 @@ TLI_DEFINE_STRING_INTERNAL("ftell") | 49 | @@ -803,6 +812,9 @@ TLI_DEFINE_STRING_INTERNAL("ftell") |
50 | TLI_DEFINE_ENUM_INTERNAL(ftello) | 50 | TLI_DEFINE_ENUM_INTERNAL(ftello) |
51 | TLI_DEFINE_STRING_INTERNAL("ftello") | 51 | TLI_DEFINE_STRING_INTERNAL("ftello") |
52 | /// off64_t ftello64(FILE *stream) | 52 | /// off64_t ftello64(FILE *stream) |
@@ -56,7 +56,7 @@ index f94debba9c5..e92dbc98c55 100644 | |||
56 | TLI_DEFINE_ENUM_INTERNAL(ftello64) | 56 | TLI_DEFINE_ENUM_INTERNAL(ftello64) |
57 | TLI_DEFINE_STRING_INTERNAL("ftello64") | 57 | TLI_DEFINE_STRING_INTERNAL("ftello64") |
58 | /// int ftrylockfile(FILE *file); | 58 | /// int ftrylockfile(FILE *file); |
59 | @@ -902,6 +914,9 @@ TLI_DEFINE_STRING_INTERNAL("logl") | 59 | @@ -929,6 +941,9 @@ TLI_DEFINE_STRING_INTERNAL("logl") |
60 | TLI_DEFINE_ENUM_INTERNAL(lstat) | 60 | TLI_DEFINE_ENUM_INTERNAL(lstat) |
61 | TLI_DEFINE_STRING_INTERNAL("lstat") | 61 | TLI_DEFINE_STRING_INTERNAL("lstat") |
62 | /// int lstat64(const char *path, struct stat64 *buf); | 62 | /// int lstat64(const char *path, struct stat64 *buf); |
@@ -66,7 +66,7 @@ index f94debba9c5..e92dbc98c55 100644 | |||
66 | TLI_DEFINE_ENUM_INTERNAL(lstat64) | 66 | TLI_DEFINE_ENUM_INTERNAL(lstat64) |
67 | TLI_DEFINE_STRING_INTERNAL("lstat64") | 67 | TLI_DEFINE_STRING_INTERNAL("lstat64") |
68 | /// void *malloc(size_t size); | 68 | /// void *malloc(size_t size); |
69 | @@ -1127,6 +1142,9 @@ TLI_DEFINE_STRING_INTERNAL("sscanf") | 69 | @@ -1154,6 +1169,9 @@ TLI_DEFINE_STRING_INTERNAL("sscanf") |
70 | TLI_DEFINE_ENUM_INTERNAL(stat) | 70 | TLI_DEFINE_ENUM_INTERNAL(stat) |
71 | TLI_DEFINE_STRING_INTERNAL("stat") | 71 | TLI_DEFINE_STRING_INTERNAL("stat") |
72 | /// int stat64(const char *path, struct stat64 *buf); | 72 | /// int stat64(const char *path, struct stat64 *buf); |
@@ -76,7 +76,7 @@ index f94debba9c5..e92dbc98c55 100644 | |||
76 | TLI_DEFINE_ENUM_INTERNAL(stat64) | 76 | TLI_DEFINE_ENUM_INTERNAL(stat64) |
77 | TLI_DEFINE_STRING_INTERNAL("stat64") | 77 | TLI_DEFINE_STRING_INTERNAL("stat64") |
78 | /// int statvfs(const char *path, struct statvfs *buf); | 78 | /// int statvfs(const char *path, struct statvfs *buf); |
79 | @@ -1256,6 +1274,9 @@ TLI_DEFINE_STRING_INTERNAL("times") | 79 | @@ -1283,6 +1301,9 @@ TLI_DEFINE_STRING_INTERNAL("times") |
80 | TLI_DEFINE_ENUM_INTERNAL(tmpfile) | 80 | TLI_DEFINE_ENUM_INTERNAL(tmpfile) |
81 | TLI_DEFINE_STRING_INTERNAL("tmpfile") | 81 | TLI_DEFINE_STRING_INTERNAL("tmpfile") |
82 | /// FILE *tmpfile64(void) | 82 | /// FILE *tmpfile64(void) |
@@ -87,5 +87,5 @@ index f94debba9c5..e92dbc98c55 100644 | |||
87 | TLI_DEFINE_STRING_INTERNAL("tmpfile64") | 87 | TLI_DEFINE_STRING_INTERNAL("tmpfile64") |
88 | /// int toascii(int c); | 88 | /// int toascii(int c); |
89 | -- | 89 | -- |
90 | 2.18.0 | 90 | 2.20.1 |
91 | 91 | ||
diff --git a/recipes-devtools/clang/clang/0002-llvm-allow-env-override-of-exe-path.patch b/recipes-devtools/clang/clang/0010-llvm-allow-env-override-of-exe-path.patch index fa49e67..c28da3c 100644 --- a/recipes-devtools/clang/clang/0002-llvm-allow-env-override-of-exe-path.patch +++ b/recipes-devtools/clang/clang/0010-llvm-allow-env-override-of-exe-path.patch | |||
@@ -1,7 +1,7 @@ | |||
1 | From c65c0af4a5721e3c0dfcc56c15ef3310a54e0008 Mon Sep 17 00:00:00 2001 | 1 | From 2af0752ca682d14984aac80e1b84a79b9fa69fb9 Mon Sep 17 00:00:00 2001 |
2 | From: Martin Kelly <mkelly@xevo.com> | 2 | From: Martin Kelly <mkelly@xevo.com> |
3 | Date: Fri, 19 May 2017 00:22:57 -0700 | 3 | Date: Fri, 19 May 2017 00:22:57 -0700 |
4 | Subject: [PATCH 2/3] llvm: allow env override of exe path | 4 | Subject: [PATCH 10/15] llvm: allow env override of exe path |
5 | 5 | ||
6 | When using a native llvm-config from inside a sysroot, we need llvm-config to | 6 | When using a native llvm-config from inside a sysroot, we need llvm-config to |
7 | return the libraries, include directories, etc. from inside the sysroot rather | 7 | return the libraries, include directories, etc. from inside the sysroot rather |
@@ -11,13 +11,13 @@ llvm-config from a target sysroot. | |||
11 | Signed-off-by: Martin Kelly <mkelly@xevo.com> | 11 | Signed-off-by: Martin Kelly <mkelly@xevo.com> |
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
13 | --- | 13 | --- |
14 | tools/llvm-config/llvm-config.cpp | 7 +++++++ | 14 | llvm/tools/llvm-config/llvm-config.cpp | 7 +++++++ |
15 | 1 file changed, 7 insertions(+) | 15 | 1 file changed, 7 insertions(+) |
16 | 16 | ||
17 | diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp | 17 | diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp |
18 | index 892adc3b9dd..38f190ecbd1 100644 | 18 | index bec89fef98c..f9a2862a55d 100644 |
19 | --- a/tools/llvm-config/llvm-config.cpp | 19 | --- a/llvm/tools/llvm-config/llvm-config.cpp |
20 | +++ b/tools/llvm-config/llvm-config.cpp | 20 | +++ b/llvm/tools/llvm-config/llvm-config.cpp |
21 | @@ -226,6 +226,13 @@ Typical components:\n\ | 21 | @@ -226,6 +226,13 @@ Typical components:\n\ |
22 | 22 | ||
23 | /// Compute the path to the main executable. | 23 | /// Compute the path to the main executable. |
@@ -33,5 +33,5 @@ index 892adc3b9dd..38f190ecbd1 100644 | |||
33 | // allow taking the address of ::main however. | 33 | // allow taking the address of ::main however. |
34 | void *P = (void *)(intptr_t)GetExecutablePath; | 34 | void *P = (void *)(intptr_t)GetExecutablePath; |
35 | -- | 35 | -- |
36 | 2.18.0 | 36 | 2.20.1 |
37 | 37 | ||
diff --git a/recipes-devtools/clang/clang/0002-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 index c331e7a..737a053 100644 --- a/recipes-devtools/clang/clang/0002-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 | |||
@@ -1,7 +1,7 @@ | |||
1 | From fa140ec90e72da40d49301e674c84854fdac804b Mon Sep 17 00:00:00 2001 | 1 | From 61d80370805142f531059d3ea58f363aadd1ff06 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Mon, 22 May 2017 17:36:16 -0700 | 3 | Date: Mon, 22 May 2017 17:36:16 -0700 |
4 | Subject: [PATCH 2/2] lldb: Add -lxml2 to linker cmdline of xml is found | 4 | Subject: [PATCH 11/15] lldb: Add -lxml2 to linker cmdline of xml is found |
5 | 5 | ||
6 | When cross compiling for systems where static libs | 6 | When cross compiling for systems where static libs |
7 | for libxml are not available cmake's detection mechanism | 7 | for libxml are not available cmake's detection mechanism |
@@ -19,14 +19,14 @@ Fixes | |||
19 | 19 | ||
20 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 20 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
21 | --- | 21 | --- |
22 | source/Host/CMakeLists.txt | 2 +- | 22 | lldb/source/Host/CMakeLists.txt | 2 +- |
23 | 1 file changed, 1 insertion(+), 1 deletion(-) | 23 | 1 file changed, 1 insertion(+), 1 deletion(-) |
24 | 24 | ||
25 | diff --git a/source/Host/CMakeLists.txt b/source/Host/CMakeLists.txt | 25 | diff --git a/lldb/source/Host/CMakeLists.txt b/lldb/source/Host/CMakeLists.txt |
26 | index 5a92447ed..22ce6eee4 100644 | 26 | index 333f109a9a2..a5237c4b779 100644 |
27 | --- a/source/Host/CMakeLists.txt | 27 | --- a/lldb/source/Host/CMakeLists.txt |
28 | +++ b/source/Host/CMakeLists.txt | 28 | +++ b/lldb/source/Host/CMakeLists.txt |
29 | @@ -149,7 +149,7 @@ if (APPLE) | 29 | @@ -148,7 +148,7 @@ if (APPLE) |
30 | list(APPEND EXTRA_LIBS xml2) | 30 | list(APPEND EXTRA_LIBS xml2) |
31 | else () | 31 | else () |
32 | if (LIBXML2_FOUND) | 32 | if (LIBXML2_FOUND) |
diff --git a/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch b/recipes-devtools/clang/clang/0012-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch index 297b56d..92fe682 100644 --- a/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch +++ b/recipes-devtools/clang/clang/0012-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch | |||
@@ -1,7 +1,7 @@ | |||
1 | From a122717a9bc31e0ab44197e743aa466711c4bf79 Mon Sep 17 00:00:00 2001 | 1 | From 058935ad2f27735cedf838b82a8a2d7d1883ab5f Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Sun, 27 Aug 2017 10:37:49 -0700 | 3 | Date: Sun, 27 Aug 2017 10:37:49 -0700 |
4 | Subject: [PATCH] libcxxabi: Find libunwind headers when | 4 | Subject: [PATCH 12/15] libcxxabi: Find libunwind headers when |
5 | LIBCXXABI_LIBUNWIND_INCLUDES is set | 5 | LIBCXXABI_LIBUNWIND_INCLUDES is set |
6 | 6 | ||
7 | Currently, when LIBCXXABI_LIBUNWIND_INCLUDES is set via CMake arguments | 7 | Currently, when LIBCXXABI_LIBUNWIND_INCLUDES is set via CMake arguments |
@@ -13,13 +13,13 @@ LIBCXXABI_LIBUNWIND_INCLUDES if its there in environment | |||
13 | 13 | ||
14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
15 | --- | 15 | --- |
16 | CMakeLists.txt | 21 +++++++++++---------- | 16 | libcxxabi/CMakeLists.txt | 21 +++++++++++---------- |
17 | 1 file changed, 11 insertions(+), 10 deletions(-) | 17 | 1 file changed, 11 insertions(+), 10 deletions(-) |
18 | 18 | ||
19 | diff --git a/CMakeLists.txt b/CMakeLists.txt | 19 | diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt |
20 | index d6648ed..12c02f2 100644 | 20 | index 92c7dc5dc55..d67bb43aba3 100644 |
21 | --- a/CMakeLists.txt | 21 | --- a/libcxxabi/CMakeLists.txt |
22 | +++ b/CMakeLists.txt | 22 | +++ b/libcxxabi/CMakeLists.txt |
23 | @@ -434,15 +434,10 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBCXXABI_C_FLAGS}") | 23 | @@ -434,15 +434,10 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBCXXABI_C_FLAGS}") |
24 | # Setup Source Code | 24 | # Setup Source Code |
25 | #=============================================================================== | 25 | #=============================================================================== |
@@ -64,5 +64,5 @@ index d6648ed..12c02f2 100644 | |||
64 | # soname, etc... | 64 | # soname, etc... |
65 | add_subdirectory(src) | 65 | add_subdirectory(src) |
66 | -- | 66 | -- |
67 | 2.18.0 | 67 | 2.20.1 |
68 | 68 | ||
diff --git a/recipes-devtools/clang/clang/0001-compiler-rt-support-a-new-embedded-linux-target.patch b/recipes-devtools/clang/clang/0013-compiler-rt-support-a-new-embedded-linux-target.patch index 8b0c9fe..8951241 100644 --- a/recipes-devtools/clang/clang/0001-compiler-rt-support-a-new-embedded-linux-target.patch +++ b/recipes-devtools/clang/clang/0013-compiler-rt-support-a-new-embedded-linux-target.patch | |||
@@ -1,22 +1,22 @@ | |||
1 | From 8b0d5d19e8ebec9b6508b51701cb0c64069091cb Mon Sep 17 00:00:00 2001 | 1 | From b56bc6f9b522b0359cb09e73d719622990dd2c38 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Sun, 19 Apr 2015 15:16:23 -0700 | 3 | Date: Sun, 19 Apr 2015 15:16:23 -0700 |
4 | Subject: [PATCH 1/4] compiler-rt: support a new embedded linux target | 4 | Subject: [PATCH 13/15] compiler-rt: support a new embedded linux target |
5 | 5 | ||
6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
7 | --- | 7 | --- |
8 | lib/builtins/int_util.c | 3 +- | 8 | compiler-rt/lib/builtins/int_util.c | 3 +- |
9 | make/platform/clang_linux_embedded.mk | 286 ++++++++++++++++++ | 9 | .../make/platform/clang_linux_embedded.mk | 286 ++++++++++++++++++ |
10 | .../clang_linux_embedded_test_input.c | 0 | 10 | .../clang_linux_embedded_test_input.c | 0 |
11 | 3 files changed, 287 insertions(+), 2 deletions(-) | 11 | 3 files changed, 287 insertions(+), 2 deletions(-) |
12 | create mode 100644 make/platform/clang_linux_embedded.mk | 12 | create mode 100644 compiler-rt/make/platform/clang_linux_embedded.mk |
13 | create mode 100644 make/platform/clang_linux_embedded_test_input.c | 13 | create mode 100644 compiler-rt/make/platform/clang_linux_embedded_test_input.c |
14 | 14 | ||
15 | diff --git a/lib/builtins/int_util.c b/lib/builtins/int_util.c | 15 | diff --git a/compiler-rt/lib/builtins/int_util.c b/compiler-rt/lib/builtins/int_util.c |
16 | index de87410db..0d5b56fe1 100644 | 16 | index 752f2015580..494c870b41d 100644 |
17 | --- a/lib/builtins/int_util.c | 17 | --- a/compiler-rt/lib/builtins/int_util.c |
18 | +++ b/lib/builtins/int_util.c | 18 | +++ b/compiler-rt/lib/builtins/int_util.c |
19 | @@ -58,8 +58,7 @@ void compilerrt_abort_impl(const char *file, int line, const char *function) { | 19 | @@ -58,8 +58,7 @@ void __compilerrt_abort_impl(const char *file, int line, const char *function) { |
20 | #else | 20 | #else |
21 | 21 | ||
22 | /* Get the system definition of abort() */ | 22 | /* Get the system definition of abort() */ |
@@ -26,11 +26,11 @@ index de87410db..0d5b56fe1 100644 | |||
26 | #ifndef _WIN32 | 26 | #ifndef _WIN32 |
27 | __attribute__((weak)) | 27 | __attribute__((weak)) |
28 | __attribute__((visibility("hidden"))) | 28 | __attribute__((visibility("hidden"))) |
29 | diff --git a/make/platform/clang_linux_embedded.mk b/make/platform/clang_linux_embedded.mk | 29 | diff --git a/compiler-rt/make/platform/clang_linux_embedded.mk b/compiler-rt/make/platform/clang_linux_embedded.mk |
30 | new file mode 100644 | 30 | new file mode 100644 |
31 | index 000000000..d0a890075 | 31 | index 00000000000..d0a890075a1 |
32 | --- /dev/null | 32 | --- /dev/null |
33 | +++ b/make/platform/clang_linux_embedded.mk | 33 | +++ b/compiler-rt/make/platform/clang_linux_embedded.mk |
34 | @@ -0,0 +1,286 @@ | 34 | @@ -0,0 +1,286 @@ |
35 | +# These are the functions which clang needs when it is targeting a previous | 35 | +# These are the functions which clang needs when it is targeting a previous |
36 | +# version of the OS. The issue is that the backend may use functions which were | 36 | +# version of the OS. The issue is that the backend may use functions which were |
@@ -318,9 +318,9 @@ index 000000000..d0a890075 | |||
318 | + | 318 | + |
319 | +FUNCTIONS.hard_static.x86_64 := $(FUNCTIONS_X86_64) | 319 | +FUNCTIONS.hard_static.x86_64 := $(FUNCTIONS_X86_64) |
320 | +FUNCTIONS.hard_pic.x86_64 := $(FUNCTIONS_X86_64) | 320 | +FUNCTIONS.hard_pic.x86_64 := $(FUNCTIONS_X86_64) |
321 | diff --git a/make/platform/clang_linux_embedded_test_input.c b/make/platform/clang_linux_embedded_test_input.c | 321 | diff --git a/compiler-rt/make/platform/clang_linux_embedded_test_input.c b/compiler-rt/make/platform/clang_linux_embedded_test_input.c |
322 | new file mode 100644 | 322 | new file mode 100644 |
323 | index 000000000..e69de29bb | 323 | index 00000000000..e69de29bb2d |
324 | -- | 324 | -- |
325 | 2.20.1 | 325 | 2.20.1 |
326 | 326 | ||
diff --git a/recipes-devtools/clang/clang/0002-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 index 2ff903b..40168b0 100644 --- a/recipes-devtools/clang/clang/0002-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 | |||
@@ -1,7 +1,7 @@ | |||
1 | From 5ee148af76169aa327bfa0bfc1c2618a68e873fb Mon Sep 17 00:00:00 2001 | 1 | From a010673fd33c7311763620cf62159993255bb559 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Thu, 19 May 2016 23:11:45 -0700 | 3 | Date: Thu, 19 May 2016 23:11:45 -0700 |
4 | Subject: [PATCH 2/4] compiler-rt: Simplify cross-compilation. Don't use | 4 | Subject: [PATCH 14/15] compiler-rt: Simplify cross-compilation. Don't use |
5 | native-compiled llvm-config. | 5 | native-compiled llvm-config. |
6 | 6 | ||
7 | Note: AddLLVM.cmake does not expose the LLVM source directory. | 7 | Note: AddLLVM.cmake does not expose the LLVM source directory. |
@@ -16,14 +16,14 @@ https://us.codeaurora.org/patches/quic/llvm/50683/compiler-rt-cross-compilation. | |||
16 | Signed-off-by: Greg Fitzgerald <gregf@codeaurora.org> | 16 | Signed-off-by: Greg Fitzgerald <gregf@codeaurora.org> |
17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
18 | --- | 18 | --- |
19 | CMakeLists.txt | 11 ++++++++++- | 19 | compiler-rt/CMakeLists.txt | 11 ++++++++++- |
20 | 1 file changed, 10 insertions(+), 1 deletion(-) | 20 | 1 file changed, 10 insertions(+), 1 deletion(-) |
21 | 21 | ||
22 | diff --git a/CMakeLists.txt b/CMakeLists.txt | 22 | diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt |
23 | index 86ca2b3ef..07d894c8a 100644 | 23 | index aa360a3ef36..264d39c95c3 100644 |
24 | --- a/CMakeLists.txt | 24 | --- a/compiler-rt/CMakeLists.txt |
25 | +++ b/CMakeLists.txt | 25 | +++ b/compiler-rt/CMakeLists.txt |
26 | @@ -63,7 +63,16 @@ set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOLEAN | 26 | @@ -66,7 +66,16 @@ set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOLEAN |
27 | "Build for a bare-metal target.") | 27 | "Build for a bare-metal target.") |
28 | 28 | ||
29 | if (COMPILER_RT_STANDALONE_BUILD) | 29 | if (COMPILER_RT_STANDALONE_BUILD) |
diff --git a/recipes-devtools/clang/clang/0003-compiler-rt-Disable-tsan-on-OE-glibc.patch b/recipes-devtools/clang/clang/0015-compiler-rt-Disable-tsan-on-OE-glibc.patch index 8f45c2b..f6a8743 100644 --- a/recipes-devtools/clang/clang/0003-compiler-rt-Disable-tsan-on-OE-glibc.patch +++ b/recipes-devtools/clang/clang/0015-compiler-rt-Disable-tsan-on-OE-glibc.patch | |||
@@ -1,22 +1,22 @@ | |||
1 | From c7d41a6e4dd61733530d2f44c377b91e13004b71 Mon Sep 17 00:00:00 2001 | 1 | From e166d4e3568de2718b687c046b1d8b89504d1451 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Mon, 18 Jul 2016 08:05:02 +0000 | 3 | Date: Mon, 18 Jul 2016 08:05:02 +0000 |
4 | Subject: [PATCH 3/4] compiler-rt: Disable tsan on OE/glibc | 4 | Subject: [PATCH 15/15] compiler-rt: Disable tsan on OE/glibc |
5 | 5 | ||
6 | It does not build see | 6 | It does not build see |
7 | http://lists.llvm.org/pipermail/llvm-dev/2016-July/102235.html | 7 | http://lists.llvm.org/pipermail/llvm-dev/2016-July/102235.html |
8 | 8 | ||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
10 | --- | 10 | --- |
11 | cmake/config-ix.cmake | 2 +- | 11 | compiler-rt/cmake/config-ix.cmake | 2 +- |
12 | test/sanitizer_common/CMakeLists.txt | 1 - | 12 | compiler-rt/test/sanitizer_common/CMakeLists.txt | 1 - |
13 | 2 files changed, 1 insertion(+), 2 deletions(-) | 13 | 2 files changed, 1 insertion(+), 2 deletions(-) |
14 | 14 | ||
15 | diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake | 15 | diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake |
16 | index f3935ffd6..2c651b756 100644 | 16 | index db5c4645dc0..83ebc95fc98 100644 |
17 | --- a/cmake/config-ix.cmake | 17 | --- a/compiler-rt/cmake/config-ix.cmake |
18 | +++ b/cmake/config-ix.cmake | 18 | +++ b/compiler-rt/cmake/config-ix.cmake |
19 | @@ -564,7 +564,7 @@ else() | 19 | @@ -593,7 +593,7 @@ else() |
20 | endif() | 20 | endif() |
21 | 21 | ||
22 | if (COMPILER_RT_HAS_SANITIZER_COMMON AND TSAN_SUPPORTED_ARCH AND | 22 | if (COMPILER_RT_HAS_SANITIZER_COMMON AND TSAN_SUPPORTED_ARCH AND |
@@ -25,10 +25,10 @@ index f3935ffd6..2c651b756 100644 | |||
25 | set(COMPILER_RT_HAS_TSAN TRUE) | 25 | set(COMPILER_RT_HAS_TSAN TRUE) |
26 | else() | 26 | else() |
27 | set(COMPILER_RT_HAS_TSAN FALSE) | 27 | set(COMPILER_RT_HAS_TSAN FALSE) |
28 | diff --git a/test/sanitizer_common/CMakeLists.txt b/test/sanitizer_common/CMakeLists.txt | 28 | diff --git a/compiler-rt/test/sanitizer_common/CMakeLists.txt b/compiler-rt/test/sanitizer_common/CMakeLists.txt |
29 | index 4e2c80390..990315f11 100644 | 29 | index 23292e54820..cae7e010885 100644 |
30 | --- a/test/sanitizer_common/CMakeLists.txt | 30 | --- a/compiler-rt/test/sanitizer_common/CMakeLists.txt |
31 | +++ b/test/sanitizer_common/CMakeLists.txt | 31 | +++ b/compiler-rt/test/sanitizer_common/CMakeLists.txt |
32 | @@ -8,7 +8,6 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux|FreeBSD|NetBSD|SunOS") | 32 | @@ -8,7 +8,6 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux|FreeBSD|NetBSD|SunOS") |
33 | list(APPEND SUPPORTED_TOOLS asan) | 33 | list(APPEND SUPPORTED_TOOLS asan) |
34 | endif() | 34 | endif() |
diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index b3b8272..464f2f7 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb | |||
@@ -14,6 +14,12 @@ inherit cmake cmake-native | |||
14 | 14 | ||
15 | OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH" | 15 | OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH" |
16 | 16 | ||
17 | def get_clang_experimental_arch(bb, d, arch_var): | ||
18 | import re | ||
19 | a = d.getVar(arch_var, True) | ||
20 | if re.match('riscv(32|64)$', a): return 'RISCV' | ||
21 | return "" | ||
22 | |||
17 | def get_clang_arch(bb, d, arch_var): | 23 | def get_clang_arch(bb, d, arch_var): |
18 | import re | 24 | import re |
19 | a = d.getVar(arch_var, True) | 25 | a = d.getVar(arch_var, True) |
@@ -24,9 +30,8 @@ def get_clang_arch(bb, d, arch_var): | |||
24 | elif re.match('aarch64_be$', a): return 'AArch64' | 30 | elif re.match('aarch64_be$', a): return 'AArch64' |
25 | elif re.match('mips(isa|)(32|64|)(r6|)(el|)$', a): return 'Mips' | 31 | elif re.match('mips(isa|)(32|64|)(r6|)(el|)$', a): return 'Mips' |
26 | elif re.match('p(pc|owerpc)(|64)', a): return 'PowerPC' | 32 | elif re.match('p(pc|owerpc)(|64)', a): return 'PowerPC' |
27 | elif re.match('riscv(32|64)$', a): return 'RISCV' | ||
28 | else: | 33 | else: |
29 | bb.error("cannot map '%s' to a supported llvm architecture" % a) | 34 | bb.note("'%s' is not a primary llvm architecture" % a) |
30 | return "" | 35 | return "" |
31 | 36 | ||
32 | def get_clang_host_arch(bb, d): | 37 | def get_clang_host_arch(bb, d): |
@@ -35,6 +40,9 @@ def get_clang_host_arch(bb, d): | |||
35 | def get_clang_target_arch(bb, d): | 40 | def get_clang_target_arch(bb, d): |
36 | return get_clang_arch(bb, d, 'TARGET_ARCH') | 41 | return get_clang_arch(bb, d, 'TARGET_ARCH') |
37 | 42 | ||
43 | def get_clang_experimental_target_arch(bb, d): | ||
44 | return get_clang_experimental_arch(bb, d, 'TARGET_ARCH') | ||
45 | |||
38 | PACKAGECONFIG ??= "compiler-rt libcplusplus shared-libs" | 46 | PACKAGECONFIG ??= "compiler-rt libcplusplus shared-libs" |
39 | PACKAGECONFIG_class-native = "" | 47 | PACKAGECONFIG_class-native = "" |
40 | PACKAGECONFIG_class-nativesdk = "compiler-rt libcplusplus" | 48 | PACKAGECONFIG_class-nativesdk = "compiler-rt libcplusplus" |
@@ -50,7 +58,11 @@ LLVM_TARGETS_TO_BUILD ?= "AArch64;ARM;BPF;Mips;PowerPC;X86" | |||
50 | LLVM_TARGETS_TO_BUILD_append = ";${@get_clang_host_arch(bb, d)};${@get_clang_target_arch(bb, d)}" | 58 | LLVM_TARGETS_TO_BUILD_append = ";${@get_clang_host_arch(bb, d)};${@get_clang_target_arch(bb, d)}" |
51 | 59 | ||
52 | LLVM_TARGETS_TO_BUILD_TARGET ?= "" | 60 | LLVM_TARGETS_TO_BUILD_TARGET ?= "" |
53 | LLVM_TARGETS_TO_BUILD_TARGET_append ?= ";${@get_clang_target_arch(bb, d)}" | 61 | LLVM_TARGETS_TO_BUILD_TARGET_append ?= "${@get_clang_target_arch(bb, d)}" |
62 | |||
63 | LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ?= "RISCV" | ||
64 | LLVM_EXPERIMENTAL_TARGETS_TO_BUILD_append = ";${@get_clang_experimental_target_arch(bb, d)}" | ||
65 | |||
54 | EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \ | 66 | EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \ |
55 | -DLLVM_ENABLE_EXPENSIVE_CHECKS=OFF \ | 67 | -DLLVM_ENABLE_EXPENSIVE_CHECKS=OFF \ |
56 | -DLLVM_ENABLE_PIC=ON \ | 68 | -DLLVM_ENABLE_PIC=ON \ |
@@ -70,11 +82,13 @@ EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \ | |||
70 | 82 | ||
71 | EXTRA_OECMAKE_append_class-native = "\ | 83 | EXTRA_OECMAKE_append_class-native = "\ |
72 | -DLLVM_TARGETS_TO_BUILD='${LLVM_TARGETS_TO_BUILD}' \ | 84 | -DLLVM_TARGETS_TO_BUILD='${LLVM_TARGETS_TO_BUILD}' \ |
85 | -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD='${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}' \ | ||
73 | " | 86 | " |
74 | EXTRA_OECMAKE_append_class-nativesdk = "\ | 87 | EXTRA_OECMAKE_append_class-nativesdk = "\ |
75 | -DCMAKE_CROSSCOMPILING:BOOL=ON \ | 88 | -DCMAKE_CROSSCOMPILING:BOOL=ON \ |
76 | -DCROSS_TOOLCHAIN_FLAGS_NATIVE='-DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain-native.cmake' \ | 89 | -DCROSS_TOOLCHAIN_FLAGS_NATIVE='-DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain-native.cmake' \ |
77 | -DLLVM_TARGETS_TO_BUILD='${LLVM_TARGETS_TO_BUILD}' \ | 90 | -DLLVM_TARGETS_TO_BUILD='${LLVM_TARGETS_TO_BUILD}' \ |
91 | -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD='${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}' \ | ||
78 | -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \ | 92 | -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \ |
79 | -DCLANG_TABLEGEN=${STAGING_BINDIR_NATIVE}/clang-tblgen \ | 93 | -DCLANG_TABLEGEN=${STAGING_BINDIR_NATIVE}/clang-tblgen \ |
80 | " | 94 | " |
@@ -86,7 +100,12 @@ EXTRA_OECMAKE_append_class-target = "\ | |||
86 | -DLLVM_TARGET_ARCH=${@get_clang_target_arch(bb, d)} \ | 100 | -DLLVM_TARGET_ARCH=${@get_clang_target_arch(bb, d)} \ |
87 | -DLLVM_DEFAULT_TARGET_TRIPLE=${TARGET_SYS} \ | 101 | -DLLVM_DEFAULT_TARGET_TRIPLE=${TARGET_SYS} \ |
88 | " | 102 | " |
89 | 103 | EXTRA_OECMAKE_append_class-target_riscv64 = "\ | |
104 | -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD='${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}' \ | ||
105 | " | ||
106 | EXTRA_OECMAKE_append_class-target_riscv32 = "\ | ||
107 | -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD='${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}' \ | ||
108 | " | ||
90 | DEPENDS = "zlib libffi libxml2 ninja-native" | 109 | DEPENDS = "zlib libffi libxml2 ninja-native" |
91 | DEPENDS_append_class-nativesdk = " clang-native virtual/${TARGET_PREFIX}binutils-crosssdk virtual/${TARGET_PREFIX}gcc-crosssdk virtual/${TARGET_PREFIX}g++-crosssdk" | 110 | DEPENDS_append_class-nativesdk = " clang-native virtual/${TARGET_PREFIX}binutils-crosssdk virtual/${TARGET_PREFIX}gcc-crosssdk virtual/${TARGET_PREFIX}g++-crosssdk" |
92 | DEPENDS_append_class-target = " clang-cross-${TARGET_ARCH} ${@bb.utils.contains('TOOLCHAIN', 'gcc', 'virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++', '', d)}" | 111 | DEPENDS_append_class-target = " clang-cross-${TARGET_ARCH} ${@bb.utils.contains('TOOLCHAIN', 'gcc', 'virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++', '', d)}" |
diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index d582d34..ad1f435 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc | |||
@@ -8,59 +8,27 @@ LICENSE = "NCSA" | |||
8 | BASEURI ??= "${LLVM_GIT}/llvm-project;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH}" | 8 | BASEURI ??= "${LLVM_GIT}/llvm-project;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH}" |
9 | SRC_URI = "\ | 9 | SRC_URI = "\ |
10 | ${BASEURI} \ | 10 | ${BASEURI} \ |
11 | ${LLVMPATCHES} \ | 11 | ${@'file://0000-clang-Enable-SSP-and-PIE-by-default.patch' if '${GCCPIE}' else ''} \ |
12 | ${CLANGPATCHES} \ | 12 | file://0001-clang-driver-Use-lib-for-ldso-on-OE.patch \ |
13 | ${COMPILERRTPATCHES} \ | 13 | file://0002-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch \ |
14 | ${LIBCXXABIPATCHES} \ | 14 | file://0003-clang-musl-ppc-does-not-support-128-bit-long-double.patch \ |
15 | ${LIBCXXPATCHES} \ | 15 | file://0004-clang-Prepend-trailing-to-sysroot.patch \ |
16 | ${LLDBPATCHES} \ | 16 | file://0005-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch \ |
17 | file://0006-clang-Define-releative-gcc-installation-dir.patch \ | ||
18 | file://0007-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch \ | ||
19 | file://0008-clang-scan-view-needs-python-2.x.patch \ | ||
20 | file://0009-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch \ | ||
21 | file://0010-llvm-allow-env-override-of-exe-path.patch \ | ||
22 | file://0011-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch \ | ||
23 | file://0012-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch \ | ||
24 | file://0013-compiler-rt-support-a-new-embedded-linux-target.patch \ | ||
25 | file://0014-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch \ | ||
26 | file://0015-compiler-rt-Disable-tsan-on-OE-glibc.patch \ | ||
17 | " | 27 | " |
18 | 28 | ||
19 | # llvm patches | ||
20 | # | ||
21 | LLVMPATCHES = "\ | ||
22 | file://0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch;patchdir=llvm \ | ||
23 | file://0002-llvm-allow-env-override-of-exe-path.patch;patchdir=llvm \ | ||
24 | file://0003-llvm-Disable-calls-to-_finite-and-other-glibc-only-f.patch;patchdir=llvm \ | ||
25 | " | ||
26 | # Fallback to no-PIE if not set | 29 | # Fallback to no-PIE if not set |
27 | GCCPIE ??= "" | 30 | GCCPIE ??= "" |
28 | 31 | ||
29 | # Clang patches | ||
30 | CLANGPATCHES = "\ | ||
31 | file://0001-clang-driver-Use-lib-for-ldso-on-OE.patch;patchdir=clang \ | ||
32 | file://0002-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch;patchdir=clang \ | ||
33 | file://0003-clang-musl-ppc-does-not-support-128-bit-long-double.patch;patchdir=clang \ | ||
34 | file://0004-clang-Prepend-trailing-to-sysroot.patch;patchdir=clang \ | ||
35 | file://0005-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch;patchdir=clang \ | ||
36 | file://0006-clang-Define-releative-gcc-installation-dir.patch;patchdir=clang \ | ||
37 | file://0007-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch;patchdir=clang \ | ||
38 | file://0008-clang-scan-view-needs-python-2.x.patch;patchdir=clang \ | ||
39 | " | ||
40 | CLANGPATCHES += "${@'file://0009-clang-Enable-SSP-and-PIE-by-default.patch;patchdir=clang' if '${GCCPIE}' else ''}" | ||
41 | |||
42 | # compiler-rt patches | ||
43 | COMPILERRTPATCHES = "\ | ||
44 | file://0001-compiler-rt-support-a-new-embedded-linux-target.patch;patchdir=compiler-rt \ | ||
45 | file://0002-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch;patchdir=compiler-rt \ | ||
46 | file://0003-compiler-rt-Disable-tsan-on-OE-glibc.patch;patchdir=compiler-rt \ | ||
47 | file://0004-compiler-rt-cmake-mips-Do-not-specify-target-with-OE.patch;patchdir=compiler-rt \ | ||
48 | " | ||
49 | # libcxxabi patches | ||
50 | LIBCXXABIPATCHES ="\ | ||
51 | file://0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch;patchdir=libcxxabi \ | ||
52 | " | ||
53 | |||
54 | # libc++ patches | ||
55 | LIBCXXPATCHES = "\ | ||
56 | " | ||
57 | |||
58 | # lldb patches | ||
59 | LLDBPATCHES = "\ | ||
60 | file://0001-lldb-Include-limits.h-for-PATH_MAX-definition.patch;patchdir=lldb \ | ||
61 | file://0002-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch;patchdir=lldb \ | ||
62 | " | ||
63 | |||
64 | S = "${TMPDIR}/work-shared/llvm-project-source-${PV}-${PR}/git" | 32 | S = "${TMPDIR}/work-shared/llvm-project-source-${PV}-${PR}/git" |
65 | B = "${WORKDIR}/llvm-project-source-${PV}/build.${HOST_SYS}.${TARGET_SYS}" | 33 | B = "${WORKDIR}/llvm-project-source-${PV}/build.${HOST_SYS}.${TARGET_SYS}" |
66 | 34 | ||