summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-devtools/clang/clang/0027-For-x86_64-set-Yocto-based-GCC-install-search-path.patch67
-rw-r--r--recipes-devtools/clang/common.inc1
2 files changed, 68 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang/0027-For-x86_64-set-Yocto-based-GCC-install-search-path.patch b/recipes-devtools/clang/clang/0027-For-x86_64-set-Yocto-based-GCC-install-search-path.patch
new file mode 100644
index 0000000..4ebab1e
--- /dev/null
+++ b/recipes-devtools/clang/clang/0027-For-x86_64-set-Yocto-based-GCC-install-search-path.patch
@@ -0,0 +1,67 @@
1From d507046e9deec46f005ad164073d3cae4e0b8a47 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Mon, 25 Jan 2021 16:14:35 +0800
4Subject: [PATCH] For x86_64, set Yocto based GCC install search path
5
6Under Yocto host, while using clang-native to build, it searches
7install host gcc failed which causing the include file not found
8[snip]
9|clang++ -target x86_64-linux -MMD -MF src/base/files/file_path_constants.o.d -I../../../tools/gn/src -I. \
10-isystem/tmp-glibc/work/x86_64-linux/gn-native/87.0.4280.141-r0/recipe-sysroot-native/usr/include -O2 -pipe \
11-std=c++17 -c ../../../tools/gn/src/base/files/file_path_constants.cc -o src/base/files/file_path_constants.o
12|../../../tools/gn/src/base/files/file_path_constants.cc:7:10: fatal error: 'iterator' file not found
13|#include <iterator>
14| ^~~~~~~~
15[snip]
16
17Set three Yocto based GCC triple: poky, oe-core and wind river
18
19Before aplly the patch
20[snip]
21$ ../recipe-sysroot-native/usr/bin/clang++ -v
22clang version 11.0.1 (https://github.com/llvm/llvm-project 43ff75f2c3feef64f9d73328230d34dac8832a91)
23Target: x86_64-unknown-linux-gnu
24Thread model: posix
25InstalledDir:tmp-glibc/work/x86_64-linux/gn-native/87.0.4280.141-r0/chromium-87.0.4280.141/../recipe-sysroot-native/usr/bin
26[snip]
27
28After aplly the patch:
29[snip]
30$ ../recipe-sysroot-native/usr/bin/clang++ -v
31clang version 11.0.1 (https://github.com/llvm/llvm-project 22c3241ff9a6224261df48d0258957fd8acc3d64)
32Target: x86_64-unknown-linux-gnu
33Thread model: posix
34InstalledDir:tmp-glibc/work/x86_64-linux/gn-native/87.0.4280.141-r0/chromium-87.0.4280.141/../recipe-sysroot-native/usr/bin
35Found candidate GCC installation: /usr/lib//x86_64-wrs-linux/10.1.0
36Found candidate GCC installation: /usr/lib/gcc/x86_64-wrs-linux/10.1.0
37Selected GCC installation: /usr/lib//x86_64-wrs-linux/10.1.0
38Candidate multilib: .;@m64
39Selected multilib: .;@m64
40[snip]
41
42BTW, it is hardly to insert a triple by the replacement of TARGET_SYS
43(=${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}), since TARGET_VENDOR
44is different between clang and clang-native
45
46Upstream-Status: Inappropriate [oe specific]
47
48Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
49---
50 clang/lib/Driver/ToolChains/Gnu.cpp | 1 +
51 1 file changed, 1 insertion(+)
52
53diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
54index d02e644c720b..fdcf6b91ebe1 100644
55--- a/clang/lib/Driver/ToolChains/Gnu.cpp
56+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
57@@ -2083,6 +2083,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
58 "x86_64-redhat-linux", "x86_64-suse-linux",
59 "x86_64-manbo-linux-gnu", "x86_64-linux-gnu",
60 "x86_64-slackware-linux", "x86_64-unknown-linux",
61+ "x86_64-oe-linux", "x86_64-poky-linux", "x86_64-wrs-linux",
62 "x86_64-amazon-linux", "x86_64-linux-android"};
63 static const char *const X32LibDirs[] = {"/libx32"};
64 static const char *const X86LibDirs[] = {"/lib32", "/lib"};
65--
662.18.2
67
diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc
index 919cc86..4709d28 100644
--- a/recipes-devtools/clang/common.inc
+++ b/recipes-devtools/clang/common.inc
@@ -34,6 +34,7 @@ SRC_URI = "\
34 file://0024-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch \ 34 file://0024-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch \
35 file://0025-libcxx-Define-__NR_futex-to-be-__NR_futex_time64-on-.patch \ 35 file://0025-libcxx-Define-__NR_futex-to-be-__NR_futex_time64-on-.patch \
36 file://0026-clang-Use-python3-in-python-scripts.patch \ 36 file://0026-clang-Use-python3-in-python-scripts.patch \
37 file://0027-For-x86_64-set-Yocto-based-GCC-install-search-path.patch \
37" 38"
38 39
39# Fallback to no-PIE if not set 40# Fallback to no-PIE if not set