2

As probably all yocto people know the sysrootfs policy changed in yocto rocko 2.4+. So I have the following issue: I try to make a recipe for a shared library with makefile. The recipe is below (I don't claim it is complete. I simply cannot pass building stage):

#==================
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://${THISDIR}/files/LICENSE;md5=5959e502cb44bafc53b2cc9400e3d4cd"
PR = "r0"

##### First try from my local repo and then we will use the big one
SRC_URI = "git:///home/w23698/projects/anybus/Generic;branch=anybus-lib-0.0.1"
SRCREV = "2fe4ce39a651d71f3f8de1c751dff2581de2c526"

S = "${WORKDIR}/git"

PACKAGES = "${PN} ${PN}-dev ${PN}-dbg"
#####The only dependency 
RDEPENDS_${PN} = "libgpiod"
RDEPENDS_${PN}-dev = "libgpiod"
RDEPENDS_${PN}-dbg = "libgpiod"

do_compile() {
    oe_runmake
}

do_install() {
    install -d ${D}${libdir}
    install -m 0644 ${PN}-m40 ${D}${libdir}
}

What was my surprise when it failed with:

 ww.c:6:10: fatal error: gpiod.h: No such file or directory 
 |  #include "gpiod.h"
 |           ^~~~~~~~~
 | compilation terminated.

Then I noticed that the command line is:

arm-poky-linux-gnueabi-gcc  -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/<full path>/recipe-sysroot -L/usr/lib -g -Wall -fpic .....

I looked in recipe-sysroot/usr/lib/ and found a minimal set of libraries and libgpiod was not there. Neither the header was there in include...

Any suggestions?

Stoogy
  • 1,307
  • 3
  • 16
  • 34
Georgi
  • 53
  • 2
  • 7

1 Answers1

2

You never set DEPENDS=libgpiod.

The RDEPENDS you set are runtime depends so are not relevant for compile time. You can just remove those as the library linkage dependencies will be generated automatically.

Ross Burton
  • 3,516
  • 13
  • 12
  • This didn't help. Apropos libgpiod is also a shared library... But it didn't work with DEPENDS nor removing them all.....the same output yelled – Georgi Dec 03 '18 at 16:02
  • Then the makefile is broken, or libgpiod is broken. oe-pkgdata-util list-pkg-files -p libgpiod will tell you what that library is installing. Assuming its installing the files correctly, then the makefile is your problem. – Ross Burton Dec 04 '18 at 10:11
  • Oh, just noticed '-L/usr/lib' in the build output. That's the host not the sysroot, so your makefile *is* broken. – Ross Burton Dec 04 '18 at 10:14
  • The makefile is not broken at all. When I build it with make it goes normally and everything is fine. just the $CC is different in yocto and in my command line environment. In yocto you can see it in the original post and in regular shell it is: arm-poky-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/poky/2.4.3/sysroots/cortexa9hf-neon-poky-linux-gnueabi. The only difference is that in this one I have the full exported rootfs. And one more thing :-) The host never heard anything about gpio library :-) – Georgi Dec 04 '18 at 10:42
  • 1
    Thank you Ross, Compilation issues are gone...Only one DEPENDS appeared to be enough :-). Thank you again – Georgi Dec 04 '18 at 14:02