Closed Bug 1616694 Opened 5 years ago Closed 5 years ago

Use the 10.12 SDK to build clang 11 for Mac

Categories

(Firefox Build System :: Toolchains, task, P3)

task

Tracking

(firefox80 fixed)

RESOLVED FIXED
mozilla80
Tracking Status
firefox80 --- fixed

People

(Reporter: away, Assigned: away)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 1 obsolete file)

Building LLVM 11 for Mac will require SDK 10.12.

Ted had already attempted the SDK upgrade in bug 1324892 but was blocked by bug 1324892 comment 27, so he settled for 10.11 at the time.

I believe that issue is now resolved. In fact, Ted's 10.12 tooltool package still exists, and it seems to work fine for me on try.

See Also: → mojave-sdk

LLVM 11 introduces a hard requirement for SDK 10.12 in order to build for Mac. Ted did some initial experiments with 10.12 in bug 1324892 and his tooltool package still exists on the server, so I've re-used it.

Note that this patch does not affect which SDK we use to build Firefox.

Assignee: nobody → dmajor
Status: NEW → ASSIGNED
Summary: Switch Mac builds to 10.12 SDK → Use the 10.12 SDK to build clang for Mac

When we move from the 10.11 SDK to 10.12, the defined(COPYFILE_CLONE) in https://github.com/llvm/llvm-project/blob/d7ea6ce809a4413afb1edafa17ba291b39129f52/llvm/lib/Support/Unix/Path.inc#L1290 activates, and LLVM takes a dependency on __isOSVersionAtLeast which powers __builtin_available.

It is not super clear why this happens or what to do about it. Web searches have led to various reports of this problem in other projects, but their solutions don't apply to our codebase. At this point all I can say is that setting -U seems to get around the problem.

Attachment #9162542 - Attachment is obsolete: true

Per glandium's suggestion, to break the chicken and egg cycle we'll use 10.12 only for clang 11+ builds, and build macosx64-clang-trunk using macosx64-clang-9.

Summary: Use the 10.12 SDK to build clang for Mac → Use the 10.12 SDK to build clang 11 for Mac
Attachment #9162013 - Attachment description: Use the 10.12 SDK to build clang → Allow build-clang to work with different Mac SDKs

Currently the macosx-cross toolchain build pulls in a linux64-clang toolchain, uses it to build a Mac native toolchain, and then clobbers the result with pieces of the Linux toolchain. This means that the same version of LLVM is used to build the Mac pieces and be part of the final artifact. This will become a problem with upcoming LLVM 11 where we'll want to build the Mac pieces with LLVM 9 but otherwise repackage an LLVM 11 Linux toolchain.

So this commit makes the macosx-cross workflow look more like the win-cross one: take two compilers built elsewhere and just merge them.

Pushed by dmajor@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/17003ce23438 Allow build-clang to work with different Mac SDKs r=froydnj
Keywords: leave-open
Pushed by dmajor@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3348e8788f8d Turn the macosx-cross toolchain task into a mere repackage r=nalexander
Blocks: 1652600
Keywords: leave-open
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80
Pushed by thunderbird@calypsoblue.org: https://hg.mozilla.org/comm-central/rev/375414b153a2 Port bug 1616694 - Add macosx64-clang-9 to toolchains. rs=bustage-fix CLOSED TREE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: