Page MenuHomeFreeBSD

Don't override CC with cmake and CROSS_TOOLCHAIN
Needs ReviewPublic

Authored by brooks on Mar 12 2021, 7:43 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 4:29 PM
Unknown Object (File)
Feb 17 2024, 6:15 AM
Unknown Object (File)
Dec 21 2023, 2:11 PM
Unknown Object (File)
Dec 20 2023, 4:46 AM
Unknown Object (File)
Dec 13 2023, 3:57 PM
Unknown Object (File)
Nov 28 2023, 2:38 PM
Unknown Object (File)
Oct 31 2023, 3:42 PM
Unknown Object (File)
Oct 9 2023, 1:41 PM
Subscribers

Details

Reviewers
bapt
jhb
Group Reviewers
portmgr
Summary

The current native (non-qemu-user-mode) cross build support works by
overriding CC, CXX, etc with versions that build target binaries. This
doesn't work with CMake because it expects that those build native
binaries and that a toolchain file be supplied to build target binaries.

This change includes the toolchain file to get XCC, etc, but doesn't
override CC when USES contains cmake.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 37800
Build 34689: arc lint + arc unit

Event Timeline

With this I've been able to construct a set of changes to llvm-devel to allow it to cross build a dependency-free version of clang which is most of the way to having base/llvm* ports suitable for use with a root fs containing no compiler.

This seems fine to me in terms of how it effects using CROSS_TOOLCHAIN for base/*, but I can't speak to whether or not checking USES directly is the best way to check for cmake.

Doing this we might miss cases where the cmake uses is inherited from a USES (which does not exist in the ports tree - yet ? but is a valid usage)

In D29236#669332, @bapt wrote:

Doing this we might miss cases where the cmake uses is inherited from a USES (which does not exist in the ports tree - yet ? but is a valid usage)

Hmm, an alternative might be do gate this on defined(GNU_CONFIGURE) instead, but I think that also suffers from the implied definition issue since this is so early in bsd.port.mk (actual code doesn't start until after line 1000).

We could also do something gross like adding an && !defined(DONT_OVERRIDE_TOOLCHAIN_FOR_CROSS_TOOLCHAIN). At the moment, I just want something that works since the current code makes it impossible to cross build cmake ports.