Make otcc code work in x64 based system with 32-bit chroot.
Set execute permission on code before running it.
Handle negative relative offsets for global variables.
Add printfs to report the progress of nested compiles.
Change way we detect whether we can run the host compiler
or not. We used to check if we were running on a 32-bit
Linux. Now we check if the executable is a 32-bit Linux
executable.
diff --git a/libacc/tests/testlocal b/libacc/tests/testlocal
index 2989e11..1650bf9 100755
--- a/libacc/tests/testlocal
+++ b/libacc/tests/testlocal
@@ -2,17 +2,20 @@
SCRIPT_DIR=`dirname $BASH_SOURCE`
DATA=$SCRIPT_DIR/data
+ACC=`which acc`
echo "Compiling returnval-ansi.c"
-acc -S $DATA/returnval-ansi.c
+$ACC -S $DATA/returnval-ansi.c
echo "Compiling whole compiler."
-acc -S "$DATA/otcc-ansi.c"
+$ACC -S "$DATA/otcc-ansi.c"
-if (( "$(uname)" = "Linux" )) && (( "$(uname -m)" = "i686" )); then
- echo "Linux i686. Testing otcc-ansi.c"
- acc -R "$DATA/otcc-ansi.c" "$DATA/returnval.c"
- acc -R $DATA/otcc-ansi.c $DATA/otcc.c $DATA/returnval.c
+if file $ACC | grep -q "ELF 32-bit LSB executable, Intel 80386"; then
+ echo "Linux 32bit Intel."
+ $ACC -R $DATA/returnval-ansi.c
+ echo Testing otcc-ansi.c
+ $ACC -R "$DATA/otcc-ansi.c" "$DATA/returnval.c"
+ $ACC -R $DATA/otcc-ansi.c $DATA/otcc.c $DATA/returnval.c
fi
echo "Done with tests."