[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FYI: libtool--devo--1.0--patch-181
From: |
Ralf Wildenhues |
Subject: |
Re: FYI: libtool--devo--1.0--patch-181 |
Date: |
Tue, 28 Sep 2004 11:53:07 +0200 |
User-agent: |
Mutt/1.4.1i |
* Gary V. Vaughan wrote on Wed, Sep 15, 2004 at 03:26:15AM CEST:
>
> Applied to HEAD.
This patch (maybe in conjunction with patch-180) breaks libtool on
linux-gnu with bash-2.05b.0(1). This can be seen using
TESTS='mdemo-conf.test mdemo-make.test mdemo-inst.test'
What happens? Command line option
-export-symbols-regex "libfoo2.*"
is not put quoted into libfoo2.la, that is, libfoo2.la contains
| relink_command="(cd
/mount/xenon/wildenhu/download/software/libtool/libtool/build/tests/mdemo;
/bin/sh
/mount/xenon/wildenhu/download/software/libtool/libtool/build/tests/mdemo/libtool
--tag CC --mode=relink gcc -g -O2 -o libfoo2.la -rpath
/mount/xenon/wildenhu/download/software/libtool/libtool/build/tests/_inst/lib
-no-undefined -module -export-symbols-regex libfoo2.* foo2.lo -lm libsub.la
@inst_prefix_dir@)"
rather than a quoted "libfoo2.*". This makes relinking fail on
installation, thus mdemo-inst.test fails (but mdemo-make.test is at
fault).
The change in relink_command is due to the different quoted arg
handling, as can be seen from the following `sh -x libtool' output snippets:
Current CVS HEAD Libtool:
+ arg=libfoo2.*
+ shift
++ echo 'Xlibfoo2.*'
++ /bin/sed -e '1s/^X//' -e 's/\([\\`\\"$\\\\]\)/\\\1/g'
+ qarg=libfoo2.*
+ libtool_args=gcc -g -O2 -o libfoo2.la -rpath
/tmp/libtool/build/tests/_inst/lib -no-undefined -module -export-symbols-regex
libfoo2.*
Libtool 1.4.3:
+ arg=libfoo2.*
+ shift
++ echo 'Xlibfoo2.*'
++ /bin/sed -e '1s/^X//' -e 's/\([\\`\\"$\\\\]\)/\\\1/g'
+ qarg="libfoo2.*"
+ libtool_args=gcc -g -O2 -o libfoo2.la -rpath
/mount/xenon/wildenhu/download/software/libtool/libtool/build/tests/_inst/lib
-no-undefined -module -export-symbols-regex "libfoo2.*"
If I change the code to use the old
| qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\"
then things work again. (Of course, since the older code looked for
meta-characters in order to quote only arguments in need of quotes,
and this simple-minded change quotes all arguments, the created
libfoo2.la file is still different. But it works for me.)
Now I know the old code was not portable. So what would be a portable
solution?
Regards,
Ralf
Snippets of that changeset:
| Index: Changelog
| from Gary V. Vaughan <address@hidden>
|
| * config/ltmain.in (func_quote_for_eval): Set a return value to
| avoid forking at every call. Changed all callers.
| (func_mode_link): Simplified, and removed the final non-portable
| nested escaped double quotes in back quotes usage in the process.
|
| --- orig/config/ltmain.in
| +++ mod/config/ltmain.in
| @@ -2368,9 +2375,10 @@
|
| # Go through the arguments, transforming them on the way.
| while test "$#" -gt 0; do
| - arg=`$echo "X$1" | $Xsed -e "$sed_quote_subst"`
| - libtool_args="$libtool_args "`func_quote_for_eval "$arg"`
| + arg="$1"
| shift
| + qarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
| + libtool_args="$libtool_args $qarg"
|
| # If the previous option needs an argument, assign it.
| if test -n "$prev"; then
Snippets of patch-180:
| Index: Changelog
| from Gary V. Vaughan <address@hidden>
|
| * config/ltmain.in (func_quote_for_eval): Factor out the ugly
| shell meta-character quoting. Changed all callers.
|
| --- orig/config/ltmain.in
| +++ mod/config/ltmain.in
| @@ -739,6 +739,25 @@
| }
|
|
| +# func_quote_for_eval arg
| +# Aesthetically quote ARG to be evaled later.
| +func_quote_for_eval ()
| +{
| + my_arg="$1"
| +
| + case $my_arg in
| + # Double-quote args containing other shell metacharacters.
| + # Many Bourne shells cannot handle close brackets correctly
| + # in scan sets, so we specify it separately.
| + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
| + my_arg="\"$my_arg\""
| + ;;
| + esac
| +
| + echo "$my_arg"
| +}
| +
| +
| # func_check_version_match
| # Ensure that we are using m4 macros, and libtool script from the same
| # release of libtool.
*snip*
| @@ -2393,15 +2368,9 @@
|
| # Go through the arguments, transforming them on the way.
| while test "$#" -gt 0; do
| - arg="$1"
| + arg=`$echo "X$1" | $Xsed -e "$sed_quote_subst"`
| + libtool_args="$libtool_args "`func_quote_for_eval "$arg"`
| shift
| - case $arg in
| - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
| - qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite:
skip nested quoting test
| - ;;
| - *) qarg=$arg ;;
| - esac
| - libtool_args="$libtool_args $qarg"
|
| # If the previous option needs an argument, assign it.
| if test -n "$prev"; then