Page MenuHomeFreeBSD

Fix the linker detection for bootstrapping under MacOS / homebrew
ClosedPublic

Authored by uqs on Tue, Jul 20, 12:19 PM.

Details

Summary

This fixes the GH action CI run.

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

uqs requested review of this revision.Tue, Jul 20, 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.Tue, Jul 20, 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