More than a cross-compiler, what you need is a toolchain, since there are more steps involving the process of getting an executable out of source code. These steps are
- Compile (source code to assembler)
- Assemble (assembler code to machine code)
- Link (routines and libraries in machine code linked together)
The naming standard in GNU toolchains is
<target>-<tool>, for example
arm-oe-linux-gnueabi-gcc would be the compiler for an ARM architecture, Open Embedded Linux variant, while
arm-oe-linux-gnueabi-as is the assembler of the same toolchain, and so on.
However, that is not all that you need to get from source code in the host to executable for the target machine, you need also the headers and libraries from the target machine in your host machine for the linker. That's why you had that build error "could not read symbols. File in wrong format".
Of course, once you have the headers and sysroot and everything copied into your host machine, you need to set the corresponding variables for the cross-compiler to find the right ones, and not the original from your host machine.
Generally speaking, source packages contain a Makefile prepared to accept a specific compiler. Seeing from previous comments, I gathered that you solved that much using the CC= variable. As soon as you have all set, just change the CC for your Makefile and call
So, long story short, you need to build your own toolchain for your target machine in your host machine or get an already built one.
Good luck and have fun!