]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS)
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Fri, 23 Feb 2007 21:11:25 +0000 (21:11 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Fri, 23 Feb 2007 21:11:25 +0000 (21:11 +0000)
<compiler_needs_object>: New tag variable.  Default to `no'.
(_LT_LINKER_SHLIBS) [ linux ]: Set it to yes for Sun C 5.9.
(_LT_LANG_CXX_CONFIG): Also default it to `no'.
[ linux ]: Set it to `yes' for Sun C++ 5.9.
* libltdl/config/ltmain.m4sh (func_mode_link): If we link
no objects but only convenience archives into a library,
force expansion if `compiler_needs_object' is yes.
For creating a linker input filelist due to long cmdline,
extract the first object if `compiler_needs_object' is yes.
* doc/libtool.texi (libtool script contents): Document it.
Fixes test failures of Sun compilers on GNU/Linux.
Report by Terry D. Dontje.

ChangeLog
doc/libtool.texi
libltdl/config/ltmain.m4sh
libltdl/m4/libtool.m4

index 5d00c62336f191f7ccf489a6fb775afb93ccd5db..a59d1cb5b2651070dcf3103e6519713cbb983798 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2007-02-23  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       * libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS)
+       <compiler_needs_object>: New tag variable.  Default to `no'.
+       (_LT_LINKER_SHLIBS) [ linux ]: Set it to yes for Sun C 5.9.
+       (_LT_LANG_CXX_CONFIG): Also default it to `no'.
+       [ linux ]: Set it to `yes' for Sun C++ 5.9.
+       * libltdl/config/ltmain.m4sh (func_mode_link): If we link
+       no objects but only convenience archives into a library,
+       force expansion if `compiler_needs_object' is yes.
+       For creating a linker input filelist due to long cmdline,
+       extract the first object if `compiler_needs_object' is yes.
+       * doc/libtool.texi (libtool script contents): Document it.
+       Fixes test failures of Sun compilers on GNU/Linux.
+       Report by Terry D. Dontje.
+
        * libltdl/config/ltmain.m4sh (func_mode_link): Avoid setting
        `$libobjs' to a single space; set it to empty in that case.
 
index 6d317d02d74c40a552b3dbcb57955eae18ba3e30..0e78f4b498c8ebb9b57f30140fbb4345be54c76a 100644 (file)
@@ -5259,6 +5259,13 @@ Whether the compiler supports the @option{-c} and @option{-o} options
 simultaneously.  Set to @samp{yes} or @samp{no}.
 @end defvar
 
+@defvar compiler_needs_object
+Whether the compiler has to see an object listed on the command line in
+order to successfully invoke the linker.  If @samp{no}, then a set of
+convenience archives or a set of object file names can be passed via
+linker-specific options or linker scripts.
+@end defvar
+
 @defvar dlopen_support
 Whether @code{dlopen} is supported on the platform.
 Set to @samp{yes} or @samp{no}.
index 74ac159b15243d8a222c69e8b159d5476d9f5feb..e44f965d379623015540321b89081dc40e179a8a 100644 (file)
@@ -5182,6 +5182,13 @@ EOF
        deplibs="$tmp_deplibs"
 
        if test -n "$convenience"; then
+         if test -n "$whole_archive_flag_spec" &&
+           test "$compiler_needs_object" = yes &&
+           test -z "$libobjs"; then
+           # extract the archives, so we have objects to list.
+           # TODO: could optimize this to just extract one archive.
+           whole_archive_flag_spec=
+         fi
          if test -n "$whole_archive_flag_spec"; then
            save_libobjs=$libobjs
            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
@@ -5270,12 +5277,19 @@ EOF
            output=${output_objdir}/${output_la}.lnk
            func_echo "creating linker input file list: $output"
            : > $output
-           for obj in $save_libobjs
+           set x $save_libobjs
+           shift
+           firstobj=
+           if test "$compiler_needs_object" = yes; then
+             firstobj="$1 "
+             shift
+           fi
+           for obj
            do
              $ECHO "$obj" >> $output
            done
            delfiles="$delfiles $output"
-           output=\"$file_list_spec$output\"
+           output=$firstobj\"$file_list_spec$output\"
          else
            func_echo "creating reloadable object files..."
            output=$output_objdir/$output_la-${k}.$objext
index 9644c4f4154390ebfc709704c82a173dca1fea17..2cc55cd37c59b8a545f7b7e367f373b8e15dd05a 100644 (file)
@@ -4003,6 +4003,7 @@ m4_if([$1], [CXX], [
   _LT_TAGVAR(always_export_symbols, $1)=no
   _LT_TAGVAR(archive_cmds, $1)=
   _LT_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_TAGVAR(compiler_needs_object, $1)=no
   _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
   _LT_TAGVAR(export_dynamic_flag_spec, $1)=
   _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
@@ -4195,6 +4196,7 @@ _LT_EOF
        case `$CC -V 2>&1 | sed 5q` in
        *Sun\ C*)                       # Sun C 5.9
          _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+         _LT_TAGVAR(compiler_needs_object, $1)=yes
          tmp_sharedflag='-G' ;;
        *Sun\ F*)                       # Sun Fortran 8.3
          tmp_sharedflag='-G' ;;
@@ -4994,6 +4996,8 @@ _LT_TAGDECL([], [export_dynamic_flag_spec], [1],
     [Compiler flag to allow reflexive dlopens])
 _LT_TAGDECL([], [whole_archive_flag_spec], [1],
     [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+    [Whether the compiler copes with passing no objects directly])
 _LT_TAGDECL([], [old_archive_from_new_cmds], [2],
     [Create an old-style archive from a shared archive])
 _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
@@ -5183,6 +5187,7 @@ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
 _LT_TAGVAR(allow_undefined_flag, $1)=
 _LT_TAGVAR(always_export_symbols, $1)=no
 _LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
 _LT_TAGVAR(hardcode_direct, $1)=no
 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
@@ -5851,6 +5856,7 @@ if test "$_lt_caught_CXX_error" != yes; then
              _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
              _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
              _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+             _LT_TAGVAR(compiler_needs_object, $1)=yes
 
              # Not sure whether something based on
              # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1