Skip to content

Preserve repeated linker options and their arguments - #54

Open
OskarEichler wants to merge 2 commits into
ruby-gnome:mainfrom
OskarEichler:codex/preserve-multiargument-link-options
Open

Preserve repeated linker options and their arguments#54
OskarEichler wants to merge 2 commits into
ruby-gnome:mainfrom
OskarEichler:codex/preserve-multiargument-link-options

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

Stop globally deduplicating individual linker tokens. Preserve repeated -framework/-Xlinker/group markers while retaining the existing joined -L/-l deduplication policy.

Reproduction and verification

A .pc file containing Libs: -framework Cocoa -framework Carbon currently produces -framework Cocoa Carbon, so Carbon is no longer an argument to -framework. Likewise -Xlinker --as-needed -Xlinker --no-as-needed loses its second -Xlinker. Generic token uniqueness also removes repeated group delimiters. The candidate keeps these sequences intact.

Five public .pc fixtures pass; four fail on baseline. Existing splitter and native GLib/MSVC-style checks still pass.

Existing suite on Ruby 4.0.6 through rbenv: 27 tests, 31 assertions, zero failures/errors, two upstream macOS omissions, baseline and this isolated patch. Combined installed-release consumer also passes the suite, 1,098 focused/model checks, four process cases, five linker-option cases and four path cases. rbenv exec ruby test/run.rb runs the existing suite.

Compatibility and limitations

Output may now contain repeated non-library flags, deliberately preserving their positional semantics. This is not a complete linker-language parser: quoted paths, repeated -l requirements across link groups and dependency ordering remain separate work. Native Windows/MSVC was not run.

No tests were added or modified under the consuming repository's no-new-tests policy. Verification uses existing tests and external scratch reproductions. No production changes; older Ruby/Linux/Windows matrices await upstream CI. No unrelated version/dependency changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant