Skip to content

Clang: Support for -Xassembler -target-feature (or similar) #97517

Closed
@alexrp

Description

@alexrp

Zig needs the ability to pass target features along to the integrated assembler - see ziglang/zig#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() to accept -target-feature and pass it along. (Or even pass anything along, as -Xclang does.)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl'

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions