From 212171643c0cd0c9065f0e7322b4d373f51a089b Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Thu, 1 Oct 2020 11:38:19 +0200 Subject: [PATCH] stage2: Add missing defines for building dllcrt2.o Closes #6482 --- src/mingw.zig | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mingw.zig b/src/mingw.zig index b6c8591ea4..ff4156cfb9 100644 --- a/src/mingw.zig +++ b/src/mingw.zig @@ -32,6 +32,8 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { var args = std.ArrayList([]const u8).init(arena); try add_cc_args(comp, arena, &args); try args.appendSlice(&[_][]const u8{ + "-D_SYSCRT=1", + "-DCRTDLL=1", "-U__CRTDLL__", "-D__MSVCRT__", // Uncomment these 3 things for crtu @@ -53,6 +55,8 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { var args = std.ArrayList([]const u8).init(arena); try add_cc_args(comp, arena, &args); try args.appendSlice(&[_][]const u8{ + "-D_SYSCRT=1", + "-DCRTDLL=1", "-U__CRTDLL__", "-D__MSVCRT__", }); @@ -437,11 +441,8 @@ fn findDef(comp: *Compilation, allocator: *Allocator, lib_name: []const u8) ![]u const lib_path = switch (target.cpu.arch) { .i386 => "lib32", .x86_64 => "lib64", - .arm, .armeb => switch (target.cpu.arch.ptrBitWidth()) { - 32 => "libarm32", - 64 => "libarm64", - else => unreachable, - }, + .arm, .armeb, .thumb, .thumbeb, .aarch64_32 => "libarm32", + .aarch64, .aarch64_be => "libarm64", else => unreachable, };