Bug 240507 - WITHOUT_CLANG=yes WITH_CLANG_BOOTSTRAP=yes does not work
Summary: WITHOUT_CLANG=yes WITH_CLANG_BOOTSTRAP=yes does not work
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-toolchain mailing list
URL:
Keywords:
Depends on:
Blocks: 240506
  Show dependency treegraph
 
Reported: 2019-09-11 13:16 UTC by Kyle Evans
Modified: 2019-09-12 12:54 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle Evans freebsd_committer 2019-09-11 13:16:13 UTC
The picobsd build script is trivially broken for CLANG_BOOTSTRAP archs because it wants to set WITHOUT_CLANG and that unsets all of the LLVM_TARGET knobs. It can be fixed to only set it for install phase because it presumably doesn't want clang installed.

Can we consider enabling all LLVM_TARGET_* knobs for the bootstrap/cross-compiler clang, and leaving those user-controlled knobs to be purely for the clang that's getting installed.
Comment 1 Kyle Evans freebsd_committer 2019-09-11 13:17:16 UTC
Assign to -toolchain, CC dim@, part of the picobsd breakage on stable/12 and head.
Comment 2 Dimitry Andric freebsd_committer 2019-09-11 16:18:02 UTC
(In reply to Kyle Evans from comment #0)
> Can we consider enabling all LLVM_TARGET_* knobs for the bootstrap/cross-compiler clang, and leaving those user-controlled knobs to be purely for the clang that's getting installed

The problem with that is that a lot of unused targets will be built, which is why the MK_LLVM_TARGET_ knobs were created in the first place.  Ideally, only the minimum set of targets is built.

That said, I agree that WITHOUT_CLANG should not immediately cause all MK_LLVM_TARGET_ knobs to be turned off.  However, the logic in share/mk/*.mk to achieve all this is very convoluted and fragile, so I would rather defer to an expert in that area. :)
Comment 3 Kyle Evans freebsd_committer 2019-09-11 16:34:11 UTC
(In reply to Dimitry Andric from comment #2)

> The problem with that is that a lot of unused targets will be built, which is why the MK_LLVM_TARGET_ knobs were created in the first place.  Ideally, only the minimum set of targets is built.

Right... so this all feels like a good opportunity for foot shooting. =\ It'd be nice if we had some way of listing the targets that `cc` supports, so we can decide if we need to bootstrap a cross-compiler that works for what we're trying to build and we can at least force *that* option on for the bootstrap compiler.

The last time I checked, one could turn off all of the LLVM_TARGET_* knobs except, say, LLVM_TARGET_X86. They install a machine that way, and the machine has all of the knobs except LLVM_TARGET_X86 turned off just like the builder. A cross-build of aarch64 would then just error out with 'target triple unknown' or something to this effect, rather than being able to detect- "oh yes, the host isn't functional for this."