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)
Sat, Dec 14, 3:28 PM
Unknown Object (File)
Nov 26 2024, 1:33 PM
Unknown Object (File)
Nov 26 2024, 3:16 AM
Unknown Object (File)
Nov 25 2024, 10:36 PM
Unknown Object (File)
Nov 21 2024, 2:03 PM
Unknown Object (File)
Nov 15 2024, 3:27 PM
Unknown Object (File)
Nov 14 2024, 3:39 PM
Unknown Object (File)
Nov 10 2024, 1:33 AM

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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–28

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