Trying to run a cross-compiled executable on target device fails with: No such file or directory

后端 未结 3 667
小蘑菇
小蘑菇 2021-02-05 16:04

I\'ve got caught in the not-so-sunny world of cross-compilation.

I\'m trying to compile a simple hello world application for my BeagleBone Black (which runs a TI Cortex-

3条回答
  •  春和景丽
    2021-02-05 16:39

    I had the same problem. I downloaded and installed gcc-arm-linuc-gnueabihf package to my Ubuntu PC from the Ubuntu repository using apt-get. Then I compiled a helloworld test program and downloaded it using sftp to my BeagleBone.

    Trying to run the program on BBB gave the error: "No such file or directory"

    Using objdump I found that the .interp field in the ELF executable was /lib/ld_linux_armhf.so.3. My BBB had dynamic linker /lib/ld-linux.so.3.

    I created a symbolic link on the BBB:

    ln -s /lib/ld-linux.so.3 /lib-linux-armhf.so.3
    

    Now the cross-compiled application works on BBB. The BBB is running the original Angstrom distribution.

    This is not the ideal fix. Now I need to either confgure the toolchain in Ubuntu to add the correct dynamic linker name to the app, or update the BBB to have a dynamic linker specified in the toolchain.

    I assume the error message is due to the dynamic linker file not found, not that the application doesn't exist.

提交回复
热议问题