Skip to content

feat(args): accept --library and --library-path, and make the mold skip reasons true (reld#14) - #158

Merged
zackees merged 1 commit into
mainfrom
feat/14-library-long-option
Sep 17, 2026
Merged

zackees merged 1 commit into
mainfrom
feat/14-library-long-option

Conversation

@zackees

@zackees zackees commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Advances #14 (Wave 2 of #153). Does not close it — 46 entries remain.

What this is based on

I ran all 47 unsupported_options mold tests against the native engine with the group temporarily un-skipped, and read the actual failure of each. That turned a blanket group reason into per-test evidence, and two entries turned out to be wrong.

library.sh comes off the list

It needed no new feature: only the GNU long spellings --library / --library-path for -l / -L, in both the separated and the = form. The parser's long-option path already routes to the same handler, so -l:libfoo.a semantics come along for free. One declaration line each, plus a unit test that asserts the long forms parse identically to the short ones.

color-diagnostics.sh is misfiled, not unimplemented

reld has implemented --color-diagnostics since #144. The test fails on a semantic difference: a bare --color-diagnostics means always in reld and in ld.lld, so it colors a pipe, while mold reads it as auto. Verified directly against ld.lld:

--color-diagnostics       => ESCAPES
--color-diagnostics=always => ESCAPES
--color-diagnostics=auto   => plain
--color-diagnostics=never  => plain

reld follows lld here, so this belongs in ignore with the other GNU-family semantic divergences, not in "does not yet implement".

The other 45 keep their skip but name the flag

Each now carries the exact option the parser rejects (--emit-relocs, -Map, --image-base, -warn-common, --undefined-glob, …). A stale reason sends the burn-down at the wrong flag, which is how --library sat here as a missing feature.

Three entries look like they pass locally — omagic.sh, undefined-glob.sh, undefined-glob-gc-sections.sh — but only because they open with test_cflags -static || skip and this host has no static glibc. They stay.

Verification

  • cargo test -p reld-core --lib args::elf::tests::library_and_library_path_long_forms_match_the_short_ones — passes
  • Full mold suite locally: 399 passed, 4 failed, 4 ignored. library.sh now passes. The four failures (rpath.sh, sframe.sh, trace.sh, weak-export-dso2.sh) fail identically before this change — NixOS host noise, not a regression.
  • cargo fmt --all -- --check, cargo clippy -p reld-core --all-targets -- -D warnings — clean

🤖 Generated with Claude Code

…ip reasons true (reld#14)

Running the 47 `unsupported_options` mold tests against the native engine turned
the group's blanket reason into per-test evidence. Two entries were wrong:

`library.sh` needed no new feature at all, only the GNU long spellings of `-l`
and `-L`, which the parser already supports everywhere else. It comes off the
list.

`color-diagnostics.sh` has not been about a missing option since reld#144: reld
implements the flag and fails on a semantic difference, because a bare
`--color-diagnostics` means `always` in reld and ld.lld — verified against
ld.lld — while mold reads it as `auto`. It moves to the `ignore` group.

The rest keep their skip but now name the exact option the parser rejects, so
the burn-down aims at a flag instead of a test.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@zackees
zackees merged commit 35a971b into main Sep 17, 2026
18 checks passed
@zackees
zackees deleted the feat/14-library-long-option branch September 17, 2026 21:23
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