diff mbox

coreutils: fix build with uClibc

Message ID fb99be0f4d3d7d7e92f0e3948d923c624730f1a4.1388492301.git.baruch@tkos.co.il
State Superseded
Headers show

Commit Message

Baruch Siach Dec. 31, 2013, 12:18 p.m. UTC
uClibc needs -lrt for posix_spawn(). As a side effect of the fix, the
timer_settime() library test breaks. So force timer_settime() library as well.

Fixes
http://autobuild.buildroot.net/results/ab1/ab1250c3d402ec3fbaf22eeffd07de218ffafb22/.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---

Note: something along the same lines should also fix m4 build against uClibc.
But since m4 for target is now deprecated I'm not sure it is worth the effort.
---
 package/coreutils/coreutils.mk | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Comments

Peter Korsgaard Jan. 10, 2014, 11:08 p.m. UTC | #1
>>>>> "Baruch" == Baruch Siach <baruch@tkos.co.il> writes:

 > uClibc needs -lrt for posix_spawn(). As a side effect of the fix, the
 > timer_settime() library test breaks. So force timer_settime() library as well.

 > Fixes
 > http://autobuild.buildroot.net/results/ab1/ab1250c3d402ec3fbaf22eeffd07de218ffafb22/.

 > Signed-off-by: Baruch Siach <baruch@tkos.co.il>


 > ---

 > Note: something along the same lines should also fix m4 build against uClibc.
 > But since m4 for target is now deprecated I'm not sure it is worth the effort.
 > ---
 >  package/coreutils/coreutils.mk | 11 ++++++++++-
 >  1 file changed, 10 insertions(+), 1 deletion(-)

 > diff --git a/package/coreutils/coreutils.mk b/package/coreutils/coreutils.mk
 > index e0e9d80..fcf8905 100644
 > --- a/package/coreutils/coreutils.mk
 > +++ b/package/coreutils/coreutils.mk
 > @@ -20,6 +20,8 @@ COREUTILS_BIN_PROGS = cat chgrp chmod chown cp date dd df dir echo false hostnam
 >  	ln ls mkdir mknod mv pwd rm rmdir vdir sleep stty sync touch true \
 >  	uname join
 
 > +COREUTILS_LDFLAGS = $(TARGET_LDFLAGS)
 > +
 >  COREUTILS_CONF_ENV = ac_cv_c_restrict=no \
 >  		ac_cv_func_chown_works=yes \
 >  		ac_cv_func_euidaccess=no \
 > @@ -54,7 +56,14 @@ COREUTILS_CONF_ENV = ac_cv_c_restrict=no \
 >  		gl_cv_func_working_utimes=yes \
 >  		gl_getline_needs_run_time_check=no \
 >  		utils_cv_localtime_cache=no \
 > -		PERL=missing
 > +		PERL=missing \
 > +		LDFLAGS="$(COREUTILS_LDFLAGS)"
 > +
 > +ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
 > +COREUTILS_LDFLAGS += -lrt
 > +COREUTILS_CONF_ENV += ac_cv_func_posix_spawn=yes \
 > +		ac_cv_search_timer_settime=-lrt

Hmm, this is only for uClibc snapshot, right? My 0.9.33 doesn't seem to
have posix_spawn, so this breaks the build.
Baruch Siach Jan. 12, 2014, 9:39 a.m. UTC | #2
Hi Peter,

On Sat, Jan 11, 2014 at 12:08:33AM +0100, Peter Korsgaard wrote:
> >>>>> "Baruch" == Baruch Siach <baruch@tkos.co.il> writes:
>  > +ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
>  > +COREUTILS_LDFLAGS += -lrt
>  > +COREUTILS_CONF_ENV += ac_cv_func_posix_spawn=yes \
>  > +		ac_cv_search_timer_settime=-lrt
> 
> Hmm, this is only for uClibc snapshot, right? My 0.9.33 doesn't seem to
> have posix_spawn, so this breaks the build.

Correct. posix_spawn support was added in uClibc after 0.9.33. I posted 
recently a patch series with a better fix in uClibc 
(http://thread.gmane.org/gmane.comp.lib.uclibc.buildroot/73863, first patch).  
Since then, however, patches 2 and 3 (but not 1) were applied to uClibc 
master.  I'll send an update series that bumps the xtnesa uClibc snapshot 
version instead.

baruch
Jonathan Ben Avraham Jan. 12, 2014, 9:45 a.m. UTC | #3
On Sun, 12 Jan 2014, Baruch Siach wrote:

> Date: Sun, 12 Jan 2014 11:39:13 +0200
> From: Baruch Siach <baruch@tkos.co.il>
> To: Peter Korsgaard <jacmet@uclibc.org>
> Cc: buildroot@busybox.net
> Subject: Re: [Buildroot] [PATCH] coreutils: fix build with uClibc
> 
> Hi Peter,
>
> On Sat, Jan 11, 2014 at 12:08:33AM +0100, Peter Korsgaard wrote:
>>>>>>> "Baruch" == Baruch Siach <baruch@tkos.co.il> writes:
>> > +ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
>> > +COREUTILS_LDFLAGS += -lrt
>> > +COREUTILS_CONF_ENV += ac_cv_func_posix_spawn=yes \
>> > +		ac_cv_search_timer_settime=-lrt
>>
>> Hmm, this is only for uClibc snapshot, right? My 0.9.33 doesn't seem to
>> have posix_spawn, so this breaks the build.
>
> Correct. posix_spawn support was added in uClibc after 0.9.33. I posted
> recently a patch series with a better fix in uClibc
> (http://thread.gmane.org/gmane.comp.lib.uclibc.buildroot/73863, first patch).
> Since then, however, patches 2 and 3 (but not 1) were applied to uClibc
> master.  I'll send an update series that bumps the xtnesa uClibc snapshot

Read as "xtensa uClibc snapshot".

  - yba


> version instead.
>
> baruch
>
>
Peter Korsgaard Jan. 12, 2014, 10:04 a.m. UTC | #4
>>>>> "Baruch" == Baruch Siach <baruch@tkos.co.il> writes:

 > Hi Peter,
 > On Sat, Jan 11, 2014 at 12:08:33AM +0100, Peter Korsgaard wrote:
 >> >>>>> "Baruch" == Baruch Siach <baruch@tkos.co.il> writes:
 >> > +ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
 >> > +COREUTILS_LDFLAGS += -lrt
 >> > +COREUTILS_CONF_ENV += ac_cv_func_posix_spawn=yes \
 >> > +		ac_cv_search_timer_settime=-lrt
 >> 
 >> Hmm, this is only for uClibc snapshot, right? My 0.9.33 doesn't seem to
 >> have posix_spawn, so this breaks the build.

 > Correct. posix_spawn support was added in uClibc after 0.9.33. I posted 
 > recently a patch series with a better fix in uClibc 
 > (http://thread.gmane.org/gmane.comp.lib.uclibc.buildroot/73863, first patch).  
 > Since then, however, patches 2 and 3 (but not 1) were applied to uClibc 
 > master.  I'll send an update series that bumps the xtnesa uClibc snapshot 
 > version instead.

Ok, great. Could you please also mark obsolete patches as such in
patchwork?
diff mbox

Patch

diff --git a/package/coreutils/coreutils.mk b/package/coreutils/coreutils.mk
index e0e9d80..fcf8905 100644
--- a/package/coreutils/coreutils.mk
+++ b/package/coreutils/coreutils.mk
@@ -20,6 +20,8 @@  COREUTILS_BIN_PROGS = cat chgrp chmod chown cp date dd df dir echo false hostnam
 	ln ls mkdir mknod mv pwd rm rmdir vdir sleep stty sync touch true \
 	uname join
 
+COREUTILS_LDFLAGS = $(TARGET_LDFLAGS)
+
 COREUTILS_CONF_ENV = ac_cv_c_restrict=no \
 		ac_cv_func_chown_works=yes \
 		ac_cv_func_euidaccess=no \
@@ -54,7 +56,14 @@  COREUTILS_CONF_ENV = ac_cv_c_restrict=no \
 		gl_cv_func_working_utimes=yes \
 		gl_getline_needs_run_time_check=no \
 		utils_cv_localtime_cache=no \
-		PERL=missing
+		PERL=missing \
+		LDFLAGS="$(COREUTILS_LDFLAGS)"
+
+ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
+COREUTILS_LDFLAGS += -lrt
+COREUTILS_CONF_ENV += ac_cv_func_posix_spawn=yes \
+		ac_cv_search_timer_settime=-lrt
+endif
 
 COREUTILS_CONF_OPT = --disable-rpath \
 		--disable-dependency-tracking \