authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2024-04-07 21:40:59-04:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2024-04-08 13:20:14-04:00
log3f1f05011edc19e0b94b3200e54f30cf7aa8da8e
treef938b16a9397fe479d78b53cc58ba75d71121af7
parentfcdb7027e9f606cf0f4415daee73cb717affe69e

haiku: fix abi and dynamic linker detection


1 files changed, 7 insertions(+), 3 deletions(-)

lib/std/zig/system.zig+7-3
......@@ -988,9 +988,13 @@ fn detectAbiAndDynamicLinker(
988988 // if it finds one, then instead of using /usr/bin/env as the ELF file to examine, it uses the file it references instead,
989989 // doing the same logic recursively in case it finds another shebang line.
990990
991 // Since /usr/bin/env is hard-coded into the shebang line of many portable scripts, it's a
992 // reasonably reliable path to start with.
993 var file_name: []const u8 = "/usr/bin/env";
991 var file_name: []const u8 = switch (os.tag) {
992 // Since /usr/bin/env is hard-coded into the shebang line of many portable scripts, it's a
993 // reasonably reliable path to start with.
994 else => "/usr/bin/env",
995 // Haiku does not have a /usr root directory.
996 .haiku => "/bin/env",
997 };
994998 // #! (2) + 255 (max length of shebang line since Linux 5.1) + \n (1)
995999 var buffer: [258]u8 = undefined;
9961000 while (true) {