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
signaturelock-open 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");
22const builtin = std.builtin;
33const is_test = builtin.is_test;
44
5const is_gnu = switch (builtin.abi) {
6 .gnu, .gnuabin32, .gnuabi64, .gnueabi, .gnueabihf, .gnux32 => true,
7 else => false,
8};
5const is_gnu = std.Target.current.abi.isGnu();
96const is_mingw = builtin.os.tag == .windows and is_gnu;
107
118comptime {
......@@ -289,7 +286,7 @@ comptime {
289286 else => {},
290287 }
291288 } else {
292 if (std.Target.current.isGnuLibC()) {
289 if (std.Target.current.isGnuLibC() and builtin.link_libc) {
293290 @export(__stack_chk_guard, .{ .name = "__stack_chk_guard", .linkage = linkage });
294291 }
295292 @export(@import("compiler_rt/divti3.zig").__divti3, .{ .name = "__divti3", .linkage = linkage });