authorgravatar for vesim809+github@protonmail.comVesim <vesim809+github@protonmail.com> 2024-07-15 14:48:40+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-07-15 15:48:40+03:00
loge5c974fa5cd3f9ed49463b597954a053da91de6d
tree121479e42157df1cbd79352fe135c212f887485a
parent9002977051b810ec023589c7e89283acb3ca9fbf
signaturebadge-check Signed by PGP key B5690EEEBB952194

std.os.linux: export getauxval only when building executable or root has main function


1 files changed, 4 insertions(+), 1 deletions(-)

lib/std/os/linux.zig+4-1
......@@ -393,7 +393,10 @@ const extern_getauxval = switch (builtin.zig_backend) {
393393};
394394
395395comptime {
396 if (extern_getauxval) {
396 const root = @import("root");
397 // Export this only when building executable, otherwise it is overriding
398 // the libc implementation
399 if (extern_getauxval and (builtin.output_mode == .Exe or @hasDecl(root, "main"))) {
397400 @export(getauxvalImpl, .{ .name = "getauxval", .linkage = .weak });
398401 }
399402}