mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-08 23:04:24 +00:00
fix __stack_chk_guard emitted even when not linking libc
This commit is contained in:
parent
6226726571
commit
36aa3c8e7f
1 changed files with 2 additions and 5 deletions
|
|
@ -2,10 +2,7 @@ const std = @import("std");
|
||||||
const builtin = std.builtin;
|
const builtin = std.builtin;
|
||||||
const is_test = builtin.is_test;
|
const is_test = builtin.is_test;
|
||||||
|
|
||||||
const is_gnu = switch (builtin.abi) {
|
const is_gnu = std.Target.current.abi.isGnu();
|
||||||
.gnu, .gnuabin32, .gnuabi64, .gnueabi, .gnueabihf, .gnux32 => true,
|
|
||||||
else => false,
|
|
||||||
};
|
|
||||||
const is_mingw = builtin.os.tag == .windows and is_gnu;
|
const is_mingw = builtin.os.tag == .windows and is_gnu;
|
||||||
|
|
||||||
comptime {
|
comptime {
|
||||||
|
|
@ -289,7 +286,7 @@ comptime {
|
||||||
else => {},
|
else => {},
|
||||||
}
|
}
|
||||||
} 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(__stack_chk_guard, .{ .name = "__stack_chk_guard", .linkage = linkage });
|
||||||
}
|
}
|
||||||
@export(@import("compiler_rt/divti3.zig").__divti3, .{ .name = "__divti3", .linkage = linkage });
|
@export(@import("compiler_rt/divti3.zig").__divti3, .{ .name = "__divti3", .linkage = linkage });
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue