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/acc.cpp b/libacc/acc.cpp
index db37ee2..e0043ef 100644
--- a/libacc/acc.cpp
+++ b/libacc/acc.cpp
@@ -10,6 +10,7 @@
 
 #include <ctype.h>
 #include <dlfcn.h>
+#include <errno.h>
 #include <setjmp.h>
 #include <stdarg.h>
 #include <stdint.h>
@@ -18,6 +19,10 @@
 #include <string.h>
 #include <cutils/hashmap.h>
 
+#if defined(__i386__)
+#include <sys/mman.h>
+#endif
+
 #if defined(__arm__)
 #include <unistd.h>
 #endif
@@ -989,7 +994,14 @@
         }
 
         virtual int finishCompile() {
-            return 0;
+            size_t pagesize = 4096;
+            size_t base = (size_t) getBase() & ~ (pagesize - 1);
+            size_t top =  ((size_t) getPC() + pagesize - 1) & ~ (pagesize - 1);
+            int err = mprotect((void*) base, top - base, PROT_READ | PROT_WRITE | PROT_EXEC);
+            if (err) {
+               error("mprotect() failed: %d", errno);
+            }
+            return err;
         }
 
     private:
@@ -1031,7 +1043,7 @@
 
         void gmov(int l, int t) {
             o(l + 0x83);
-            oad((t < LOCAL) << 7 | 5, t);
+            oad((t > -LOCAL && t < LOCAL) << 7 | 5, t);
         }
     };
 
@@ -2165,7 +2177,7 @@
             inp();
             next();
             globalDeclarations();
-            pGen->finishCompile();
+            result = pGen->finishCompile();
         }
         return result;
     }