[PPL-devel] mode=execute argument munging bug

Roberto Bagnara bagnara at cs.unipr.it
Wed Mar 5 07:37:58 CET 2008


Ralf Wildenhues wrote:
> * Roberto Bagnara wrote on Mon, Mar 03, 2008 at 09:14:48PM CET:
>> $ cat mycommand
>> #!/bin/sh
>> echo "mycommand invoked with argument '$1'"
>> $ mycommand ciao
>> mycommand invoked with argument 'ciao'
>> $ ./libtool --mode=execute mycommand ciao
>> mycommand invoked with argument '/home/roberto/tppl/'
>> $
>>
>> Note that /home/roberto/tppl/ is the directory where the libtool
>> script is located.  I can also do
>>
>> $ cd interfaces/
>> $ ../libtool --mode=execute ../mycommand ciao
>> mycommand invoked with argument '/home/roberto/tppl/'
>>
>> Is this behavior normal?
> 
> No.  Thank you for the bug report.  I've applied the fix below.
> 
> FWIW, the ordering of the tests in execute-mode.at is such that the
> first set still passes for 1.5.26.
> 
>> ./libtool is what has been created at configure time and a bzipped
>> version of it is attached to this file.

Thanks a lot Ralf!

It is better now, but there is still the problem that, apparently,
libtool redirects stdin for the program it is running.
Here is a new testcase:

$ cat mycommand
#!/bin/sh
echo "mycommand invoked with argument '$1' '$2' '$3' '$4' '$5'"
while read line
do
     echo "$line"
done
$ /bin/sh ../../../libtool --mode=execute \
         -dlopen ../../../src/libppl.la \
         -dlopen ../../../Watchdog/src/libpwl.la \
         mycommand
mycommand invoked with argument '' '' '' '' ''
#
# Please DO NOT delete this file!
# It is necessary for linking the library.

# The name that we can dlopen(3).
dlname='libpwl.so.4'

# Names of this library.
library_names='libpwl.so.4.0.0 libpwl.so.4 libpwl.so'

# The name of the static archive.
old_library='libpwl.a'

# Linker flags that can not go in dependency_libs.
inherited_linker_flags=''

# Libraries that this one depends upon.
dependency_libs=''

# Names of additional weak libraries provided by this library
weak_library_names=''

# Version information for libpwl.
current=4
age=0
revision=0

# Is this an already installed library?
installed=no

# Should we warn about portability when linking against -modules?
shouldnotlink=no

# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''

# Directory that this library needs to be installed in:
libdir='/usr/local/lib'
$ /bin/sh ../../../libtool --mode=execute \
         -dlopen ../../../src/libppl.la \
         -dlopen ../../../Watchdog/src/libpwl.la \
         mycommand >produced_by_mycommand
$ diff produced_by_mycommand ../../../Watchdog/src/libpwl.la
1c1,2
< mycommand invoked with argument '' '' '' '' ''
---
 > # libpwl.la - a libtool library file
 > # Generated by ltmain.sh (GNU libtool) 2.2
$


> It wasn't attached to the message, but that's not a problem.  :-)

You are right.  It happens to me all the time :-)
Let me know if you need it this time.
Cheers,

     Roberto

-- 
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara at cs.unipr.it



More information about the PPL-devel mailing list