[PATCH] D35742: [Driver] Register effective triple before get arm float abi.
Leo Li via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 21 15:41:51 PDT 2017
aoli created this revision.
Herald added subscribers: kristof.beyls, javed.absar, aemerson.
We need to register effective triple before calling `getARMFloatABI`.
Add missing code when `--print-libgcc-file-name` is passed.
https://reviews.llvm.org/D35742
Files:
lib/Driver/Driver.cpp
test/Driver/arm-compiler-rt.c
Index: test/Driver/arm-compiler-rt.c
===================================================================
--- test/Driver/arm-compiler-rt.c
+++ test/Driver/arm-compiler-rt.c
@@ -19,3 +19,9 @@
// RUN: %clang -target arm-linux-androideabi -rtlib=compiler-rt -mfloat-abi=hard -### %s 2>&1 | FileCheck %s -check-prefix ARM-ANDROIDHF
// ARM-ANDROIDHF: "{{.*[/\\]}}libclang_rt.builtins-armhf-android.a"
+// RUN: %clang -target arm-linux-androideabi -rtlib=compiler-rt --print-libgcc-file-name 2>&1 | FileCheck %s -check-prefix ARM-PRINT-LIBGCC-ANDROID
+// ARM-PRINT-LIBGCC-ANDROID: {{.*[/\\]}}libclang_rt.builtins-arm-android.a
+
+// RUN: %clang -target arm-linux-androideabi -rtlib=compiler-rt -mfloat-abi=hard --print-libgcc-file-name 2>&1 | FileCheck %s -check-prefix ARM-PRINT-LIBGCC-ANDROIDHF
+// ARM-PRINT-LIBGCC-ANDROIDHF: {{.*[/\\]}}libclang_rt.builtins-armhf-android.a
+
Index: lib/Driver/Driver.cpp
===================================================================
--- lib/Driver/Driver.cpp
+++ lib/Driver/Driver.cpp
@@ -1306,9 +1306,12 @@
if (C.getArgs().hasArg(options::OPT_print_libgcc_file_name)) {
ToolChain::RuntimeLibType RLT = TC.GetRuntimeLibType(C.getArgs());
switch (RLT) {
- case ToolChain::RLT_CompilerRT:
+ case ToolChain::RLT_CompilerRT: {
+ const llvm::Triple Triple(TC.ComputeEffectiveClangTriple(C.getArgs()));
+ RegisterEffectiveTriple TripleRAII(TC, Triple);
llvm::outs() << TC.getCompilerRT(C.getArgs(), "builtins") << "\n";
break;
+ }
case ToolChain::RLT_Libgcc:
llvm::outs() << GetFilePath("libgcc.a", TC) << "\n";
break;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35742.107732.patch
Type: text/x-patch
Size: 1619 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170721/ae8377d1/attachment.bin>
More information about the llvm-commits
mailing list