Page MenuHomeFreeBSD

If CROSS_TOOLCHAIN isn't set, look for base toolchain makefiles.
AbandonedPublic

Authored by jhb on Mar 6 2019, 6:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 19, 1:15 AM
Unknown Object (File)
Mon, Dec 2, 5:31 AM
Unknown Object (File)
Nov 22 2024, 11:54 AM
Unknown Object (File)
Oct 4 2024, 2:21 PM
Unknown Object (File)
Sep 15 2024, 10:32 PM
Unknown Object (File)
Sep 11 2024, 11:12 AM
Unknown Object (File)
Sep 10 2024, 2:29 AM
Unknown Object (File)
Sep 9 2024, 11:23 PM
Subscribers

Details

Summary

These are installed in /usr/share/toolchains. Just hardcode the two
possible names for now rather than invoking ls to get a list.

Test Plan
  • built a self-hosted world + kernel with base/* and suitable files in /usr/share/toolchains. These files set suitable settings per my mail to toolchains@ to turn off the build of base components that are replaced by the base packages and also fixup 'make delete-old' to not delete bits installed by the packages.
  • also tested that 'make buildenv' creates an environment where the Right Thing (tm) happens

Note that I originally pursued a plan of support arbitrary files in
/etc/src.conf.d/, however, there is the problem of ignoring them
when CROSS_TOOLCHAIN is set to support cross builds and the risk of
invoking 'ls' to enumerate those files in each invocation of
make, etc. Note that the installed files I will add to the ports
shortly have to use 'export' for WITH/WITHOUT options since they
are only included in Makefile.inc1 and not by sub-makes.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 22916
Build 22002: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Mar 27 2019, 2:24 PM

Technically seems fine.
Feels like a POLA issue though. If I happened to have some package installed then buildworld behaved differently.
Maybe CROSS_TOOLCHAIN=yes or CROSS_TOOLCHAIN=base?
I don't really care either way; default on like you have is fine too as I don't fully understand the use case.

Technically seems fine.
Feels like a POLA issue though. If I happened to have some package installed then buildworld behaved differently.
Maybe CROSS_TOOLCHAIN=yes or CROSS_TOOLCHAIN=base?
I don't really care either way; default on like you have is fine too as I don't fully understand the use case.

My goal was that if a user has installed base/binutils or base/gcc, I wanted 'make buildworld' to work as-is rather than defaulting to building and installing older binaries that overwrote the files installed by the package. For a platform where external GCC becomes the only toolchain I don't think they should have to remember to use 'make CROSS_TOOLCHAIN=foo' every time. The separate files approach also lets a platform only use base/binutils if, for example, clang works, but lld does not.

FYI, as an update I found that this did break a cross-build that didn't use an explicit CROSS_TOOLCHAIN, e.g. make buildworld TARGET_ARCH=i386. I haven't committed this yet or the port changes to add the new files. I'll have to think a bit more about what the right solution is. I'd really like this to be seamless in terms of the base toolchain just being used without having to have an explicit CROSS_TOOLCHAIN.

imp added inline comments.
Makefile.inc1
71

I think we want to gate this on some option like WITH_EXT_TOOLCHAIN so that you don't run afoul of situations where these are installed, but you don't want to use them for some builds.