HomeFreeBSD

Makefile.inc1: override MACHINE for native-xtools

Description

Makefile.inc1: override MACHINE for native-xtools

For the final step of the native-xtools target, "everything" is built
with TARGET and TARGET_ARCH set to the architecture we wish to
cross-build for. However, CROSSENV overwrites the values of MACHINE and
MACHINE_ARCH, setting them to be identical to TARGET and TARGET_ARCH.
For native-xtools this is undesirable since we are building binaries to
run on the host architecture, that can cross compile for the target
architecture.

When building native-xtools for RISC-V, this issue manifests as an invalid
argument for "-march". The compiler is invoked with the target triple of the
host architecture, but the CFLAGS inherited from bsd.cpu.mk are that of the
target architecture.

Reviewed by: imp, bdrewery
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D23838

Details

Provenance
mhorneAuthored on
Reviewer
imp
Differential Revision
D23838: Makefile.inc1: override MACHINE for native-xtools
Parents
rS359288: Only call panic when building with INVARIANTS.
Branches
Unknown
Tags
Unknown