libtool-patches
[Top][All Lists]
Advanced

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

flat, no all-load for darwin


From: Geoffrey Keating
Subject: flat, no all-load for darwin
Date: Tue, 27 Jul 2004 17:38:18 -0700 (PDT)

Libtool was using -all_load to get all the members of a convenience
archive.  Unfortunately, -all_load applies to *every* library in the
link, so this would cause it to pull in everything from, say,
libstdc++, causing huge binary bloat and occasionally link errors
when a library is listed twice on the link line.

Also, libtool is changed to use -flat_namespace for C++.  This is
usually what you want, especially for libstdc++ itself.

I've tested a version of this patch that applied to an earlier libtool
(1.5.2, I think) by building all of GCC with it, and running its
testsuite.

I'm pretty sure I don't have write access, so could someone commit
this for me?

-- 
- Geoffrey Keating <address@hidden>

===File ~/patches/libtool-flat.patch========================
2004-07-27  Geoffrey Keating  <address@hidden>

        * m4/libtool.m4 [darwin]: Don't use -all_load.  Use flat namespace
        for linking C++ objects.

Index: m4/libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/m4/libtool.m4,v
retrieving revision 1.80
diff -u -p -u -p -r1.80 libtool.m4
--- m4/libtool.m4       23 Jul 2004 14:12:44 -0000      1.80
+++ m4/libtool.m4       28 Jul 2004 00:32:44 -0000
@@ -3805,8 +3805,11 @@ _LT_EOF
       _LT_AC_TAGVAR(hardcode_direct, $1)=no
       _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      # Darwin ld has a command to load all input files from a .a, but
+      # it applies to *every* .a on the link line, so it's not really very
+      # useful.
+
     if test "$GCC" = yes ; then
        output_verbose_link_cmd='echo'
         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag 
-o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname 
$verstring'
@@ -4723,7 +4726,7 @@ if test -n "$compiler"; then
                _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace 
${wl}-undefined ${wl}suppress'
                ;;
              10.*)
-               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined 
${wl}dynamic_lookup'
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace 
-undefined ${wl}dynamic_lookup'
                ;;
            esac
          fi
@@ -4733,8 +4736,10 @@ if test -n "$compiler"; then
       _LT_AC_TAGVAR(hardcode_direct, $1)=no
       _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      # Darwin ld has a command to load all input files from a .a, but
+      # it applies to *every* .a on the link line, so it's not really very
+      # useful.
 
     if test "$GXX" = yes ; then
       lt_int_apple_cc_single_mod=no
============================================================




reply via email to

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