* Ralf Wildenhues wrote on Sun, Feb 11, 2007 at 05:47:16PM CET:
I would like to fix all failures at once, due to the intertwined code
in ltmain. Currently, I'm about half-way through. I'll post what I
have in a followup mail FYI, but won't apply it.
This patch makes the cmdline_wrap test pass on GNU/Linux and newer
Solaris. Showing 'diff -b', hiding the indentation of the large
block inside `if $have_libobjs'.
Cheers,
Ralf
2007-02-11 Ralf Wildenhues <address@hidden>
Fix -export-symbols and -export-symbols-regex for links that
exceed the command line length and use convenience archives.
* libltdl/config/ltmain.m4sh (func_mode_link) <have_libobjs>:
New variable, to avoid being sensitive to $libobjs containing a
single space.
(func_mode_link): Avoid grepping a nonexistent file if using
reloadable objects. Do not create a linker script nor a linker
input file if no objects are passed. Apply export_symbols_regex
in case the command line length is exceeded.
Index: libltdl/config/ltmain.m4sh
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/config/ltmain.m4sh,v
retrieving revision 1.62
diff -u -b -r1.62 ltmain.m4sh
--- libltdl/config/ltmain.m4sh 11 Feb 2007 16:22:42 -0000 1.62
+++ libltdl/config/ltmain.m4sh 11 Feb 2007 18:15:35 -0000
@@ -5088,6 +5088,11 @@
# Use standard objects if they are pic
test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e
"$lo2o" | $NL2SP`
+ case $libobjs in
+ *[[!\ ]]*) have_libobjs=: ;;
+ *) have_libobjs=false ;;
+ esac
+
delfiles=
if test -n "$export_symbols" && test -n "$include_expsyms"; then
$opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
@@ -5140,7 +5145,7 @@
fi
done
IFS="$save_ifs"
- if test -n "$export_symbols_regex"; then
+ if test -n "$export_symbols_regex" && test "X$skipped_export" !=
"X:"; then
func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" >
"${export_symbols}T"'
func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
fi
@@ -5251,7 +5256,7 @@
last_robj=
k=1
- if test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+ if $have_libobjs && test "X$skipped_export" != "X:" && test
"$with_gnu_ld" = yes; then
output=${output_objdir}/${output_la}.lnkscript
func_echo "creating GNU ld script: $output"
$ECHO 'INPUT (' > $output
@@ -5261,7 +5266,7 @@
done
$ECHO ')' >> $output
delfiles="$delfiles $output"
- elif test "X$skipped_export" != "X:" && test "X$file_list_spec" != X;
then
+ elif $have_libobjs && test "X$skipped_export" != "X:" && test
"X$file_list_spec" != X; then
output=${output_objdir}/${output_la}.lnk
func_echo "creating linker input file list: $output"
: > $output
@@ -5272,6 +5277,7 @@
delfiles="$delfiles $output"
output=\"$file_list_spec$output\"
else
+ if $have_libobjs; then
func_echo "creating reloadable object files..."
output=$output_objdir/$output_la-${k}.$objext
# Loop over the list of objects to be linked.
@@ -5306,15 +5312,6 @@
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
- if ${skipped_export-false}; then
- func_echo "generating symbol list for \`$libname.la'"
- export_symbols="$output_objdir/$libname.exp"
- $opt_dry_run || $RM $export_symbols
- libobjs=$output
- # Append the command to create the export file.
- eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
- fi
-
# Set up a command to remove the reloadable object files
# after they are used.
i=0
@@ -5323,7 +5320,21 @@
i=`expr $i + 1`
delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
done
+ else
+ output=
+ fi
+ if ${skipped_export-false}; then
+ func_echo "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+ fi
+
+ $have_libobjs &&
func_echo "creating a temporary reloadable object file: $output"
# Loop through the commands generated above and execute them.
@@ -5348,6 +5359,11 @@
}
done
IFS="$save_ifs"
+
+ if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" >
"${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
fi
libobjs=$output