This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Work around libtool for `$' in filenames
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: gcc-patches at gcc dot gnu dot org, libtool-patches at gnu dot org
- Date: 27 Nov 2002 00:44:03 -0200
- Subject: Re: PATCH: Work around libtool for `$' in filenames
- Organization: GCC Team, Red Hat
- References: <20021126135515.A593@lucon.org>
[Cc:ing libtool-patches, to make sure libtool maintainers are aware of
the problem and don't end up rewriting this patch by mistake]
On Nov 26, 2002, "H. J. Lu" <hjl@lucon.org> wrote:
> Libtool couldn't deal with `$' in filenames, which is used in libjava
> test. This patch seems to work for me.
Sorry, this one can't go in. For one, it would break the libtool
testsuite for disregarding $run, which would break libtool -n.
This is probably a symptom of places where arguments to libtool should
be quoted but aren't, or cases in which we expand a command line with
eval too many times. Simply quoting `$' may fix this particular
problem, without fixing the more general problem that should be fixed,
e.g., other shell meta-characters would remain broken.
Also, by policy, GCC doesn't accept patches that didn't make it to the
libtool CVS tree, and this one doesn't seem to have made it.
Fortunately, otherwise it would have to be reverted :-)
> 2002-11-23 H.J. Lu <hjl@gnu.org>
> * ltmain.sh: Handle `$' in filenames.
> --- ltmain.sh.dollar Fri Nov 22 12:33:19 2002
> +++ ltmain.sh Sat Nov 23 10:04:22 2002
> @@ -655,9 +655,11 @@ EOF
> $run $rm "$lobj" "$output_obj"
> + command=`echo $command | sed -e "s/[$]/\\\\$/g"`
> $show "$command"
> - if $run eval "$command"; then :
> - else
> + $SHELL -c "$command"
> + status=$?
> + if test $status -ne 0; then
> test -n "$output_obj" && $run $rm $removelist
> exit 1
> fi
> @@ -723,11 +725,12 @@ EOF
> fi
> # Suppress compiler output if we already did a PIC compilation.
> - command="$command$suppress_output"
> $run $rm "$obj" "$output_obj"
> + command=`echo $command | sed -e "s/[$]/\\\\$/g"`
> $show "$command"
> - if $run eval "$command"; then :
> - else
> + $SHELL -c "$command"
> + status=$?
> + if test $status -ne 0; then
> $run $rm $removelist
> exit 1
> fi
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer