[uClibc]Arguments passing erorr of ash on mipsel
Jonathan Chang
changcs at santos.ee.ntu.edu.tw
Wed Apr 9 05:50:25 UTC 2003
Build environments:
1. gcc 3.2.2
2. uClibc snapshot_20030311
3. cross-compiled for mipsel-linux on i386-pc-linux-gnu
4. ash obtained from http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/leaf/src/bering-uclibc/apps/ash (following the instructions in http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/leaf/src/bering-uclibc/apps/ash/ash.txt)
Test environments:
The following shell script
---------------------------------------------
#!/path/to/the/built/ash
while getopts fawv opt ; do
case "$opt" in
f) echo result is f ;;
a) echo result is a ;;
w) echo result is w ;;
v) echo result is v ;;
esac
done
---------------------------------------------
executed via
$ ./script -f -a
Test results:
Seg fault! However, this ash used to work perfectly with gcc2.96 and
uClibc 0.9.15.
Possible cause:
getopts() fails to pass correct arguments to setvarsafe().
setvarsafe("OPTARG", "", 0) is called from within getopts, but
setvarsafe will find the first argument is always NULL.
Can anyone help me solve this problem?? Any help would be greatly
appreciated.
Best regards,
PS: If anything goes wrong, please also check the argc of
ash. Sometimes ash obtains wrong argc values under gcc 3.2.2 and
uClibc snapshot_20030311.
--
Chia-Sheng "Jonathan" Chang
Delta Networks, INC
Tel: 886-2-87972088 ext 3066
E-Mail: changchias at ieee.org
More information about the uClibc
mailing list