Re: Building G.C.C 4.3.3 on Centos 5.5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



12.3.2012 10:25, Moran Smith kirjoitti:
Hello,

I'm trying to build gcc-4.3.3 (C, C++) on a CentOS 5.5 system (gcc 4.1.2).
But I'm hitting an error I don't know how to deal correct.

Configure:

/worktable/gcc-4.3.3/configure --program-suffix=-4.3.3
--enable-version-specific-runtime-libs --enable-languages=c,c++
--disable-nls --with-mpfr=/usr/local
--with-mpfr-include=/usr/local/include --with-mpfr-lib=/usr/local/lib

This issue has been discussed many times on this list but answering
once more (how I see it) shouldn't hurt...

The 'gmp', 'mpfr', 'mpc' and 'ppl' libraries could be thought as
equivalents to 'curses', 'termcap' etc. "extra libraries", some
executables may require them when being linked and when being run.
The assumption is that the underlying system provides them, not
necessarily as default but with extra installable packages. But
CentOS 5.x doesn't seem to provide 'mpfr', 'mpc' nor 'ppl' libs
as extra RPMS and so you are trying to provide 'mpfr' yourself.
The newer GCCs will require 'gmp', 'mpfr' and maybe 'mpc' as
linkable static or shared libraries at link-time and if linked
against the shared ones, also at run-time!

You seem to have built and installed 'mpfr' yourself and put it
into '/usr/local/...' and expect all executables finding it there
automagically without any extra actions! That is your mistake,
things in '/usr/local/lib' will not be found automagically via
the "dynamic linker" aka "program interpreter", in your case the
'/lib/ld-linux-x86_64.so.2'!  The '--with-...' stuff only tells
what to use at link-time, not what to use at run-time :-(  When
building and installing separately, the assumption is to produce
and install also the shared libraries...

If your aim was to add 'mpfr' libs to be a local addition into
the CentOS 5.5, then at least adding '/usr/local/lib' to be the
place for ALL the local runtime-library additions must be done
once, it cannot be "automatic" in any somehow safe system...

If your aime was to provide 'mpfr' ONLY for the gcc-4.3.3 you
was building, then your method was wrong! In this case you
should have provided the 'mpfr' sources to be one part in the
gcc-4.3.3 sources. Usually one unpacks both the GCC sources
and the mpfr sources onto the same directory and then symlinks
the mpfr-x.y.z sources to appear as a 'mpfr' subdir in the main
GCC sources dir, in your case you should have had 'gcc-4.3.3/mpfr'
in your GCC sources!  In this scheme only the static '.a' libs
will be produced and linked statically into the executables.
Then the executables will not require the shared ones at run-time!

Please check what the :

  ldd /worktable/gcc-4.3.3-objdir/gcc/xgcc
  ldd /worktable/gcc-4.3.3-objdir/gcc/cc1
  ldd /worktable/gcc-4.3.3-objdir/gcc/cc1plus

etc. will now say about the shared libs required at runtime!


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux