Commit cd03a0a153
Changed files (2)
src
src/link/Coff.zig
@@ -2113,21 +2113,17 @@ fn linkWithLLD(coff: *Coff, arena: Allocator, tid: Zcu.PerThread.Id, prog_node:
try argv.append(try comp.crtFileAsString(arena, "libmingw32.lib"));
} else {
+ try argv.append(switch (comp.config.link_mode) {
+ .static => "libcmt.lib",
+ .dynamic => "msvcrt.lib",
+ });
+
const lib_str = switch (comp.config.link_mode) {
- .dynamic => "",
.static => "lib",
+ .dynamic => "",
};
- const d_str = switch (optimize_mode) {
- .Debug => "d",
- else => "",
- };
- switch (comp.config.link_mode) {
- .static => try argv.append(try allocPrint(arena, "libcmt{s}.lib", .{d_str})),
- .dynamic => try argv.append(try allocPrint(arena, "msvcrt{s}.lib", .{d_str})),
- }
-
- try argv.append(try allocPrint(arena, "{s}vcruntime{s}.lib", .{ lib_str, d_str }));
- try argv.append(try allocPrint(arena, "{s}ucrt{s}.lib", .{ lib_str, d_str }));
+ try argv.append(try allocPrint(arena, "{s}vcruntime.lib", .{lib_str}));
+ try argv.append(try allocPrint(arena, "{s}ucrt.lib", .{lib_str}));
//Visual C++ 2015 Conformance Changes
//https://msdn.microsoft.com/en-us/library/bb531344.aspx
src/Compilation.zig
@@ -5904,8 +5904,7 @@ fn updateWin32Resource(comp: *Compilation, win32_resource: *Win32Resource, win32
// them being defined matches the behavior of how MSVC calls rc.exe which is the more
// relevant behavior in this case.
switch (rc_src.owner.optimize_mode) {
- .Debug => try argv.append("-D_DEBUG"),
- .ReleaseSafe => {},
+ .Debug, .ReleaseSafe => {},
.ReleaseFast, .ReleaseSmall => try argv.append("-DNDEBUG"),
}
try argv.appendSlice(rc_src.extra_flags);
@@ -6260,10 +6259,7 @@ pub fn addCCArgs(
// LLVM IR files don't support these flags.
if (ext != .ll and ext != .bc) {
switch (mod.optimize_mode) {
- .Debug => {
- // windows c runtime requires -D_DEBUG if using debug libraries
- try argv.append("-D_DEBUG");
- },
+ .Debug => {},
.ReleaseSafe => {
try argv.append("-D_FORTIFY_SOURCE=2");
},