cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
asobeih
Explorer
Explorer
973 Views
Registered: ‎02-13-2016

LD returned 1 exit status error while cross compiling files for DPU

Jump to solution

Hi,

I am trying to cross-compile the kernel files generated from the Vitis AI Compiler to be executed on the DPU. I am following this tutorial:

https://developer.xilinx.com/en/articles/medical-ai-application-acceleration-with-xilinx-vitis-ai.html

When I execute the following command, I have this error.

 

(base) user@user:~/Desktop/zcu104_itip/out$ aarch64-xilinx-linux-gcc -fPIC -shared dpu_thin_1stage_dense_0.elf -o libdpumodeldpu_thin_1stage_dense.so
/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/real-ld: cannot find crti.o: No such file or directory
/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/real-ld: cannot find crtbeginS.o: No such file or directory
/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/real-ld: cannot find -lgcc
/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/real-ld: cannot find -lgcc_s
/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/real-ld: cannot find -lc
/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/real-ld: cannot find -lgcc
/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/real-ld: cannot find -lgcc_s
/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/real-ld: cannot find crtendS.o: No such file or directory
/home/user/petalinux_sdk/sysroots/x86_64-petalinux-linux/usr/libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/real-ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
(base) user@user:~/Desktop/zcu104_itip/out$ 

 

How to solve this problem?

0 Kudos
1 Solution

Accepted Solutions
asobeih
Explorer
Explorer
794 Views
Registered: ‎02-13-2016

Hi @roguma,

Indeed. You are absolutely right. however, I tried this solution you are proposing with the aarch64-xilinx-linux-gcc compiler and it did not work, however, it worked with the GNU compiler. I have solved it myself and posted the solution here on the fourm.

Thanks a lot for helping me out with this. I do appreciate that!

View solution in original post

0 Kudos
3 Replies
asobeih
Explorer
Explorer
903 Views
Registered: ‎02-13-2016
Hi,

I still have not received any response to my question, yet! Would you please help me with that?

Thanks,
0 Kudos
roguma
Observer
Observer
802 Views
Registered: ‎05-07-2018

Hello,

The problem is caused due to your sysroot is not found. You must to specify your sysroot directory as an argument while compiling:

 

aarch64-xilinx-linux-gcc -fPIC -shared --sysroot=$SDKTARGETSYSROOT -shared dpu_thin_1stage_dense_0.elf -o libdpumodeldpu_thin_1stage_dense.so

 

0 Kudos
asobeih
Explorer
Explorer
795 Views
Registered: ‎02-13-2016

Hi @roguma,

Indeed. You are absolutely right. however, I tried this solution you are proposing with the aarch64-xilinx-linux-gcc compiler and it did not work, however, it worked with the GNU compiler. I have solved it myself and posted the solution here on the fourm.

Thanks a lot for helping me out with this. I do appreciate that!

View solution in original post

0 Kudos