[Buildroot] Analysis of build results for 2015-11-18

Alexey Brodkin Alexey.Brodkin at synopsys.com
Tue Nov 24 12:10:35 UTC 2015


Hi Thomas,

On Sat, 2015-11-21 at 00:01 +0300, Alexey Brodkin wrote:
> Hi Thomas,
> 
> On Fri, 2015-11-20 at 00:15 +0100, Thomas Petazzoni wrote:
> > Hello,
> > 
> > Jérôme, Johan, Bernd, Yann, Martin, Gustavo, Rémi, Samuel, Alexey,
> > Waldemar, Clayton, please read below, there are some interesting issues
> > for you :-) Thanks !

[snip]

> > > arc |              util-linux-2.27.1 | NOK | 
> > > http://autobuild.buildroot.net/results/75960db671807091fe9155aee9e46a6245e32590/
> > 
> > checking for prlimit... no
> > configure: error: flock selected, but required timer_create function not available
> > 
> > Not sure. Alexey ?
> 
> Well I was trying to reproduce that locally but to no avail.
> Indeed I tried to strip everything but "util-linux" from defconfig to save time so
> might be that's the reason of my failed attempt.
> 
> Still google tells me there's a similar issue with MIPSEL, see
> http://autobuild.buildroot.org/results/112/112e8b85783f5aaba42a937a6eb064317615a21b/build-end.log
> 
> So I would assume that's not just ARC. Still I'm going to start building full defconfig
> from failed build and we'll see if I'll be able to trigger that same issue.

Ok I got it reproduced and it looks like another static build problem.
What happens util-linux on configuration step tries to build and example that
uses timer_create() function. That function exists in librt and configuration
utility correctly adds this lib (-lrt).

But timer_create() uses pthreads internally and so for successful linkage "-lpthread"
is required as well (in addition to "-lrt").

I think log below is quite self-explaining:
------------------->8-----------------
configure:18434: checking for timer_create in -lrt
configure:18459: /home/autobuild/instance-1/output/host/usr/bin/arc-buildroot-linux-uclibc-gcc -std=gnu99 -o conftest 
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -matomic -Os  -static -D_LARGEFILE_SOURCE 
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -static conftest.c -lrt   >&5
/home/autobuild/instance-1/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib/librt.a(timer_create.os): In
function `timer_create':
timer_create.c:(.text+0x96): undefined reference to `pthread_once'
timer_create.c:(.text+0xc8): undefined reference to `pthread_attr_init'
timer_create.c:(.text+0xec): undefined reference to `pthread_attr_setdetachstate'
timer_create.c:(.text+0x130): undefined reference to `pthread_mutex_lock'
timer_create.c:(.text+0x14a): undefined reference to `pthread_mutex_unlock'
/home/autobuild/instance-1/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib/librt.a(timer_routines.os): In
function `timer_helper_thread':
timer_routines.c:(.text+0x84): undefined reference to `pthread_mutex_lock'
timer_routines.c:(.text+0xb8): undefined reference to `pthread_create'
timer_routines.c:(.text+0xc6): undefined reference to `pthread_mutex_unlock'
timer_routines.c:(.text+0xd2): undefined reference to `pthread_exit'
/home/autobuild/instance-1/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib/librt.a(timer_routines.os): In
function `__start_helper_thread':
timer_routines.c:(.text+0x120): undefined reference to `pthread_attr_init'
timer_routines.c:(.text+0x12c): undefined reference to `pthread_attr_setstacksize'
timer_routines.c:(.text+0x166): undefined reference to `pthread_create'
timer_routines.c:(.text+0x18c): undefined reference to `pthread_attr_destroy'
timer_routines.c:(.text+0x19c): undefined reference to `pthread_atfork'
collect2: error: ld returned 1 exit status
------------------->8-----------------

I've got a fix already but first I'd like to upstream my change and apply it
as a true back-port once fix is in upstream.

If we don't have enough time I may post my fix for Buildroot
(these are just 2 additional patches for util-linux) right away.

-Alexey


More information about the buildroot mailing list