UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

取消
显示结果 
搜索替代 
您的意思是: 
Highlighted
Contributor
Contributor
561 次查看
注册日期: ‎11-18-2018

Xilinx SDK 如何Debug petalinux应用

转到解答

我创建了一个petalinux工程,已经使能TCF agent。我使用Xilinx SDK软件创建了一个linux应用

捕获.PNG

并设置了C/C++ Build Settings,添加了PATH,如下图:

2.PNG

最后在编译的过程中出现了如下错误:

Building target: hdmi.elf
Invoking: ARM v8 Linux gcc linker
aarch64-linux-gnu-gcc -L/home/zz/opt/petalinux/sysroots/aarch64-xilinx-linux/bin -L/home/zz/opt/petalinux/sysroots/aarch64-xilinx-linux/usr/bin -L/home/zz/opt/petalinux/sysroots/aarch64-xilinx-linux/usr/lib -o "hdmi.elf" ./src/video_lib/drm_helper.o ./src/video_lib/edid_helper.o ./src/video_lib/mediactl_helper.o ./src/video_lib/s2m_pipeline.o ./src/video_lib/swgen_pipeline.o ./src/video_lib/v4l2_helper.o ./src/video_lib/video.o ./src/modetest/format.o ./src/modetest/pattern.o ./src/menu.o ./src/video_cmd.o
/tools/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/bin/../lib/gcc/aarch64-linux-gnu/7.3.1/../../../../aarch64-linux-gnu/bin/ld: cannot find /lib/libc.so.6
makefile:38: recipe for target 'hdmi.elf' failed
/tools/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/bin/../lib/gcc/aarch64-linux-gnu/7.3.1/../../../../aarch64-linux-gnu/bin/ld: cannot find /usr/lib/libc_nonshared.a
/tools/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/bin/../lib/gcc/aarch64-linux-gnu/7.3.1/../../../../aarch64-linux-gnu/bin/ld: cannot find /lib/ld-linux-aarch64.so.1
collect2: error: ld returned 1 exit status
make: *** [hdmi.elf] Error 1

02:13:41 Build Finished (took 2s.583ms)

我不清楚发生这样error时需要设置或修改什么。

 

0 项奖励
1 个已接受解答

已接受的解答
Moderator
Moderator
552 次查看
注册日期: ‎05-23-2018

回复: Xilinx SDK 如何Debug petalinux应用

转到解答

Hi, @zhuangzhuang 

静态链接库和动态链接库都没有链接到,在Arm v8 linux gcc linker中链接一下。

-------------------------------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------------------------------
如果提供的信息能解决您的问题,请标记为“接受为解决方案”。
如果您认为帖子有帮助,请点击“奖励”。谢谢!
-------------------------------------------------------------------------------------------------

在原帖中查看解决方案

5 条回复5
Moderator
Moderator
553 次查看
注册日期: ‎05-23-2018

回复: Xilinx SDK 如何Debug petalinux应用

转到解答

Hi, @zhuangzhuang 

静态链接库和动态链接库都没有链接到,在Arm v8 linux gcc linker中链接一下。

-------------------------------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------------------------------
如果提供的信息能解决您的问题,请标记为“接受为解决方案”。
如果您认为帖子有帮助,请点击“奖励”。谢谢!
-------------------------------------------------------------------------------------------------

在原帖中查看解决方案

Contributor
Contributor
537 次查看
注册日期: ‎11-18-2018

回复: Xilinx SDK 如何Debug petalinux应用

转到解答

我现在添加了,如图:

 

捕获.PNG

但还是出现如下问题:

aarch64-linux-gnu-gcc -L/home/zz/opt/petalinux/sysroots/aarch64-xilinx-linux/bin -L/home/zz/opt/petalinux/sysroots/aarch64-xilinx-linux -L/home/zz/opt/petalinux/sysroots/aarch64-xilinx-linux/lib -L/home/zz/opt/petalinux/sysroots/aarch64-xilinx-linux/usr/bin -L/home/zz/opt/petalinux/sysroots/aarch64-xilinx-linux/usr/lib -o "hdmi.elf" ./src/video_lib/drm_helper.o ./src/video_lib/edid_helper.o ./src/video_lib/mediactl_helper.o ./src/video_lib/s2m_pipeline.o ./src/video_lib/swgen_pipeline.o ./src/video_lib/v4l2_helper.o ./src/video_lib/video.o ./src/modetest/format.o ./src/modetest/pattern.o ./src/menu.o ./src/video_cmd.o -lpthread -llimdrm -ldl -lpthread_nonshared -ldrm -lmediactl -lv4l2subdev -lrt
/tools/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/bin/../lib/gcc/aarch64-linux-gnu/7.3.1/../../../../aarch64-linux-gnu/bin/ld: cannot find /lib/libpthread.so.0
/tools/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/bin/../lib/gcc/aarch64-linux-gnu/7.3.1/../../../../aarch64-linux-gnu/bin/ld: cannot find /usr/lib/libpthread_nonshared.a
makefile:38: recipe for target 'hdmi.elf' failed
collect2: error: ld returned 1 exit status

 

我对这块链接库不太熟悉,这是还缺少什么吗?

0 项奖励
Moderator
Moderator
491 次查看
注册日期: ‎05-23-2018

回复: Xilinx SDK 如何Debug petalinux应用

转到解答

Hi, @zhuangzhuang 

你可以看一下报错信息,你所缺少的库是在SDK目录下的,不是在你设定的sysroot目录下的。你需要将SDK目录下如报错信息所示的缺失库链接到你的工程中去。

-------------------------------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------------------------------
如果提供的信息能解决您的问题,请标记为“接受为解决方案”。
如果您认为帖子有帮助,请点击“奖励”。谢谢!
-------------------------------------------------------------------------------------------------
0 项奖励
Contributor
Contributor
485 次查看
注册日期: ‎11-18-2018

回复: Xilinx SDK 如何Debug petalinux应用

转到解答

@weiyil ,你好,我添加了下面如图所示的库:

捕获.PNG

还是出现:

/tools/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/bin/../lib/gcc/aarch64-linux-gnu/7.3.1/../../../../aarch64-linux-gnu/bin/ld: cannot find -l/tools/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/aarch64-linux-gnu/libc/usr/lib/libpthread_nonshared.a
makefile:38: recipe for target 'hdmi.elf' failed
/tools/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/bin/../lib/gcc/aarch64-linux-gnu/7.3.1/../../../../aarch64-linux-gnu/bin/ld: cannot find -l/tools/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/aarch64-linux-gnu/libc/lib/libpthread.so.0
/tools/Xilinx/SDK/2018.3/gnu/aarch64/lin/aarch64-linux/bin/../lib/gcc/aarch64-linux-gnu/7.3.1/../../../../aarch64-linux-gnu/bin/ld: cannot find -llimdrm
collect2: error: ld returned 1 exit status
make: *** [hdmi.elf] Error 1

是我操作错误还是其他什么原因?谢谢

0 项奖励
Contributor
Contributor
463 次查看
注册日期: ‎11-18-2018

回复: Xilinx SDK 如何Debug petalinux应用

转到解答

@weiyil 非常感谢,已经解决这个问题了,现在应用可以编译,并且通过Tcf agent debug。谢谢!!!

0 项奖励