Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Apr 2015 20:17:48 -0700
From:      Mark Millard <markmi@dsl-only.net>
To:        Warner Losh <imp@bsdimp.com>
Cc:        FreeBSD Toolchain <freebsd-toolchain@freebsd.org>, FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>
Subject:   Re: Shorter report: powerpc64-xtoolchain-gcc use fails from powerpc (non-64)
Message-ID:  <D7A0BB9E-1FCA-4D33-8C41-B4E915A8B3E6@dsl-only.net>
In-Reply-To: <83AB15DC-4B96-489D-A74B-84A552050785@bsdimp.com>
References:  <BB07709E-A5D3-458A-8ED7-61E64103A43C@dsl-only.net> <B49E8B91-B8C2-4F0C-9662-8814C16041A4@bsdimp.com> <7AF12D5F-F4A0-429E-AEAE-4AEF2D35FE31@dsl-only.net> <83AB15DC-4B96-489D-A74B-84A552050785@bsdimp.com>

index | next in thread | previous in thread | raw e-mail

[I've omitted history going in a different direction than this note.]


On 2015-Apr-1, at 02:49 PM, Warner Losh <imp at bsdimp.com> wrote:

> 
> On Apr 1, 2015, at 4:37 PM, Mark Millard <markmi@dsl-only.net> wrote:
> 
>> From a powerpc (non-64) 11.0-CURRENT boot is the following supposed to work by producing a powerpc64 appropriate result (no CROSS_TOOLCHAIN for this question)?
>> 
>> make buildworld buildkernel KERNCONF=GENERIC64 TARGET=powerpc TARGET_ARCH=powerpc64
> 
> This should work, modulo broken compilers.
> 
>> The standard v4.2.1 /usr/bin/gcc in a powerpc context (non-64) for that make command would produce files for TARGET_ARCH=powerpc unless the command lines specified otherwise.
> 
> Ah, so it is a ‘cross build’ situation...
> 
>> Notably the build environment is picking powerpc64 specific paths when appropriate, such as:
>> 
>> lib/csu/powerpc64/Makefile
>> 
>> so that specific Makefile is not likely to be used when powerpc64 handling is inappropriate, even executed from from a powerpc (non-64) context. A different path (and so a distinct Makefile) would be used for KERNCONF=GENERIC TARGET_ARCH=powerpc .


After some experimentation I think that I've learned that I'd not guessed the existence of a required step to enable "make buildkernel KERNCONF=GENERIC64 TARGET=powerpc TARGET_ARCH=powerpc64" from powerpc: one first must do a...

make kernel-toolchain KERNCONF=GENERIC64 TARGET=powerpc TARGET_ARCH=powerpc64

before trying buildkernel. Similarly if buildworld is going to be done then

make toolchain KERNCONF=GENERIC64 TARGET=powerpc TARGET_ARCH=powerpc64

should be done first.

These put in place a tailored gcc 4.2.1 build into the appropriate part of the /usr/obj/... tree and once it exists the path used during make picks up the sub-tree-specific gcc 4.2.1.

The defaults for this tree-specific gcc do not require command line options to specify the default context for the special TARGET_ARCH.

Similarly for building for powerpc from powerpc64.

===
Mark Millard
markmi at dsl-only.net



help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D7A0BB9E-1FCA-4D33-8C41-B4E915A8B3E6>