Skip to content

Commit

Permalink
[Driver] Use -dynamic-linker /lib/ld-musl-i386.so.1 for i?86-linux-musl
Browse files Browse the repository at this point in the history
Noticed by Khem Raj
  • Loading branch information
MaskRay committed Mar 25, 2021
1 parent 97d8972 commit cdd993f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions clang/lib/Driver/ToolChains/Linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
5 changes: 5 additions & 0 deletions clang/test/Driver/linux-cross.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit cdd993f

Please sign in to comment.