Bug 54887 - Liking against an archive doesn't work right.
Liking against an archive doesn't work right.
Product: Red Hat Linux
Classification: Retired
Component: libtool (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jens Petersen
Aaron Brown
Depends On:
  Show dependency treegraph
Reported: 2001-10-22 14:35 EDT by hjl
Modified: 2007-04-18 12:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-12-03 23:17:35 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
A patch (1.06 KB, patch)
2001-10-22 14:35 EDT, hjl
no flags Details | Diff

  None (edit)
Description hjl 2001-10-22 14:35:26 EDT
Liking against an archive doesn't work right when building
a shared library.  For example,

# touch foo.c
# gcc -fPIC -c foo.c
# ar rcvs libfoo.a foo.o
# toiuch bar.c
# gcc -fPIC -c foo.c
# /bin/sh ./libtool --mode=link gcc -o -release 1.0 -L. -lfoo.a

will have

dependency_libs='-L..... -lfoo"

in libbar.la . It is complete bogus.
Comment 1 hjl 2001-10-22 14:35:55 EDT
Created attachment 34582 [details]
A patch
Comment 2 Jens Petersen 2001-10-24 04:06:32 EDT
Not sure I understand the problem completely, but it seems to me that the
"dependency_libs='-L..... -lfoo'" is caused purely because of the "-L." passed
through libtool to gcc.
What do you think the expected bahaviour should be?
Comment 3 hjl 2001-10-24 10:25:34 EDT
It is caused by "-L...  -lfoo" and there is libfoo.a, no libfoo.so.
In that case, the stupid tool decides to add

dependency_libs='-L..... -lfoo"

BTW, the libtool people decide to fix it also. See

Comment 4 Jens Petersen 2001-11-01 04:52:35 EST
Ok. Looks like it needs fixing.  But in order to fix I need to know how to
reproduce it consistently.
Could you give me a working command sequence that reproduces it. I see what
you're saying, but the sequence you originally submitted doesn't work correctly.
Comment 5 hjl 2001-11-01 12:33:22 EST
Check out binutils from CVS on sourceware. Make sure you use
--enable-shared on Linux. Look for which libiberty.a is used
for ld. We want libiberty/libiberty.a, not libiberty/pic/libiberty.a.
Yes, I have fixed it in my Linux binutils.
Comment 6 Jens Petersen 2001-12-03 05:52:53 EST
Fixed in next rawhide package release.
Comment 7 Jens Petersen 2001-12-10 02:56:06 EST
Fixed in libtool-1.4.2-3.
Comment 8 Jens Petersen 2002-02-12 04:14:42 EST
Following the thread under
(Message-ID: <orlme5davr.fsf@free.redhat.lsd.ic.unicamp.br>).
I'm reverting this too in libtool-1.4.2-5.

Note You need to log in before you can comment on or make changes to this bug.