Added beginnings of an ARM port, to the point where it compiles.  It does not
run, though.  There are lots of stubs to be filled in.  (The asm ones currently
just have "swi" in them, which seems to cause seg faults.) 

Also, some of the macros are decided dubious, especially:

  ARCH_* are bogus
  SYSCALL_RET is bogus
  PLATFORM_SET_SYSCALL_RESULT is bogus
  not sure about SET_SYSCALL_RETVAL
  FIRST_STACK_FRAME et al -- bogus?
  VG_MAX_JUMPS ?

And in stage2.lds, the 0x8048000 is almost certainly wrong


This required some tweakings of the core:
- some of the vki_*.h kernel types were fixed up

- had to disable the AM_PROG_CC_C_O macro in configure.in, because automake
  (autoconf?) didn't like it...

- some "#ifdef __x86__" guards were introduced, for nasty x86 things I don't
  yet know how to factor out (trampoline page muck, sysinfo page muck).

- fixed a minor stupidity in vg_proxylwp.c.

- moved the ptrace wrapper into the x86-linux part

- had to change the intercept mangling scheme, to use 'J' instead of '$' as the
  escape char because GCC didn't like '$'.  This is all very dubious, and only
  works because none of our intercepted symbols contains a 'J'.  To be fixed up
  ASAP.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3120 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/vg_main.c b/coregrind/vg_main.c
index a92af0f..0930f2c 100644
--- a/coregrind/vg_main.c
+++ b/coregrind/vg_main.c
@@ -1120,9 +1120,11 @@
    *auxv = *orig_auxv;
    vg_assert(auxv->a_type == AT_NULL);
 
+#ifdef __x86__
    /* --- trampoline page --- */
    VG_(memcpy)( (void *)VG_(client_trampoline_code),
                 &VG_(trampoline_code_start), VG_(trampoline_code_length) );
+#endif
 
    vg_assert((strtab-stringbase) == stringsize);
 
@@ -1671,7 +1673,6 @@
 static void process_cmd_line_options( UInt* client_auxv, const char* toolname )
 {
    Int  i, eventually_log_fd;
-   Int *auxp;
    Int  toolname_len = VG_(strlen)(toolname);
 
    /* log to stderr by default, but usage message goes to stdout */
@@ -1682,13 +1683,18 @@
      config_error("Please use absolute paths in "
                   "./configure --prefix=... or --libdir=...");
 
-   for (auxp = client_auxv; auxp[0] != AT_NULL; auxp += 2) {
-      switch(auxp[0]) {
-      case AT_SYSINFO:
-	 auxp[1] = (Int)(VG_(client_trampoline_code) + VG_(tramp_syscall_offset));
-	 break;
-      }
-   } 
+#ifdef __x86__
+   {
+      Int *auxp;
+      for (auxp = client_auxv; auxp[0] != AT_NULL; auxp += 2) {
+         switch(auxp[0]) {
+         case AT_SYSINFO:
+            auxp[1] = (Int)(VG_(client_trampoline_code) + VG_(tramp_syscall_offset));
+            break;
+         }
+      } 
+   }
+#endif
 
    for (i = 1; i < vg_argc; i++) {
 
@@ -2565,12 +2571,14 @@
    VG_(parse_procselfmaps) ( build_segment_map_callback );  /* everything */
    sp_at_startup___global_arg = 0;
    
+#ifdef __i386__
    //--------------------------------------------------------------
    // Protect client trampoline page (which is also sysinfo stuff)
    //   p: segment stuff   [otherwise get seg faults...]
    //--------------------------------------------------------------
    VG_(mprotect)( (void *)VG_(client_trampoline_code),
                  VG_(trampoline_code_length), VKI_PROT_READ|VKI_PROT_EXEC );
+#endif
 
    //==============================================================
    // Can use VG_(map)() after segments set up