您如何从Yocto正确构建gpiod应用程序? [英] How do you properly build gpiod applications from Yocto?

查看:408
本文介绍了您如何从Yocto正确构建gpiod应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to incorporate a CPLD programming utility on Github available at https://github.com/kontron/altera-stapl into my Yocto build but am getting undefined references to gpiod functions. I have that it depends on libgpiod in my recipe. Am I specifying the dependency correctly?

这是我的食谱:

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} 
}

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

These are the linker errors I am getting (there are a lot of them, not just this one, I can post the whole log if needed)

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).

What is the correct way to set the dependency? Update: I am running Yocto Zeus on Ubuntu 18.04 (my GCC is 7.4.0).

推荐答案

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

Turns out this issue was in the Makefile that was part of the GitHub project, and was actually fixed in a recent version. In case anyone else ever wants to use this project, the final recipe is as follows (just update the SRCREV if newer versions are release):

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}
}

这篇关于您如何从Yocto正确构建gpiod应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆