Fail mac packaging when a stripped binary has a __LINKEDIT layout dyld rejects
Categories
(Firefox Build System :: General, task)
Tracking
(firefox162 fixed)
| Tracking | Status | |
|---|---|---|
| firefox162 | --- | fixed |
People
(Reporter: RyanVM, Assigned: RyanVM)
References
Details
Attachments
(1 external file)
In bug 2091237, Nightly 20261109214446 did not start on macOS 27: dyld rejected libnss3.dylib with "mis-aligned LINKEDIT string pool". clang 22's llvm-strip can leave the string table of a stripped Mach-O binary 4-byte aligned, and dyld on macOS 27 refuses that layout in binaries built against the macOS 27 SDK.
Nothing caught it before Nightly shipped: the builds were green on try and central, and no CI job runs Firefox on macOS 27. The same misaligned layout had been in every clang 22 build for weeks without consequence, because dyld only enforces its __LINKEDIT layout rules for binaries built against a recent enough SDK. Any toolchain or SDK change can therefore produce binaries a newer macOS refuses to load without any build or test failing. We can and should add a check for this to the builds so it fails loudly up front.
| Assignee | ||
Comment 1•7 days ago
|
||
dyld refuses to load a binary whose __LINKEDIT contents overlap, run past the end of the segment or are
misaligned, once it is linked against a recent enough SDK. dyld on macOS 27 also requires the string pool to
be pointer-size aligned, which clang 22's llvm-strip does not guarantee, so a Nightly built with it against
the macOS 27 SDK did not start there (bug 2091237). Nothing in CI runs Firefox on macOS 27, so check the
layout right after stripping instead.
| Assignee | ||
Comment 2•7 days ago
|
||
Try push showing this check successfully catching the issue with the current clang-22 builds in CI: https://treeherder.mozilla.org/jobs?repo=try&revision=a127737b07183f14da435ef936e7a608ab4e6ae7
Try push showing SDK 27.2 builds passing w/ D341230 included in the stack: https://treeherder.mozilla.org/jobs?repo=try&revision=3a126db7a534751fdca3d9452b21660261bf4695
Comment 3•7 days ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox Build System::Toolchains' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
| Assignee | ||
Updated•7 days ago
|
Comment 5•6 days ago
|
||
| bugherder | ||
Description
•