All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libbsd 0.8.3: BBCLASSEXTEND to native and nativesdk
@ 2016-10-20  8:30 Koen Kooi
  2016-10-20 11:05 ` Burton, Ross
  0 siblings, 1 reply; 11+ messages in thread
From: Koen Kooi @ 2016-10-20  8:30 UTC (permalink / raw)
  To: openembedded-core; +Cc: Koen Kooi

Android-tools depends on it and to build the native versions of fastboot, adb, mkbootimg and others libbsd needs to support native builds.

Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
---
 meta/recipes-support/libbsd/libbsd_0.8.3.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-support/libbsd/libbsd_0.8.3.bb b/meta/recipes-support/libbsd/libbsd_0.8.3.bb
index 92121ef..6f734ab 100644
--- a/meta/recipes-support/libbsd/libbsd_0.8.3.bb
+++ b/meta/recipes-support/libbsd/libbsd_0.8.3.bb
@@ -41,3 +41,5 @@ SRC_URI[md5sum] = "e935c1bb6cc98a4a43cb1da22795493a"
 SRC_URI[sha256sum] = "934b634f4dfd865b6482650b8f522c70ae65c463529de8be907b53c89c3a34a8"
 
 inherit autotools pkgconfig
+
+BBCLASSEXTEND = "native nativesdk"
-- 
2.4.11



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] libbsd 0.8.3: BBCLASSEXTEND to native and nativesdk
  2016-10-20  8:30 [PATCH] libbsd 0.8.3: BBCLASSEXTEND to native and nativesdk Koen Kooi
@ 2016-10-20 11:05 ` Burton, Ross
  2016-11-04 21:25   ` Nicolas Dechesne
  2016-11-05  0:04   ` Khem Raj
  0 siblings, 2 replies; 11+ messages in thread
From: Burton, Ross @ 2016-10-20 11:05 UTC (permalink / raw)
  To: Koen Kooi; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 1832 bytes --]

On 20 October 2016 at 09:30, Koen Kooi <koen.kooi@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.

Ross

[-- Attachment #2: Type: text/html, Size: 2499 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] libbsd 0.8.3: BBCLASSEXTEND to native and nativesdk
  2016-10-20 11:05 ` Burton, Ross
@ 2016-11-04 21:25   ` Nicolas Dechesne
  2016-11-04 23:24     ` Burton, Ross
  2016-11-05  0:04   ` Khem Raj
  1 sibling, 1 reply; 11+ messages in thread
From: Nicolas Dechesne @ 2016-11-04 21:25 UTC (permalink / raw)
  To: Burton, Ross; +Cc: Koen Kooi, OE-core

On Thu, Oct 20, 2016 at 1:05 PM, Burton, Ross <ross.burton@intel.com> wrote:
> On 20 October 2016 at 09:30, Koen Kooi <koen.kooi@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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] libbsd 0.8.3: BBCLASSEXTEND to native and nativesdk
  2016-11-04 21:25   ` Nicolas Dechesne
@ 2016-11-04 23:24     ` Burton, Ross
  2016-11-04 23:47       ` Nicolas Dechesne
  2016-11-05  0:09       ` Phil Blundell
  0 siblings, 2 replies; 11+ messages in thread
From: Burton, Ross @ 2016-11-04 23:24 UTC (permalink / raw)
  To: Nicolas Dechesne; +Cc: Koen Kooi, OE-core

[-- Attachment #1: Type: text/plain, Size: 780 bytes --]

On 4 November 2016 at 21:25, Nicolas Dechesne <nicolas.dechesne@linaro.org>
wrote:

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

No, I checked the files in /usr on the host, as this is a native build it
should be linking against the host libc.

$ grep -r getrandom
x86_64-linux-gnu/bits/syscall.h:#define SYS_getrandom __NR_getrandom
x86_64-linux-gnu/bits/syscall.h:#define SYS_getrandom __NR_getrandom
x86_64-linux-gnu/bits/syscall.h:#define SYS_getrandom __NR_getrandom

Yes, looks like Debian headers are a bit broken.

Ross

[-- Attachment #2: Type: text/html, Size: 1552 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] libbsd 0.8.3: BBCLASSEXTEND to native and nativesdk
  2016-11-04 23:24     ` Burton, Ross
@ 2016-11-04 23:47       ` Nicolas Dechesne
  2016-11-05  0:09       ` Phil Blundell
  1 sibling, 0 replies; 11+ messages in thread
From: Nicolas Dechesne @ 2016-11-04 23:47 UTC (permalink / raw)
  To: Burton, Ross; +Cc: Koen Kooi, OE-core

On Sat, Nov 5, 2016 at 12:24 AM, Burton, Ross <ross.burton@intel.com> wrote:
> On 4 November 2016 at 21:25, Nicolas Dechesne <nicolas.dechesne@linaro.org>
> wrote:
>>
>> 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?
>
>
> No, I checked the files in /usr on the host, as this is a native build it
> should be linking against the host libc.
>
> $ grep -r getrandom
> x86_64-linux-gnu/bits/syscall.h:#define SYS_getrandom __NR_getrandom
> x86_64-linux-gnu/bits/syscall.h:#define SYS_getrandom __NR_getrandom
> x86_64-linux-gnu/bits/syscall.h:#define SYS_getrandom __NR_getrandom
>
> Yes, looks like Debian headers are a bit broken.

hmm. not for me...

root@nikaia:/usr/include# grep getrandom
/usr/include/x86_64-linux-gnu/bits/syscall.h

root@nikaia:/usr/include# dpkg -S /usr/include/x86_64-linux-gnu/bits/syscall.h
libc6-dev:amd64: /usr/include/x86_64-linux-gnu/bits/syscall.h

root@nikaia:/usr/include# dpkg -l | grep libc6-dev
ii  libc6-dev:amd64                2.19-18+deb8u6           amd64
  GNU C Library: Development Libraries and Header Files

this is from a fresh jessie debootstrap


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] libbsd 0.8.3: BBCLASSEXTEND to native and nativesdk
  2016-10-20 11:05 ` Burton, Ross
  2016-11-04 21:25   ` Nicolas Dechesne
@ 2016-11-05  0:04   ` Khem Raj
  1 sibling, 0 replies; 11+ messages in thread
From: Khem Raj @ 2016-11-05  0:04 UTC (permalink / raw)
  To: Burton, Ross, Koen Kooi; +Cc: OE-core



On 10/20/16 4:05 AM, Burton, Ross wrote:
> 
> On 20 October 2016 at 09:30, Koen Kooi <koen.kooi@linaro.org
> <mailto:koen.kooi@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.


Do you have libbsd pre-installed on your build system ?

> 
> Ross
> 
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] libbsd 0.8.3: BBCLASSEXTEND to native and nativesdk
  2016-11-04 23:24     ` Burton, Ross
  2016-11-04 23:47       ` Nicolas Dechesne
@ 2016-11-05  0:09       ` Phil Blundell
  2016-11-07  9:28         ` Burton, Ross
  1 sibling, 1 reply; 11+ messages in thread
From: Phil Blundell @ 2016-11-05  0:09 UTC (permalink / raw)
  To: Burton, Ross, Nicolas Dechesne; +Cc: Koen Kooi, OE-core

[-- Attachment #1: Type: text/plain, Size: 806 bytes --]

On Fri, 2016-11-04 at 23:24 +0000, Burton, Ross wrote:
> > No, I checked the files in /usr on the host, as this is a native
build it should be linking against the host libc.
> 
> $ grep -r getrandom
> x86_64-linux-gnu/bits/syscall.h:#define SYS_getrandom __NR_getrandom
> x86_64-linux-gnu/bits/syscall.h:#define SYS_getrandom __NR_getrandom
> x86_64-linux-gnu/bits/syscall.h:#define SYS_getrandom __NR_getrandom
> 
> 
> Yes, looks like Debian headers are a bit broken.
> 
> 
> 

That would happen if your glibc was compiled against a newer version of
the kernel headers than you actually have installed (bits/syscall.h is
auto-generated from the kernel headers at build time). If this is a
clean Debian install then it does sound like they have messed up the
packaging somehow.

p.


[-- Attachment #2: Type: text/html, Size: 1216 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] libbsd 0.8.3: BBCLASSEXTEND to native and nativesdk
  2016-11-05  0:09       ` Phil Blundell
@ 2016-11-07  9:28         ` Burton, Ross
  2016-11-07  9:30           ` Burton, Ross
  0 siblings, 1 reply; 11+ messages in thread
From: Burton, Ross @ 2016-11-07  9:28 UTC (permalink / raw)
  To: Phil Blundell; +Cc: Koen Kooi, OE-core

[-- Attachment #1: Type: text/plain, Size: 499 bytes --]

On 5 November 2016 at 00:09, Phil Blundell <pb@pbcl.net> wrote:

> That would happen if your glibc was compiled against a newer version of
> the kernel headers than you actually have installed (bits/syscall.h is
> auto-generated from the kernel headers at build time). If this is a clean
> Debian install then it does sound like they have messed up the packaging
> somehow.
>

Ah.  I might (cough) have a hybrid stable/testing setup as I needed a newer
kernel.  I'll have a look.

Ross

[-- Attachment #2: Type: text/html, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] libbsd 0.8.3: BBCLASSEXTEND to native and nativesdk
  2016-11-07  9:28         ` Burton, Ross
@ 2016-11-07  9:30           ` Burton, Ross
  2016-11-07  9:42             ` Nicolas Dechesne
  0 siblings, 1 reply; 11+ messages in thread
From: Burton, Ross @ 2016-11-07  9:30 UTC (permalink / raw)
  To: Phil Blundell; +Cc: Koen Kooi, OE-core

[-- Attachment #1: Type: text/plain, Size: 668 bytes --]

On 7 November 2016 at 09:28, Burton, Ross <ross.burton@intel.com> wrote:

> Ah.  I might (cough) have a hybrid stable/testing setup as I needed a
> newer kernel.  I'll have a look.
>

$ grep -r getrandom
x86_64-linux-gnu/bits/syscall.h:#define SYS_getrandom __NR_getrandom
x86_64-linux-gnu/bits/syscall.h:#define SYS_getrandom __NR_getrandom
x86_64-linux-gnu/bits/syscall.h:#define SYS_getrandom __NR_getrandom
x86_64-linux-gnu/asm/unistd_x32.h:#define __NR_getrandom (__X32_SYSCALL_BIT
+ 318)
x86_64-linux-gnu/asm/unistd_64.h:#define __NR_getrandom 318
x86_64-linux-gnu/asm/unistd_32.h:#define __NR_getrandom 355

That's better.  Thanks Phil.

Ross

[-- Attachment #2: Type: text/html, Size: 1207 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] libbsd 0.8.3: BBCLASSEXTEND to native and nativesdk
  2016-11-07  9:30           ` Burton, Ross
@ 2016-11-07  9:42             ` Nicolas Dechesne
  2016-11-07  9:54               ` Burton, Ross
  0 siblings, 1 reply; 11+ messages in thread
From: Nicolas Dechesne @ 2016-11-07  9:42 UTC (permalink / raw)
  To: Burton, Ross; +Cc: Koen Kooi, OE-core

On Mon, Nov 7, 2016 at 10:30 AM, Burton, Ross <ross.burton@intel.com> wrote:
> On 7 November 2016 at 09:28, Burton, Ross <ross.burton@intel.com> wrote:
>>
>> Ah.  I might (cough) have a hybrid stable/testing setup as I needed a
>> newer kernel.  I'll have a look.
>
>
> $ grep -r getrandom
> x86_64-linux-gnu/bits/syscall.h:#define SYS_getrandom __NR_getrandom
> x86_64-linux-gnu/bits/syscall.h:#define SYS_getrandom __NR_getrandom
> x86_64-linux-gnu/bits/syscall.h:#define SYS_getrandom __NR_getrandom
> x86_64-linux-gnu/asm/unistd_x32.h:#define __NR_getrandom (__X32_SYSCALL_BIT
> + 318)
> x86_64-linux-gnu/asm/unistd_64.h:#define __NR_getrandom 318
> x86_64-linux-gnu/asm/unistd_32.h:#define __NR_getrandom 355
>
> That's better.  Thanks Phil.

great. Does that mean that this patch can be merged or do you have any
other issue?

It's needed to get the android tools -native.. and we will need a
backport on morty too (but we will send that separately).


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] libbsd 0.8.3: BBCLASSEXTEND to native and nativesdk
  2016-11-07  9:42             ` Nicolas Dechesne
@ 2016-11-07  9:54               ` Burton, Ross
  0 siblings, 0 replies; 11+ messages in thread
From: Burton, Ross @ 2016-11-07  9:54 UTC (permalink / raw)
  To: Nicolas Dechesne; +Cc: Koen Kooi, OE-core

[-- Attachment #1: Type: text/plain, Size: 272 bytes --]

On 7 November 2016 at 09:42, Nicolas Dechesne <nicolas.dechesne@linaro.org>
wrote:

> great. Does that mean that this patch can be merged or do you have any
> other issue?
>

Yeah, it's queued in my staging branch now. Sorry for user error stalling
this.

Ross

[-- Attachment #2: Type: text/html, Size: 690 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-11-07  9:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-20  8:30 [PATCH] libbsd 0.8.3: BBCLASSEXTEND to native and nativesdk Koen Kooi
2016-10-20 11:05 ` Burton, Ross
2016-11-04 21:25   ` Nicolas Dechesne
2016-11-04 23:24     ` Burton, Ross
2016-11-04 23:47       ` Nicolas Dechesne
2016-11-05  0:09       ` Phil Blundell
2016-11-07  9:28         ` Burton, Ross
2016-11-07  9:30           ` Burton, Ross
2016-11-07  9:42             ` Nicolas Dechesne
2016-11-07  9:54               ` Burton, Ross
2016-11-05  0:04   ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.