[PATCH] D103184: [AArch64] handle -Wa,-march=

Jian Cai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 1 14:11:35 PDT 2021


jcai19 added a comment.

Thanks for the comments. Please see my replies inlined.

In D103184#2790486 <https://reviews.llvm.org/D103184#2790486>, @DavidSpickett wrote:

> Thanks for taking this up! I never got the time for it.
>
> I'd like to see the test check that there are no unused argument warnings when there are multiple values. I missed that with another patch in this area.
>
> Beyond that I'm not sure the logic is right here. You've got `-Wa,-march` being additive, in contrast to the compiler option which only uses the last value:
>
>   $ ./bin/clang --target=aarch64-arm-none-eabi -march=armv8.1-a -march=armv8.2-a /tmp/test.c -###
>   <...> "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.2a" <...>
>
> Maybe you're working to make some specific build system work but from the clang side we'd want consistent behaviour for Arm and AArch64 options.

I understand it's a little bit confusing here, but I was simply trying to match GCC's behavior (please see the example in my last comment) unless I misunderstood its output. I definitely agree having consistent behaviors between Arm and Aarch64 in Clang is more reasonable (in fact that was what I implemented at first) and maybe we should fork from gcc, WDYT?

> Let me restate the Arm behaviour, minus the `mcpu` stuff that was also in that patch:
>
> - Only compiler options apply to non assembly files
> - Compiler and assembler options apply to assembly files
> - For assembly files, if you have both kinds of option, you prefer the assembler option(s)
> - Of the options that apply (or are preferred), the last value wins (it's not additive)
>
> Do you disagree with that set of rules?
>
> I wouldn't think that AArch64 would have that different needs, but then again I'm not trying to build existing projects, just make the clang side logical.

Thanks for the clarification. I will add more checks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103184/new/

https://reviews.llvm.org/D103184



More information about the cfe-commits mailing list