Skip to content

Factor librustc_target from rustc into a standalone library #1053

Open
@sunfishcode

Description

librustc_target is a library in rustc for implementing a lot of native ABI and toolchain logic. It has some overlap with target-lexicon, however it provides much more extensive features, especially including knowledge of calling conventions. It's written in a way which is mostly independent from the rest of rustc, so it's an interesting candidate for factoring out into a standalone library that Cranelift users and others could use to more easily integrate with native C ABI/toolchain environments.

This aligns fairly well with cranelift-codegen's rough design for calling conventions, in which it only does the lowest-level parts, and assumes that cranelift-frontend or other libraries will be the place for offering higher-level functionality such as handling struct types.

See this comment for some more details on librustc_target.

This library isn't Cranelift-specific, as other projects could make use of such a library too. That said, it is particularly interesting for use with Cranelift, so I'm posting an issue here so we can track it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    craneliftIssues related to the Cranelift code generatorcranelift:E-compiler-designOpen-ended compiler design issues.cranelift:goal:native-ABIFocus area: Interoperate with native platform ABIs and calling conventions.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions