-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(main/zig): fix warning missing ABI and dynamic linker
Closes #20294 Zig uses FHS-type path to guess the ABI and dynamic linker of `env` binary. That leads to a warning like in #20294
- Loading branch information
Showing
2 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
diff --git a/lib/std/zig/system.zig b/lib/std/zig/system.zig | ||
index 83c798c34..8eebdb857 100644 | ||
--- a/zig/lib/std/zig/system.zig | ||
+++ b/zig/lib/std/zig/system.zig | ||
@@ -988,7 +988,9 @@ 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. | ||
|
||
- var file_name: []const u8 = switch (os.tag) { | ||
+ var file_name: []const u8 = if (os.tag.isAndroid()) | ||
+ "@TERMUX_PREFIX@/bin/env" | ||
+ else 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", |