Bug 26628 - Build fails trying to run ppc64 binaries on powerpc-apple-darwin8.5.0
Summary: Build fails trying to run ppc64 binaries on powerpc-apple-darwin8.5.0
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.1.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2006-03-10 02:49 UTC by Malcolm Purvis
Modified: 2006-04-29 23:18 UTC (History)
1 user (show)

See Also:
Host: powerpc-apple-darwin8.5.0
Target: powerpc-apple-darwin8.5.0
Build: powerpc-apple-darwin8.5.0
Known to work:
Known to fail:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Malcolm Purvis 2006-03-10 02:49:02 UTC
I've been trying to build the official 4.1.0 release on my G3 and G4 MacOS 10.4.5 systems with the configure command:

$ ../gcc-4.1.0/configure --prefix=/Users/malcolmp/prefix/gcc-4.1-world

This eventually fails when trying to build libstdc++-v3.  The last few lines of output are:

dding multilib support to Makefile in ../../../gcc-4.1.0/libstdc++-v3
Running configure in multilib subdirs ppc64
pwd: /Users/malcolmp/src/objdir/powerpc-apple-darwin8.5.0/libstdc++-v3
Running configure in multilib subdir ppc64
pwd: /Users/malcolmp/src/objdir/powerpc-apple-darwin8.5.0
mkdir ppc64
configure: creating cache ./config.cache
checking build system type... powerpc-apple-darwin8.5.0
checking host system type... powerpc-apple-darwin8.5.0
checking target system type... powerpc-apple-darwin8.5.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for powerpc-apple-darwin8.5.0-gcc... /Users/malcolmp/src/objdir/./gcc/xgcc -B/Users/malcolmp/src/objdir/./gcc/ -B/Users/malcolmp/prefix/gcc-4.1-world/powerpc-apple-darwin8.5.0/bin/ -B/Users/malcolmp/prefix/gcc-4.1-world/powerpc-apple-darwin8.5.0/lib/ -isystem /Users/malcolmp/prefix/gcc-4.1-world/powerpc-apple-darwin8.5.0/include -isystem /Users/malcolmp/prefix/gcc-4.1-world/powerpc-apple-darwin8.5.0/sys-include -m64
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
make[1]: *** [configure-target-libstdc++-v3] Error 1
make: *** [all] Error 2

It looks like configure is performing a test compile with 'xgcc -m64' and trying to run the result.  Obviously this fails on these 32-bit cpus.

The same source and the same configure flags builds without error on my 10.4.5 G5 system.
Comment 1 Andrew Pinski 2006-03-10 02:52:27 UTC
Use --disable-multilib.
Comment 2 Malcolm Purvis 2006-03-10 08:40:08 UTC
(In reply to comment #1)
> Use --disable-multilib.

This has fixed the problem.  Thank you.

However, I would query the determination that this is not a bug.  I don't expect the default configuration of a common system in an official release to fail.  Either multilib should be disabled by default for this target or special mention  of be made in INSTALL/specific.html (as I have subsequently discovered the case for mips-sgi-irix6 and sparc-sun-solaris2*).
Comment 3 Jason Titus 2006-04-29 23:18:59 UTC
Just wasted a day or so on this as well.  Sure seems like a bug to me.  Why should it auto-detect which CPU it is building upon and then attempt to build a compiler that is guaranteed to break?

Does it attempt to execute code for other cross compiler targets?