This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problematic linking between glibc and shared libgcc



  > 
  > >>>>> "Brad" == Brad Lucier <lucier@math.purdue.edu> writes:
  > 
  >     Brad> I then tried it with gcc-2.95.1 and found out that
  >     Brad> -static-libgcc is not a valid option for that compiler.  So
  >     Brad> people building applications with the new version of gcc
  >     Brad> seems to have the option of doing some configurey to see
  >     Brad> which version of gcc they're using to see how to get this
  >     Brad> right, or tell the use that they better have the directory
  >     Brad> containing libgcc.so in their LD_LIBRARY_PATH.
  > 
  > Correct.

  OK, so let me follow up.  What if I want to build on our Solaris systems an
  existing package that currently uses shared libraries (Perl, say, although I don't 
  know whether it, in particular, uses shared libraries) with gcc-3.0.  The authors
  of that package wouldn't know the future requirement of -static-libgcc
  when they shipped it, so, short of examining and fixing every makefile of
  every package I want to install, or requiring that every person on our
  Solaris systems that wants to use Perl, say, has /pkgs/gcc-3.0/lib, or whatever,
  in their LD_LIBRARY_PATH, I seem to need to put libgcc_s.so in a
  standard place that would normally be found by ld.so.

Correct.  Personally, I don't see the "add this to your
LD_LIBRARY_PATH" thing as too odious, but that's true.

The other alternative is to build these packages with a GCC configured
with --disable-shared (or with one hacked in some other way not to
build a shared libgcc.)  This doesn't have to be your default GCC; it
could just be the one you use to build packages like this with.

Another alternative is to hack your default GCC to use -static-libgcc
by default.  (This is a very simple hack.)

Then you would only get a shared libgcc if you explicitly asked for
it.

  I'm asking this because I'm the faculty member in charge of our computer
  network (and a few specific packages like gcc, binutils, and TeX) and this
  seems like it could get tricky.

Poor you! :-)

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]