aboutsummaryrefslogtreecommitdiff
path: root/src/libs/mingw.zig
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2025-06-12 02:51:36 +0200
committerGitHub <noreply@github.com>2025-06-12 02:51:36 +0200
commit4a02e080d127cc577d40f8ea5d68122ba8ac4243 (patch)
treeec78ff4709cf83e749f6240445302d804a92bbaa /src/libs/mingw.zig
parentf4c7290bc51c48293690a879a428b24e520b0f68 (diff)
parent78d6f1c56aa3bca72c3f336b89626982631da2e7 (diff)
downloadzig-4a02e080d127cc577d40f8ea5d68122ba8ac4243.tar.gz
zig-4a02e080d127cc577d40f8ea5d68122ba8ac4243.zip
Merge pull request #23912 from alexrp/mingw-update
`mingw`: Update MinGW-w64 to 38c8142f660b6ba11e7c408f2de1e9f8bfaf839e.
Diffstat (limited to 'src/libs/mingw.zig')
-rw-r--r--src/libs/mingw.zig49
1 files changed, 29 insertions, 20 deletions
diff --git a/src/libs/mingw.zig b/src/libs/mingw.zig
index 8b5197a43b..9454a9af25 100644
--- a/src/libs/mingw.zig
+++ b/src/libs/mingw.zig
@@ -154,7 +154,8 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
try addCcArgs(comp, arena, &winpthreads_args);
try winpthreads_args.appendSlice(&[_][]const u8{
"-DIN_WINPTHREAD",
- "-DWIN32_LEAN_AND_MEAN",
+ // winpthreads incorrectly assumes that Clang has `-Wprio-ctor-dtor`.
+ "-Wno-unknown-warning-option",
});
switch (comp.compilerRtOptMode()) {
@@ -294,18 +295,12 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void {
"o", &digest, final_def_basename,
});
- const target_defines = switch (target.cpu.arch) {
- .thumb => "#define DEF_ARM32\n",
- .aarch64 => "#define DEF_ARM64\n",
- .x86 => "#define DEF_I386\n",
- .x86_64 => "#define DEF_X64\n",
- else => unreachable,
- };
-
const aro = @import("aro");
var aro_comp = aro.Compilation.init(gpa, std.fs.cwd());
defer aro_comp.deinit();
+ aro_comp.target = target;
+
const include_dir = try comp.dirs.zig_lib.join(arena, &.{ "libc", "mingw", "def-include" });
if (comp.verbose_cc) print: {
@@ -320,7 +315,6 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void {
try aro_comp.include_dirs.append(gpa, include_dir);
const builtin_macros = try aro_comp.generateBuiltinMacros(.include_system_defines);
- const user_macros = try aro_comp.addSourceFromBuffer("<command line>", target_defines);
const def_file_source = try aro_comp.addSourceFromPath(def_file_path);
var pp = aro.Preprocessor.init(&aro_comp);
@@ -328,7 +322,7 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void {
pp.linemarkers = .none;
pp.preserve_whitespace = true;
- try pp.preprocessSources(&.{ def_file_source, builtin_macros, user_macros });
+ try pp.preprocessSources(&.{ def_file_source, builtin_macros });
for (aro_comp.diagnostics.list.items) |diagnostic| {
if (diagnostic.kind == .@"fatal error" or diagnostic.kind == .@"error") {
@@ -485,7 +479,6 @@ const mingw32_generic_src = [_][]const u8{
"crt" ++ path.sep_str ++ "pesect.c",
"crt" ++ path.sep_str ++ "udllargc.c",
"crt" ++ path.sep_str ++ "xthdloc.c",
- "crt" ++ path.sep_str ++ "CRT_fp10.c",
"crt" ++ path.sep_str ++ "mingw_helpers.c",
"crt" ++ path.sep_str ++ "pseudo-reloc.c",
"crt" ++ path.sep_str ++ "udll_argv.c",
@@ -609,7 +602,6 @@ const mingw32_generic_src = [_][]const u8{
"misc" ++ path.sep_str ++ "delayimp.c",
"misc" ++ path.sep_str ++ "dirent.c",
"misc" ++ path.sep_str ++ "dirname.c",
- "misc" ++ path.sep_str ++ "dllentrypoint.c",
"misc" ++ path.sep_str ++ "dllmain.c",
"misc" ++ path.sep_str ++ "feclearexcept.c",
"misc" ++ path.sep_str ++ "fegetenv.c",
@@ -621,10 +613,14 @@ const mingw32_generic_src = [_][]const u8{
"misc" ++ path.sep_str ++ "fesetexceptflag.c",
"misc" ++ path.sep_str ++ "fesetround.c",
"misc" ++ path.sep_str ++ "fetestexcept.c",
+ "misc" ++ path.sep_str ++ "mingw_controlfp.c",
+ "misc" ++ path.sep_str ++ "mingw_setfp.c",
"misc" ++ path.sep_str ++ "feupdateenv.c",
"misc" ++ path.sep_str ++ "ftruncate.c",
- "misc" ++ path.sep_str ++ "ftw.c",
+ "misc" ++ path.sep_str ++ "ftw32.c",
+ "misc" ++ path.sep_str ++ "ftw32i64.c",
"misc" ++ path.sep_str ++ "ftw64.c",
+ "misc" ++ path.sep_str ++ "ftw64i32.c",
"misc" ++ path.sep_str ++ "fwide.c",
"misc" ++ path.sep_str ++ "getlogin.c",
"misc" ++ path.sep_str ++ "getopt.c",
@@ -669,12 +665,12 @@ const mingw32_generic_src = [_][]const u8{
"stdio" ++ path.sep_str ++ "_findfirst64i32.c",
"stdio" ++ path.sep_str ++ "_findnext64i32.c",
"stdio" ++ path.sep_str ++ "_fstat64i32.c",
- "stdio" ++ path.sep_str ++ "_stat.c",
"stdio" ++ path.sep_str ++ "_stat64i32.c",
"stdio" ++ path.sep_str ++ "_wfindfirst64i32.c",
"stdio" ++ path.sep_str ++ "_wfindnext64i32.c",
- "stdio" ++ path.sep_str ++ "_wstat.c",
"stdio" ++ path.sep_str ++ "_wstat64i32.c",
+ "stdio" ++ path.sep_str ++ "__mingw_fix_stat_path.c",
+ "stdio" ++ path.sep_str ++ "__mingw_fix_wstat_path.c",
"stdio" ++ path.sep_str ++ "asprintf.c",
"stdio" ++ path.sep_str ++ "fopen64.c",
"stdio" ++ path.sep_str ++ "fseeko32.c",
@@ -749,23 +745,36 @@ const mingw32_generic_src = [_][]const u8{
"stdio" ++ path.sep_str ++ "ucrt__vscprintf.c",
"stdio" ++ path.sep_str ++ "ucrt__vsnprintf.c",
"stdio" ++ path.sep_str ++ "ucrt__vsnwprintf.c",
+ "stdio" ++ path.sep_str ++ "ucrt___local_stdio_printf_options.c",
+ "stdio" ++ path.sep_str ++ "ucrt___local_stdio_scanf_options.c",
"stdio" ++ path.sep_str ++ "ucrt_fprintf.c",
"stdio" ++ path.sep_str ++ "ucrt_fscanf.c",
"stdio" ++ path.sep_str ++ "ucrt_fwprintf.c",
- "stdio" ++ path.sep_str ++ "ucrt_ms_fprintf.c",
+ "stdio" ++ path.sep_str ++ "ucrt_fwscanf.c",
"stdio" ++ path.sep_str ++ "ucrt_ms_fwprintf.c",
"stdio" ++ path.sep_str ++ "ucrt_printf.c",
"stdio" ++ path.sep_str ++ "ucrt_scanf.c",
"stdio" ++ path.sep_str ++ "ucrt_snprintf.c",
+ "stdio" ++ path.sep_str ++ "ucrt_snwprintf.c",
"stdio" ++ path.sep_str ++ "ucrt_sprintf.c",
"stdio" ++ path.sep_str ++ "ucrt_sscanf.c",
+ "stdio" ++ path.sep_str ++ "ucrt_swscanf.c",
+ "stdio" ++ path.sep_str ++ "ucrt_swprintf.c",
"stdio" ++ path.sep_str ++ "ucrt_vfprintf.c",
"stdio" ++ path.sep_str ++ "ucrt_vfscanf.c",
+ "stdio" ++ path.sep_str ++ "ucrt_vfwscanf.c",
+ "stdio" ++ path.sep_str ++ "ucrt_vfwprintf.c",
"stdio" ++ path.sep_str ++ "ucrt_vprintf.c",
"stdio" ++ path.sep_str ++ "ucrt_vscanf.c",
"stdio" ++ path.sep_str ++ "ucrt_vsnprintf.c",
+ "stdio" ++ path.sep_str ++ "ucrt_vsnwprintf.c",
"stdio" ++ path.sep_str ++ "ucrt_vsprintf.c",
+ "stdio" ++ path.sep_str ++ "ucrt_vswprintf.c",
"stdio" ++ path.sep_str ++ "ucrt_vsscanf.c",
+ "stdio" ++ path.sep_str ++ "ucrt_vwscanf.c",
+ "stdio" ++ path.sep_str ++ "ucrt_wscanf.c",
+ "stdio" ++ path.sep_str ++ "ucrt_vwprintf.c",
+ "stdio" ++ path.sep_str ++ "ucrt_wprintf.c",
"string" ++ path.sep_str ++ "ucrt__wcstok.c",
// uuid
"libsrc" ++ path.sep_str ++ "ativscp-uuid.c",
@@ -889,6 +898,8 @@ const mingw32_generic_src = [_][]const u8{
};
const mingw32_x86_src = [_][]const u8{
+ // mingw32
+ "crt" ++ path.sep_str ++ "CRT_fp10.c",
// mingwex
"math" ++ path.sep_str ++ "cbrtl.c",
"math" ++ path.sep_str ++ "erfl.c",
@@ -971,11 +982,11 @@ const mingw32_x86_32_src = [_][]const u8{
const mingw32_arm_src = [_][]const u8{
// mingwex
"math" ++ path.sep_str ++ "arm-common" ++ path.sep_str ++ "ldexpl.c",
+ "math" ++ path.sep_str ++ "arm-common" ++ path.sep_str ++ "sincosl.c",
};
const mingw32_arm32_src = [_][]const u8{
// mingwex
- "math" ++ path.sep_str ++ "arm" ++ path.sep_str ++ "_chgsignl.S",
"math" ++ path.sep_str ++ "arm" ++ path.sep_str ++ "s_rint.c",
"math" ++ path.sep_str ++ "arm" ++ path.sep_str ++ "s_rintf.c",
"math" ++ path.sep_str ++ "arm" ++ path.sep_str ++ "sincos.S",
@@ -983,7 +994,6 @@ const mingw32_arm32_src = [_][]const u8{
const mingw32_arm64_src = [_][]const u8{
// mingwex
- "math" ++ path.sep_str ++ "arm64" ++ path.sep_str ++ "_chgsignl.S",
"math" ++ path.sep_str ++ "arm64" ++ path.sep_str ++ "rint.c",
"math" ++ path.sep_str ++ "arm64" ++ path.sep_str ++ "rintf.c",
"math" ++ path.sep_str ++ "arm64" ++ path.sep_str ++ "sincos.S",
@@ -997,7 +1007,6 @@ const mingw32_winpthreads_src = [_][]const u8{
"winpthreads" ++ path.sep_str ++ "misc.c",
"winpthreads" ++ path.sep_str ++ "mutex.c",
"winpthreads" ++ path.sep_str ++ "nanosleep.c",
- "winpthreads" ++ path.sep_str ++ "ref.c",
"winpthreads" ++ path.sep_str ++ "rwlock.c",
"winpthreads" ++ path.sep_str ++ "sched.c",
"winpthreads" ++ path.sep_str ++ "sem.c",