From: Eric Joldasov Upstream parses /usr/bin/env ELF file for detecting C ABI and the dynamic linker. However, if sys-apps/coreutils was merged with "multicall" USE flag, it would be a script and not a ELF file. This will raise error.UnexpectedEndOfFile, and Zig will fallback to default dynamic linker (i.e. musl), which breaks building programs with Zig on glibc systems. This patch changes file from /usr/bin/env to /bin/bash, because it is more reliable on Gentoo systems. --- a/lib/std/zig/system/NativeTargetInfo.zig +++ b/lib/std/zig/system/NativeTargetInfo.zig @@ -355,7 +355,7 @@ fn detectAbiAndDynamicLinker( return result; } - const env_file = std.fs.openFileAbsoluteZ("/usr/bin/env", .{}) catch |err| switch (err) { + const env_file = std.fs.openFileAbsoluteZ("/bin/bash", .{}) catch |err| switch (err) { error.NoSpaceLeft => unreachable, error.NameTooLong => unreachable, error.PathAlreadyExists => unreachable,