Bug 28962 - building a cross compiler with --disable-multilib fails
Summary: building a cross compiler with --disable-multilib fails
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.0.3
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2006-09-06 14:12 UTC by Adrian Bunk
Modified: 2008-12-28 21:28 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: powerpc64-unknown-linux-gnu (and several others)
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
configure log (948 bytes, text/plain)
2006-09-06 14:13 UTC, Adrian Bunk
Details
make log (30.38 KB, text/plain)
2006-09-06 14:13 UTC, Adrian Bunk
Details
powerpc64-linux/libmudflap/config.log (2.66 KB, text/plain)
2006-09-06 14:15 UTC, Adrian Bunk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Bunk 2006-09-06 14:12:00 UTC
cd /TMP/build-gcc-svn20060906-powerpc64

/TMP/gcc-svn20060906/configure --target=powerpc64-linux --prefix=/usr/local/DIR/gcc-powerpc64-svn20060906 --enable-languages=c --with-as=/usr/local/bin/powerpc64-linux-as --with-ld=/usr/local/bin/powerpc64-linux-ld --disable-shared --enable-threads=single --disable-multilib

make


results in:

<--  snip  -->

...
make[2]: Leaving directory `/TMP/build-gcc-svn20060906-powerpc64/gcc'
Checking multilib configuration for libmudflap...
mkdir -p -- powerpc64-linux/libmudflap
Configuring in powerpc64-linux/libmudflap
configure: creating cache ./config.cache
checking build system type... i686-pc-linux-gnu
checking host system type... powerpc64-unknown-linux-gnu
checking target system type... powerpc64-unknown-linux-gnu
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 powerpc64-linux-strip... powerpc64-linux-strip
checking for --enable-version-specific-runtime-libs... no
checking whether to enable maintainer-specific portions of Makefiles... no
checking for powerpc64-linux-gcc... /TMP/build-gcc-svn20060906-powerpc64/./gcc/x
gcc -B/TMP/build-gcc-svn20060906-powerpc64/./gcc/ -B/usr/local/DIR/gcc-powerpc64
-svn20060906/powerpc64-linux/bin/ -B/usr/local/DIR/gcc-powerpc64-svn20060906/pow
erpc64-linux/lib/ -isystem /usr/local/DIR/gcc-powerpc64-svn20060906/powerpc64-li
nux/include -isystem /usr/local/DIR/gcc-powerpc64-svn20060906/powerpc64-linux/sy
s-include
checking for C compiler default output file name... configure: error: C compiler
 cannot create executables
See `config.log' for more details.
make[1]: *** [configure-target-libmudflap] Error 1
make[1]: Leaving directory `/TMP/build-gcc-svn20060906-powerpc64'
make: *** [all] Error 2

<--  snip  -->


I can workaround this issue with "--disable-libmudflap --disable-libssp".
Comment 1 Adrian Bunk 2006-09-06 14:13:25 UTC
Created attachment 12197 [details]
configure log
Comment 2 Adrian Bunk 2006-09-06 14:13:45 UTC
Created attachment 12198 [details]
make log
Comment 3 Adrian Bunk 2006-09-06 14:15:01 UTC
Created attachment 12199 [details]
powerpc64-linux/libmudflap/config.log
Comment 4 Adrian Bunk 2006-09-06 14:19:57 UTC
Note:
"checking host system type... powerpc64-unknown-linux-gnu" is obviously wrong
 
Comment 5 Andrew Pinski 2006-09-06 16:28:18 UTC
Subject: Re:  [4.0/4.1/4.2 regression] building a
	cross compiler with --disable-multilib fails

On Wed, 2006-09-06 at 14:19 +0000, bunk at stusta dot de wrote:
> 
> ------- Comment #4 from bunk at stusta dot de  2006-09-06 14:19 -------
> Note:
> "checking host system type... powerpc64-unknown-linux-gnu" is obviously wrong

No it is not.

-- Pinski

Comment 6 Andrew Pinski 2006-09-06 16:32:23 UTC
/usr/local/DIR/gcc-powerpc64-svn20060906/powerpc64-linux/sys-include -O2 -g -O2    conftest.c  >&5
/usr/local/bin/powerpc64-linux-ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status


That means you don't have binutils/glibc installed correctly.
And this is not a regression anyways.
Comment 7 Adrian Bunk 2006-09-06 17:22:41 UTC
I don't have a glibc for this target.

But this might be where my problems are coming from:

I am able to compile gcc 4.1.1 for at about a dozen targets without having any libc for these targets present. And the resulting compilers work fine for my purposes (cross-compiling Linux kernels).

But the configure options I had to figure out for doing this seem to indicate that this is a working but not documented setup.

It seems sending a bug report for part of this wasn't the right solution.

Is there a good reason why gcc can't officially support being built without a libc by either figuring out that there's no libc itself or by offering some kind of --i-do-not-have-a-libc option to configure?

Comment 8 Andrew Pinski 2006-09-13 06:23:21 UTC
(In reply to comment #7)
> Is there a good reason why gcc can't officially support being built without a
> libc by either figuring out that there's no libc itself or by offering some
> kind of --i-do-not-have-a-libc option to configure?

Yes because you are configuring wrong in the first place.
Try looking at what crosstool does for how to build a cross compiler.
http://kegel.com/crosstool/
Comment 9 Andrew Pinski 2008-12-28 21:28:22 UTC
You should disable libmudflap and libssp (in newer gcc's) if you want to build a cross compiler to start stage1.