mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:24:33 +01:00
std.os.linux: export getauxval only when building executable or root has main function
This commit is contained in:
parent
9002977051
commit
e5c974fa5c
1 changed files with 4 additions and 1 deletions
|
|
@ -393,7 +393,10 @@ const extern_getauxval = switch (builtin.zig_backend) {
|
|||
};
|
||||
|
||||
comptime {
|
||||
if (extern_getauxval) {
|
||||
const root = @import("root");
|
||||
// Export this only when building executable, otherwise it is overriding
|
||||
// the libc implementation
|
||||
if (extern_getauxval and (builtin.output_mode == .Exe or @hasDecl(root, "main"))) {
|
||||
@export(getauxvalImpl, .{ .name = "getauxval", .linkage = .weak });
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue