GCC downgrade problems

2.1k views Asked by At

I'm trying to build from source compiler for Cyclone programming language. I'm running 32-bit Ubuntu 12.04 with GCC 4.6.3 install by default.

But make fails due to crash in bootstrap utility. To workaround this I'm trying to install older GCC version.

I've patched /etc/apt/sources.list and installed gcc-3.3 and g++-3.3 using apt-get. But configure script fails when it is forced to use GCC 3.3:

$ export CC=gcc-3.3
$ export CXX=g++-3.3
$ ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... gcc-3.3
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.

And config.log shows:

...
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: cannot find -lgcc_s
...

Version of ld is 2.22

3

There are 3 answers

0
Aaron Digulla On

apt-file search crt1.o shows you which packages contain this file. If it doesn't print anything, run apt-file update once.

0
Brooks Moses On

As michel mentioned, you can do this to get the older GCC to bootstrap:

export LIBRARY_PATH=/usr/lib/i386-linux-gnu

for whereever the crt1.o file is on your system -- on mine, it's in /usr/lib32.

Then, once you've built a working GCC, you can symlink (or copy) crt1.o, crti.o, and crtn.o into the ${prefix}/lib/gcc/... directory for the newly-built compiler, and you won't need to set LIBRARY_PATH when you use it. Look for the crtstart.o file or things like it, and that's the right directory to put the symlinks into,.

0
michel On

I've had this same issue too. The libc6-dev package provides the crt1.o file but it is installed in a non standard directory for gcc. This is so to support 32 bit and 64 bit programs on the same host.

To fix the issue, I've setup the following environment variable:

export LIBRARY_PATH=/usr/lib/i386-linux-gnu