Skip to content

Link: the macOS deployment target covers the archives a program links, so a package built for 13.0 no longer warns once per object (#2316) - #2662

Merged
ehartford merged 1 commit into
fix-2319from
fix-2316
Oct 25, 2026
Merged

ehartford merged 1 commit into
fix-2319from
fix-2316

Conversation

@ehartford

@ehartford ehartford commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Root cause: link_stage_macho_macos_minos (src/compiler/Link.w) read only a
bare 64-bit Mach-O (magic at offset 0); an archive returned 0. And
link_stage_darwin_platform_version scanned the program object and the extra
inputs, never the archives the -l names resolve to, which is how a
with get package is linked (-L <dep>/lib -lxml2). A Conan libxml2.a built
for macOS 13.0 linked at -platform_version macos 11.0 and ld64.lld printed
"libxml2.a(threads.c.o) has version 13.0.0, which is newer than target
minimum of 11.0" 47 times.

The minos scan walks an archive's members (BSD #1/<n> names included).
The link's target is 11.0 or the newest input: objects, extras, and each
-l name resolved over the link's -L directories as ld64 searches (a dylib
or .tbd first, then the archive). An input never targets a newer macOS than
the program.

Test: test/internals/link_darwin_archive_minos_test.w (a synthesized
archive with 13.0 and 12.0 members gives "13.0"; without it "11.0").
Verified: with get c.libxml2 + with build printed 47 warnings with the
installed compiler.

Closes #2316

…, so a package built for 13.0 no longer warns once per object (#2316)

Root cause: link_stage_macho_macos_minos (src/compiler/Link.w) read only a
bare 64-bit Mach-O (magic at offset 0); an archive returned 0. And
link_stage_darwin_platform_version scanned the program object and the extra
inputs, never the archives the `-l` names resolve to, which is how a
`with get` package is linked (`-L <dep>/lib -lxml2`). A Conan libxml2.a built
for macOS 13.0 linked at `-platform_version macos 11.0` and ld64.lld printed
"libxml2.a(threads.c.o) has version 13.0.0, which is newer than target
minimum of 11.0" 47 times.

The minos scan walks an archive's members (BSD `#1/<n>` names included).
The link's target is 11.0 or the newest input: objects, extras, and each
`-l` name resolved over the link's -L directories as ld64 searches (a dylib
or .tbd first, then the archive). An input never targets a newer macOS than
the program.

Test: test/internals/link_darwin_archive_minos_test.w (a synthesized
archive with 13.0 and 12.0 members gives "13.0"; without it "11.0").
Verified: `with get c.libxml2` + `with build` printed 47 warnings with the
installed compiler.
@ehartford
ehartford added this pull request to stack #2668 October 25, 2026 22:01
@ehartford ehartford changed the title fix 2316 Link: the macOS deployment target covers the archives a program links, so a package built for 13.0 no longer warns once per object (#2316) Oct 25, 2026
@ehartford
ehartford marked this pull request as ready for review October 25, 2026 22:13
@ehartford
ehartford merged commit a334e28 into main Oct 25, 2026
@ehartford
ehartford deleted the fix-2316 branch October 25, 2026 22:14
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.

with get: Conan's macOS static libs target 13.0; we link for 11.0, so every link prints one ld64.lld warning per object

1 participant