Skip to content

Commit 72343ff

Browse files
zhaozgandrewrk
authored andcommitted
fix #3237: resolve undefined symbol _DllMainCRTStartup
1 parent 490cafe commit 72343ff

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/link/Coff.zig

+5
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,11 @@ fn linkWithLLD(self: *Coff, comp: *Compilation) !void {
10541054

10551055
if (is_dyn_lib) {
10561056
try argv.append(try comp.get_libc_crt_file(arena, "dllcrt2.o"));
1057+
if (target.cpu.arch == .i386) {
1058+
try argv.append("-ALTERNATENAME:__DllMainCRTStartup@12=_DllMainCRTStartup@12");
1059+
} else {
1060+
try argv.append("-ALTERNATENAME:_DllMainCRTStartup=DllMainCRTStartup");
1061+
}
10571062
} else {
10581063
try argv.append(try comp.get_libc_crt_file(arena, "crt2.o"));
10591064
}

0 commit comments

Comments
 (0)