This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I am trying to set up cross compiling for my Dart-4460 and am running into a strange problem.
First my setup. My development environment is Ubuntu 12.04.5 LTS 32-bit using arm-linux-gnueabihf as my tool-chain. My target is the Variscite Dart-4460.
To show my issue I created an empty cpp program with just a main function that returns 0.
I run the follow command to compile.
arm-linux-gnueabihf-g++ -O0 -Wall -o "HelloWorld" "./Main.cpp"
I transfer the file over and everything works fine.
Now for the weird part, if I add -c to the build so I can link in a separate step it doesn't work anymore. I used the commands below.
arm-linux-gnueabihf-g++ -O0 -Wall -c -o "Main.o" "./Main.cpp" arm-linux-gnueabihf-g++ -o "HelloWorld" "./Main.o"
When I transfer the file over I get a Segmentation Fault.
So here is some information I've gathered.
I ran file on the executable, result = ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), stripped
I ran ldd on the executable, result = not a dynamic executable
I tried using gdb but it fails saying "not in executable format: File format not recognized"
I ran strace on it, I don't have the exact output but it says the SIGSEGV occured @ 0
Things I've tried.
-Setting -static, -nostdlib, -static-libgcc, -static-libstdc++ flags in various combinations on the link command
-Removing and reinstalling the tool-chain
-Made sure I have the same glibc version on both devices
-Setting the -mcpu=cortex-a9 flag
I've run out of ideas and for now am going to just build on the device but I would really like to get this working so any advice would be much appreciated. Thanks.
Ok, I figured it out and it turns out it was FileZilla not detecting that my file was a binary and it was transferring it as an ASCII file. Forced it to transfer as binary and it solved the problem.