libtool-patches
[Top][All Lists]
Advanced

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

Re: [patch] list of input files if max_cmd_len exceeded


From: Ralf Wildenhues
Subject: Re: [patch] list of input files if max_cmd_len exceeded
Date: Thu, 14 Apr 2005 08:05:11 +0200
User-agent: Mutt/1.4.1i

Hi David, others,

* David Edelsohn wrote on Thu, Apr 14, 2005 at 02:20:13AM CEST:
> Peter> Look for $with_gnu_ld in ltmain.m4sh.
> 
>       Okay, sorry that I missed that.  I can move my change to that
> block, but the GNU ld linker script syntax is just different enough that I
> cannot reuse the file.  GNU ld wants a file containing 
> 
> INPUT (
> "filename1"
> "filename2"
> )
> 
> without requiring a commandline option while AIX, at least, wants a file
> that simply contains filenames (no quotes) and the file is specified with
> a commandline option.

What would the linker do with special characters in file names?
Not that it would matter for libtool ATM, but this might change (at
least the dollar sign would be helpful), so it'd be good to know what
breaks then.

Also, if we find more linkers with more link script syntax forms, it
might be good to fold that into a recipe to be put in libtool.m4.
Something like

# GNU ld
archive_linkscript_cmds='echo "INPUT ("~
                         $ECHO "X$save_libobjs" | $SP2NL | $Xsed -e s,\^,\", -e 
s,\$,\",~
                         echo ")"'
# AIX
archive_linkscript_cmds='$ECHO "X$save_libobjs" | $Xsed | $SP2NL'
 
and then in ltmain we'd just test for nonzero $archive_linkscript_cmds
instead of $with_gnu_ld or $file_list_spec, and exec that, redirected to
output=${output_objdir}/${output_la}.lnkscript.

Completely untested, BTW.  And I haven't thought about exported symbols
yet.


>       Also, libtool currently does not delete the temporary linker
> script, which it probably should.

ACK.

I like the general idea, btw.  Nits below.

Regards,
Ralf

>       * config/ltmain.m4sh (func_mode_link): If command exceeds
>       max_cmd_len and file_list_spec exists, write list of input files
>       to temporary file.
>       * m4/libtool.m4 (_LT_LINKER_SHLIBS, aix[45]): Define file_list_spec.
>       (_LT_LANG_CXX_CONFIG, aix[45]): Define file_list_spec.
> 
> Index: config/ltmain.m4sh
> ===================================================================
> RCS file: /cvsroot/libtool/libtool/config/ltmain.m4sh,v
> retrieving revision 1.60
> diff -c -p -r1.60 ltmain.m4sh
> *** config/ltmain.m4sh        7 Apr 2005 17:58:26 -0000       1.60
> --- config/ltmain.m4sh        14 Apr 2005 00:12:38 -0000
> *************** EOF
> *** 5129,5134 ****
> --- 5129,5144 ----
>             $ECHO \""$obj"\" >> $output
>           done
>           $ECHO ')' >> $output
> +         delfiles="$delfiles $output"
> +       elif test "X$file_list_spec" != X; then
> +         output=${output_objdir}/${output_la}.lnk

> +         func_echo "creating linker input file list: $output"
> +         for obj in $save_libobjs
> +         do
> +           $ECHO $obj >> $output
> +         done

Unnecessary.  Just do
  $ECHO "X$save_libobjs" | $Xsed | $SP2NL > $output
instead of looping over every file.  Note that $ECHO may only take one
argument.  Also, your patch does not remove $output before using, so a
second link would have a wrong list.


> +         delfiles="$delfiles $output"
> +         output=\"$file_list_spec$filelist\"
>         else
>           func_echo "creating reloadable object files..."
>           output=$output_objdir/$output_la-${k}.$objext




reply via email to

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