[clang] cdd993f - [Driver] Use -dynamic-linker /lib/ld-musl-i386.so.1 for i?86-linux-musl
Fangrui Song via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 24 19:45:01 PDT 2021
Author: Fangrui Song
Date: 2021-03-24T19:44:53-07:00
New Revision: cdd993fab3629474011b73985285c04722cffd61
URL: https://github.com/llvm/llvm-project/commit/cdd993fab3629474011b73985285c04722cffd61
DIFF: https://github.com/llvm/llvm-project/commit/cdd993fab3629474011b73985285c04722cffd61.diff
LOG: [Driver] Use -dynamic-linker /lib/ld-musl-i386.so.1 for i?86-linux-musl
Noticed by Khem Raj
Added:
Modified:
clang/lib/Driver/ToolChains/Linux.cpp
clang/test/Driver/linux-cross.cpp
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
index c1aabfd0aecd..eacc540fee30 100644
--- a/clang/lib/Driver/ToolChains/Linux.cpp
+++ b/clang/lib/Driver/ToolChains/Linux.cpp
@@ -398,6 +398,9 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
ArchName = "armeb";
IsArm = true;
break;
+ case llvm::Triple::x86:
+ ArchName = "i386";
+ break;
default:
ArchName = Triple.getArchName().str();
}
diff --git a/clang/test/Driver/linux-cross.cpp b/clang/test/Driver/linux-cross.cpp
index 6fdd9193fa2f..49e7861923ba 100644
--- a/clang/test/Driver/linux-cross.cpp
+++ b/clang/test/Driver/linux-cross.cpp
@@ -70,3 +70,8 @@
// DEBIAN_AARCH64-SAME: {{^}} "-L[[SYSROOT]]/usr/lib/gcc-cross/aarch64-linux-gnu/10/../../.."
// DEBIAN_AARCH64-SAME: {{^}} "-L[[SYSROOT]]/lib"
// DEBIAN_AARCH64-SAME: {{^}} "-L[[SYSROOT]]/usr/lib"
+
+/// LDSO_ARCH is i386 for all x86-32 variants.
+// RUN: %clang -### %s --target=i686-linux-musl --sysroot= \
+// RUN: --stdlib=platform --rtlib=platform 2>&1 | FileCheck %s --check-prefix=MUSL_I686
+// MUSL_I686: "-dynamic-linker" "/lib/ld-musl-i386.so.1"
More information about the cfe-commits
mailing list