<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Oh, yes, sure<br>
<br>
Best Regards<br>
<br>
Christian<br>
<br>
<br>
<div class="moz-cite-prefix">On 09/05/2018 12:05 AM, Richard Smith wrote:<br>
</div>
<blockquote type="cite" cite="mid:CAOfiQqmyDY4gXCQ4iNGY+MctsONxB83JvS3YWUadB1kVeMneOg@mail.gmail.com">
<div dir="ltr">
<div>This is breaking buildbots:</div>
<div dir="ltr"><br>
</div>
<div dir="ltr"><a href="http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules/builds/19509" moz-do-not-send="true">http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules/builds/19509</a><br>
</div>
<div dir="ltr"><br>
</div>
<div>Can you take a look? Thanks!</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Tue, 4 Sep 2018 at 08:36, Christian Bruel via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" moz-do-not-send="true">cfe-commits@lists.llvm.org</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: chrib<br>
Date: Tue Sep 4 08:22:13 2018<br>
New Revision: 341373<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=341373&view=rev" rel="noreferrer" target="_blank" moz-do-not-send="true">
http://llvm.org/viewvc/llvm-project?rev=341373&view=rev</a><br>
Log:<br>
Fix the -print-multi-directory flag to print the selected multilib.<br>
<br>
Summary: Fix -print-multi-directory to print the selected multilib<br>
<br>
Reviewers: jroelofs<br>
<br>
Reviewed By: jroelofs<br>
<br>
Subscribers: srhines, cfe-commits<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D51354" rel="noreferrer" target="_blank" moz-do-not-send="true">
https://reviews.llvm.org/D51354</a><br>
<br>
Added:<br>
cfe/trunk/test/Driver/print-multi-directory.c<br>
Modified:<br>
cfe/trunk/include/clang/Driver/ToolChain.h<br>
cfe/trunk/lib/Driver/Driver.cpp<br>
cfe/trunk/lib/Driver/ToolChains/Linux.cpp<br>
<br>
Modified: cfe/trunk/include/clang/Driver/ToolChain.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/ToolChain.h?rev=341373&r1=341372&r2=341373&view=diff" rel="noreferrer" target="_blank" moz-do-not-send="true">
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/ToolChain.h?rev=341373&r1=341372&r2=341373&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Driver/ToolChain.h (original)<br>
+++ cfe/trunk/include/clang/Driver/ToolChain.h Tue Sep 4 08:22:13 2018<br>
@@ -149,6 +149,7 @@ private:<br>
<br>
protected:<br>
MultilibSet Multilibs;<br>
+ Multilib SelectedMultilib;<br>
<br>
ToolChain(const Driver &D, const llvm::Triple &T,<br>
const llvm::opt::ArgList &Args);<br>
@@ -227,6 +228,8 @@ public:<br>
<br>
const MultilibSet &getMultilibs() const { return Multilibs; }<br>
<br>
+ const Multilib &getMultilib() const { return SelectedMultilib; }<br>
+<br>
const SanitizerArgs& getSanitizerArgs() const;<br>
<br>
const XRayArgs& getXRayArgs() const;<br>
<br>
Modified: cfe/trunk/lib/Driver/Driver.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=341373&r1=341372&r2=341373&view=diff" rel="noreferrer" target="_blank" moz-do-not-send="true">
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=341373&r1=341372&r2=341373&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/Driver.cpp (original)<br>
+++ cfe/trunk/lib/Driver/Driver.cpp Tue Sep 4 08:22:13 2018<br>
@@ -1661,14 +1661,13 @@ bool Driver::HandleImmediateArgs(const C<br>
}<br>
<br>
if (C.getArgs().hasArg(options::OPT_print_multi_directory)) {<br>
- for (const Multilib &Multilib : TC.getMultilibs()) {<br>
- if (Multilib.gccSuffix().empty())<br>
- llvm::outs() << ".\n";<br>
- else {<br>
- StringRef Suffix(Multilib.gccSuffix());<br>
- assert(Suffix.front() == '/');<br>
- llvm::outs() << Suffix.substr(1) << "\n";<br>
- }<br>
+ const Multilib &Multilib = TC.getMultilib();<br>
+ if (Multilib.gccSuffix().empty())<br>
+ llvm::outs() << ".\n";<br>
+ else {<br>
+ StringRef Suffix(Multilib.gccSuffix());<br>
+ assert(Suffix.front() == '/');<br>
+ llvm::outs() << Suffix.substr(1) << "\n";<br>
}<br>
return false;<br>
}<br>
<br>
Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.cpp?rev=341373&r1=341372&r2=341373&view=diff" rel="noreferrer" target="_blank" moz-do-not-send="true">
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.cpp?rev=341373&r1=341372&r2=341373&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/ToolChains/Linux.cpp (original)<br>
+++ cfe/trunk/lib/Driver/ToolChains/Linux.cpp Tue Sep 4 08:22:13 2018<br>
@@ -210,6 +210,7 @@ Linux::Linux(const Driver &D, const llvm<br>
: Generic_ELF(D, Triple, Args) {<br>
GCCInstallation.init(Triple, Args);<br>
Multilibs = GCCInstallation.getMultilibs();<br>
+ SelectedMultilib = GCCInstallation.getMultilib();<br>
llvm::Triple::ArchType Arch = Triple.getArch();<br>
std::string SysRoot = computeSysRoot();<br>
<br>
@@ -299,16 +300,14 @@ Linux::Linux(const Driver &D, const llvm<br>
if (GCCInstallation.isValid()) {<br>
const llvm::Triple &GCCTriple = GCCInstallation.getTriple();<br>
const std::string &LibPath = GCCInstallation.getParentLibPath();<br>
- const Multilib &Multilib = GCCInstallation.getMultilib();<br>
- const MultilibSet &Multilibs = GCCInstallation.getMultilibs();<br>
<br>
// Add toolchain / multilib specific file paths.<br>
- addMultilibsFilePaths(D, Multilibs, Multilib,<br>
+ addMultilibsFilePaths(D, Multilibs, SelectedMultilib,<br>
GCCInstallation.getInstallPath(), Paths);<br>
<br>
// Sourcery CodeBench MIPS toolchain holds some libraries under<br>
// a biarch-like suffix of the GCC installation.<br>
- addPathIfExists(D, GCCInstallation.getInstallPath() + Multilib.gccSuffix(),<br>
+ addPathIfExists(D, GCCInstallation.getInstallPath() + SelectedMultilib.gccSuffix(),<br>
Paths);<br>
<br>
// GCC cross compiling toolchains will install target libraries which ship<br>
@@ -330,7 +329,7 @@ Linux::Linux(const Driver &D, const llvm<br>
// Note that this matches the GCC behavior. See the below comment for where<br>
// Clang diverges from GCC's behavior.<br>
addPathIfExists(D, LibPath + "/../" + GCCTriple.str() + "/lib/../" +<br>
- OSLibDir + Multilib.osSuffix(),<br>
+ OSLibDir + SelectedMultilib.osSuffix(),<br>
Paths);<br>
<br>
// If the GCC installation we found is inside of the sysroot, we want to<br>
<br>
Added: cfe/trunk/test/Driver/print-multi-directory.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/print-multi-directory.c?rev=341373&view=auto" rel="noreferrer" target="_blank" moz-do-not-send="true">
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/print-multi-directory.c?rev=341373&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/Driver/print-multi-directory.c (added)<br>
+++ cfe/trunk/test/Driver/print-multi-directory.c Tue Sep 4 08:22:13 2018<br>
@@ -0,0 +1,28 @@<br>
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \<br>
+// RUN: -target i386-none-linux \<br>
+// RUN: -print-multi-directory \<br>
+// RUN: | FileCheck --check-prefix=CHECK-X86-MULTILIBS %s<br>
+<br>
+// CHECK-X86-MULTILIBS: 32<br>
+// CHECK-X86-MULTILIBS-NOT: x32<br>
+// CHECK-X86-MULTILIBS-NOT: .<br>
+<br>
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \<br>
+// RUN: -target i386-none-linux -m64 \<br>
+// RUN: -print-multi-directory \<br>
+// RUN: | FileCheck --check-prefix=CHECK-X86_64-MULTILIBS %s<br>
+<br>
+// CHECK-X86_64-MULTILIBS: .<br>
+// CHECK-X86_64-MULTILIBS-NOT: x32<br>
+// CHECK-X86_64-MULTILIBS-NOT: 32<br>
+<br>
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \<br>
+// RUN: -target arm-linux-androideabi21 -stdlib=libstdc++ \<br>
+// RUN: -mthumb \<br>
+// RUN: -B%S/Inputs/basic_android_ndk_tree \<br>
+// RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \<br>
+// RUN: -print-multi-directory \<br>
+// RUN: | FileCheck --check-prefix=CHECK-ARM-MULTILIBS %s<br>
+<br>
+// CHECK-ARM-MULTILIBS: thumb<br>
+// CHECK-ARM-MULTILIBS-NOT: .<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank" moz-do-not-send="true">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote>
</div>
</blockquote>
<br>
</body>
</html>