Re: skalibs: how to properly detect posix_spawnp() when using uclibc-ng?

From: Eric Le Bihan <eric.le.bihan.dev_at_free.fr>
Date: Fri, 12 Aug 2016 10:48:26 +0200

Hi!

Le Wed, 10 Aug 2016 21:47:36 +0200,
Laurent Bercot <ska-skaware_at_skarnet.org> a écrit :

> On 10/08/2016 21:29, Laurent Bercot wrote:
> > putting the spawn.h functions in librt is valid, so uclibc-ng is
> > conforming and my autodetection is incorrect. I need to fix the
> > configure script.
>
> Eric: please test building the latest skalibs git head against
> uclibc-ng and tell me if it works. In particular, I'd like to know
> whether the posix_spawn autodetection works both when your compiler
> links dynamically by default (CC=gcc) and when you force it to link
> statically (CC="gcc -static").

Unfortunately, it does not work. The modification assumes that the
check for clock_gettime() will result in $rt_lib being set to -lrt, but
it is not the case for uclibc-ng, where this function is available in
the C runtime:

```
$ nm i686-buildroot-linux-uclibc/sysroot/lib/librt-1.0.14.so \
  | grep clock_gettime
00002308 T clock_gettime
00002308 t __GI_clock_gettime
$ nm i686-buildroot-linux-uclibc/sysroot/lib/libuClibc-1.0.14.so \
  | grep clock_gettime
0000d5dd T clock_gettime
```

I modified ./configure to perform a more complicated test to handle
this case (see attached patch) but the build of the skaware programs
still fails because the -lrt sysdep is not added by default. Shouldn't
the deps-exe and deps-lib files of these programs be updated to add
${RT_LIB}?

BTW, I noticed that `s6-uevent-spawner` calls posix_spawnp() directly
instead of using child_spawn0().

So, for buildroot-s6, I ended up forcing -lrt in the runtime test
for posix_spawnp() in the ./configure script and passing LDLIBS=-lrt
to `make` when uclibc is selected [1].

[1] https://github.com/elebihan/buildroot-s6/commit/98c9547fb3720859514b99d165aa80649a8a1ece

Best regards,

-- 
ELB



Received on Fri Aug 12 2016 - 08:48:26 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC