2
votes

I am trying to install GCC 4.4.6 on Ubuntu 11.04 64 bit and having some trouble. As the package does not ship with this distribution I try to build it from source. It needs GMP and MPFR which I installed from the package system. I am using distinct source, build and install directories as advised. Target=build=host.

Except --prefix I do not give any configure options:

gcc-4.4.6/configure --prefix=[absolute_path]/install/gcc-4.4.6

These environment variables are also used:

CXX=/usr/bin/g++-4.4
CC=/usr/bin/gcc-4.4

since (gcc and g++ default to 4.5 which is also installed)

make produces the following error (it seems after the bootstrap compiler was built) when it comes to compile gcc-4.4.6/libgcc/../gcc/libgcc2.c

/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory

The filename might suggest that this is a 64/32 bit issue. Is there something to consider when building GCC on a 64 bit machine?

The config.log says:

uname -m = x86_64
uname -r = 2.6.38-11-generic
uname -s = Linux
uname -v = #50-Ubuntu SMP Mon Sep 12 21:17:25 UTC 2011

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
hostinfo               = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin

-----------

Core tests.

-----------

configure:1563: checking build system type configure:1581: result: x86_64-unknown-linux-gnu configure:1616: checking host system type configure:1630: result: x86_64-unknown-linux-gnu configure:1638: checking target system type configure:1652: result: x86_64-unknown-linux-gnu configure:1696: checking for a BSD-compatible install configure:1762: result: /usr/bin/install -c configure:1773: checking whether ln works configure:1795: result: yes configure:1799: checking whether ln -s works configure:1803: result: yes configure:3002: checking for gcc configure:3028: result: /usr/bin/gcc-4.4 configure:3274: checking for C compiler version configure:3277: /usr/bin/gcc-4.4 --version &5 gcc-4.4 (Ubuntu/Linaro 4.4.5-15ubuntu1) 4.4.5 Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

1
GCC 4.4.6 is packaged in the upcoming Ubuntu release 11.10 (Oneiric). Perhaps upgrade or just try to install the packages from that release on your machine?Philipp Wendler
Upgrading to the newest distribution just for a compiler version doesn't sound very attractive. There might be too many side effects. And relying on the package system until a specific version becomes available doesn't convince me neither. It should be possible to build a specific version when needed.ritter
Sure, you're absolutely right. I just wanted to give you a possible workaround in case you don't find a better solution.Philipp Wendler
As this question is not implementation specific, you should try superuser or even askubuntu.mbx
@mbx Building gcc from source is something much more likely to be answered by a programmer than anyone else. It also falls under "tools commonly used by programmers" so it's on topic here.Bill the Lizard

1 Answers

1
votes

The problem is a missing package: "libc6-dev-i386"

apt-file update

apt-file search stubs-32.h

libc6-dev-i386: /usr/include/gnu/stubs-32.h

apt-get install libc6-dev-i386

That solves it!