diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2024-04-07 21:40:59 -0400 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2024-04-08 13:20:14 -0400 |
| commit | 3f1f05011edc19e0b94b3200e54f30cf7aa8da8e (patch) | |
| tree | f938b16a9397fe479d78b53cc58ba75d71121af7 /lib | |
| parent | fcdb7027e9f606cf0f4415daee73cb717affe69e (diff) | |
| download | zig-3f1f05011edc19e0b94b3200e54f30cf7aa8da8e.tar.gz zig-3f1f05011edc19e0b94b3200e54f30cf7aa8da8e.zip | |
haiku: fix abi and dynamic linker detection
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/std/zig/system.zig | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/std/zig/system.zig b/lib/std/zig/system.zig index c9fe14a1c6..af0986e0b8 100644 --- a/lib/std/zig/system.zig +++ b/lib/std/zig/system.zig @@ -988,9 +988,13 @@ fn detectAbiAndDynamicLinker( // if it finds one, then instead of using /usr/bin/env as the ELF file to examine, it uses the file it references instead, // doing the same logic recursively in case it finds another shebang line. - // Since /usr/bin/env is hard-coded into the shebang line of many portable scripts, it's a - // reasonably reliable path to start with. - var file_name: []const u8 = "/usr/bin/env"; + var file_name: []const u8 = switch (os.tag) { + // Since /usr/bin/env is hard-coded into the shebang line of many portable scripts, it's a + // reasonably reliable path to start with. + else => "/usr/bin/env", + // Haiku does not have a /usr root directory. + .haiku => "/bin/env", + }; // #! (2) + 255 (max length of shebang line since Linux 5.1) + \n (1) var buffer: [258]u8 = undefined; while (true) { |
