Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set gcc 4.3 default specs file?

Tags:

c++

c

gcc

gcc4

When using gcc version 4.3.2, I see how to generate specs using:

$ /usr/local/gcc-4.3.2/bin/gcc -v
Using built-in specs

Now changing to the same directory as libgcc:

cd /usr/local/gcc-4.3.2/lib/gcc/x86_64-unknown-linux-gnu/4.3.2
/usr/local/gcc-4.3.2/bin/gcc -dumpspecs > specs

I have a populated specs file that I can modify. However, once that is done I still see that:

$ /usr/local/gcc-4.3.2/bin/gcc -v
Using built-in specs

How do I tell gcc to use that specs file by default rather than forcing me to pass a -specs parameter every compile? I would like it to match another system I have where I get the following:

$ /usr/local/gcc-4.3.2/bin/gcc -v
Reading specs from /usr/local/gcc-4.3.2/lib/gcc/i686-pc-linux-gnu/4.3.2/specs</code>

As you can see, the major difference between the two systems is that the existing setup is 32-bit and I am now trying to match that on a 64-bit system. The version of Linux is otherwise the same and I am compiling the same version of gcc. (With both systems gcc 4.3.2 is the second gcc installation, with 4.1.2 being used to compile 4.3.2)

like image 667
Gary Avatar asked Apr 25 '11 12:04

Gary


1 Answers

As hinted at by the strace suggestion by Johannes Schaub - litb, it was a problem with where the compiler was looking for the file. As it turns out, the non-working installation had an environment variable set in the .bashrc that was causing the confusion.

The correct location for the specs file is indeed the same directory that libgcc is in. Just be sure you're looking there.

like image 171
Gary Avatar answered Sep 17 '22 09:09

Gary