Commit 2c192f8882

Alex Rønne Petersen <alex@alexrp.com>
2024-11-30 13:17:24
mingw: Update sources list to dcd7fefc703fb4b12187235386900d34cc13fdc5.
1 parent 45fff0a
Changed files (1)
src/mingw.zig
@@ -81,7 +81,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
                     .owner = undefined,
                 });
             }
-            if (target.cpu.arch == .x86 or target.cpu.arch == .x86_64) {
+            if (target.cpu.arch.isX86()) {
                 for (mingw32_x86_src) |dep| {
                     try c_source_files.append(.{
                         .src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{
@@ -103,6 +103,15 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
                     }
                 }
             } else if (target.cpu.arch.isThumb()) {
+                for (mingw32_arm_src) |dep| {
+                    try c_source_files.append(.{
+                        .src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{
+                            "libc", "mingw", dep,
+                        }),
+                        .extra_flags = args.items,
+                        .owner = undefined,
+                    });
+                }
                 for (mingw32_arm32_src) |dep| {
                     try c_source_files.append(.{
                         .src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{
@@ -113,6 +122,15 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
                     });
                 }
             } else if (target.cpu.arch.isAARCH64()) {
+                for (mingw32_arm_src) |dep| {
+                    try c_source_files.append(.{
+                        .src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{
+                            "libc", "mingw", dep,
+                        }),
+                        .extra_flags = args.items,
+                        .owner = undefined,
+                    });
+                }
                 for (mingw32_arm64_src) |dep| {
                     try c_source_files.append(.{
                         .src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{
@@ -488,8 +506,6 @@ const mingw32_generic_src = [_][]const u8{
     "complex" ++ path.sep_str ++ "ctan.c",
     "complex" ++ path.sep_str ++ "ctanf.c",
     "complex" ++ path.sep_str ++ "ctanl.c",
-    "crt" ++ path.sep_str ++ "dllentry.c",
-    "crt" ++ path.sep_str ++ "dllmain.c",
     "gdtoa" ++ path.sep_str ++ "arithchk.c",
     "gdtoa" ++ path.sep_str ++ "dmisc.c",
     "gdtoa" ++ path.sep_str ++ "dtoa.c",
@@ -531,8 +547,6 @@ const mingw32_generic_src = [_][]const u8{
     "math" ++ path.sep_str ++ "lgammaf.c",
     "math" ++ path.sep_str ++ "lgammal.c",
     "math" ++ path.sep_str ++ "modfl.c",
-    "math" ++ path.sep_str ++ "nextafterl.c",
-    "math" ++ path.sep_str ++ "nexttoward.c",
     "math" ++ path.sep_str ++ "powi.c",
     "math" ++ path.sep_str ++ "powif.c",
     "math" ++ path.sep_str ++ "powil.c",
@@ -550,6 +564,8 @@ 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",
     "misc" ++ path.sep_str ++ "fegetexceptflag.c",
@@ -611,9 +627,7 @@ const mingw32_generic_src = [_][]const u8{
     "stdio" ++ path.sep_str ++ "_Exit.c",
     "stdio" ++ path.sep_str ++ "_findfirst64i32.c",
     "stdio" ++ path.sep_str ++ "_findnext64i32.c",
-    "stdio" ++ path.sep_str ++ "_fstat.c",
     "stdio" ++ path.sep_str ++ "_fstat64i32.c",
-    "stdio" ++ path.sep_str ++ "_ftime.c",
     "stdio" ++ path.sep_str ++ "_stat.c",
     "stdio" ++ path.sep_str ++ "_stat64i32.c",
     "stdio" ++ path.sep_str ++ "_wfindfirst64i32.c",
@@ -621,11 +635,9 @@ const mingw32_generic_src = [_][]const u8{
     "stdio" ++ path.sep_str ++ "_wstat.c",
     "stdio" ++ path.sep_str ++ "_wstat64i32.c",
     "stdio" ++ path.sep_str ++ "asprintf.c",
-    "stdio" ++ path.sep_str ++ "fgetpos64.c",
     "stdio" ++ path.sep_str ++ "fopen64.c",
     "stdio" ++ path.sep_str ++ "fseeko32.c",
     "stdio" ++ path.sep_str ++ "fseeko64.c",
-    "stdio" ++ path.sep_str ++ "fsetpos64.c",
     "stdio" ++ path.sep_str ++ "ftello.c",
     "stdio" ++ path.sep_str ++ "ftello64.c",
     "stdio" ++ path.sep_str ++ "ftruncate64.c",
@@ -685,11 +697,24 @@ const mingw32_generic_src = [_][]const u8{
     "stdio" ++ path.sep_str ++ "vwscanf.c",
     "stdio" ++ path.sep_str ++ "vwscanf2.S",
     "stdio" ++ path.sep_str ++ "wtoll.c",
+    // mingwthrd
+    "libsrc" ++ path.sep_str ++ "mingwthrd_mt.c",
     // ucrtbase
-    "crt" ++ path.sep_str ++ "ucrtbase_compat.c",
     "math" ++ path.sep_str ++ "_huge.c",
     "misc" ++ path.sep_str ++ "__initenv.c",
+    "misc" ++ path.sep_str ++ "__winitenv.c",
+    "misc" ++ path.sep_str ++ "__p___initenv.c",
+    "misc" ++ path.sep_str ++ "__p___winitenv.c",
+    "misc" ++ path.sep_str ++ "_onexit.c",
     "misc" ++ path.sep_str ++ "ucrt-access.c",
+    "misc" ++ path.sep_str ++ "ucrt__getmainargs.c",
+    "misc" ++ path.sep_str ++ "ucrt__wgetmainargs.c",
+    "misc" ++ path.sep_str ++ "ucrt_amsg_exit.c",
+    "misc" ++ path.sep_str ++ "ucrt_at_quick_exit.c",
+    "misc" ++ path.sep_str ++ "ucrt_tzset.c",
+    "stdio" ++ path.sep_str ++ "ucrt__scprintf.c",
+    "stdio" ++ path.sep_str ++ "ucrt__snprintf.c",
+    "stdio" ++ path.sep_str ++ "ucrt__snscanf.c",
     "stdio" ++ path.sep_str ++ "ucrt__snwprintf.c",
     "stdio" ++ path.sep_str ++ "ucrt__vscprintf.c",
     "stdio" ++ path.sep_str ++ "ucrt__vsnprintf.c",
@@ -697,6 +722,7 @@ const mingw32_generic_src = [_][]const u8{
     "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_fwprintf.c",
     "stdio" ++ path.sep_str ++ "ucrt_printf.c",
     "stdio" ++ path.sep_str ++ "ucrt_scanf.c",
     "stdio" ++ path.sep_str ++ "ucrt_snprintf.c",
@@ -709,6 +735,20 @@ const mingw32_generic_src = [_][]const u8{
     "stdio" ++ path.sep_str ++ "ucrt_vsnprintf.c",
     "stdio" ++ path.sep_str ++ "ucrt_vsprintf.c",
     "stdio" ++ path.sep_str ++ "ucrt_vsscanf.c",
+    "string" ++ path.sep_str ++ "ucrt__wcstok.c",
+    // winpthreads
+    "winpthreads" ++ path.sep_str ++ "barrier.c",
+    "winpthreads" ++ path.sep_str ++ "clock.c",
+    "winpthreads" ++ path.sep_str ++ "cond.c",
+    "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",
+    "winpthreads" ++ path.sep_str ++ "spinlock.c",
+    "winpthreads" ++ path.sep_str ++ "thread.c",
     // uuid
     "libsrc" ++ path.sep_str ++ "ativscp-uuid.c",
     "libsrc" ++ path.sep_str ++ "atsmedia-uuid.c",
@@ -819,11 +859,13 @@ const mingw32_generic_src = [_][]const u8{
     "libsrc" ++ path.sep_str ++ "windowscodecs.c",
     "libsrc" ++ path.sep_str ++ "dxguid.c",
     "libsrc" ++ path.sep_str ++ "ksuser.c",
+    "libsrc" ++ path.sep_str ++ "largeint.c",
     "libsrc" ++ path.sep_str ++ "locationapi.c",
     "libsrc" ++ path.sep_str ++ "sapi.c",
     "libsrc" ++ path.sep_str ++ "sensorsapi.c",
     "libsrc" ++ path.sep_str ++ "portabledeviceguids.c",
     "libsrc" ++ path.sep_str ++ "taskschd.c",
+    "libsrc" ++ path.sep_str ++ "scrnsave.c",
     "libsrc" ++ path.sep_str ++ "strmiids.c",
     "libsrc" ++ path.sep_str ++ "gdiplus.c",
     "libsrc" ++ path.sep_str ++ "activeds-uuid.c",
@@ -845,6 +887,7 @@ const mingw32_x86_src = [_][]const u8{
     "math" ++ path.sep_str ++ "roundl.c",
     "math" ++ path.sep_str ++ "tgammal.c",
     "math" ++ path.sep_str ++ "truncl.c",
+    "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "_chgsignl.S",
     "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "acoshl.c",
     "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "acosl.c",
     "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "asinhl.c",
@@ -853,7 +896,6 @@ const mingw32_x86_src = [_][]const u8{
     "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "atanhl.c",
     "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "atanl.c",
     "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "ceill.S",
-    "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "_chgsignl.S",
     "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "copysignl.S",
     "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "cosl.c",
     "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "cosl_internal.S",
@@ -877,18 +919,21 @@ const mingw32_x86_src = [_][]const u8{
     "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "powl.c",
     "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "remainderl.S",
     "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "remquol.S",
+    "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "scalbn.S",
     "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "scalbnf.S",
     "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "scalbnl.S",
-    "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "scalbn.S",
     "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "sinl.c",
     "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "sinl_internal.S",
     "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "tanl.S",
     // ucrtbase
     "math" ++ path.sep_str ++ "fabsf.c",
+    "math" ++ path.sep_str ++ "nextafterl.c",
+    "math" ++ path.sep_str ++ "nexttoward.c",
     "math" ++ path.sep_str ++ "nexttowardf.c",
 };
 
 const mingw32_x86_32_src = [_][]const u8{
+    // ucrtbase
     "math" ++ path.sep_str ++ "coshf.c",
     "math" ++ path.sep_str ++ "expf.c",
     "math" ++ path.sep_str ++ "log10f.c",
@@ -910,8 +955,13 @@ const mingw32_x86_32_src = [_][]const u8{
     "math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "tanf.c",
 };
 
-const mingw32_arm32_src = [_][]const u8{
+const mingw32_arm_src = [_][]const u8{
+    // mingwex
     "math" ++ path.sep_str ++ "arm-common" ++ path.sep_str ++ "ldexpl.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",
@@ -920,7 +970,7 @@ const mingw32_arm32_src = [_][]const u8{
 };
 
 const mingw32_arm64_src = [_][]const u8{
-    "math" ++ path.sep_str ++ "arm-common" ++ path.sep_str ++ "ldexpl.c",
+    // 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",