libtool-patches
[Top][All Lists]
Advanced

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

Re: darwin/Fortran: -single_module


From: Peter O'Gorman
Subject: Re: darwin/Fortran: -single_module
Date: Sat, 03 Dec 2005 23:00:38 +0900
User-agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Peter O'Gorman wrote:
| I have been persuaded that -single_module should be the default (probably
| only for HEAD for now patch coming soon).

Okay for HEAD?

Peter
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Darwin)

iQCVAwUBQ5GlBriDAg3OZTLPAQJABAQAioH9iAmN44hE/sW/OiZ1sC1pyFIA6XMS
aFQC3aILaeKrOU9uNLvt/Np9noxQaF/PbzAlgXPrYrhc5DMmyuLTVX902+iP9JFJ
tXqfQ+1X2tF2sMEHQff15hcJPzbvfKHRRp6xmPpiPDifB3odDQd297rSaZDGN/iP
tuiINscUrOo=
=duIi
-----END PGP SIGNATURE-----
Index: ChangeLog
2005-11-28  Peter O'Gorman  <address@hidden>

        * libltdl/config/ltmain.m4sh, libltdl/m4/libtool.m4  [darwin]:
        Use -single_module by default when linking shared libraries. Can
        be overridden by specifying -multi-module or by setting the env
        var MULTI_MODULE before configure.

Index: libltdl/config/ltmain.m4sh
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/config/ltmain.m4sh,v
retrieving revision 1.21
diff -u -3 -p -u -r1.21 ltmain.m4sh
--- libltdl/config/ltmain.m4sh 25 Nov 2005 18:13:53 -0000 1.21
+++ libltdl/config/ltmain.m4sh 3 Dec 2005 12:36:09 -0000
@@ -2194,7 +2194,7 @@ func_mode_link ()
     vinfo=
     vinfo_number=no
     weak_libs=
-
+    single_module="${wl}-single_module"
     func_infer_tag $base_compile
 
     # We need to know -static, to get the right output filenames.
@@ -2661,6 +2661,11 @@ func_mode_link ()
        esac
        continue
        ;;
+
+      -multi_module)
+        single_module="${wl}-multi_module"
+        continue
+        ;;
 
       -no-fast-install)
        fast_install=no
Index: libltdl/m4/libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/m4/libtool.m4,v
retrieving revision 1.49
diff -u -3 -p -u -r1.49 libtool.m4
--- libltdl/m4/libtool.m4 27 Nov 2005 15:18:09 -0000 1.49
+++ libltdl/m4/libtool.m4 3 Dec 2005 12:36:11 -0000
@@ -4393,11 +4393,26 @@ _LT_EOF
       _LT_TAGVAR(whole_archive_flag_spec, $1)=''
       _LT_TAGVAR(link_all_deplibs, $1)=yes
       if test "$GCC" = yes ; then
-       output_verbose_link_cmd=echo
-       _LT_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o 
$lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+        lt_int_apple_cc_single_mod=no
+        output_verbose_link_cmd=echo
+        if test -z "$MULTI_MODULE"; then
+          # By default we will add the -single_module flag. You can override
+          # by either setting the environment variable MULTI_MODULE non-empty
+          # at configure time, or by adding -multi-module to the link flags.
+          # All ld's that accept -v accept -single_module
+          if test -n "`ld -v 2>/dev/null`" ||
+            $CC -dumpspecs 2>&1 | $GREP 'single_module' >/dev/null; then
+              lt_int_apple_cc_single_mod=yes
+          fi
+       fi
+        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+          _LT_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $single_module 
$allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name 
$rpath/$soname $verstring'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    
]*,," -e "s,^\(..*\),_&," < $export_symbols > 
$output_objdir/${libname}-symbols.expsym~$CC $single_module -dynamiclib 
$allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name 
$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym 
${lib}'
+        else
+         _LT_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag 
-o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname 
$verstring'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    
]*,," -e "s,^\(..*\),_&," < $export_symbols > 
$output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag 
-o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname 
$verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        fi
        _LT_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle 
$libobjs $deplibs$compiler_flags'
-       # Don't fix this by using the ld -exported_symbols_list flag, it 
doesn't exist in older darwin lds
-       _LT_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," 
-e "s,^\(..*\),_&," < $export_symbols > 
$output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag 
-o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname 
$verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
        _LT_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," 
-e "s,^\(..*\),_&," < $export_symbols > 
$output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib 
-bundle $libobjs $deplibs$compiler_flags~nmedit -s 
$output_objdir/${libname}-symbols.expsym ${lib}'
       else
        case $cc_basename in
@@ -5368,33 +5383,25 @@ if test "$_lt_caught_CXX_error" != yes; 
 
         if test "$GXX" = yes ; then
           lt_int_apple_cc_single_mod=no
-          output_verbose_link_cmd=echo
-          case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
-          10.[[0123]])
-            # only use -single_module on bona fide Apple compilers.
-            if $CC -v 2>&1| grep Apple 2>&1 >/dev/null ; then
-              if $CC -dumpspecs 2>&1 | $GREP 'single_module' >/dev/null ; then
+          output_verbose_link_cmd=echo        
+          if test -z "$MULTI_MODULE"; then
+            # By default we will add the -single_module flag. You can override
+            # by either setting the environment variable MULTI_MODULE non-empty
+            # at configure time, or by adding -multi-module to the link flags.
+            # All ld's that accept -v accept -single_module
+            if test -n "`ld -v 2>/dev/null`" ||
+              $CC -dumpspecs 2>&1 | $GREP 'single_module' >/dev/null; then
                 lt_int_apple_cc_single_mod=yes
-              fi
-            fi
-            if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-             _LT_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module 
$allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name 
$rpath/$soname $verstring'
-            else
-              _LT_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs 
-nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o 
$lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname 
$verstring'
             fi
-            ;;
-          *)
-            _LT_TAGVAR(archive_cmds, $1)='$CC -dynamiclib 
$allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name 
$rpath/$soname $verstring'
-            ;;
-          esac
-          _LT_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib 
-bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag,
-         # it doesn't exist in older darwin lds
+         fi
           if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-            _LT_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    
]*,," -e "s,^\(..*\),_&," < $export_symbols > 
$output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module 
$allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name 
$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym 
${lib}'
+           _LT_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $single_module 
$allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name 
$rpath/$soname $verstring'
+            _LT_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    
]*,," -e "s,^\(..*\),_&," < $export_symbols > 
$output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $single_module 
$allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name 
$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym 
${lib}'
           else
+            _LT_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs 
-nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o 
$lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname 
$verstring'
             _LT_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    
]*,," -e "s,^\(..*\),_&," < $export_symbols > 
$output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib 
-o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib 
${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname 
$verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
           fi
+          _LT_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib 
-bundle $libobjs $deplibs$compiler_flags'
           _LT_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    
]*,," -e "s,^\(..*\),_&," < $export_symbols > 
$output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib 
-bundle $libobjs $deplibs$compiler_flags~nmedit -s 
$output_objdir/${libname}-symbols.expsym ${lib}'
         else
           case $cc_basename in

reply via email to

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