fix: preserve linker list operands with Zig 0.16 - #480
Merged
Merged
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Since 0.23.4, an existing filename passed as
-Wl,<path>is rewritten as a positional input even when it is the operand of-exported_symbols_list. With Zig 0.16, an Apple cdylib link then fails withunable to read exported symbols list '-dead_strip': FileNotFound.Preserve the following operand for the two list options already handled by the filter:
-exported_symbols_listand--dynamic-list. Share filtering state between command-line arguments and response files, including pairs that cross a response-file boundary. A trailing response-file newline no longer consumes a pending operand. Older Zig versions still strip these list pairs, and the positional archive rewrite from #477 is preserved.Replace the nonexistent filename in the existing Zig 0.16 unit test with a real file. Add executable-wrapper regression tests covering 106 argument scenarios: split and combined forms, old and new version gates, whole-archive inputs, subsequent argument filtering, UTF-16 response files, and pairs crossing response-file boundaries. Run the Rust test suite in the existing CI matrix. Correct the stale percent-escaping assertion exposed by running the suite on Windows, and run that pure string test on all hosts.
Validation on macOS with rustc 1.98.0:
cargo test --locked --all-targets --all-features: 57 tests passed.cargo fmt --all -- --checkandgit diff --check: passed.cargo clippy --locked --all-targets --all-features: completed with five pre-existing warnings; strict-D warningsremains blocked by those warnings.The executable-wrapper tests require Unix. They exercise Windows-target filtering and UTF-16 response files, but native Windows execution was not validated locally.
Fixes #479.