libtool-patches
[Top][All Lists]
Advanced

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

Re: darwin/Fortran: -single_module


From: Ralf Wildenhues
Subject: Re: darwin/Fortran: -single_module
Date: Sat, 3 Dec 2005 17:52:03 +0100
User-agent: Mutt/1.5.11

Hi Peter,

* Peter O'Gorman wrote on Sat, Dec 03, 2005 at 03:00:38PM CET:
> 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?

No testing done, and little experience with darwin, so if you deem ok
and tests pass, then please go ahead, after looking at these comments:

Cheers,
Ralf

> 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.

Please mention the fact that MACOSX_DEPLOYMENT_TARGET is not used as a
criterion any more in the ChangeLog.

Is MULTI_MODULE used by other tools on darwin?  If yes, should we not,
for the sake of non-interacting, use something like LT_MULTI_MODULE?

Can it ever be useful to want to specify neither -single_module nor
-multi_module?

May users defeat your change by passing -Wl,-multi_module?  They
wouldn't do that, right?

Note indenting is inconsistenly wrt. TABs/spaces.

More comments inline.

> 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

Plural is `lds'.  This criterion seems quite dubious; if it's true..

> +          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}'

Am I correct in that the
   "s,^[    ]*,,"
which will, after m4 quote removal, be
   "s,^    *,,"
is supposed to remove 3 or more leading spaces, and not mess with any
TABs at all?  (Just asking because this is a likely editor-messes-it-up
thing; several occasions.)

I wonder whether all this export_symbols munging should not rather
happen someplace else.  In global_symbol_pipe maybe?  The macro there
even tests for leading underscores and stuff.  Where do the comment
lines and the spaces come from?

Surely, since you are not introducing this you may leave fixing it to
another patch.

> +        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

See above.

> +            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]