Skip to content

Commit

Permalink
fix(main/zig): fix warning missing ABI and dynamic linker
Browse files Browse the repository at this point in the history
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
mbekkomo committed Dec 2, 2024
1 parent aae6163 commit 94c7603
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/zig/lib-std-zig-system.zig.patch
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/lib/std/zig/system.zig
+++ b/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",

0 comments on commit 94c7603

Please sign in to comment.