-
-
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
3 changed files
with
32 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/LibCInstallation.zig b/lib/std/zig/LibCInstallation.zig | ||
index 686471bde..47e1f714c 100644 | ||
--- a/zig/lib/std/zig/LibCInstallation.zig | ||
+++ b/zig/lib/std/zig/LibCInstallation.zig | ||
@@ -203,6 +203,10 @@ pub fn findNative(args: FindNativeOptions) FindError!LibCInstallation { | ||
self.include_dir = try args.allocator.dupeZ(u8, "/usr/include"); | ||
self.sys_include_dir = try args.allocator.dupeZ(u8, "/usr/include"); | ||
self.crt_dir = try args.allocator.dupeZ(u8, "/usr/lib/64"); | ||
+ } else if (builtin.target.isAndroid()) { | ||
+ self.include_dir = try args.allocator.dupeZ(u8, "@TERMUX_PREFIX@/include"); | ||
+ self.sys_include_dir = try args.allocator.dupeZ(u8, "@TERMUX_PREFIX@/include/sys"); | ||
+ self.crt_dir = try args.allocator.dupeZ(u8, "@TERMUX_PREFIX@/lib/crtbegin_dynamic.o"); | ||
} else if (std.process.can_spawn) { | ||
try self.findNativeIncludeDirPosix(args); | ||
switch (builtin.target.os.tag) { |
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,16 @@ | ||
diff --git a/lib/std/zig/system.zig b/lib/std/zig/system.zig | ||
index 83c798c34..6668f4bcd 100644 | ||
--- a/zig/lib/std/zig/system.zig | ||
+++ b/zig/lib/std/zig/system.zig | ||
@@ -996,6 +996,11 @@ fn detectAbiAndDynamicLinker( | ||
.haiku => "/bin/env", | ||
}; | ||
|
||
+ if (builtin.target.isAndroid()) { | ||
+ // Consider using /system/bin/env instead | ||
+ file_name = "@TERMUX_PREFIX@/bin/env"; | ||
+ } | ||
+ | ||
// According to `man 2 execve`: | ||
// | ||
// The kernel imposes a maximum length on the text |