Page MenuHomeFreeBSD

Fix the linker detection for bootstrapping under MacOS / homebrew
ClosedPublic

Authored by uqs on Jul 20 2021, 12:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 8, 1:09 AM
Unknown Object (File)
Sun, Apr 7, 11:31 PM
Unknown Object (File)
Sun, Apr 7, 5:06 PM
Unknown Object (File)
Fri, Mar 22, 5:18 PM
Unknown Object (File)
Fri, Mar 22, 5:18 PM
Unknown Object (File)
Fri, Mar 22, 5:18 PM
Unknown Object (File)
Fri, Mar 22, 5:18 PM
Unknown Object (File)
Mar 15 2024, 9:11 PM

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 40550
Build 37439: arc lint + arc unit

Event Timeline

uqs requested review of this revision.Jul 20 2021, 12:19 PM

This is not quite correct, the linker in that run is lld. See https://reviews.freebsd.org/D31224 (will commit shortly).

.github/workflows/cross-bootstrap-tools.yml
26

These changes look good to me and should still be committed after I land D31224

This is not quite correct, the linker in that run is lld. See https://reviews.freebsd.org/D31224 (will commit shortly).

What do you mean by that? I see that this run no longer has the debug output that I added, but it is/was running the homebrew lld and then falling flat on its face.

Here's a run with -dx showing that LD=/usr/local/opt/llvm/bin/ld.lld

https://github.com/uqs/freebsd-src/runs/3112515316?check_suite_focus=true

In D31231#703428, @uqs wrote:

This is not quite correct, the linker in that run is lld. See https://reviews.freebsd.org/D31224 (will commit shortly).

What do you mean by that? I see that this run no longer has the debug output that I added, but it is/was running the homebrew lld and then falling flat on its face.

Here's a run with -dx showing that LD=/usr/local/opt/llvm/bin/ld.lld

https://github.com/uqs/freebsd-src/runs/3112515316?check_suite_focus=true

Homebrew LLD is still LLD just with a vendor prefix (ELF linker) and not the macOS linker (Mach-O output format).

In D31231#703428, @uqs wrote:

This is not quite correct, the linker in that run is lld. See https://reviews.freebsd.org/D31224 (will commit shortly).

What do you mean by that? I see that this run no longer has the debug output that I added, but it is/was running the homebrew lld and then falling flat on its face.

Here's a run with -dx showing that LD=/usr/local/opt/llvm/bin/ld.lld

https://github.com/uqs/freebsd-src/runs/3112515316?check_suite_focus=true

Homebrew LLD is still LLD just with a vendor prefix (ELF linker) and not the macOS linker (Mach-O output format).

Pardon my ignorance, but which one do we want? The ELF one, right? As we're trying to build a FreeBSD image after all. Just the host tools need to be in Mach-O?

In D31231#703440, @uqs wrote:
In D31231#703428, @uqs wrote:

This is not quite correct, the linker in that run is lld. See https://reviews.freebsd.org/D31224 (will commit shortly).

What do you mean by that? I see that this run no longer has the debug output that I added, but it is/was running the homebrew lld and then falling flat on its face.

Here's a run with -dx showing that LD=/usr/local/opt/llvm/bin/ld.lld

https://github.com/uqs/freebsd-src/runs/3112515316?check_suite_focus=true

Homebrew LLD is still LLD just with a vendor prefix (ELF linker) and not the macOS linker (Mach-O output format).

Pardon my ignorance, but which one do we want? The ELF one, right? As we're trying to build a FreeBSD image after all. Just the host tools need to be in Mach-O?

Yes, the bootstrap-tools/build-tools phase wants the Mach-O linker (LINKER_TYPE==mac), the later phases want lld since we are cross-compiling FreeBSD ELF files. So when building we want LD=/usr/bin/ld XLD=/usr/local/opt/llvm/bin/ld.lld (which should be the values that make.py sets).

This revision is now accepted and ready to land.Jul 20 2021, 3:23 PM

Actually, the commit message should be updated: this no longer unbreaks github actions CI it just corrects the clang version displayed in the output.

Actually, the commit message should be updated: this no longer unbreaks github actions CI it just corrects the clang version displayed in the output.

I just ran arc diff --update D31231 which doesn't seem to pull in the new message, it now reads:

Make it clear we're running clang-12 for the GH actions

This chases a homebrew change in the default clang version.

Reviewers: arichardson

Subscribers: bdrewery, imp, emaste

Differential Revision: https://reviews.freebsd.org/D31231