[OE-core] [PATCH] libbsd 0.8.3: BBCLASSEXTEND to native and nativesdk

Nicolas Dechesne nicolas.dechesne at linaro.org
Fri Nov 4 21:25:51 UTC 2016


On Thu, Oct 20, 2016 at 1:05 PM, Burton, Ross <ross.burton at intel.com> wrote:
> On 20 October 2016 at 09:30, Koen Kooi <koen.kooi at linaro.org> wrote:
>>
>> +BBCLASSEXTEND = "native nativesdk"
>
>
> The native form fails on Debian stable hosts:
>
> | make[2]: Entering directory
> '/data/poky-master/tmp-glibc/work/x86_64-linux/libbsd-native/0.8.3-r0/build/src'
> | ../x86_64-linux-libtool  --tag=CC   --mode=compile gcc  -DHAVE_CONFIG_H
> -I.. -isystem ../../libbsd-0.8.3/include/bsd/ -include ../config.h
> -DLIBBSD_OVERLAY -DLIBBSD_DISABLE_DEPRECATED -D__REENTRANT
> -isystem/data/poky-master/tmp-glibc/sysroots/x86_64-linux/usr/include
> -isystem/data/poky-master/tmp-glibc/sysroots/x86_64-linux/usr/include -O2
> -pipe -c -o getentropy.lo ../../libbsd-0.8.3/src/getentropy.c
> | x86_64-linux-libtool: compile:  gcc -DHAVE_CONFIG_H -I.. -isystem
> ../../libbsd-0.8.3/include/bsd/ -include ../config.h -DLIBBSD_OVERLAY
> -DLIBBSD_DISABLE_DEPRECATED -D__REENTRANT
> -isystem/data/poky-master/tmp-glibc/sysroots/x86_64-linux/usr/include
> -isystem/data/poky-master/tmp-glibc/sysroots/x86_64-linux/usr/include -O2
> -pipe -c ../../libbsd-0.8.3/src/getentropy.c  -fPIC -DPIC -o
> .libs/getentropy.o
> | In file included from /usr/include/x86_64-linux-gnu/sys/syscall.h:31:0,
> |                  from ../../libbsd-0.8.3/src/getentropy_linux.c:29,
> |                  from ../../libbsd-0.8.3/src/getentropy.c:28:
> | ../../libbsd-0.8.3/src/getentropy_linux.c: In function
> ‘getentropy_getrandom’:
> | ../../libbsd-0.8.3/src/getentropy_linux.c:203:17: error: ‘__NR_getrandom’
> undeclared (first use in this function)
> |    ret = syscall(SYS_getrandom, buf, len, 0);
> |                  ^
> | ../../libbsd-0.8.3/src/getentropy_linux.c:203:17: note: each undeclared
> identifier is reported only once for each function it appears in
>
> It's not wrong - there's no actual definition of __NR_getrandom in
> /usr/include here.

hmm. that's odd. libbsd is supposed to work with system that have this
syscall, and with system without it. in the upstream source code, they
properly do it like this:

#ifdef SYS_getrandom
static int
getentropy_getrandom(void *buf, size_t len)
{
    int pre_errno = errno;
    int ret;
    if (len > 256)
        return (-1);
    do {
        ret = syscall(SYS_getrandom, buf, len, 0);
<...>
#endif

So in order to get the build error you are seeing, that means that
SYS_getrandom is define to NR_getrandom (in syscall.h), but that
NR_getrandom is not set to the right syscall ID. That makes it quite
inconsistent.. could we be mixing HOST and sysroot content here?

I don't have a debian stable system handy right now, i will have to setup one.

nico



More information about the Openembedded-core mailing list