I am trying to build a universal APPLE gcc on a MacOS PPC system,
because I want to tweak it to add a couple extra features.
The build fails as already described here:
http://www.cocoabuilder.com/archive/message/cocoa/2005/6/24/139961
The problem seems to be around line 1626 of gcc/configure.ac in both
Apple and FSF versions where the following appears:
if test x$host != x$target
then
CROSS="-DCROSS_COMPILE"
ALL=all.cross
SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)'
case "$host","$target" in
# Darwin crosses can use the host system's libraries and headers,
# because of the fat library support. Of course, it must be the
# same version of Darwin on both sides. Allow the user to
# just say --target=foo-darwin without a version number to mean
# "the version on this system".
*-*-darwin*,*-*-darwin*)
hostos=`echo $host | sed 's/.*-darwin/darwin/'`
targetos=`echo $target | sed 's/.*-darwin/darwin/'`
if test $hostos = $targetos -o $targetos = darwin ; then
CROSS=
SYSTEM_HEADER_DIR='$(NATIVE_SYSTEM_HEADER_DIR)'
with_headers=yes
fi
;;
i?86-*-*,x86_64-*-* \
| powerpc*-*-*,powerpc64*-*-*)
CROSS="$CROSS -DNATIVE_CROSS" ;;
esac
elif test "x$TARGET_SYSTEM_ROOT" != x; then
As far as I can see, the assumption of the test is currently
incorrect and the logic of the test is flawed.
The assumption is incorrect because, MacOS PPC systems do not have
i386 code in their system libraries, only ppc and ppc64. MacOS Intel
system have three way fat libraries with i386, ppc and ppc64 code.
The logic seems to me to be flawed first because it confuses the
build os with the host os on which the compiler being built is
expected to run. Secondly it ignores what comes after "darwin" in
the host and target names. As luck would have it, an FSF build seems
the invoke configure in gcc with host=ppc-apple-darwin8.6.0 and
target=i386-apple-darwin8. The test
if test $hostos = $targetos -o $targetos = darwin ; then
fails and the build succeeds. In the Apple build host gets set to
ppc-apple-darwin8. So the test succeeds and the build fails because
of the missing i386 code in the system libraries.
There is similar code in the configure script of libstdc++.
None of this is a problem on MacOS X Intel. The cross-compilers
build without problems on an Intel Mac.
This has also been reported by someone trying to use the SDKs to
build a cross compiler on Linux which targeted i386 Darwin, I am
afraid I have lost the reference.
Cheers
Bill Northcott