ltconfig: Define file_list_spec.

* ltconfig: Define file_list_spec.  Pass file_list_spec and
        with_gnu_ld to libtool.
        * ltcf-c.sh (aix[45]): Define file_list_spec.
        * ltcf-cxx.sh (aix[45]): Same.
        * ltcf-gcj.sh (aix[45]): Same.
        * ltmain.sh: If command exceeds max_cmd_len and file_list_spec
        exists, write list of input files to temporary file.

From-SVN: r99268
This commit is contained in:
David Edelsohn 2005-05-05 15:04:39 +00:00 committed by David Edelsohn
parent c54c732251
commit c9392a2bf8
6 changed files with 108 additions and 64 deletions

View File

@ -1,3 +1,13 @@
2005-05-05 David Edelsohn <edelsohn@gnu.org>
* ltconfig: Define file_list_spec. Pass file_list_spec and
with_gnu_ld to libtool.
* ltcf-c.sh (aix[45]): Define file_list_spec.
* ltcf-cxx.sh (aix[45]): Same.
* ltcf-gcj.sh (aix[45]): Same.
* ltmain.sh: If command exceeds max_cmd_len and file_list_spec
exists, write list of input files to temporary file.
2005-05-04 Mike Stump <mrs@apple.com> 2005-05-04 Mike Stump <mrs@apple.com>
* configure.in: Always pass --target to target configures as * configure.in: Always pass --target to target configures as

View File

@ -267,6 +267,7 @@ else
hardcode_direct=yes hardcode_direct=yes
hardcode_libdir_separator=':' hardcode_libdir_separator=':'
link_all_deplibs=yes link_all_deplibs=yes
file_list_spec='${wl}-f,'
# When large executables or shared objects are built, AIX ld can # When large executables or shared objects are built, AIX ld can
# have problems creating the table of contents. If linking a library # have problems creating the table of contents. If linking a library
# or program results in "error TOC overflow" add -mminimal-toc to # or program results in "error TOC overflow" add -mminimal-toc to

View File

@ -128,6 +128,7 @@ case $host_os in
hardcode_direct=yes hardcode_direct=yes
hardcode_libdir_separator=':' hardcode_libdir_separator=':'
link_all_deplibs=yes link_all_deplibs=yes
file_list_spec='${wl}-f,'
# When large executables or shared objects are built, AIX ld can # When large executables or shared objects are built, AIX ld can
# have problems creating the table of contents. If linking a library # have problems creating the table of contents. If linking a library
# or program results in "error TOC overflow" add -mminimal-toc to # or program results in "error TOC overflow" add -mminimal-toc to

View File

@ -266,6 +266,7 @@ else
hardcode_direct=yes hardcode_direct=yes
hardcode_libdir_separator=':' hardcode_libdir_separator=':'
link_all_deplibs=yes link_all_deplibs=yes
file_list_spec='${wl}-f,'
# When large executables or shared objects are built, AIX ld can # When large executables or shared objects are built, AIX ld can
# have problems creating the table of contents. If linking a library # have problems creating the table of contents. If linking a library
# or program results in "error TOC overflow" add -mminimal-toc to # or program results in "error TOC overflow" add -mminimal-toc to

View File

@ -266,6 +266,7 @@ exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
# rely on this symbol name, it's probably fine to never include it in # rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables. # preloaded symbol tables.
extract_expsyms_cmds= extract_expsyms_cmds=
file_list_spec=
## Tools: ## Tools:
old_AR="$AR" old_AR="$AR"
@ -2164,7 +2165,7 @@ case $ltmain in
finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
hardcode_libdir_flag_spec hardcode_libdir_separator \ hardcode_libdir_flag_spec hardcode_libdir_separator \
sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
compiler_c_o need_locks exclude_expsyms include_expsyms; do compiler_c_o need_locks exclude_expsyms include_expsyms file_list_spec; do
case $var in case $var in
reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
@ -2557,6 +2558,12 @@ exclude_expsyms=$exclude_expsyms
# Symbols that must always be exported. # Symbols that must always be exported.
include_expsyms=$include_expsyms include_expsyms=$include_expsyms
# Specify filename containing input files.
file_list_spec=$file_list_spec
# with_gnu_ld value
with_gnu_ld=$with_gnu_ld
EOF EOF
if test -z "$tagname"; then if test -z "$tagname"; then

150
ltmain.sh
View File

@ -3272,7 +3272,6 @@ EOF
: :
else else
# The command line is too long to link in one step, link piecewise. # The command line is too long to link in one step, link piecewise.
$echo "creating reloadable object files..."
# Save the value of $output and $libobjs because we want to # Save the value of $output and $libobjs because we want to
# use them later. If we have whole_archive_flag_spec, we # use them later. If we have whole_archive_flag_spec, we
@ -3286,6 +3285,7 @@ EOF
save_libobjs=$libobjs save_libobjs=$libobjs
fi fi
save_output=$output save_output=$output
output_la=`$echo "X$output" | $Xsed -e "s,^.*/,,"`
# Clear the reloadable object creation command queue and # Clear the reloadable object creation command queue and
# initialize k to one. # initialize k to one.
@ -3295,63 +3295,87 @@ EOF
delfiles= delfiles=
last_robj= last_robj=
k=1 k=1
output=$output_objdir/$save_output-${k}.$objext
# Loop over the list of objects to be linked.
for obj in $save_libobjs
do
eval test_cmds=\"$reload_cmds $objlist $last_robj\"
if test "X$objlist" = X ||
{ len=`expr "X$test_cmds" : ".*"` &&
test $len -le $max_cmd_len; }; then
objlist="$objlist $obj"
else
# The command $test_cmds is almost too long, add a
# command to the queue.
if test $k -eq 1 ; then
# The first file doesn't have a previous command to add.
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
else
# All subsequent reloadable object files will link in
# the last one created.
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
fi
last_robj=$output_objdir/$save_output-${k}.$objext
k=`expr $k + 1`
output=$output_objdir/$save_output-${k}.$objext
objlist=$obj
len=1
fi
done
# Handle the remaining objects by creating one last
# reloadable object file. All subsequent reloadable object
# files will link in the last one created.
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
# Set up a command to remove the reloadale object files if test "$with_gnu_ld" = yes; then
# after they are used. output=${output_objdir}/${output_la}.lnkscript
i=0 $echo "creating GNU ld script: $output"
while test $i -lt $k $echo 'INPUT (' > $output
do for obj in $save_libobjs
i=`expr $i + 1` do
delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" $echo \""$obj"\" >> $output
done done
$echo ')' >> $output
delfiles="$delfiles $output"
elif test "X$file_list_spec" != X; then
output=${output_objdir}/${output_la}.lnk
$echo "creating linker input file list: $output"
: > $output
for obj in $save_libobjs
do
$echo "$obj" >> $output
done
delfiles="$delfiles $output"
output=\"$file_list_spec$output\"
else
$echo "creating reloadable object files..."
output=$output_objdir/$save_output-${k}.$objext
# Loop over the list of objects to be linked.
for obj in $save_libobjs
do
eval test_cmds=\"$reload_cmds $objlist $last_robj\"
if test "X$objlist" = X ||
{ len=`expr "X$test_cmds" : ".*"` &&
test $len -le $max_cmd_len; }; then
objlist="$objlist $obj"
else
# The command $test_cmds is almost too long, add a
# command to the queue.
if test $k -eq 1 ; then
# The first file doesn't have a previous command to add.
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
else
# All subsequent reloadable object files will link in
# the last one created.
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
fi
last_robj=$output_objdir/$save_output-${k}.$objext
k=`expr $k + 1`
output=$output_objdir/$save_output-${k}.$objext
objlist=$obj
len=1
fi
done
# Handle the remaining objects by creating one last
# reloadable object file. All subsequent reloadable object
# files will link in the last one created.
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
$echo "creating a temporary reloadable object file: $output" # Set up a command to remove the reloadale object files
# after they are used.
i=0
while test $i -lt $k
do
i=`expr $i + 1`
delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
done
# Loop through the commands generated above and execute them. $echo "creating a temporary reloadable object file: $output"
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
for cmd in $concat_cmds; do
IFS="$save_ifs"
eval cmd=\"$cmd\"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
libobjs=$output # Loop through the commands generated above and execute them.
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
for cmd in $concat_cmds; do
IFS="$save_ifs"
eval cmd=\"$cmd\"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
fi
libobjs=$output
# Restore the value of output. # Restore the value of output.
output=$save_output output=$save_output
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
eval libobjs=\"\$libobjs $whole_archive_flag_spec\" eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
@ -3364,20 +3388,20 @@ EOF
cmds=$archive_expsym_cmds cmds=$archive_expsym_cmds
else else
cmds=$archive_cmds cmds=$archive_cmds
fi fi
# Append the command to remove the reloadable object files # Append the command to remove the reloadable object files
# to the just-reset $cmds. # to the just-reset $cmds.
eval cmds=\"\$cmds~$rm $delfiles\" eval cmds=\"\$cmds~$rm $delfiles\"
fi fi
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do for cmd in $cmds; do
IFS="$save_ifs" IFS="$save_ifs"
eval cmd=\"$cmd\" eval cmd=\"$cmd\"
$show "$cmd" $show "$cmd"
$run eval "$cmd" || exit $? $run eval "$cmd" || exit $?
done done
IFS="$save_ifs" IFS="$save_ifs"
# Restore the uninstalled library and exit # Restore the uninstalled library and exit
if test "$mode" = relink; then if test "$mode" = relink; then