I have Raspbian Jessie installed on my Raspberry PI, and I have a virtual box with a fresh install of Debian Jessie for amd64 with the armhf architecture enabled, and with the ARM cross toolchain from Emdebian installed. This is gcc 4.9 on both systems, and libc6 2.19-17 on both systems.
However, when I cross-compile a simple hello world on amd64:
root@vbox:~/# arm-linux-gnueabihf-gcc-4.9 -g hello.c -o "hello.arm"
and try to run it on the ARM device, I get a segfault:
pi@raspberrypi ~/host/raspi $ gdb hello.arm
GNU gdb (Raspbian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from hello.arm...done.
(gdb) run
Starting program: /home/pi/host/raspi/hello.arm
Program received signal SIGSEGV, Segmentation fault.
0x0005f4be in ?? ()
(gdb)
Any thoughts as to what's wrong here?