[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Several Darwin fixes
From: |
Christoph Pfisterer |
Subject: |
Several Darwin fixes |
Date: |
Thu, 30 Aug 2001 19:56:14 +0200 |
Hi!
Here are patches to fix two issues with Darwin / Mac OS X.
Issue number one is the new linker that will be shipped with Mac OS X
10.1 next month. Apple has introduced a new namespace model to
improve performance. The new 'two-level namespace' requires that all
symbols can be resolved at link time. That means that '-undefined
suppress' only works when 'flat namespace' is explicitly selected
through an option. The patch adds that option for Darwin 1.3 (a.k.a.
Mac OS X 10.0, where the option will do no harm) and later (where it
will be needed). Libraries that want to take advantage of the
two-level namespace should use -no-undefined and list all
inter-library dependencies.
Issue number two is zsh's quoting again. The Darwin support uses some
$verstring trickery to use Mach-O version numbers. Since libtool may
reset that to "" or "0.0", there is a check in $archive_cmds. As it
turns out, that test fails miserably, but that only shows when
-release is used without -version-info. Actually, testing $verstring
in $archive_cmds is impossible because $verstring can contain spaces
and quoting doesn't work with zsh. The patch fixes that by resetting
$verstring to "" instead of "0.0" when $version_type is "darwin".
Here's the patch for branch-1-4:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/libtool/libtool/ChangeLog,v
retrieving revision 1.922.2.27
diff -u -r1.922.2.27 ChangeLog
--- ChangeLog 2001/08/18 22:31:47 1.922.2.27
+++ ChangeLog 2001/08/30 17:41:37
@@ -1,3 +1,8 @@
+2001-08-30 Christoph Pfisterer <address@hidden>
+
+ * libtool.m4, ltmain.in: Linker flag and version numbering fixes
+ for Darwin.
+
2001-08-18 Brad <address@hidden>
* ltmain.in: Do not remove -lm from deplibs for OpenBSD.
Index: libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/libtool.m4,v
retrieving revision 1.166.2.16
diff -u -r1.166.2.16 libtool.m4
--- libtool.m4 2001/08/05 16:48:33 1.166.2.16
+++ libtool.m4 2001/08/30 17:41:40
@@ -1537,11 +1537,18 @@
;;
darwin* | rhapsody*)
- allow_undefined_flag='-undefined suppress'
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ allow_undefined_flag='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ allow_undefined_flag='-flat_namespace -undefined suppress'
+ ;;
+ esac
# FIXME: Relying on posixy $() will cause problems for
# cross-compilation, but unfortunately the echo tests do not
# yet detect zsh echo's removal of \ escapes.
- archive_cmds='$nonopt $(test .$module = .yes && echo -bundle ||
echo -dynam
iclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags
-install_nam
e $rpath/$soname $(test -n "$verstring" -a x$verstring != x0.0 &&
echo $verstrin
g)'
+ archive_cmds='$nonopt $(test .$module = .yes && echo -bundle ||
echo -dynam
iclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags
-install_nam
e $rpath/$soname $verstring'
# We need to add '_' to the symbols in $export_symbols first
#archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
hardcode_direct=yes
Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/ltmain.in,v
retrieving revision 1.259.2.6
diff -u -r1.259.2.6 ltmain.in
--- ltmain.in 2001/08/18 22:31:47 1.259.2.6
+++ ltmain.in 2001/08/30 17:41:43
@@ -2333,6 +2333,16 @@
if test -z "$vinfo" && test -n "$release"; then
major=
verstring="0.0"
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+ verstring=""
+ ;;
+ *)
+ verstring="0.0"
+ ;;
+ esac
if test "$need_version" = no; then
versuffix=
else
And a (hopefully correct) patch for HEAD:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/libtool/libtool/ChangeLog,v
retrieving revision 1.1026
diff -u -r1.1026 ChangeLog
--- ChangeLog 2001/08/19 20:20:25 1.1026
+++ ChangeLog 2001/08/30 17:52:56
@@ -1,3 +1,8 @@
+2001-08-30 Christoph Pfisterer <address@hidden>
+
+ * libtool.m4, ltmain.in: Linker flag and version numbering fixes
+ for Darwin.
+
2001-08-19 Ossama Othman <address@hidden>
* libtool.m4 (AC_LIBTOOL_LANG_CXX_CONFIG): Corrected and improved
Index: libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/libtool.m4,v
retrieving revision 1.219
diff -u -r1.219 libtool.m4
--- libtool.m4 2001/08/19 20:20:25 1.219
+++ libtool.m4 2001/08/30 17:53:00
@@ -4394,11 +4394,19 @@
;;
darwin* | rhapsody*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace
-undefined sup
press'
+ ;;
+ esac
+
# FIXME: Relying on posixy $() will cause problems for
# cross-compilation, but unfortunately the echo tests do not
# yet detect zsh echo's removal of \ escapes.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC $(test .$module = .yes &&
echo -bund
le || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs
$deplibs$linker_f
lags -install_name $rpath/$soname $(test -n "$verstring" -a x$verstring != x0.0
&& echo $verstring)'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC $(test .$module = .yes &&
echo -bund
le || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs
$deplibs$linker_f
lags -install_name $rpath/$soname $verstring'
# We need to add '_' to the symbols in $export_symbols first
#_LT_AC_TAGVAR(archive_expsym_cmds,
$1)="$_LT_AC_TAGVAR(archive_cmds, $1)
"' && strip -s $export_symbols'
_LT_AC_TAGVAR(hardcode_direct, $1)=yes
Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/ltmain.in,v
retrieving revision 1.272
diff -u -r1.272 ltmain.in
--- ltmain.in 2001/08/18 22:25:17 1.272
+++ ltmain.in 2001/08/30 17:53:03
@@ -2706,7 +2706,16 @@
# Clear the version info if we defaulted, and they specified a release.
if test -z "$vinfo" && test -n "$release"; then
major=
- verstring="0.0"
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+ verstring=""
+ ;;
+ *)
+ verstring="0.0"
+ ;;
+ esac
if test "$need_version" = no; then
versuffix=
else
-chrisp
--
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."
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Several Darwin fixes,
Christoph Pfisterer <=