libtool
[Top][All Lists]
Advanced

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

OS/X Libtool && -bundle


From: Robert Boehne
Subject: OS/X Libtool && -bundle
Date: Thu, 06 Feb 2003 00:46:01 -0600

Hello,

I'm having problems with Mac OS/X in CVS Libtool, and I wonder
if some of you more familiar with the platform could help out.

In an older version of Libtool, a library built with -module is
linked with:
cc -flat_namespace -undefined suppress -o .libs/libdb_tcl-4.2.so *.lo
-lc -dynamiclib -install_name 
/Users/rboehne/testdb/lib/libdb_tcl-4.2.so 

Which works like I'd expect:
[dsl092-075-147:~/db-4.2.8/build_unix] rboehne% file
.libs/libdb_tcl-4.2.so 
.libs/libdb_tcl-4.2.so: Mach-O dynamically linked shared library ppc
[dsl092-075-147:~/db-4.2.8/build_unix] rboehne% ./libtool --version
ltmain.sh (GNU libtool) 1.4.2 (1.922.2.53 2001/09/11 03:18:52)
[dsl092-075-147:~/db-4.2.8/build_unix] rboehne% man ld
[dsl092-075-147:~/db-4.2.8/build_unix] rboehne% /usr/bin/tclsh8.3
% source ../test/test.tcl
% exit


More recent (CVS) Libtool uses a two-step linking process when -module
is present on the Libtool link line, like so:
cc -r -Wl,-bind_at_load -keep_private_externs -nostdlib -o
.libs/libdb_tcl-4.2.so-master.o  .libs/*.o && cc -bundle -flat_namespace
-undefined suppress -o .libs/libdb_tcl-4.2.so .
libs/libdb_tcl-4.2.so-master.o

But this method doesn't seem to work:
[dsl092-075-147:~/new-db-4.2.8/build_unix] rboehne% file
.libs/libdb_tcl-4.2.so
.libs/libdb_tcl-4.2.so: Mach-O bundle ppc
[dsl092-075-147:~/new-db-4.2.8/build_unix] rboehne% ./libtool --version
ltmain.sh (GNU libtool) 1.4e (1.1182 2003/01/29 04:57:52)

Copyright 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
[dsl092-075-147:~/new-db-4.2.8/build_unix] rboehne%  /usr/bin/tclsh8.3
% source ../test/test.tcl
dyld: /usr/bin/tclsh8.3 malformed library: .libs/libdb_tcl-4.2.so (not a
Mach-O library file, bad filetype value)

% exit

It looks to me like this should work, a module should be dlopen-able,
wheras
a Libtool library not built with -module may not.  If I take out the
-module
from the link line, I get .libs/libdb_tcl-4.2.dylib and tclsh is able to
dlopen it.  Part of what really troubles me is that "file" doesn't
return
the same thing on the libraries.  I do notice that "file" gives the same
result I'm getting on all the *.so files under /usr/lib/ though.

So am I supposed to be able to dlopen() a "bundle", and if not, what can
be done with it?  I'm confused.

Thanks,

Robert Boehne




reply via email to

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