r256468 - 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:36:44 PST 2015
Author: dim
Date: Sun Dec 27 04:36:44 2015
New Revision: 256468
URL: http://llvm.org/viewvc/llvm-project?rev=256468&view=rev
Log:
On {mips,mipsel,mips64,mips64el}-freebsd, we need to pass any -G option to the assembler.
Summary:
See also:
https://sourceware.org/binutils/docs/as/MIPS-Options.html#index-g_t_0040code_007b_002dG_007d-option-_0028MIPS_0029-1392
Reviewers: theraven, atanasyan, brooks, emaste
Subscribers: rnk, emaste, cfe-commits, seanbruno, dim
Differential Revision: http://reviews.llvm.org/D10137
Modified:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/freebsd-mips-as.c
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=256468&r1=256467&r2=256468&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Sun Dec 27 04:36:44 2015
@@ -7776,6 +7776,12 @@ void freebsd::Assembler::ConstructJob(Co
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;
}
Modified: cfe/trunk/test/Driver/freebsd-mips-as.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/freebsd-mips-as.c?rev=256468&r1=256467&r2=256468&view=diff
==============================================================================
--- cfe/trunk/test/Driver/freebsd-mips-as.c (original)
+++ cfe/trunk/test/Driver/freebsd-mips-as.c Sun Dec 27 04:36:44 2015
@@ -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"
More information about the cfe-commits
mailing list