title: Problem with gprof on OS X: [program] is not of the host architecture
body: <p>I'm having trouble running <code>gprof</code> on OS X. The file <code>test.c</code> is:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
    printf("Hello, World!\n");
    return 0;
  }
  </code></pre>
  
  <p>and my terminal looks like:</p>
  
  <pre><code>$ gcc -pg test.c
  $ gcc -pg -o test test.c
  $ ./test
  Hello, World!
  $ gprof test
  gprof: file: test is not of the host architecture
  </code></pre>
  
  <p>Edit: also, it doesn't generate the file <code>gmon.out</code>.</p>
  
  <p>What's going on here?</p>