AnsweredAssumed Answered

Unable to run my program (Cannot exec such file or directory)

Question asked by M T on Jul 24, 2015
Latest reply on Apr 27, 2017 by chris_f

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
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'>'
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.