Skip to content

Commit

Permalink
fix ziglang#3237: resolve undefined symbol _DllMainCRTStartup
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaozg committed Oct 26, 2020
1 parent e3fed3c commit f265a46
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/link/Coff.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,11 @@ fn linkWithLLD(self: *Coff, comp: *Compilation) !void {

if (is_dyn_lib) {
try argv.append(try comp.get_libc_crt_file(arena, "dllcrt2.o"));
if (target.cpu.arch == .i386) {
try argv.append("-ALTERNATENAME:__DllMainCRTStartup@12=_DllMainCRTStartup@12");
} else {
try argv.append("-ALTERNATENAME:_DllMainCRTStartup=DllMainCRTStartup");
}
} else {
try argv.append(try comp.get_libc_crt_file(arena, "crt2.o"));
}
Expand Down

0 comments on commit f265a46

Please sign in to comment.