cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jlesquer
Contributor
Contributor
1,986 Views
Registered: ‎10-08-2013

compiling errors SDK application with petalinux 2018.2

Jump to solution

Hi,

I'm trying to develop an app in sdk using  the generated libraries in petalinux runing:

petalinux-build --sdk

petalinux-package --sysroot

I added the paths:

Untitled2.jpgUntitled.jpg

 

And I'm having the next errors:

Invoking: ARM v8 Linux gcc linker
aarch64-linux-gnu-gcc -L"/home/myuser/hdl/dev/Petalinux_test/Petalinux/uz7ev_evcc_2018_2/images/linux/sdk/sysroots/aarch64-xilinx-linux/usr/lib" -L"/home/myuser/hdl/dev/Petalinux_test/Petalinux/uz7ev_evcc_2018_2/images/linux/sdk/sysroots/aarch64-xilinx-linux/lib" -o "TestCamApi.elf"  ./src/helloworld.o   -lm
/home/myuser/opt/Xilinx/SDK/2018.2/gnu/aarch64/lin/aarch64-linux/bin/../lib/gcc/aarch64-linux-gnu/7.2.1/../../../../aarch64-linux-gnu/bin/ld: cannot find /lib/libc.so.6
/home/myuser/opt/Xilinx/SDK/2018.2/gnu/aarch64/lin/aarch64-linux/bin/../lib/gcc/aarch64-linux-gnu/7.2.1/../../../../aarch64-linux-gnu/bin/ld: cannot find /usr/lib/libc_nonshared.a
makefile:36: recipe for target 'TestCamApi.elf' failed
/home/myuser/opt/Xilinx/SDK/2018.2/gnu/aarch64/lin/aarch64-linux/bin/../lib/gcc/aarch64-linux-gnu/7.2.1/../../../../aarch64-linux-gnu/bin/ld: cannot find /lib/ld-linux-aarch64.so.1
collect2: error: ld returned 1 exit status
make: *** [TestCamApi.elf] Error 1

 

I followed the steps here  and the solution on similar post issue here and nothing worked.

It looks like it is missing the Miscellaneous Linker Flags, but I can not find the correct path/file to add, I looked in the above links and in this AR#69159 .

Every time I'm adding the sysroot path to theMiscellaneous Linker Flags, for instance:

--sysroot = "/home/myuser/hdl/dev/Petalinux_test/Petalinux/uz7ev_evcc_2018_2/images/linux/sdk/sysroots/aarch64-xilinx-linux"

I've got the error "file not recognised: Is a directory" and the errors change:

/home/myuser/opt/Xilinx/SDK/2018.2/gnu/aarch64/lin/aarch64-linux/bin/../lib/gcc/aarch64-linux-gnu/7.2.1/../../../../aarch64-linux-gnu/bin/ld: cannot find crt1.o: No such file or directory
/home/myuser/opt/Xilinx/SDK/2018.2/gnu/aarch64/lin/aarch64-linux/bin/../lib/gcc/aarch64-linux-gnu/7.2.1/../../../../aarch64-linux-gnu/bin/ld: cannot find crti.o: No such file or directory
/home/myuser/hdl/dev/Petalinux_test/Petalinux/uz7ev_evcc_2018_2/images/linux/sdk/sysroots/aarch64-xilinx-linux: file not recognised: Is a directory
collect2: error: ld returned 1 exit status

I'm lost with this because I don't know what to add to the linker flag option, and I cannot find the plnx_aarch64 file as suggested in the AR......

Any suggestions?

I'd appreciate any help with this.

Thanks in advance.

0 Kudos
1 Solution

Accepted Solutions
jlesquer
Contributor
Contributor
1,911 Views
Registered: ‎10-08-2013

Hi @shabbirk , thanks for your reply.

Yes, I tried to modify the paths as is mentioned in that thread but it didn't work till now because I had another path in Linker Miscellaneous which made a conflict, so what did the trick is to leave the Miscellaneous linker path blank. I've got it working now with only this line in the Linker Libraries (as suggested):

"/home/myuser/hdl/dev/Petalinux_test/Petalinux/uz7ev_evcc_2018_2/images/linux/sdk/sysroots/aarch64-xilinx-linux"

And removing any --sysroot=<path> from Linker Miscellaneous

View solution in original post

3 Replies
jlesquer
Contributor
Contributor
1,952 Views
Registered: ‎10-08-2013

I've also had a look to this thread and tried to implement @stephenm suggestions, but unfortunatelly I'm still having same errors... 

I looked for the "missing" libraries (like the libc.so.6) and they are in the correct sysroot folder path but XSDK cannot find them....

Is it a known problem with the 2018.2 tools? 

Any ideas?

 

 

 

0 Kudos
shabbirk
Moderator
Moderator
1,928 Views
Registered: ‎12-04-2016

Hi

Please refer to below thread. you need to change the library path as mentioned

https://forums.xilinx.com/t5/Embedded-Linux/Develop-Linux-app-with-Xilinx-XSDK-and-Petalinux-2018-2-rootfs/td-p/903024

 

 

 

0 Kudos
jlesquer
Contributor
Contributor
1,912 Views
Registered: ‎10-08-2013

Hi @shabbirk , thanks for your reply.

Yes, I tried to modify the paths as is mentioned in that thread but it didn't work till now because I had another path in Linker Miscellaneous which made a conflict, so what did the trick is to leave the Miscellaneous linker path blank. I've got it working now with only this line in the Linker Libraries (as suggested):

"/home/myuser/hdl/dev/Petalinux_test/Petalinux/uz7ev_evcc_2018_2/images/linux/sdk/sysroots/aarch64-xilinx-linux"

And removing any --sysroot=<path> from Linker Miscellaneous

View solution in original post