Error when building GCC 4.7.1 on hppa2.0-unknown-linux-gnu

Kai Ruottu kai.ruottu@wippies.com
Thu Jul 5 12:08:00 GMT 2012


5.7.2012 12:36, Vincent Lefevre kirjoitti:
> I wanted to build GCC 4.7.1 with:
>
> $ ~/gcc-4.7.1/configure --prefix=$HOME/sw/gcc-4.7.1 --disable-tls --enable-languages=c --with-gmp=/opt/cfarm/gmp-latest --with-mpfr=/opt/cfarm/mpfr-latest --with-mpc=/opt/cfarm/mpc-latest
>
> but got the following error:
>
> /home/vinc17/gcc-obj/./gcc/cc1: error while loading shared libraries: libmpc.so.2: cannot open shared object file: No such file or directory
> So, it cannot find "libmpc.so.2".
>
> But in /opt/cfarm/mpc-latest/lib/ there is:
> -rw-r--r-- 1 iulius cfarm 150030 Jun 18 22:50 libmpc.a
> -rwxr-xr-x 1 iulius cfarm   1148 Jun 18 22:50 libmpc.la
> lrwxrwxrwx 1 iulius cfarm     15 Jun 18 22:50 libmpc.so -> libmpc.so.2.0.0
> lrwxrwxrwx 1 iulius cfarm     15 Jun 18 22:50 libmpc.so.2 -> libmpc.so.2.0.0
> -rwxr-xr-x 1 iulius cfarm  95959 Jun 18 22:50 libmpc.so.2.0.0
>
> Where does the problem come from?
>

It comes from you not knowing where executables will search for the 
shared libraries
they need :-(   Are you really sure that you have added 
'/opt/cfarm/mpc-latest/lib'
into the search path for the (runtime) dynamic linker?

The '--with-*' options only advice the compile time linker to find the 
right libraries
but don't do anything for the runtime situation...

My thought is that gmp, mpfr and mpc are aimed to be built to be an 
additional
part of the development/runtime system if built separately, if they are 
built with
the GCC sources then they are aimed to be "only for GCC".  I myself 
prefer to use
the latter approach although it makes the GCC build process longer when gmp,
mpfr and gmp are built from their sources each time.

That they would be built with the GCC sources means in your case providing
symlinks or links :

   gcc-4.7.1/gmp ->  $src/gmp-latest
   gcc-4.7.1/gmp ->  $src/mpfr-latest
   gcc-4.7.1/gmp ->  $src/mpc-latest

to point to their main src directories as subdirs 'gmp', 'mpfr' and 
'mpc' in the
main gcc-4.7.1 sources....




More information about the Gcc-help mailing list