authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-02-27 11:52:55-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-02-28 14:51:55-05:00
log36aa3c8e7ff1c945c9014bcd5431a4eedd217e8c
treeb9107f64766b7893c6d974eba5fcb3351a52440a
parent6226726571cf6fd500fbc3735e604c85abae641c
signature Commit is signed but in an unrecognized format.

fix __stack_chk_guard emitted even when not linking libc


1 files changed, 2 insertions(+), 5 deletions(-)

lib/std/special/compiler_rt.zig+2-5
...@@ -2,10 +2,7 @@ const std = @import("std");...@@ -2,10 +2,7 @@ const std = @import("std");
2const builtin = std.builtin;2const builtin = std.builtin;
3const is_test = builtin.is_test;3const is_test = builtin.is_test;
44
5const is_gnu = switch (builtin.abi) {5const is_gnu = std.Target.current.abi.isGnu();
6 .gnu, .gnuabin32, .gnuabi64, .gnueabi, .gnueabihf, .gnux32 => true,
7 else => false,
8};
9const is_mingw = builtin.os.tag == .windows and is_gnu;6const is_mingw = builtin.os.tag == .windows and is_gnu;
107
11comptime {8comptime {
...@@ -289,7 +286,7 @@ comptime {...@@ -289,7 +286,7 @@ comptime {
289 else => {},286 else => {},
290 }287 }
291 } else {288 } else {
292 if (std.Target.current.isGnuLibC()) {289 if (std.Target.current.isGnuLibC() and builtin.link_libc) {
293 @export(__stack_chk_guard, .{ .name = "__stack_chk_guard", .linkage = linkage });290 @export(__stack_chk_guard, .{ .name = "__stack_chk_guard", .linkage = linkage });
294 }291 }
295 @export(@import("compiler_rt/divti3.zig").__divti3, .{ .name = "__divti3", .linkage = linkage });292 @export(@import("compiler_rt/divti3.zig").__divti3, .{ .name = "__divti3", .linkage = linkage });