Page MenuHomeFreeBSD

Build kernel-toolchain before kernel during make universe
AbandonedPublic

Authored by arichardson on Oct 31 2018, 2:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 20, 1:41 PM
Unknown Object (File)
Dec 24 2023, 10:01 AM
Unknown Object (File)
Dec 23 2023, 2:33 AM
Unknown Object (File)
Dec 10 2023, 11:30 PM
Unknown Object (File)
Nov 6 2023, 12:43 AM
Unknown Object (File)
Nov 5 2023, 11:18 PM
Unknown Object (File)
Nov 4 2023, 9:55 PM
Unknown Object (File)
Oct 10 2023, 7:24 PM
Subscribers
None

Details

Summary

This fixes make universe/tinderbox with -DMAKE_JUST_KERNELS when
worlds (for GCC targets) and universe-toolchain (for clang targets)
have not been built yet.
Without MAKE_JUST_KERNELS the toolchain from the world stage will be
used instead of invoking an additional kernel-toolchain make.

Test Plan

make universe with -DMAKE_JUST_KERNELS now builds kernel-toolchain
before starting kernel builds. Before this was causing build failures due
to $CC missing

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 20535
Build 19960: arc lint + arc unit

Event Timeline

I'm uneasy about doing this automatically... What if I already have a good compiler? Last thing I want is to rebuild clang a bazillion times while I'm iterating through kernel build issues on N platforms.

In D17779#380013, @imp wrote:

I'm uneasy about doing this automatically... What if I already have a good compiler? Last thing I want is to rebuild clang a bazillion times while I'm iterating through kernel build issues on N platforms.

I'm happy to disable building of universe-toolchain by default. However, if I look at lines 588 and 599 it seems to me like _need_clang_${target}_${target_arch} and _need_lld_${target}_${target_arch} should be set to false in that case so universe-toolchain will not be added as a dependency.
I will try to test this on a system where I can use the system linker. So far I only tested this on a 11 system.

GCC and usr.sbin/config needs to be built regardless (especially if D16815 is committed since then we will no longer fall back to /usr/bin/config).
I believe if system clang+lld are new enough kernel-toolchain will only build the bootstrap tools such as config?

I think what Warner is saying is that it is user error to do a MAKE_JUST_KERNELS universe if you haven't already used 'make tinderbox' or 'make toolchains' beforehand and that existing users understand that requirement. If the PATH changes still work fine with that model, then I think you don't need to change tinderbox at all.

Ah that makes sense. If make kernel-toolchains is already a requirement for MAKE_JUST_KERNELS, I'll drop this and just run make kernel-toolchains first in cheribuild.

Perhaps if a MAKE_JUST_KERNELS universe fails we could emit a .warning reminder that toolchain was not built?