[Buildroot] [PATCH 1/2] nilfs-utils: need NPTL threads

Yann E. MORIN yann.morin.1998 at free.fr
Thu Jan 4 15:52:13 UTC 2018


On 2018-01-04 12:28 +0100, Kurt Van Dijck spake thusly:
> > Hi Thomas,
> > 
> > On Thu, Jan 04, 2018 at 11:33:36AM +0100, Thomas Petazzoni wrote:
> > > On Thu, 4 Jan 2018 12:19:27 +0200, Baruch Siach wrote:
> > > 
> > > > On Thu, Jan 04, 2018 at 11:10:51AM +0100, Kurt Van Dijck wrote:
> > > > > nilfs-utils use clock_nanosleep(), which comes with NPTL threads  
> > > > 
> > > > What is your indication that this is the case?
> 
> The input of Thomas below indeed was my indication.
> Adding this effectively solved/avoided build problems
> using toolchains with threads but without NPTL threads.
> So I thought the puzzle was complete here ...
> 
> > > > In the uClibc-ng config 
> > > > UCLIBC_HAS_REALTIME is selected by both linuxthreads and NPTL. When 
> > > > UCLIBC_HAS_REALTIME is enabled, UCLIBC_HAS_ADVANCED_REALTIME is also enabled 
> > > > by default. UCLIBC_HAS_ADVANCED_REALTIME provides clock_nanosleep().
> > > 
> > > I haven't looked at it in detail, but:
> > > 
> > > package/blktrace/Config.in:     depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # clock_nanosleep()
> > 
> > Added in commit 08b9e24eaa4e. No previous threads dependency.
> > 
> > > package/can-utils/Config.in:    depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # clock_nanosleep()
> > 
> > Added in commit dbfca7963049. No previous threads dependency.
> > 
> > > package/dvblast/Config.in:      depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # clock_nanosleep()
> > 
> > Added in commit ec875d9bf9b183, changed from a previous plain threads 
> > dependency.
> 
> > 
> > Yann, do you remember the reason why "clock_nanosleep() is only availabe with 
> > NPTL" as commit ec875d9bf9b183 says?

No, I am not sure, but the current code of uClibc-ng has:

    $ cat librt/Makefile.in
    [...]
    17 ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
    18 librt_filter_SRC += mq_notify.c timer_create.c timer_delete.c \
    19 	timer_getoverr.c timer_gettime.c timer_settime.c
    20 else
    21 librt_filter_SRC += clock_nanosleep.c clock_getcpuclockid.c clock_gettime.c
    22 endif
    [...]

So, if I read that correctly, the clock_*.c files are excluded (filtered)
if there is no support for native threads.

Now, since glibc and musl always have NPTL and always have clock_nanosleep,
and only uClibc has a conditional NPTL, we made clock_nanosleep et al.
depend on NPTL.

Q.E.D.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'



More information about the buildroot mailing list