title: Cross compiling static C hello world for Android using arm-linux-gnueabi-gcc
body: <p>I want to build a static hello world from C using arm-linux-gnueabi-gcc as opposed to using the NDK standalone toolchain or Codesourcery for that matter.</p>
  
  <p>In Ubuntu...</p>
  
  <p>I have done the following:</p>
  
  <pre><code>sudo apt-get install gcc-arm-linux-gnueabi
  </code></pre>
  
  <p>I created a hi.c like this:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(int argc, char** argv) {
     printf("hello world\n");
     return 0;
  }
  </code></pre>
  
  <p>I have compiled it like this:</p>
  
  <pre><code>arm-linux-gnueabi-gcc -static hi.c -o hi 
  </code></pre>
  
  <p>I ran it on an emulator like this:</p>
  
  <pre><code>adb push hi /data/hi
  adb shell /data/hi
  </code></pre>
  
  <p>But, I get this:</p>
  
  <pre><code>[1]   Illegal instruction     /data/hi
  </code></pre>
  
  <p>What step have I forgot?  Based on past experience this "should" have worked, but I obviously messed this up.</p>