How to solve “error while loading shared libraries” when trying to run an arm binary with qemu-arm?

后端 未结 6 718
-上瘾入骨i
-上瘾入骨i 2021-02-04 08:40

I\'m running Linux Mint 14 with qemu, qemu-user, and the gnueabi toolchain installed. I compiled test.c with arm-linux-gnueabi-gcc test.c -o test.

When I tr

6条回答
  •  一向
    一向 (楼主)
    2021-02-04 09:28

    A variant, which worked for me, was to pass the loader library directly and to specify the required library paths using the loader parameter --library-path. For example:

    $ TOOLCHAIN_ROOT=/usr/local/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf
    $ qemu-arm $TOOLCHAIN_ROOT/libc/lib/ld-linux-armhf.so.3 --library-path $TOOLCHAIN_ROOT/libc/lib/arm-linux-gnueabihf:/$TOOLCHAIN_ROOT/lib ./my_executable
    

    Or equivalently export LD_LIBRARY_PATH instead of using --library-path.

提交回复
热议问题