[Top][All Lists]

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

shared library creation versus custom gcc specs file

From: Chris McCraw
Subject: shared library creation versus custom gcc specs file
Date: Thu, 20 Jan 2005 18:38:02 -0600
User-agent: Mutt/1.5.6i

this problem potentially has much wider scope than my title might indicate,
but i have just spent a day debugging this situation.

i am perhaps insanely trying to build kde on solaris 9, and i am trying
to do it in such a way that it is self-contained except for references
to system libraries in /lib, /usr/lib, and /usr/openwin/lib.  this has
required me to build a lot of auxiliary libraries like zlib, libpng, etc.
i have stuck all of these companion libraries into /lusr/kde3, which will
eventually be the destination of my kde installation.

to use these new libraries in preference to the ones that may already be
installed (/usr/local/lib/ for instance) without modifying the
system default shared library search path (which i cannot do), i have
been using the -R (aka -rpath) flag to gcc to point the linker in the
right direction.

this works great, except when creating shared libraries with libtool.
for some reason, probably a good one but in this case ill-fated, when
libtool links a shared a library, it ignores my $CFLAGS, wherein i point
gcc to a custom specs file which contains my -R / -L directives.  i remedy
the situation by hacking the libtool script to include
"-specs /path/to/my/specsfile" after both occurrences of "-shared", which
works fine.

my initial thought was to set $LDFLAGS to "-specs ..." but then configure
bails out since i cannot use the trick in the specs file that i am
using to create a new RPATH search list twice--
        gcc -specs file -specs file
just bombs out, and gcc is not to blame (except perhaps for making it
so difficult to redefine things like "how we link binaries").

so the questions:  is this intentional?  is there some way to get around
this other than kludging each libtool instance?  i realize my environment
and needs are non-mainstream, but it took quite a bit of debugging to
figure out why libtool linked my binaries fine (ie, not ignoring my $CFLAGS)
but not my shared libs.  if you've never had the joy of reading the output
of ld --verbose, allow me to disrecommend it :/

thanks in advance!

chris mccraw | unix wrangler | university of texas @austin, computer sciences

reply via email to

[Prev in Thread] Current Thread [Next in Thread]