r188906 - Centralize the handling of -target-feature.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Mon Oct 28 21:03:42 PDT 2013


On 28 October 2013 23:28, Lang Hames <lhames at gmail.com> wrote:
> Hi Rafael,
>
> I noticed that as a consequence of this patch, clang is issuing the
> following warning when assembling for arm:
>
> "'+soft-float-abi' is not a recognized feature for this target (ignoring
> feature)"
>
> You can reproduce this (at least on Darwin, and I expect on Linux too) by
> creating an empty foo.s file and running:
>
> clang -arch armv7 -c foo.s
>
> It looks like the cause of the warning is that both Clang::ConstructJob and
> ClangAs::ConstructJob are both calling getARMTargetFeatures (indirectly via
> getTargetFeatures), and getARMTargetFeatures always adds the abi-appropriate
> flag, even when the driver was being invoked as an assembler.
>
> I'm not very familiar with the driver code, so I didn't want to jump in and
> undo any of the useful parts of your refactor to fix this.
>
> Do you have any thoughts on the right way to omit this flag when assembling?

Good question. These are odd "feature, but not really". It looks like
the driver passes them as features because that is all that TargetInfo
in "clang -cc1" will see. Some options would be

* Don't pass this information as features. Call them TargetOptions or
something like that and add a  virtual bool handleTargetOption.
* Make them real features (attached patch).
* Pass a flag to getARMTargetFeatures so that it knows the target
features are being collected for the assembler.

Daniel, you added this back in r91755 along with the "this is a hack"
FIXME. What was the direction you wanted this to take?

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: text/x-patch
Size: 1151 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131029/8784705f/attachment.bin>


More information about the cfe-commits mailing list