Closed Bug 2091466 Opened 7 days ago Closed 6 days ago

Fail mac packaging when a stripped binary has a __LINKEDIT layout dyld rejects

Categories

(Firefox Build System :: General, task)

task

Tracking

(firefox162 fixed)

RESOLVED FIXED
162 Branch
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.

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.

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

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.

Component: General → Toolchains
Component: Toolchains → General
Pushed by rvandermeulen@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/f830d9973b15 https://hg.mozilla.org/integration/autoland/rev/544f733c0349 Fail packaging when a stripped Mach-O has a __LINKEDIT layout dyld rejects. r=firefox-build-system-reviewers,ahochheiden
Status: NEW → RESOLVED
Closed: 6 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: