aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-01-08 16:13:14 -0800
committerGitHub <noreply@github.com>2024-01-08 16:13:14 -0800
commit4cf08932b51ab433933f5b3059d0cab90acc9696 (patch)
tree0b5898e42b26de178bf7d42b8bff0d89ac82bcb4 /src/Compilation.zig
parent9c8c9b7cc82d73293c5051f8b020e984eefb9e5a (diff)
parente92cc155fd6098200e9e2f3dd478dc13ff02ebf2 (diff)
downloadzig-4cf08932b51ab433933f5b3059d0cab90acc9696.tar.gz
zig-4cf08932b51ab433933f5b3059d0cab90acc9696.zip
Merge pull request #16109
Update mingw-w64 to latest git commit
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index 602cd645a0..4ca0a4cd72 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -1821,7 +1821,6 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil
const static_lib_jobs = [_]Job{
.{ .mingw_crt_file = .mingw32_lib },
- .{ .mingw_crt_file = .msvcrt_os_lib },
.{ .mingw_crt_file = .mingwex_lib },
.{ .mingw_crt_file = .uuid_lib },
};
@@ -5087,12 +5086,17 @@ pub fn addCCArgs(
try argv.append(libunwind_include_path);
}
- if (comp.config.link_libc and target.isGnuLibC()) {
- const target_version = target.os.version_range.linux.glibc;
- const glibc_minor_define = try std.fmt.allocPrint(arena, "-D__GLIBC_MINOR__={d}", .{
- target_version.minor,
- });
- try argv.append(glibc_minor_define);
+ if (comp.config.link_libc) {
+ if (target.isGnuLibC()) {
+ const target_version = target.os.version_range.linux.glibc;
+ const glibc_minor_define = try std.fmt.allocPrint(arena, "-D__GLIBC_MINOR__={d}", .{
+ target_version.minor,
+ });
+ try argv.append(glibc_minor_define);
+ } else if (target.isMinGW()) {
+ try argv.append("-D__MSVCRT_VERSION__=0xE00"); // use ucrt
+
+ }
}
const llvm_triple = try @import("codegen/llvm.zig").targetTriple(arena, target);
@@ -5101,7 +5105,9 @@ pub fn addCCArgs(
if (target.os.tag == .windows) switch (ext) {
.c, .cpp, .m, .mm, .h, .cu, .rc, .assembly, .assembly_with_cpp => {
const minver: u16 = @truncate(@intFromEnum(target.os.getVersionRange().windows.min) >> 16);
- try argv.append(try std.fmt.allocPrint(argv.allocator, "-D_WIN32_WINNT=0x{x:0>4}", .{minver}));
+ try argv.append(
+ try std.fmt.allocPrint(arena, "-D_WIN32_WINNT=0x{x:0>4}", .{minver}),
+ );
},
else => {},
};