Pregunta

I build gcc 4.6.1 and when I run ldconfig it comes back with this result:

ldconfig: /usr/local/mpc/lib/libmpc.so.2 is not a symbolic link

ldconfig: /usr/local/gmp/lib/libgmp.so.3 is not a symbolic link

ldconfig: /usr/local/mpfr/lib/libmpfr.so.1 is not a symbolic link

Here is how I built gcc using the libraries:

tar jxf gmp-4.3.2.tar.bz2
cd gmp-4.3.2/
./configure --prefix=/usr/local/gmp
make
make install
cd ..

tar jxf mpfr-2.4.2.tar.bz2
cd mpfr-2.4.2/
./configure --prefix=/usr/local/mpfr --with-gmp=/usr/local/gmp
make
make install 
cd ..

tar xzf mpc-0.8.1.tar.gz
cd mpc-0.8.1
./configure --prefix=/usr/local/mpc --with-mpfr=/usr/local/mpfr --with-gmp=/usr/local/gmp
make
make install
cd ..

tar jxf gcc-4.6.1.tar.bz2
cd gcc-4.6.1
./configure --prefix=/usr/local/gcc --enable-threads=posix --disable-checking -disable-multilib --enable-languages=c,c++ --with-gmp=/usr/local/gmp --with-mpfr=/usr/local/mpfr/ --with-mpc=/usr/local/mpc/

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mpc/lib:/usr/local/gmp/lib:/usr/local/mpfr/lib/
make
make install

cp gcc.4.6.1.conf /etc/ld.so.conf.d/gcc.4.6.1.conf
ldconfig
mv /usr/bin/gcc  /usr/bin/gcc_old
mv /usr/bin/g++  /usr/bin/g++_old
ln -s -f /usr/local/gcc/bin/gcc  /usr/bin/gcc
ln -s -f /usr/local/gcc/bin/g++  /usr/bin/g++

cp /usr/local/gcc/lib64/libstdc++.so.6.0.16 /usr/lib64/.
mv /usr/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so.6.bak
ln -s -f /usr/lib64/libstdc++.so.6.0.16 /usr/lib64/libstdc++.so.6

Please say I don't need to rebuild gcc! Is this symbolic link problem something that can really affect a program? Or will it not make any difference, it does pop up every now and again, for instance when I was yum install certain things as well. Thanks in advance.

¿Fue útil?

Solución

I fixed this problem by installing gmp, mpc, and mpfr with the ./contrib/download_prerequisites command, which downloads the required files and sets up symbolic links during the install process.

My whole build was:

tar -xzvf gcc-4.6.2.tar.gz
cd gcc-4.6.2
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-4.6.2/configure --prefix=/opt/gcc-4.6.2 
make
make install

ldconfig
mv /usr/bin/gcc  /usr/bin/gcc_old
mv /usr/bin/g++  /usr/bin/g++_old
ln -s -f /usr/local/gcc/bin/gcc  /usr/bin/gcc
ln -s -f /usr/local/gcc/bin/g++  /usr/bin/g++

cp /usr/local/gcc/lib64/libstdc++.so.6.0.16 /usr/lib64/.
mv /usr/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so.6.bak
ln -s -f /usr/lib64/libstdc++.so.6.0.16 /usr/lib64/libstdc++.so.6
export CC=gcc
export CXX=g++

I don't know how to fully link the CC and CXX variables to the new gcc and g++, but it works!

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top