You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea here is that zig would pay attention to its argv[0] when invoked, and handle certain names specially. For example, if the basename of argv[0] is cc then this would invoke zig cc without an extra cc parameter, and zig could be the system C compiler.
also supporting being symlinked to a compiler name that has a target in it. For example, /usr/bin/riscv64-linux-musl-cc would work, and it would set the target. This is because some systems expect this to be how to invoke a cross compiler, rather than passing a -target parameter.
The text was updated successfully, but these errors were encountered:
andrewrk
added
proposal
This issue suggests modifications. If it also has the "accepted" label then it is planned.
zig cc
Zig as a drop-in C compiler feature
labels
Mar 22, 2020
also supporting being symlinked to a compiler name that has a target in it. For example, /usr/bin/riscv64-linux-musl-cc would work, and it would set the target. This is because some systems expect this to be how to invoke a cross compiler, rather than passing a -target parameter.
clang has never been used this way. This is only because gcc cross-compilation is not as flexible as clang's and you have to recompile it for the target.
The idea here is that zig would pay attention to its argv[0] when invoked, and handle certain names specially. For example, if the basename of argv[0] is
cc
then this would invokezig cc
without an extracc
parameter, and zig could be the system C compiler.Thanks to Lietu for the idea.
Some other things to consider:
zig c++
(see support compiling and linking c++ code #4786)/usr/bin/riscv64-linux-musl-cc
would work, and it would set the target. This is because some systems expect this to be how to invoke a cross compiler, rather than passing a-target
parameter.The text was updated successfully, but these errors were encountered: