How to setup arm-linux-gnuabihf cross-compile ? [message #1784545] |
Thu, 29 March 2018 04:07  |
Eclipse User |
|
|
|
Hello,
I am trying to run cross-compile with arm-linux-gnuabihf for my developementboard with an armv7 (cortex-a9) with arm-ds-5 which is based on the eclipse enviroment. First im trying to run a simple "Helloworld" to validate the settings, but i have run into problems i somehow cannot overcome.
What i have done so far is to generate a linux with buildroot with a gdbserver to run on my board. Gdb-multiarch is installed on the host. The arm-linux-gnueabihf is installed on the host. I have compiled a Helloworld with the toolchain and was able to cross-compile with it on the board via commandline, so there shouldnt be any problem with these programs.
The ssh connection is setup as well and i am able to connect to the board properly.
Eclipse knows there is a arm-linux-gnueabihf and i can choose the toolchain inside eclipse (i used add_toolchain and select_default_toolchain to do this).
I created a new empty executable Project and added a sorce file for a Helloworld program (the same i used for command line test):
#include <stdio.h>
int main()
{
printf("Hello");
return 0;
}
The debug configurations for a c/c++ remote application point to the project and the executable hello file. The build configuration is set to Debug.
GDB debugger is set to gdb-multiarch ant the commant file is .gdbinit. Other settings are default.
So the first error i have is that the project doesnt get build correctly.
When running:
arm-linux.gnueabihf-gcc -o "Hello" ./hello.o
I get an error:
./hello.o: file not recognized: File format not recognized
collect2: error : ld returned 1 exit status
make: *** [Hello] Error 1
So when i run debug i will be asked if i want to proceed anyway and if i want to switch in debug view. In debug view i get a window which states "No source available for "__libc_csu_init() at 0x840c"" but I AM ABLE TO DEBUG in assembler.
I would like to debug directly from my sourcefile like normal people do, but i dont know how to accomplish that.
I am using ubuntu 14.04 64-bit the arm processor is 32-bit maybe there is some problem.
I would like to use eclipse under Windows, too, but i dont know how to setup mingw correctly (i think i need mingw).
So i basicly have 3 Problems in short:
1.) ERROR: ./hello.o: file not recognized: File format not recognized
2.) ERROR: No source available for "__libc_csu_init() at 0x840c
3.) Setting up MinGW for eclipse on win10
Any hints or solutions are highly appreciated. If anything is unclear give me a chance to be more specific. Although i belive i postet my thread in the correct location, please relocate this threat if i am mistaking.
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04314 seconds