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.