std.zig.system.NativeTargetInfo: improve examined file search #16973
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Append Termux-specific path to
zig_examined_elf_files
to workaround different path forenv
binary. See also Compiling a program on termux aarch64 producesFileNotFound
errors #14146Use same buffer for searching shebang line to search ELF magic constant, if any, and remove corresponding (now duplicate) check from
abiAndDynamicLinkerFromFile
Fix not finding interpret path when it it separater from shebang by one or more blank spaces
Fix too big minimal limit of bytes from file (minimal shebang length instead of
buffer.len
)BTW with this changes Zig correctly chases files from shebang line again, but
abiAndDynamicLinkerFromFile
returns incorrect result2.19.0
instead of2.37
(hidden bug popped up), so this PR is not enough to mitigate all related issues.