From a01c3d56bf9aa2668e068126fa58d0f0a74d81e0 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 19 May 2021 17:59:09 -0700 Subject: clang: Fix x86 tuple for include search paths This ensures that search path for c++ headers is using right directory structure as per Openembedded gcc and sysroot install e.g. ignoring nonexistent directory "/mnt/b/yoe/master/build/tmp/work/core2-32-yoe-linux-musl/compiler-rt/13.0.0-r0/recipe-sysroot/usr/lib/i686-yoe-linux-musl/11.1.0/../../../include/ c++/11.1.0/i386-linux-gnu" Signed-off-by: Khem Raj (cherry picked from commit 6ecc0989f152811b8e042d0eb0c94db24c023543) --- ...86-triple-for-non-debian-multiarch-linux-.patch | 25 ++++++++++++++++++++++ recipes-devtools/clang/common.inc | 1 + 2 files changed, 26 insertions(+) create mode 100644 recipes-devtools/clang/clang/0030-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch diff --git a/recipes-devtools/clang/clang/0030-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch b/recipes-devtools/clang/clang/0030-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch new file mode 100644 index 0000000..2e6527f --- /dev/null +++ b/recipes-devtools/clang/clang/0030-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch @@ -0,0 +1,25 @@ +From 923e1a9142f88b4970a3a860b6e41bf74dea4091 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 19 May 2021 17:56:03 -0700 +Subject: [PATCH] clang: Fix x86 triple for non-debian multiarch linux distros + +OpenEmbedded does not hardcode mutli-arch like debian therefore ensure +that it still uses the proper tuple + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Linux.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -622,6 +622,9 @@ void Linux::addLibStdCxxIncludePaths(con + GCCInstallation.getTriple().getArch() == llvm::Triple::x86 + ? "i386-linux-gnu" + : TripleStr; ++ // OpenEmbedded does not hardcode the triple to i386-linux-gnu like debian ++ if (GCCInstallation.getTriple().getVendor() == llvm::Triple::OpenEmbedded) ++ DebianMultiarch = TripleStr; + + // Try generic GCC detection first. + if (Generic_GCC::addGCCLibStdCxxIncludePaths(DriverArgs, CC1Args, diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index 69bb40a..e37c459 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -38,6 +38,7 @@ SRC_URI = "\ file://0027-compiler-rt-Use-mcr-based-barrier-on-armv6.patch \ file://0028-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch \ file://0029-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch \ + file://0030-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch \ file://0033-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch \ file://0034-CMake-Installable-find-modules-for-terminfo-and-libf.patch \ file://0035-llvm-Do-not-use-standard-search-paths-in-find_librar.patch \ -- cgit v1.2.3-54-g00ecf