Shorter report: powerpc64-xtoolchain-gcc use fails from powerpc (non-64)
Mark Millard
markmi at dsl-only.net
Thu Apr 2 03:17:58 UTC 2015
[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 at 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
More information about the freebsd-ppc
mailing list