Patchwork [46/50] mesa-xlib: Dont use locales with uclibc

login
register
mail settings
Submitter Saul Wold
Date July 20, 2011, 8:28 a.m.
Message ID <4fb98dee67ddcdbc35f6e5c203ddb7217cd55a97.1311150183.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/8021/
State New, archived
Headers show

Comments

Saul Wold - July 20, 2011, 8:28 a.m.
From: Khem Raj <raj.khem@gmail.com>

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../mesa/mesa-xlib/uclibc_locale.patch             |   31 ++++++++++++++++++++
 meta/recipes-graphics/mesa/mesa-xlib_7.10.2.bb     |    3 +-
 2 files changed, 33 insertions(+), 1 deletions(-)
 create mode 100644 meta/recipes-graphics/mesa/mesa-xlib/uclibc_locale.patch
Phil Blundell - July 20, 2011, 10:14 a.m.
On Wed, 2011-07-20 at 01:28 -0700, Saul Wold wrote:
> +We disable locale on uclibc in OE therefore we do not use it if building for uclibc
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +Upstream-Status: Inappropriate <OE config related>
> +
> + {
> +-#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__)
> ++#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && !defined(__UCLIBC__)

I'm not totally thrilled about having the equivalence between "uclibc"
and "no locale" patched into random sources in a piecemeal way like
this.  uClibc doesn't inherently lack locale support, it's just that the
default oe-core configuration happens to turn it off, and there's no
reason that another layer mightn't decide to enable it again.  It would
suck if that layer then had to re-patch all these recipes to take the
__UCLIBC__ conditional back out.

I think it would be better to replace this sort of thing with an
autoconf linker test that checks to see whether newlocale() is actually
available in the installed libc.

p.
Richard Purdie - July 20, 2011, 2:15 p.m.
On Wed, 2011-07-20 at 11:14 +0100, Phil Blundell wrote:
> On Wed, 2011-07-20 at 01:28 -0700, Saul Wold wrote:
> > +We disable locale on uclibc in OE therefore we do not use it if building for uclibc
> > +
> > +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > +Upstream-Status: Inappropriate <OE config related>
> > +
> > + {
> > +-#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__)
> > ++#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && !defined(__UCLIBC__)
> 
> I'm not totally thrilled about having the equivalence between "uclibc"
> and "no locale" patched into random sources in a piecemeal way like
> this.  uClibc doesn't inherently lack locale support, it's just that the
> default oe-core configuration happens to turn it off, and there's no
> reason that another layer mightn't decide to enable it again.  It would
> suck if that layer then had to re-patch all these recipes to take the
> __UCLIBC__ conditional back out.
> 
> I think it would be better to replace this sort of thing with an
> autoconf linker test that checks to see whether newlocale() is actually
> available in the installed libc.

Agreed, when I first saw this I wasn't happy either, I don't think it
makes sense. An autoconf test here would be much more scalable (and more
likely to get accepted upstream too).

Cheers,

Richard
Khem Raj - July 20, 2011, 6:07 p.m.
On 07/20/2011 03:14 AM, Phil Blundell wrote:
> On Wed, 2011-07-20 at 01:28 -0700, Saul Wold wrote:
>> +We disable locale on uclibc in OE therefore we do not use it if building for uclibc
>> +
>> +Signed-off-by: Khem Raj<raj.khem@gmail.com>
>> +Upstream-Status: Inappropriate<OE config related>
>> +
>> + {
>> +-#if defined(_GNU_SOURCE)&&  !defined(__CYGWIN__)&&  !defined(__FreeBSD__)
>> ++#if defined(_GNU_SOURCE)&&  !defined(__CYGWIN__)&&  !defined(__FreeBSD__)&&  !defined(__UCLIBC__)
>
> I'm not totally thrilled about having the equivalence between "uclibc"
> and "no locale" patched into random sources in a piecemeal way like
> this.  uClibc doesn't inherently lack locale support, it's just that the
> default oe-core configuration happens to turn it off, and there's no
> reason that another layer mightn't decide to enable it again.  It would
> suck if that layer then had to re-patch all these recipes to take the
> __UCLIBC__ conditional back out.
>
> I think it would be better to replace this sort of thing with an
> autoconf linker test that checks to see whether newlocale() is actually
> available in the installed libc.
>

Well I thought so. Its just lazyness and time :)
I will rework it that way as I did it for other recipe

> p.
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Patch

diff --git a/meta/recipes-graphics/mesa/mesa-xlib/uclibc_locale.patch b/meta/recipes-graphics/mesa/mesa-xlib/uclibc_locale.patch
new file mode 100644
index 0000000..7076f02
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-xlib/uclibc_locale.patch
@@ -0,0 +1,31 @@ 
+We disable locale on uclibc in OE therefore we do not use it if building for uclibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Inappropriate <OE config related>
+
+Index: Mesa-7.10.2/src/glsl/strtod.c
+===================================================================
+--- Mesa-7.10.2.orig/src/glsl/strtod.c	2011-01-03 16:45:51.000000000 -0800
++++ Mesa-7.10.2/src/glsl/strtod.c	2011-07-19 14:28:42.591809160 -0700
+@@ -44,7 +44,7 @@
+ double
+ glsl_strtod(const char *s, char **end)
+ {
+-#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__)
++#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && !defined(__UCLIBC__)
+    static locale_t loc = NULL;
+    if (!loc) {
+       loc = newlocale(LC_CTYPE_MASK, "C", NULL);
+Index: Mesa-7.10.2/src/mesa/main/imports.c
+===================================================================
+--- Mesa-7.10.2.orig/src/mesa/main/imports.c	2011-03-01 12:57:29.000000000 -0800
++++ Mesa-7.10.2/src/mesa/main/imports.c	2011-07-19 16:11:02.301807753 -0700
+@@ -757,7 +757,7 @@
+ float
+ _mesa_strtof( const char *s, char **end )
+ {
+-#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__)
++#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && !defined(__UCLIBC__)
+    static locale_t loc = NULL;
+    if (!loc) {
+       loc = newlocale(LC_CTYPE_MASK, "C", NULL);
diff --git a/meta/recipes-graphics/mesa/mesa-xlib_7.10.2.bb b/meta/recipes-graphics/mesa/mesa-xlib_7.10.2.bb
index b77df2c..848c072 100644
--- a/meta/recipes-graphics/mesa/mesa-xlib_7.10.2.bb
+++ b/meta/recipes-graphics/mesa/mesa-xlib_7.10.2.bb
@@ -1,6 +1,7 @@ 
 include mesa-common.inc
 
 SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/MesaLib-${PV}.tar.bz2 \
+           file://uclibc_locale.patch \
            "
 
 SRC_URI[md5sum] = "f5de82852f1243f42cc004039e10b771"
@@ -14,6 +15,6 @@  LIB_DEPS = "virtual/libx11 libxext libxxf86vm libxdamage libxfixes libxml2-nativ
 DEPENDS = "${PROTO_DEPS}  ${LIB_DEPS} makedepend-native"
 
 PE = "1"
-PR = "r0"
+PR = "r1"
 
 EXTRA_OECONF += "--with-driver=xlib"