Skip to content

[meta] better c/c++ toolchain compatibility #7917

@motiejus

Description

@motiejus

Do we want to extend clang cc to other "standard" C/C++ toolchain commands like as, ar, ld, cpp?

Why?

Currently, if one wants to have an LLVM cross-compilation, the tools to have it are quite large. E.g. llvm toolchain weights ~360MB. Zig could almost replace it, with an order of magnitude smaller download.

Full LLVM toolchains are useful when working primarily with C/C++ code, but more "lightweight" programs (e.g. #7915 -- compiling xz with autotools) or other language repos, where relatively small amount of interop-C is required (my use case), would benefit a lot from extended zig cc.

Proposal

For full C/C++ toolchain compatibility, one still needs commands which llvm exports -- e.g. ld, cpp, dwp, gcov, nm, objcopy, objdump, ar.

  1. Is it a good idea to expose front-ends for these auxiliary commands in the long run?
  2. If yes, how much do we really need to expose? Everything Bazel expects would be ideal for me, but would it be for zig?

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedThis proposal is planned.proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.zig ccZig as a drop-in C compiler feature

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions