summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/clang/clang/0030-Correct-library-search-path-for-OpenEmbedded-Host.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-devtools/clang/clang/0030-Correct-library-search-path-for-OpenEmbedded-Host.patch')
-rw-r--r--recipes-devtools/clang/clang/0030-Correct-library-search-path-for-OpenEmbedded-Host.patch84
1 files changed, 84 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang/0030-Correct-library-search-path-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0030-Correct-library-search-path-for-OpenEmbedded-Host.patch
new file mode 100644
index 0000000..d286791
--- /dev/null
+++ b/recipes-devtools/clang/clang/0030-Correct-library-search-path-for-OpenEmbedded-Host.patch
@@ -0,0 +1,84 @@
1From f336b9d079e5576ce6d98bb1650002eb107b824a Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Tue, 7 Dec 2021 04:55:48 +0000
4Subject: [PATCH] Correct library search path for OpenEmbedded Host
5
6For OpenEmbedded Host, the gcc install path is
7/usr/lib/x86_64-[distroname]-linux/[gcc-version].
8So the library search path is not found with default triple
9'x86_64-linux-gnu' for x86_64. Causing following error:
10[snip]
11compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang
12-target x86_64-linux
13-isystem/path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/include
14-O2 -pipe
15/path/to/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/share/cmake-3.21/Modules/CMakeCCompilerABI.c`
16| /build/tmp-glibc/hosttools/ld: cannot find -lgcc
17| /build/tmp-glibc/hosttools/ld: cannot find -lgcc
18| clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
19[snip]
20
21before this patch:
22b59da142f2b0:$ /path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --print-search-dirs
23programs: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin
24libraries: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/lib/clang/13.0.1:/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/../lib://lib://usr/lib
25
26after this patch:
27b59da142f2b0:$ /path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --print-search-dirs
28programs: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin
29libraries: =/build/tmp-glibc/work/x84_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/lib/clang/13.0.1:/usr/lib/x86_64-wrs-linux/10.2.0://lib/x86_64-wrs-linux://usr/lib/x86_64-wrs-linux:/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/../lib://lib://usr/lib
30
31Upstream-Status: Inappropriate [oe specific]
32
33Signed-off-by: Changqing Li <changqing.li@windriver.com>
34Signed-off-by: Khem Raj <raj.khem@gmail.com>
35---
36 clang/include/clang/Driver/Distro.h | 2 ++
37 clang/lib/Driver/Distro.cpp | 1 +
38 clang/lib/Driver/ToolChains/Linux.cpp | 1 +
39 3 files changed, 4 insertions(+)
40
41diff --git a/clang/include/clang/Driver/Distro.h b/clang/include/clang/Driver/Distro.h
42index 01d66b30b038..4d5aa366a005 100644
43--- a/clang/include/clang/Driver/Distro.h
44+++ b/clang/include/clang/Driver/Distro.h
45@@ -45,6 +45,7 @@ public:
46 RHEL7,
47 Fedora,
48 Gentoo,
49+ //CLANG_EXTRA_OE_DISTRO_NAME
50 OpenSUSE,
51 UbuntuHardy,
52 UbuntuIntrepid,
53@@ -134,6 +135,7 @@ public:
54
55 bool IsGentoo() const { return DistroVal == Gentoo; }
56
57+ //CLANG_EXTRA_OE_DISTRO_CHECK
58 /// @}
59 };
60
61diff --git a/clang/lib/Driver/Distro.cpp b/clang/lib/Driver/Distro.cpp
62index 1898667279cc..ab7bc8d45ac1 100644
63--- a/clang/lib/Driver/Distro.cpp
64+++ b/clang/lib/Driver/Distro.cpp
65@@ -44,6 +44,7 @@ static Distro::DistroType DetectOsRelease(llvm::vfs::FileSystem &VFS) {
66 .Case("sles", Distro::OpenSUSE)
67 .Case("opensuse", Distro::OpenSUSE)
68 .Case("exherbo", Distro::Exherbo)
69+ //CLANG_EXTRA_OE_DISTRO_CASE
70 .Default(Distro::UnknownDistro);
71 return Version;
72 }
73diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
74index aac45650f97b..3c4034ea4921 100644
75--- a/clang/lib/Driver/ToolChains/Linux.cpp
76+++ b/clang/lib/Driver/ToolChains/Linux.cpp
77@@ -77,6 +77,7 @@ std::string Linux::getMultiarchTriple(const Driver &D,
78 return "x86_64-linux-android";
79 if (TargetEnvironment == llvm::Triple::GNUX32)
80 return "x86_64-linux-gnux32";
81+ //CLANG_EXTRA_OE_DISTRO_TRIPLE
82 return "x86_64-linux-gnu";
83 case llvm::Triple::aarch64:
84 if (IsAndroid)