[PATCH] D10137: On {mips, mipsel, mips64, mips64el}-freebsd, we need to pass any -G option to the assembler.
Dimitry Andric via cfe-commits
cfe-commits at lists.llvm.org
Sun Dec 27 02:28:12 PST 2015
dim updated this revision to Diff 43655.
dim added a comment.
Add a test for passing -G0 to the assembler.
http://reviews.llvm.org/D10137
Files:
lib/Driver/Tools.cpp
test/Driver/freebsd-mips-as.c
Index: test/Driver/freebsd-mips-as.c
===================================================================
--- test/Driver/freebsd-mips-as.c
+++ test/Driver/freebsd-mips-as.c
@@ -89,3 +89,9 @@
// RUN: -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS-ALIAS-64R2 %s
// MIPS-ALIAS-64R2: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-EB"
+//
+// RUN: %clang -target mips-unknown-freebsd -### \
+// RUN: -no-integrated-as -G0 -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=MIPS32-EB-AS-G0 %s
+// MIPS32-EB-AS-G0: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-EB" "-G0"
+// MIPS32-EB-AS-G0-NOT: "-KPIC"
Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -7776,6 +7776,12 @@
else
CmdArgs.push_back("-EL");
+ if (Arg *A = Args.getLastArg(options::OPT_G)) {
+ StringRef v = A->getValue();
+ CmdArgs.push_back(Args.MakeArgString("-G" + v));
+ A->claim();
+ }
+
AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
break;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10137.43655.patch
Type: text/x-patch
Size: 1094 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151227/517413d8/attachment.bin>
More information about the cfe-commits
mailing list