Issue 97517
Summary Clang: Support for `-Xassembler -target-feature`
Labels clang
Assignees
Reporter alexrp
    Zig needs the ability to pass target features along to the integrated assembler - see https://github.com/ziglang/zig/issues/10411.

For C files, Zig uses `-Xclang -target-feature`. For assembly, the only option at the moment is to switch to `clang -cc1as` but that would require massive surgery in Zig's driver code since it has a shared code path (with tons of logic) for both at the moment.

There is a very simple change that would solve this headache: Update Clang's [`CollectArgsForIntegratedAssembler()`](https://github.com/llvm/llvm-project/blob/6a992bc89f5ca25d132abd044d78ecf27ae6e162/clang/lib/Driver/ToolChains/Clang.cpp#L2464) to accept `-target-feature` and pass it along. (Or even pass *anything* along, as `-Xclang` [does](https://github.com/llvm/llvm-project/blob/6a992bc89f5ca25d132abd044d78ecf27ae6e162/clang/lib/Driver/ToolChains/Clang.cpp#L7553).)

Alternatively, if `-Xassembler` has to be kept GNU-compatible only, we could imagine adding a new `-Xclangas` that just passes the arguments through like `-Xclang`.

Would either of these options be acceptable? If so, I could probably do a PR.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to