如何从Yocto正确构建gpiod应用程序?

问题描述 投票:0回答:1

我正在尝试将https://github.com/kontron/altera-stapl上可用的Github上的CPLD编程实用程序合并到我的Yocto构建中,但正在获得对gpiod函数的未定义引用。我认为这取决于我食谱中的libgpiod。我可以正确指定依赖项吗?

这是我的食谱:

SUMMARY = "CPLD STAPL Programming"

DESCRIPTION = "A userspace port of the Altera Jam STAPL Bytecode Player."
MAINTAINER = "Michael Walle <michael.walle@kontron.com>"
HOMEPAGE = "https://github.com/kontron/altera-stapl"

LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=4641e94ec96f98fabc56ff9cc48be14b"

SRC_URI = "git://github.com/kontron/altera-stapl.git"
SRCREV = "71540fb3dccf57ea0e43cef77d628244de402152"
SRC_URI[sha256sum] = "DCF8A052CD7908F484EAEE8A1924809056611E68EA28652E17C021BE836FAA6C"

DEPENDS = "libgpiod"

S="${WORKDIR}/git"

do_install () {
   install -d ${D}${bindir}
   install -m 0755 altera-stapl ${D}${bindir} 
}

这些是我得到的链接器错误(有很多错误,而不仅仅是这个错误,如果需要,我可以发布整个日志)

gnueabi/gcc/arm-poky-linux-gnueabi/9.2.0/ld: altera-gpio.c:(.text+0x3f4): undefined reference to `gpiod_line_request_output'
/home/gen-ccm-root/workdir/tools/poky/build-dev/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/altera-stapl/1.0-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.2.0/ld: altera-gpio.o: in function `close_jtag_hardware':
altera-gpio.c:(.text+0x4da): undefined reference to `gpiod_line_release'
collect2: error: ld returned 1 exit status
Makefile:31: recipe for target 'altera-stapl' failed

设置依赖项的正确方法是什么?更新:我在Ubuntu 18.04上运行Yocto Zeus(我的GCC是7.4.0)。

embedded-linux yocto bitbake
1个回答
0
投票

最终发现此问题在GitHub项目的Makefile中,并且实际上已在最新版本中修复。如果其他人想使用该项目,则最终配方如下(如果发布了新版本,则只需更新SRCREV):

SUMMARY = "CPLD STAPL Programming"

DESCRIPTION = "A userspace port of the Altera Jam STAPL Bytecode Player."
HOMEPAGE = "https://github.com/kontron/altera-stapl"

LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=4641e94ec96f98fabc56ff9cc48be14b"

SRC_URI = "git://github.com/kontron/altera-stapl.git"
SRCREV = "852ff9d13cc06fef7d207abe12cc19ea5b67a16b"

DEPENDS = "libgpiod"

S="${WORKDIR}/git"

do_install () {
   install -d ${D}${bindir}
   install -m 0755 altera-stapl ${D}${bindir}
}
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.