Hi guys,
I need some help. I'm so close to getting this working.
I'm new to Linux. I managed to build an image for the Sabre Lite i.MX6 board, put it on an SD card and it booted.
Next I built meta-toolchain for the Sabre Lite and its installed into /opt/poky/1.8 on my desktop Ubuntu.
I'm trying now to build a simple "Hello World" program in Eclipse and download it to the Sabre Lite board. Here's where the problem is.
Eclipse is able to compile the program successfully. Eclipse shows it as an [arm/le] binary. Eclipse is able to download it to the board and I see the file appear on the Sabre Lite in the correct directory in a terminal program. Eclipse is able to start up the gdbserver debugger on the Sabre Lite board. But when Eclipse runs the program, it reports :
"Cannot exec /home/Eclipse/Firmware/Cross-A/Cross-A: No such file or directory."
I tried chmod 777 on the file. But it still says the same thing. It won't run.
I'm not sure why my program won't run. I'm wondering if perhaps I'm using the wrong toolchain (i.e. the binary is not compiled for the right target) or I've got the compiler/linker/assembler setup improperly in Eclipse. What could the problem be?
Do you see anything wrong here with my settings in Eclipse? :
Target Architecture : coretexa9hf-vfp-neon-poky-linux-gnueabi
Compiler prefix : arm-poky-linux-gnueabi-
Cross GCC Compiler : gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 --sysroot=/opt/poky/1.8/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi
Cross GCC Linker : gcc --sysroot=/opt/poky/1.8/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi
Assembler : as
Or perhaps do you see anything wrong here :
Last login: Sat Jul 25 01:42:42 2015 from 192.9.207.23
echo $PWD'>'
chmod 777 /home/Eclipse/Firmware/Cross-A/Cross-A;gdbserver :2345 /home/Eclipse/Firmware/Cross-A/Cross-A;exit
root@imx6qsabrelite:~# echo $PWD'>'
/home/root>
root@imx6qsabrelite:~# chmod 777 /home/Eclipse/Firmware/Cross-A/Cross-A;gdbserver :2345 /home/Eclipse/Firmware/Cross-A/Cross-A;exit
Process /home/Eclipse/Firmware/Cross-A/Cross-A created; pid = 415
Cannot exec /home/Eclipse/Firmware/Cross-A/Cross-A: No such file or directory.
Child exited with status 127
No program to debug. GDBserver exiting.
logout
Solved! Go to Solution.
Hi,
I managed to solve the issue.
On the target (Sabre Lite) after the application Cross-A was compiled and downloaded to a directory, I typed :
file Cross-A
It reported :
./Cross-A : ELF 32 bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3 for GNU Linux 2.6.31, not stripped
I decided to do a find to see if I could find the interpreter ld-linux.so.3 in the rootfs of the Sabre Lite image I was using to boot the board.
find / -name 'ld-linux.so.3'
It found nothing! The file did not exist anywhere in the rootfs. Maybe that's why Cross-A was not launching. It could not find the library it was looking for in /lib to run. So I looked in /lib and found a similar file (a symbolic link to a file actually) named :
ld-linux-armhf.so.3
I created a copy of the above symbolic link and named it ld-linux.so.3 (which the binary Cross-A was looking for) in the same /lib directory
cp ld-linux-armhf.so.3 ld-linux.so.3
Then I went back to the directory where Cross-A binary was located and ran it. It worked!!
!!!Hello World!!!
Why the file had the "armhf" keyword in the middle in my image and why Cross-A was looking for a file without that keyword, I don't know.
I recall reading that in Yocto fido (which I'm using), the keyword "armhf" was appended to some libraries - for what reason I know not. Anyway for those of you struggling out there with this problem, I hope this helps.
I've run in to the same problem. If you're building with -mfloat-abi=hard, you also need to link with the option -mfloat-abi=hard. Resulting executable then references the ld-linux-armhf (presumably arm hard float) correctly.
1.
Please try Linux command "file" on the i.MX6 target to check file type of
"/home/Eclipse/Firmware/Cross-A/Cross-A".
2. Is it possible to run "/home/Eclipse/Firmware/Cross-A/Cross-A" on the target
(without GDB) ?
Regards,
Yuri.
Hi,
I managed to solve the issue.
On the target (Sabre Lite) after the application Cross-A was compiled and downloaded to a directory, I typed :
file Cross-A
It reported :
./Cross-A : ELF 32 bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3 for GNU Linux 2.6.31, not stripped
I decided to do a find to see if I could find the interpreter ld-linux.so.3 in the rootfs of the Sabre Lite image I was using to boot the board.
find / -name 'ld-linux.so.3'
It found nothing! The file did not exist anywhere in the rootfs. Maybe that's why Cross-A was not launching. It could not find the library it was looking for in /lib to run. So I looked in /lib and found a similar file (a symbolic link to a file actually) named :
ld-linux-armhf.so.3
I created a copy of the above symbolic link and named it ld-linux.so.3 (which the binary Cross-A was looking for) in the same /lib directory
cp ld-linux-armhf.so.3 ld-linux.so.3
Then I went back to the directory where Cross-A binary was located and ran it. It worked!!
!!!Hello World!!!
Why the file had the "armhf" keyword in the middle in my image and why Cross-A was looking for a file without that keyword, I don't know.
I recall reading that in Yocto fido (which I'm using), the keyword "armhf" was appended to some libraries - for what reason I know not. Anyway for those of you struggling out there with this problem, I hope this helps.
It is recommended to use GCC option "-mfloat-abi=softfp" with FSL Linux.
https://community.freescale.com/docs/DOC-103736
Regards,
Yuri.