Update to macOS SDK 27.2
Categories
(Firefox Build System :: Toolchains, task)
Tracking
(firefox162 fixed)
| Tracking | Status | |
|---|---|---|
| firefox162 | --- | fixed |
People
(Reporter: RyanVM, Assigned: RyanVM)
References
(Regressed 1 open bug)
Details
Attachments
(6 external files, 2 obsolete files)
| Assignee | ||
Updated•2 months ago
|
| Assignee | ||
Comment 1•2 months ago
|
||
This is potentially problematic:
The following items have been deprecated or removed:
- The minimum supported deployment target on macOS for the C++ standard library has been increased to 11.0.
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 2•1 month ago
|
||
"Green" Try push (by our standards):
https://treeherder.mozilla.org/jobs?repo=try&revision=c514db16fadddb8cba877f12742b10838e7849b9
I've also pretty exhaustively tested all the downstream toolchain builds on this also. The only thing I haven't been able to verify are the custom-car jobs which appear to be permafailing for other reasons at the moment.
| Assignee | ||
Comment 4•1 month ago
|
||
The macOS 27.0 SDK's linker stubs declare an arm64e.x1 target that ld64.lld rejects as an unknown
architecture, failing every link against the SDK. clang-trunk already has the upstream fix.
| Assignee | ||
Comment 5•1 month ago
|
||
The macOS 27.0 SDK applies attribute((stack_protector_ignore)) unconditionally in its os_log macros, which
clang 22 rejects with -Wunknown-attributes. clang 23 and trunk already have it.
| Assignee | ||
Comment 6•1 month ago
|
||
The macOS 27 SDK's .tbd stubs list arm64e.x1 targets, which libtapi rejects as an unknown architecture, so
ld64 cannot link against the SDK. PGO/LTO macOS builds still link with ld64. This ports the TextAPI part of
LLVM b8007a8e4020: the architecture table gets a separate name column so the slice can be named arm64e.x1.
libtapi's fallback for arm64 links keeps picking the arm64e slice.
| Assignee | ||
Comment 7•1 month ago
|
||
| Assignee | ||
Comment 8•1 month ago
|
||
The macOS 27.0 SDK declares pipe2 and dup3, so configure picks them up, but the libSystem of older macOS
releases does not export them; with pipe2 the freshly built python dies in dyld during make libinstall.
| Assignee | ||
Comment 9•1 month ago
|
||
libc++ in the macOS 27.0 SDK emits a #warning that deployment targets below 11.0 are no longer supported. We
still target 10.15 on Intel, and #warning is not suppressed in system headers, so this is the only way to keep
-Werror builds and the clang-plugin -verify tests compiling. -Wcpp is clang's alias for -W#warnings; the # in
the canonical spelling gets shell-quoted on its way through cargo build scripts and clang then treats it as a
file name. bindgen does not see the warning flags, so BINDGEN_SYSTEM_FLAGS carries it too. The toolchain
builds get the same flag through macos-setup.sh, build-clang.py and build-llvm-common.sh so their logs stay
readable.
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Updated•17 days ago
|
Updated•16 days ago
|
Updated•16 days ago
|
Comment 10•8 days ago
|
||
Comment 11•7 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/de6392e544f0
https://hg.mozilla.org/mozilla-central/rev/8a1c8d80ea1a
https://hg.mozilla.org/mozilla-central/rev/a1bd3b36031e
https://hg.mozilla.org/mozilla-central/rev/eb59c86ee05f
https://hg.mozilla.org/mozilla-central/rev/285c2f681d2f
https://hg.mozilla.org/mozilla-central/rev/62abfd7bd873
| Assignee | ||
Updated•7 days ago
|
Comment 12•6 days ago
|
||
llvm-strip from clang 22 can leave the string table of a stripped Mach-O binary 4-byte aligned. dyld on macOS 27 appears to reject such binaries once they're built against the macOS 27 SDK, which is what kept the 20261109214446 Nightly from starting (bug 2091237). clang 23 already has the fix.
Comment 13•6 days ago
|
||
| Assignee | ||
Comment 14•6 days ago
|
||
Local builds target 10.15 on aarch64 too, so keying the flag on x86_64 missed them.
Updated•6 days ago
|
Comment 15•6 days ago
|
||
FYI, we've had to temporarily stop Nightly updates on macOS because of an unfortunate sequence of events. The SDK bump to 27.2 in this bug landed around the same time as the switch to clang 23 in bug 2039813. clang 23 then had to be backed out for performance regressions (bug 2090871), which put our builds back on clang 22. clang 22's llvm-strip has a bug that was only fixed in clang 23: it can leave the string table of a stripped Mach-O binary misaligned. Once our binaries are built with the macOS 27.2 SDK, dyld on macOS 27 appears to reject them, so Nightly failed to start (bug 2091237).
The SDK bump has been backed out. I've added D341230 to this stack, which backports the upstream llvm-objcopy fix to clang 22, so the SDK bump no longer depends on clang 23 landing at the same time. glandium has already accepted it.
I've also moved the follow-up we had to land for the SDK bump (D340913, which disables -Wcpp for every macOS deployment target below 11.0 and was originally in bug 2090948) over to this bug and into the same stack. That way we can land everything at once, as soon as try comes back green and we've verified that the build launches. The updated stack is on try: https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=117287
Comment 16•6 days ago
|
||
Backed out at the Stephen A Pohl request https://treeherder.mozilla.org/jobs?repo=autoland&group_state=expanded&resultStatus=testfailed%2Cbusted%2Cexception%2Cretry%2Cusercancel&revision=aa021af8f0f71d24c4b9e871d7650b14670205e5
Updated•6 days ago
|
Updated•6 days ago
|
Comment 17•6 days ago
|
||
I pushed the SDK 27.2 stack together with the clang 22 llvm-objcopy backport to try, and the resulting build looks good:
https://treeherder.mozilla.org/jobs?repo=try&revision=e0bc1aaec336
- All 57 jobs succeeded, including the rebuilt
toolchain-linux64-clang-22and both macOS opt builds. - In the
build-macosx64-aarch64/optbuild,LC_SYMTAB.stroffis 8-byte aligned inXUL,libnss3.dylib,libEGL.dylib,libGLESv2.dylib,libmozavcodec.dylib,libmozavutil.dylib,libmozinference.dylib,libmozglue.dylibandfirefox, anddyld_infono longer reports "mis-aligned LINKEDIT string pool" for any of them. These are the files that were misaligned in Nightly 20261109214446 (bug 2091237). - The build starts normally on macOS 27.3 (arm64). In Nightly 20261109214446, dyld rejected
libnss3.dylibon the same machine.
I've only checked the arm64 opt build. The x86_64 slice and a signed shippable build haven't been checked yet.
Updated•6 days ago
|
| Assignee | ||
Comment 18•6 days ago
|
||
Stephen, one wrinkle for the reland: bug 2091029 (on central since this morning) moved the libtapi fetch to the upstream revision that already includes the arm64e.x1 support, so D332002 is redundant now. Your try push predates it (its cctools-port job still applied libtapi-arm64e-x1.patch), and relanding D332002 on current main would re-add a patch that no longer applies.
Since the stack needs updating anyway, I've rebased it onto current main without D332002 and folded D340913 into D332005, which keeps the -Wcpp change in a single patch. Try push: https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=117497
Once that's green I plan to abandon D332002 and D340913 and resubmit the rest, D341230 included, unchanged. Let me know if you have local changes to the stack you'd rather I hold off for.
Updated•6 days ago
|
Updated•6 days ago
|
Updated•6 days ago
|
Comment 19•6 days ago
|
||
(In reply to Ryan VanderMeulen [:RyanVM] from comment #18)
Stephen, one wrinkle for the reland: bug 2091029 (on central since this morning) moved the libtapi fetch to the upstream revision that already includes the arm64e.x1 support, so D332002 is redundant now. Your try push predates it (its cctools-port job still applied
libtapi-arm64e-x1.patch), and relanding D332002 on current main would re-add a patch that no longer applies.Since the stack needs updating anyway, I've rebased it onto current main without D332002 and folded D340913 into D332005, which keeps the
-Wcppchange in a single patch. Try push: https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=117497Once that's green I plan to abandon D332002 and D340913 and resubmit the rest, D341230 included, unchanged. Let me know if you have local changes to the stack you'd rather I hold off for.
Thanks for catching this and your plan sounds good to me. Thank you!
| Assignee | ||
Comment 20•6 days ago
|
||
The try push from my last comment is green.
I also checked the built binaries for the alignment problem from bug 2091237. In the macosx64/opt, macosx64-aarch64/opt and both shippable builds, every Mach-O's LC_SYMTAB.stroff is 8-byte aligned, in both the arm64 and x86_64 slices. Nightly 20261109214446 had 11 misaligned images in its arm64 slice and 14 in its x86_64 slice. I can't launch anything on macOS 27 myself, so please double-check that side if you get a chance.
The Phabricator stack is updated: D332002 is abandoned, since bug 2091029 already brought in the libtapi change, and D340913 is folded into D332005. From my side it can reland whenever you're comfortable.
To catch this class of problem at build time going forward, bug 2091466 (D341463, in review) makes packaging fail when a stripped Mach-O has a __LINKEDIT layout dyld would reject. On current main it fails the mac opt builds, as expected, and on top of this stack it passes. It depends on this bug landing first.
Comment 21•6 days ago
|
||
(In reply to Ryan VanderMeulen [:RyanVM] from comment #20)
The try push from my last comment is green.
I also checked the built binaries for the alignment problem from bug 2091237. In the
macosx64/opt,macosx64-aarch64/optand both shippable builds, every Mach-O'sLC_SYMTAB.stroffis 8-byte aligned, in both the arm64 and x86_64 slices. Nightly 20261109214446 had 11 misaligned images in its arm64 slice and 14 in its x86_64 slice. I can't launch anything on macOS 27 myself, so please double-check that side if you get a chance.The Phabricator stack is updated: D332002 is abandoned, since bug 2091029 already brought in the libtapi change, and D340913 is folded into D332005. From my side it can reland whenever you're comfortable.
To catch this class of problem at build time going forward, bug 2091466 (D341463, in review) makes packaging fail when a stripped Mach-O has a
__LINKEDITlayout dyld would reject. On current main it fails the mac opt builds, as expected, and on top of this stack it passes. It depends on this bug landing first.
I have verified the try build on my end as well and can confirm that everything seems correct now. I'm in favor of re-landing these changes soon in order to catch anything else before the merge on the 20th. Thank you!
Comment 22•6 days ago
|
||
Comment 23•5 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/55361990343c
https://hg.mozilla.org/mozilla-central/rev/ed306c4c7ee6
https://hg.mozilla.org/mozilla-central/rev/a4fc85c348bd
https://hg.mozilla.org/mozilla-central/rev/49569fac4100
https://hg.mozilla.org/mozilla-central/rev/0bb07f104b31
https://hg.mozilla.org/mozilla-central/rev/401155dcbbf7
Description
•