diff --git a/Tupfile b/Tupfile
index 47130e7..8fa3058 100644
--- a/Tupfile
+++ b/Tupfile
@@ -1,14 +1,16 @@
 include_rules
 
-CFLAGS0=-DDEBUG -DGLUE_CHECKSUM=0 -DXLIB -DFAST_COMPILER -DSIC_COMPILER -DNATIVE_ARCH=i386 -DDYNLINK_SUPPORTED -DCOMPILER=GCC_COMPILER -DTARGET_OS_VERSION=LINUX_VERSION -DTARGET_OS_FAMILY=UNIX_FAMILY -DTARGET_ARCH=I386_ARCH -DHOST_ARCH=I386_ARCH -DGENERATE_DEBUGGING_AIDS=0 -DSPEND_TIME_FOR_DEBUGGING_BY_DEFAULT=0 -DTARGET_IS_OPTIMIZED=1 -DTARGET_IS_PROFILED=0 -DTARGET_IS_FOR_DEBUGGING=0 -m32 -fno-threadsafe-statics -fvisibility=default -fkeep-inline-functions -fno-exceptions -fno-stack-protector -Wabi -Wreorder -Wreturn-type -Wswitch -Wcomment -Wformat -Wpointer-arith -Woverloaded-virtual -Wno-write-strings -Wparentheses -Ivm/src/any/asm -Ivm/src/any/fast_compiler -Ivm/src/any/interpreter -Ivm/src/any/lookup -Ivm/src/any/memory -Ivm/src/any/objects -Ivm/src/any/os -Ivm/src/any/parser -Ivm/src/any/prims -Ivm/src/any/runtime -Ivm/src/any/sic -Ivm/src/any/zone -Ivm/src/i386/asm -Ivm/src/i386/fast_compiler -Ivm/src/i386/lookup -Ivm/src/i386/memory -Ivm/src/i386/prims -Ivm/src/i386/runtime -Ivm/src/i386/sic -Ivm/src/i386/zone -Ivm/src/unix/os -Ivm/src/unix/prims -Ivm/src/unix/runtime -Iobjects/glue -Iincls
+CC0=g++
+CC=i686-android-linux-g++
+CFLAGS0=-DDEBUG -DGLUE_CHECKSUM=0 -DFAST_COMPILER -DSIC_COMPILER -DNATIVE_ARCH=i386 -DDYNLINK_SUPPORTED -DCOMPILER=GCC_COMPILER -DTARGET_OS_VERSION=LINUX_VERSION -DTARGET_OS_FAMILY=UNIX_FAMILY -DTARGET_ARCH=I386_ARCH -DHOST_ARCH=I386_ARCH -DGENERATE_DEBUGGING_AIDS=0 -DSPEND_TIME_FOR_DEBUGGING_BY_DEFAULT=0 -DTARGET_IS_OPTIMIZED=1 -DTARGET_IS_PROFILED=0 -DTARGET_IS_FOR_DEBUGGING=0 -m32 -fno-threadsafe-statics -fvisibility=default -fkeep-inline-functions -fno-exceptions -fno-stack-protector -Wabi -Wreorder -Wreturn-type -Wswitch -Wcomment -Wformat -Wpointer-arith -Woverloaded-virtual -Wno-write-strings -Wparentheses -Ivm/src/any/asm -Ivm/src/any/fast_compiler -Ivm/src/any/interpreter -Ivm/src/any/lookup -Ivm/src/any/memory -Ivm/src/any/objects -Ivm/src/any/os -Ivm/src/any/parser -Ivm/src/any/prims -Ivm/src/any/runtime -Ivm/src/any/sic -Ivm/src/any/zone -Ivm/src/i386/asm -Ivm/src/i386/fast_compiler -Ivm/src/i386/lookup -Ivm/src/i386/memory -Ivm/src/i386/prims -Ivm/src/i386/runtime -Ivm/src/i386/sic -Ivm/src/i386/zone -Ivm/src/unix/os -Ivm/src/unix/prims -Ivm/src/unix/runtime -Iobjects/glue -Iincls
 
 CFLAGS=$(CFLAGS0) -include incls/_precompiled.hh -Winvalid-pch
 
 LINKFLAGS=-m32 -fno-threadsafe-statics -fvisibility=default -fkeep-inline-functions -fno-exceptions -fno-stack-protector -Wabi -Wreorder -Wreturn-type -Wswitch -Wcomment -Wformat -Wpointer-arith -Woverloaded-virtual -Wno-write-strings -Wparentheses
 
 ## build_support 
-: vm/build_support/makeDeps.cpp |> $(CC) $(CFLAGS0) -o %o -c %f |> %f.o
-: vm/build_support/makeDeps.cpp.o |> $(CC) $(LINKFLAGS) %f -o %o -rdynamic |> vm/build_support/makeDeps
+: vm/build_support/makeDeps.cpp |> $(CC0) $(CFLAGS0) -o %o -c %f |> %f.o
+: vm/build_support/makeDeps.cpp.o |> $(CC0) $(LINKFLAGS) %f -o %o -rdynamic |> vm/build_support/makeDeps
 
 ## incls
 INCLS0= \
@@ -309,46 +311,46 @@ INCLS0= \
 : incls/_precompiled.hh | $(INCLS0) |> $(CC) $(CFLAGS0) -c %f -o %o |> %f.gch
 
 ## vmDate
-DATE="`date \"+%a\ %d\ %h\ %y\ %H:%M:%S\"`"
-GIT="`git describe --tags --dirty`"
+DATE="undefined"
+GIT="undefined"
 PLATFORM="Linux i386"
 
 : vm/build_support/vmDate.cpp.in |> sed -e s/@DATE@/$(DATE)/g -e s/@PLATFORM@/$(PLATFORM)/g -e s/@GIT_REVISION@/$(GIT)/g %f >%o |> incls/vmDate.cpp
-: incls/vmDate.cpp | incls/_precompiled.hh.gch |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: incls/vmDate.cpp | incls/_precompiled.hh.gch |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
 
 INCLS=$(INCLS0) incls/_precompiled.hh.gch
 
 ## Glue
-: objects/glue/stat_glue.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: objects/glue/termcap_glue.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: objects/glue/transcendental_glue.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: objects/glue/xlib_glue.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: objects/glue/stat_glue.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: objects/glue/termcap_glue.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: objects/glue/transcendental_glue.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+#: objects/glue/xlib_glue.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
 
 ## VM
-: foreach vm/src/unix/prims/*.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: foreach vm/src/unix/os/*.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: foreach vm/src/unix/runtime/*.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: foreach vm/src/i386/lookup/*.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: foreach vm/src/i386/zone/*.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: foreach vm/src/i386/fast_compiler/*.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: foreach vm/src/i386/prims/*.S | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: foreach vm/src/i386/asm/*.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: foreach vm/src/i386/sic/*.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: foreach vm/src/i386/memory/*.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: foreach vm/src/i386/runtime/*.cpp vm/src/i386/runtime/*.S | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: foreach vm/src/any/lookup/*.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: foreach vm/src/any/zone/*.cpp *.S | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: foreach vm/src/any/fast_compiler/*.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: foreach vm/src/any/interpreter/*.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: foreach vm/src/any/prims/*.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: foreach vm/src/any/parser/*.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: foreach vm/src/any/os/*.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: foreach vm/src/any/asm/*.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: foreach vm/src/any/sic/*.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: foreach vm/src/any/memory/*.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: foreach vm/src/any/runtime/*.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
-: foreach vm/src/any/objects/*.cpp | $(INCLS) |> g++ $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: foreach vm/src/unix/prims/*.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: foreach vm/src/unix/os/*.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: foreach vm/src/unix/runtime/*.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: foreach vm/src/i386/lookup/*.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: foreach vm/src/i386/zone/*.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: foreach vm/src/i386/fast_compiler/*.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: foreach vm/src/i386/prims/*.S | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: foreach vm/src/i386/asm/*.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: foreach vm/src/i386/sic/*.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: foreach vm/src/i386/memory/*.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: foreach vm/src/i386/runtime/*.cpp vm/src/i386/runtime/*.S | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: foreach vm/src/any/lookup/*.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: foreach vm/src/any/zone/*.cpp *.S | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: foreach vm/src/any/fast_compiler/*.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: foreach vm/src/any/interpreter/*.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: foreach vm/src/any/prims/*.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: foreach vm/src/any/parser/*.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: foreach vm/src/any/os/*.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: foreach vm/src/any/asm/*.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: foreach vm/src/any/sic/*.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: foreach vm/src/any/memory/*.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: foreach vm/src/any/runtime/*.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
+: foreach vm/src/any/objects/*.cpp | $(INCLS) |> $(CC) $(CFLAGS) -o %o -c %f |> %f.o {objs}
 
-: {objs} |> $(CC) $(LINKFLAGS) %f -o %o -rdynamic -lpthread -lX11 -lXext -lncurses -ltinfo -ldl |> Self
+: {objs} |> $(CC) $(LINKFLAGS) %f -o %o -rdynamic /home/chris/stkx86/lib/libtinfo.a -ldl |> Self
 
 
diff --git a/vm/src/any/os/sig.cpp b/vm/src/any/os/sig.cpp
index 0340783..140c7a1 100755
--- a/vm/src/any/os/sig.cpp
+++ b/vm/src/any/os/sig.cpp
@@ -167,7 +167,7 @@ void SignalInterface::simulate_fatal_signal() {
 // signal, call me.
 void SignalInterface::handle_Self_signal(SelfSignal ssig) {
   const int max_ctrl_c = 5;
-  FlagSettingInt fs(errno, 0);  // save errno
+  FlagSettingInt fs((int&)errno, 0);  // save errno
   safely_handle_Self_signal(ssig);
   
   smi kbs = PendingSelfSignals::keyboard_signals();
@@ -218,7 +218,7 @@ void SignalInterface::safely_handle_Self_signal(SelfSignal ssig) {
 // Handle an OS signal that won't be passed to Self
 void SignalInterface::handle_OS_signal(int ossig, char* addr, int32 code) {
 
-  FlagSettingInt fs(errno, 0);  // save errno
+  FlagSettingInt fs((int&)errno, 0);  // save errno
 
   if (eventLog != NULL) // might not exist yet
     LOG_EVENT3("signal %ld pc %#lx npc %#lx",
diff --git a/vm/src/any/runtime/allocation.cpp b/vm/src/any/runtime/allocation.cpp
index cca41a8..63e69bf 100755
--- a/vm/src/any/runtime/allocation.cpp
+++ b/vm/src/any/runtime/allocation.cpp
@@ -333,7 +333,10 @@ static int32 true_size_of_malloced_obj(int32* p) {
 
 void malloc_init() {
     # if TARGET_OS_VERSION == LINUX_VERSION
+      # if defined(__ANDROID__)
+      # else
       mallopt(M_MMAP_MAX, 0); // if Linux malloc mmaps, we get bit 31 on, which conflicts with memOop marking
+      # endif
     # endif
     mallocReserve= (caddr_t)malloc(mallocReserveAmount);
     if (mallocReserve == NULL)
diff --git a/vm/src/any/zone/fprofiler.cpp b/vm/src/any/zone/fprofiler.cpp
index ff0dd4b..0db2980 100755
--- a/vm/src/any/zone/fprofiler.cpp
+++ b/vm/src/any/zone/fprofiler.cpp
@@ -25,13 +25,22 @@ extern "C" int profil( char* /*buf*/,
   return 0;
 }
 # elif TARGET_OS_FAMILY == UNIX_FAMILY
+#if defined(__ANDROID__)
+extern "C" int profil( short unsigned int* /*buf*/,
+            size_t   /*bufsiz*/,
+            unsigned long    /*offset*/,
+            unsigned int    /*scale*/ ) {
+  fatal("unimp mac");
+  return 0;
+}
+#else
 /* Pick this up from header file:
   extern "C" void profil(unsigned short *buf,
                          unsigned int bufsiz,
                          unsigned int offset,
                          unsigned int scale);
 */
-                       
+#endif                       
 # endif
 
 
diff --git a/vm/src/i386/runtime/interruptedCtx_i386.cpp b/vm/src/i386/runtime/interruptedCtx_i386.cpp
index 79604d7..7415d1f 100644
--- a/vm/src/i386/runtime/interruptedCtx_i386.cpp
+++ b/vm/src/i386/runtime/interruptedCtx_i386.cpp
@@ -80,13 +80,13 @@ void InterruptedContext::setupPreemptionFromSignal() {
 # elif TARGET_OS_VERSION == LINUX_VERSION
 
   char** InterruptedContext::pc_addr() {
-    return  (char**) &scp->uc_mcontext.gregs[REG_EIP]; // see /usr/include/asm-i386/sigcontext.h
+    return  (char**) &scp->uc_mcontext.eip; // see /usr/include/asm-i386/sigcontext.h
   }
   int* InterruptedContext::sp_addr() {
-    return  (int*) &scp->uc_mcontext.gregs[REG_ESP];
+    return  (int*) &scp->uc_mcontext.esp;
   }
   int* InterruptedContext::ebp_addr() {
-    return  (int*) &scp->uc_mcontext.gregs[REG_EBP];
+    return  (int*) &scp->uc_mcontext.ebp;
   }
 
 # elif TARGET_OS_VERSION == SOLARIS_VERSION
@@ -135,7 +135,8 @@ void InterruptedContext::print_registers() {
   lprintf("gs       = 0x%x\n", ssp->__gs);
 
   # elif TARGET_OS_VERSION == LINUX_VERSION
-
+#if defined(__ANDROID__)
+#else
     greg_t *gregs = ic->scp->uc_mcontext.gregs;
     lprintf("eax       = 0x%x\n", gregs[REG_EAX]);
     lprintf("ebx       = 0x%x\n", gregs[REG_EBX]);
@@ -156,7 +157,8 @@ void InterruptedContext::print_registers() {
     lprintf("trapno    = 0x%x\n", gregs[REG_TRAPNO]);
     lprintf("err       = 0x%x\n", gregs[REG_ERR]);
     lprintf("uesp      = 0x%x\n", gregs[REG_UESP]);
-  
+#endif  
+
 # elif TARGET_OS_VERSION == SOLARIS_VERSION
   
   greg_t *gregs = ((ucontext_t*) ic->scp)->uc_mcontext.gregs;
diff --git a/vm/src/i386/runtime/runtime_i386.cpp b/vm/src/i386/runtime/runtime_i386.cpp
index 4ff38ed..146ec2a 100644
--- a/vm/src/i386/runtime/runtime_i386.cpp
+++ b/vm/src/i386/runtime/runtime_i386.cpp
@@ -100,7 +100,7 @@ void fillRegisterValue(Location loc, oop b) {
 
 
 void set_flags_for_platform() {
-  LogVMMessages                        = true;   lprintf("for I386:  LogVMMessages = true\n");
+  LogVMMessages                        = false;   lprintf("for I386:  LogVMMessages = true\n");
   PrintScriptName                      = true;   lprintf("for I386:  PrintScriptName  = true\n");
   Inline                               = true;   lprintf("for I386:  Inline = true\n");
   # ifdef SIC_COMPILER
diff --git a/vm/src/unix/os/os_includes_unix.hh b/vm/src/unix/os/os_includes_unix.hh
index 8e11248..5fb6823 100755
--- a/vm/src/unix/os/os_includes_unix.hh
+++ b/vm/src/unix/os/os_includes_unix.hh
@@ -104,6 +104,17 @@ extern "C" {
   typedef struct sigstack  self_stack_t;
 # elif TARGET_OS_VERSION == MACOSX_VERSION \
     || TARGET_OS_VERSION ==  LINUX_VERSION
+  #if defined(__ANDROID__)
+    // The Android NDK does not have sys/ucontext.h yet.
+    typedef struct ucontext {
+      uint32_t uc_flags;
+      struct ucontext *uc_link;
+      stack_t uc_stack;
+      struct sigcontext uc_mcontext;
+      // Other fields omitted...
+    } ucontext_t;
+  #endif
+
   typedef siginfo_t        self_code_info_t;
   typedef ucontext_t       self_sig_context_t;
   typedef stack_t          self_stack_t;
@@ -247,4 +258,4 @@ extern "C" { int malloc_verify(); }
 
 # if TARGET_OS_VERSION == MACOSX_VERSION
   typedef size_t nbytes_t;
-# endif
\ No newline at end of file
+# endif
diff --git a/vm/src/unix/os/os_unix.cpp b/vm/src/unix/os/os_unix.cpp
index e7b9533..0d97070 100755
--- a/vm/src/unix/os/os_unix.cpp
+++ b/vm/src/unix/os/os_unix.cpp
@@ -363,7 +363,7 @@ void OS::set_log_buf(FILE* f, char* buf, int bs) {
 
 const char* OS::log_file_name() {
   static char fname[100];
-  sprintf(fname, "/tmp/Self.vmlog.%ld", long(getpid()));
+  sprintf(fname, "./Self.vmlog.%ld", long(getpid()));
   assert(strlen(fname) < sizeof(fname), "");
   return fname;
 }
diff --git a/vm/src/unix/os/sig_unix.cpp b/vm/src/unix/os/sig_unix.cpp
index b173172..e1f472f 100755
--- a/vm/src/unix/os/sig_unix.cpp
+++ b/vm/src/unix/os/sig_unix.cpp
@@ -195,7 +195,7 @@ static int32 ctrl_z_handler(int sig) {
   if (InterruptedContext::the_interrupted_context->forwarded_to_self_thread(sig))
     return 0;
   
-  FlagSettingInt fs(errno, 0);  // save errno
+  FlagSettingInt fs((int&)errno, 0);  // save errno
   if (sig == SIGTSTP) {
     OS::handle_suspend_and_resume(true);
     LOG_EVENT("Control-Z");
diff --git a/vm/src/unix/runtime/interruptedCtx_unix.cpp b/vm/src/unix/runtime/interruptedCtx_unix.cpp
index 86625f4..b949a50 100755
--- a/vm/src/unix/runtime/interruptedCtx_unix.cpp
+++ b/vm/src/unix/runtime/interruptedCtx_unix.cpp
@@ -35,5 +35,5 @@ bool InterruptedContext::forwarded_to_self_thread(int sig) {
 }
 
 
-bool InterruptedContext::in_read_trap()  { return  in_system_trap()  &&  system_trap() == SYS_read;  }
-bool InterruptedContext::in_write_trap() { return  in_system_trap()  &&  system_trap() == SYS_write; }
+bool InterruptedContext::in_read_trap()  { return  in_system_trap()  &&  false /*system_trap() == SYS_read*/;  }
+bool InterruptedContext::in_write_trap() { return  in_system_trap()  &&  false /*system_trap() == SYS_write*/; }
