- On N64 ABI, -mno-abicalls is needed to disable PIC. Warning is reported when only -fno-pic/-fno-PIC is used. This is how GCC behaves.
- An error is reported when -fno-pic or -fno-PIC is used in combination with -mabicalls.
Depends on D44381.
Paths
| Differential D44684
[mips] Improve handling of -fno-[pic/PIC] option ClosedPublic Authored by abeserminji on Mar 20 2018, 8:44 AM.
Details
Summary
Depends on D44381.
Diff Detail Event TimelineComment Actions A quick comment on the error message, inlined. It's about the quality of the diagnostics.
This revision now requires changes to proceed.Apr 19 2018, 3:39 AM
abeserminji marked 2 inline comments as done. Comment ActionsComments resolved.
Comment Actions LGTM, with a touch up of the error message to match the others we have regarding -mabicalls. Some other minor nits inlined.
This revision is now accepted and ready to land.Apr 30 2018, 3:45 AM Closed by commit rL331636: [mips] Improve handling of -fno-[pic/PIC] option (authored by abeserminji). · Explain WhyMay 7 2018, 7:23 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 144344 include/clang/Basic/DiagnosticDriverKinds.td
lib/Driver/ToolChains/Arch/Mips.cpp
lib/Driver/ToolChains/CommonArgs.cpp
test/Driver/mips-abicalls-error.c
test/Driver/mips-abicalls-warning.ctest/Driver/mips-as.c
test/Driver/mips-features.c
|
Can you fine tune this error message to say:
"ignoring '-fno-pic' option as it cannot be used with explicit use of -mabicalls and the N64 ABI" when -mabicalls is used on the commandline and:
"ignoring '-fno-pic' option as it cannot be used with implicit use of -mabicalls and the N64 ABI" when -mno-abicalls and -mabicalls are not present.
You should also report the precise pic/PIC/pie/PIE option used in the error message. You should be able to get it from the argument directly: http://llvm.org/doxygen/classllvm_1_1opt_1_1Arg.html