[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Darwin & Dynamic modules
Re: Darwin & Dynamic modules
Sun, 16 Sep 2001 16:16:13 +0200
Max Horn wrote:
OK, I think I just found out that this is the reason modules are
not built right on darwin:
# Commands used to build and install a shared archive.
archive_cmds="\$CC \$(test \\"x\$module\\" = xyes && echo -bundle ||
echo -dynamiclib) \$allow_undefined_flag -o \$lib \$libobjs
\$deplibs\$linker_flags -install_name \$rpath/\$soname \$verstring"
Changing the two \\" to \" worked nicely for me. Libtool, with this
change, produces modules now when asked for them.
As Guido noted this is in fact an old problem and has been fixed
before. Unfortunately, it was reintroduced into branch-1-4 and HEAD
when my latest Darwin support patch was merged on September 2nd. The
1.4.1 and 1.4.2 releases are affected by this. Some quotes:
Before (libtool.m4 revision 220.127.116.11):
archive_cmds='$nonopt $(test .$module = .yes && echo -bundle ||
clib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags
$rpath/$soname $(test -n "$verstring" -a x$verstring != x0.0 && echo
My submitted patch:
archive_cmds='$nonopt $(test .$module = .yes && echo -bundle || echo -dynam
iclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags
e $rpath/$soname $verstring'
After (libtool.m4 revision 18.104.22.168):
archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle ||
miclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags
me $rpath/$soname $verstring'
I actually explained in my mail at the time that double quotes don't
work in archive_cmds with zsh, which forced me to move the $verstring
handling to ltmain.sh... I guess that was a case of pre-release
As for the convenience library issue: Gary refused the patch saying
that it breaks the cdemo tests. It was not said on which platform,
but I assume it was Linux. Actually, I was able to reproduce the
failure on my Debian Linux box (potato w/ 2.4 kernel) with branch-1-4
as of Wednesday. After reverting back to a clean copy, running
cdemo-conf and cdemo-make in verbose mode produces these command
lines at the end of cdemo-make (still on Linux):
/bin/sh ./libtool --mode=link gcc -g -O2 -o cdemo main.o libfoo.la
gcc -g -O2 -o cdemo main.o ./.libs/libfoo.al -lm
As I understand it, listing a convenience library on the link command
line is supposed to be equivalent to listing its member objects.
'cdemo/libtool --config' shows that libtool knows the special flags
to accheive this:
For some reason, this is not used in this situation. My conclusion is
that convenience library linking is broken as it is and needs to be
fixed. That the patch that fixes it on Darwin breaks other platforms
is just a symptom of greater breakage.
I'll be happy to provide more information if required.
Hope this helps,
chrisp a.k.a. Christoph Pfisterer "Any sufficiently advanced
address@hidden - http://chrisp.de bug is indistinguishable
PGP key & geek code available from a feature."