[PATCH] Forward -target-feature option through to assembler.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri Nov 7 10:04:54 PST 2014


We normally use -Wa,FOO to be compatible with gnu as. Is there a gnu
as option that you could use?

On 7 November 2014 12:41, Charlie Turner <charlie.turner at arm.com> wrote:
> The `cc1as` driver supports the `-target-feature` option, but the Clang driver refuses to forward such an option specified with `-Xassembler` or `-Wa` through to `cc1as`, claiming it is unrecognized.  This patch makes Clang forward the `target-feature` option and its argument through to the assembler.
>
> The `-target-feature` option is useful for enabling/disabling optional features when using Clang as an assembler. For example (assuming `test.s` contains appropriate content),
>
> ```
> $ clang -c -target arm-none-eabi -mcpu=cortex-a9 -Xassembler -target-feature -Xassembler -mp test.s
> # Or
> $ clang -c -target arm-none-eabi -mcpu=cortex-a9 -Wa,-target-feature,-mp test.s
> ```
>
> Would signal an error if the assembly file `test.s` contained any multiprocessing extension instructions, such as `PLDW`,
>
> ```
> $ clang -c -target arm-none-eabi -mcpu=cortex-a9 -Xassembler -target-feature -Xassembler -mp test.s
> test.s:31:2: error: instruction requires: mp-extensions
>         pldw    [r0]
> ```
>
> However, currently the behavior is,
>
> ```
> $ clang -c -target arm-none-eabi -mcpu=cortex-a9 -Xassembler -target-feature -Xassembler -mp test.s
> clang-3.6: error: unsupported argument '-target-feature' to option 'Xassembler'
> clang-3.6: error: unsupported argument '-mp' to option 'Xassembler
> ```
>
> Which I consider incorrect.
>
> http://reviews.llvm.org/D6170
>
> Files:
>   lib/Driver/Tools.cpp
>   test/Driver/integrated-as.s
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>




More information about the cfe-commits mailing list