Skip to content

Query rustc for clang target triples #994

Closed
@djkoloski

Description

@djkoloski

Right now, we pick the target triples to pass clang by defaulting to the first segment of the target triple and then manually fixing them up with a large set of branches. Is there a way we could query the target spec from rustc to get the LLVM target names? For example, by running:

$ rustc +nightly -Zunstable-options --print all-target-specs-json

We can obtain a JSON dump of all of the target configurations. Each target configuration contains an "llvm-target" field which we should be passing to clang. That's not stable right now, but maybe there's some other way to work with that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions