diff options
Diffstat (limited to 'recipes-devtools/clang/clang/0026-Correct-library-search-path-for-OpenEmbedded-Host.patch')
-rw-r--r-- | recipes-devtools/clang/clang/0026-Correct-library-search-path-for-OpenEmbedded-Host.patch | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang/0026-Correct-library-search-path-for-OpenEmbedded-Host.patch b/recipes-devtools/clang/clang/0026-Correct-library-search-path-for-OpenEmbedded-Host.patch new file mode 100644 index 0000000..6fdb5f9 --- /dev/null +++ b/recipes-devtools/clang/clang/0026-Correct-library-search-path-for-OpenEmbedded-Host.patch | |||
@@ -0,0 +1,84 @@ | |||
1 | From e15c555d55efa0732adf97c3e858441296b4e83c Mon Sep 17 00:00:00 2001 | ||
2 | From: Changqing Li <changqing.li@windriver.com> | ||
3 | Date: Tue, 7 Dec 2021 04:55:48 +0000 | ||
4 | Subject: [PATCH] Correct library search path for OpenEmbedded Host | ||
5 | |||
6 | For OpenEmbedded Host, the gcc install path is | ||
7 | /usr/lib/x86_64-[distroname]-linux/[gcc-version]. | ||
8 | So the library search path is not found with default triple | ||
9 | 'x86_64-linux-gnu' for x86_64. Causing following error: | ||
10 | [snip] | ||
11 | compiler-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 | |||
21 | before this patch: | ||
22 | b59da142f2b0:$ /path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --print-search-dirs | ||
23 | programs: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin | ||
24 | libraries: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/lib/clang/13.0.1:/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/../lib://lib://usr/lib | ||
25 | |||
26 | after this patch: | ||
27 | b59da142f2b0:$ /path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --print-search-dirs | ||
28 | programs: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin | ||
29 | libraries: =/build/tmp-glibc/work/x84_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/lib/clang/13.0.1:/usr/lib/x86_64-wrs-linux/10.2.0://lib/x86_64-wrs-linux://usr/lib/x86_64-wrs-linux:/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/../lib://lib://usr/lib | ||
30 | |||
31 | Upstream-Status: Inappropriate [oe specific] | ||
32 | |||
33 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
34 | Signed-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 | |||
41 | diff --git a/clang/include/clang/Driver/Distro.h b/clang/include/clang/Driver/Distro.h | ||
42 | index 1404e1686848..90940e4a0bac 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 | @@ -138,6 +139,7 @@ public: | ||
54 | |||
55 | bool IsGentoo() const { return DistroVal == Gentoo; } | ||
56 | |||
57 | + //CLANG_EXTRA_OE_DISTRO_CHECK | ||
58 | /// @} | ||
59 | }; | ||
60 | |||
61 | diff --git a/clang/lib/Driver/Distro.cpp b/clang/lib/Driver/Distro.cpp | ||
62 | index 6f49e641104c..63b9ff30f0b6 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 | } | ||
73 | diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp | ||
74 | index cdea589eb226..41818470cf85 100644 | ||
75 | --- a/clang/lib/Driver/ToolChains/Linux.cpp | ||
76 | +++ b/clang/lib/Driver/ToolChains/Linux.cpp | ||
77 | @@ -82,6 +82,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) | ||