diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-02-27 11:52:55 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-02-28 14:51:55 -0500 |
| commit | 36aa3c8e7ff1c945c9014bcd5431a4eedd217e8c (patch) | |
| tree | b9107f64766b7893c6d974eba5fcb3351a52440a /lib/std/special/compiler_rt.zig | |
| parent | 6226726571cf6fd500fbc3735e604c85abae641c (diff) | |
| download | zig-36aa3c8e7ff1c945c9014bcd5431a4eedd217e8c.tar.gz zig-36aa3c8e7ff1c945c9014bcd5431a4eedd217e8c.zip | |
fix __stack_chk_guard emitted even when not linking libc
Diffstat (limited to 'lib/std/special/compiler_rt.zig')
| -rw-r--r-- | lib/std/special/compiler_rt.zig | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/std/special/compiler_rt.zig b/lib/std/special/compiler_rt.zig index 3126e81b9d..9ed866f62d 100644 --- a/lib/std/special/compiler_rt.zig +++ b/lib/std/special/compiler_rt.zig @@ -2,10 +2,7 @@ const std = @import("std"); const builtin = std.builtin; const is_test = builtin.is_test; -const is_gnu = switch (builtin.abi) { - .gnu, .gnuabin32, .gnuabi64, .gnueabi, .gnueabihf, .gnux32 => true, - else => false, -}; +const is_gnu = std.Target.current.abi.isGnu(); const is_mingw = builtin.os.tag == .windows and is_gnu; comptime { @@ -289,7 +286,7 @@ comptime { else => {}, } } else { - if (std.Target.current.isGnuLibC()) { + if (std.Target.current.isGnuLibC() and builtin.link_libc) { @export(__stack_chk_guard, .{ .name = "__stack_chk_guard", .linkage = linkage }); } @export(@import("compiler_rt/divti3.zig").__divti3, .{ .name = "__divti3", .linkage = linkage }); |
