Ubuntu 11.04: Installing GCC 4.4.6

gccubuntu-11.04

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.

Best Answer

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!