[Top][All Lists]

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

$ECHO change uncovered underquoting (was: 2.2.6: -ofoo.exe creates foo)

From: Ralf Wildenhues
Subject: $ECHO change uncovered underquoting (was: 2.2.6: -ofoo.exe creates foo)
Date: Tue, 25 Nov 2008 22:16:24 +0100
User-agent: Mutt/1.5.18 (2008-05-17)


Hello Paolo, Akim, all,

* Akim Demaille wrote on Tue, Nov 25, 2008 at 12:47:07PM CET:
> Well, I have new kinds of failures with current master (still on that  
> GNU/Linux + Wine + VC++ machine):
> /bin/sh ../libtool --tag=CXX   --mode=link cl.exe /EHsc   -Wall /wd4099 
> /wd4121 /wd4127 /wd4347 /wd4512 /wd4571 /wd4619 /wd4625 /wd4626 /wd4668 
> /wd4710 /wd4711 /wd4800 /wd4820 -g -O3 -no-undefined -L/ 
> home/build/local_wine/winroot/opt/lib -o liburbi/liburbi.la -rpath / 
> usr/local/gostai/lib libuco/liburbi_liburbi_la-uvalue-common.lo  
> liburbi/liburbi_liburbi_la-package-info.lo liburbi/liburbi_liburbi_la- 
> uabstractclient.lo liburbi/liburbi_liburbi_la-uclient.lo liburbi/ 
> liburbi_liburbi_la-uconversion.lo liburbi/liburbi_liburbi_la-umessage.lo 
> liburbi/liburbi_liburbi_la-usyncclient.lo  -lws2_32 ../lib/ 
> libport/libport.la ../jpeg-6b/libjpeg.la
> libtool: link: cl.exe /EHsc -o liburbi/.libs/liburbi-0.dll   
> libuco/.libs/liburbi_liburbi_la-uvalue-common.obj liburbi/.libs/ 
> liburbi_liburbi_la-package-info.obj liburbi/.libs/liburbi_liburbi_la- 
> uabstractclient.obj liburbi/.libs/liburbi_liburbi_la-uclient.obj  
> liburbi/.libs/liburbi_liburbi_la-uconversion.obj liburbi/.libs/ 
> liburbi_liburbi_la-umessage.obj liburbi/.libs/liburbi_liburbi_la- 
> usyncclient.obj     `printf %s\n " -L/home/build/local_wine/winroot/ 
> opt/lib -lws2_32 ../lib/libport/.libs/libport.lib ../jpeg-6b/.libs/ 
> libjpeg.lib" | /bin/sed 's/ -lc$//'` -link -dll
> cl.exe: start: -lws2_32
> cl : Command line warning D9024 : unrecognized source file type '../ 
> jpeg-6b/.libs/libjpeg.libn', object file assumed
> LINK : fatal error LNK1181: cannot open input file '../jpeg-6b/.libs/ 
> libjpeg.libn'
> gmake[4]: *** [liburbi/liburbi.la] Error 2
> As you can see, libtool somehow wants to use printf, and fails.
> $ /bin/sh -c 'printf %s\n "foo"'
> foon%
> (The % shows that there is no eol here).
> $ /bin/sh -c 'printf "%s\n" "foo"'
> foo

> # Which release of libtool.m4 was used?
> macro_version=2.2.7a
> macro_revision=1.3046
> # Shell to use when invoking shell scripts.
> SHELL="/bin/sh"
> # An echo program that protects backslashes.
> ECHO="printf %s\\n"
> # Commands used to build a shared archive.
> archive_cmds="\$CC -o \$lib \$libobjs \$compiler_flags \\\`\$ECHO 
> \\\"\$deplibs\\\" | \$SED 's/ -lc\$//'\\\` -link -dll~linknames="

it looks like this bug received more exposure by the $ECHO change.
  grep \''.*`.*ECHO.*`' libltdl/m4/libtool.m4

matches a couple dozen places, and there are probably more that use "
rather than ' as outer quoting.  I see two ways to fix this:

1) Add more escaping to the input lines.  E.g.,
      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO 
"$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='

would become
      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags 
`\$ECHO "\$deplibs" | \$SED '\''s/ -lc$//'\''` -link -dll~linknames='

so that the respective line in libtool will be
  archive_cmds="\$CC -o \$lib \$libobjs \$compiler_flags \\\`\\\$ECHO 
\\\"\$deplibs\\\" | \\\$SED 's/ -lc\\\$//'\\\` -link -dll~linknames="

2) Somehow try to change _LT_OUTPUT_LIBTOOL_COMMANDS_INIT and sister
macros to fix the escaping inside backquotes.  No idea whether that is
possible easily.

(Of course in this special case, -lc should just be removed from
$deplibs inside ltmain.sh; right now I'm trying to address the general



reply via email to

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