[Top][All Lists]

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

Re: Inter-library dependencies

From: Carlo Wood
Subject: Re: Inter-library dependencies
Date: Mon, 23 Oct 2000 00:07:37 +0200
User-agent: Mutt/1.1i

On Sun, Oct 22, 2000 at 10:51:12AM -0600, Wesley W. Terpstra wrote:
> All of what you have just described should already work under the newest 
> libtool.

I'll double check that it doesn't work with 1.3.5, then upgrade
libtool to the latest cvs version and check again.

First for 1.3.5 thus:

> Try getting the version out of cvs and seeing if that solves your
> problems. Also check that you are compiling with commands roughly like:
> libtool c++ -Wall -O2 -g -c cwd.c -o cwd.lo

/bin/sh ./libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I- -I./include 
-I../libcw/src/libcwd/include -DDEBUG    -g -fno-exceptions -pipe -Wall 
-Woverloaded-virtual -Wundef -Wpointer-arith -Winline -Wwrite-strings -Werror 
-c ../libcw/src/libcwd/
which executes:
g++ -DHAVE_CONFIG_H -I. -I- -I./include -I../libcw/src/libcwd/include -DDEBUG 
-g -fno-exceptions -pipe -Wall -Woverloaded-virtual -Wundef -Wpointer-arith 
-Winline -Wwrite-strings -Werror -Wp,-MD,.deps/type_info.pp -c 
../libcw/src/libcwd/  -fPIC -DPIC -o type_info.lo

That seems correct.

> libtool c++ -Wall -O2 -g -rpath /usr/lib -o cwd.lo -ldl -lbfd

/bin/sh ./libtool --mode=link g++  -g -fno-exceptions -pipe -Wall 
-Woverloaded-virtual -Wundef -Wpointer-arith -Winline -Wwrite-strings -Werror  
-o -rpath /usr/local/lib -version-info 99:4:99 bfd.lo debug.lo 
debugdebugcheckpoint.lo debugmalloc.lo demangle.lo printcw.lo strerrno.lo 
type_info.lo utils/ -lbfd -liberty -ldl 
which executes:
gcc -shared  bfd.lo debug.lo debugdebugcheckpoint.lo debugmalloc.lo demangle.lo 
printcw.lo strerrno.lo type_info.lo -Wl,--whole-archive utils/.libs/ 
-Wl,--no-whole-archive  -lbfd -liberty -ldl -lc  -Wl,-soname -Wl, -o 

I am afraid that -liberty got linked in:

~/c++/libcw-objdir/.libs>nm | grep xmalloc
00036a30 T xmalloc
00036a20 T xmalloc_set_program_name

while libiberty.a is a static library, not compiled with -fPIC.
This is bad.  For the rest it looks conceptually like your line.

> libtool c++ -Wall -O2 -g -c cw.c -o cw.lo

/bin/sh ./libtool --mode=compile g++  -I. -I- -I./include 
-I../../../libcw/src/libcw/include    -DDEBUG -g -fno-exceptions -pipe -Wall 
-Woverloaded-virtual -Wundef -Wpointer-arith -Winline -Wwrite-strings -Werror 
which executes:
g++ -I. -I- -I./include -I../../../libcw/src/libcw/include -DDEBUG -g 
-fno-exceptions -pipe -Wall -Woverloaded-virtual -Wundef -Wpointer-arith 
-Winline -Wwrite-strings -Werror -Wp,-MD,.deps/version.pp -c  -fPIC 
-DPIC -o version.lo

This is equivalent with the above

> libtool c++ -Wall -O2 -g -rpath /usr/lib -o cw.lo

/bin/sh ./libtool --mode=link g++  -DDEBUG -g -fno-exceptions -pipe -Wall 
-Woverloaded-virtual -Wundef -Wpointer-arith -Winline -Wwrite-strings -Werror  
-o -rpath /usr/local/lib -version-info 0:0:0 version.lo 
crosslink/ io/ kernel/ llists/ 
net/ ../libcwd/ 
which executes:
libtool: link: error: cannot link shared libraries into libtool libraries

Duh.  Well, you said that it was supported in 1.4, not 1.3.5.

> c++ -Wall -O2 -g -c mytest.c -o mytest.o
> libtool c++ -Wall -O2 -g -o mytest mytest.o

Surely you mean: libtool c++ -Wall -O2 -g -o mytest mytest.o
Note the ->

> PS. I've moved my reply from 'libtool-patch' to 'libtool' b/c there is no
> patch under discussion.


> Wesley W. Terpstra <address@hidden>
> Javien Canada Inc. - Linux Developer

Thanks, I'll follow up with the results under 1.4-to-be tomorrow.

Carlo Wood <address@hidden>                        -=- Jesus Loves you -=-

reply via email to

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