-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make "gnu" (mingw-w64) the default C ABI on Windows #6565
Comments
btw, will it support specify exact output filename(including extension but not whole path) in install step? |
Good question. Related: #6325 |
Zig's 0.8 Release Notes says:
As far as I know, you can't use / it might cause issues to use Static Libraries generated with |
Can you cite your source? |
Maybe you can look at https://github.com/jmeubank/tdm-distrib/blob/master/tdm64/core/README-gcc-tdm64.md |
Currently if you download Zig on Windows, and then try to build some C code, without MSVC installed, you get an error saying that Zig cannot find or provide a libc. This is a shame because we actually can provide a libc! The magic sauce is
-target native-native-gnu
which uses mingw-w64 to provide libc.This proposal is to make -gnu the default on windows rather than -msvc. This C ABI is binary-compatible with MSVC-compiled code, however the header files are not source-compatible with MSVC libc header files. When zig is responsible for compiling all of the C, C++, and Zig code for a given project, then there is 0 downsides to using mingw-w64 as the C ABI. The upsides are huge: no dependency on MSVC being installed. Zig acts as a C and C++ compiler that works out of the box, without MSVC installed.
I discussed this with @mlarouche on IRC and he indicated that it may sometimes be useful to specify
-target native-native-msvc
but that it does make sense to make the default mingw-w64.Some more tid bits:
Related: #6363
The text was updated successfully, but these errors were encountered: