Skip to contentSkip to conversation

mesa-xlib, mesa-dri: Probe for newlocale() before using it.

PATCH In review Khem Raj 3 participants 9 messages Jul 21, 2011 – Jul 22, 2011

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/6 mesa-xlib, mesa-dri: Probe for newlocale() before using it.

---
 meta/recipes-graphics/mesa/mesa-dri/uclibc.patch |   40 ++++++++++++++++++++++
 meta/recipes-graphics/mesa/mesa-dri_7.10.2.bb    |    6 ++-
 meta/recipes-graphics/mesa/mesa-xlib_7.10.2.bb   |    5 ++-
 3 files changed, 48 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-graphics/mesa/mesa-dri/uclibc.patch
meta/recipes-graphics/mesa/mesa-dri/uclibc.patch new file +40 -0
new file mode 100644
index 0000000..bb5af44
@@ -0,0 +1,40 @@
+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-20 19:08:49.441785510 -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 (HAVE_NEWLOCALE)
+    static locale_t loc = NULL;
+    if (!loc) {
+       loc = newlocale(LC_CTYPE_MASK, "C", NULL);
+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-20 19:10:21.441785488 -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 (HAVE_NEWLOCALE)
+    static locale_t loc = NULL;
+    if (!loc) {
+       loc = newlocale(LC_CTYPE_MASK, "C", NULL);
+Index: Mesa-7.10.2/configure.ac
+===================================================================
+--- Mesa-7.10.2.orig/configure.ac	2011-07-20 19:09:02.000000000 -0700
++++ Mesa-7.10.2/configure.ac	2011-07-20 19:09:57.121785492 -0700
+@@ -450,6 +450,9 @@
+ dnl See if posix_memalign is available
+ AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
+ 
++dnl See if newlocale is available
++AC_CHECK_FUNCS_ONCE(newlocale)
++
+ dnl SELinux awareness.
+ AC_ARG_ENABLE([selinux],
+     [AS_HELP_STRING([--enable-selinux],
meta/recipes-graphics/mesa/mesa-dri_7.10.2.bb +4 -2
index c7bd974..aac7a1c 100644
@@ -8,10 +8,12 @@ LIB_DEPS = "libdrm virtual/libx11 libxext libxxf86vm libxdamage libxfixes expat
 
 DEPENDS = "${PROTO_DEPS}  ${LIB_DEPS} makedepend-native python-native"
 
-PR = "r0"
+PR = "r1"
 
 SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/MesaLib-${PV}.tar.bz2 \
-           file://crossfix.patch"
+           file://crossfix.patch \
+           file://uclibc.patch \
+          "
 
 SRC_URI[md5sum] = "f5de82852f1243f42cc004039e10b771"
 SRC_URI[sha256sum] = "8ced2678ce11cf30804694a92ea3ca6b82f158ae8995bdc626c7e85aac71c7c1"
meta/recipes-graphics/mesa/mesa-xlib_7.10.2.bb +4 -1
index b77df2c..511103d 100644
@@ -1,6 +1,9 @@
 include mesa-common.inc
 
+FILESPATH =. "${FILE_DIRNAME}/mesa-dri:"
+
 SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/MesaLib-${PV}.tar.bz2 \
+           file://uclibc.patch \
            "
 
 SRC_URI[md5sum] = "f5de82852f1243f42cc004039e10b771"
@@ -14,6 +17,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"
Signature · 1 line
1.7.4.1
author
#1 lore raw

PATCH 2/6 task-core-tools.bb: Exclude lttng-ust for x86_64/uclibc

---
 meta/recipes-core/tasks/task-core-tools.bb |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
meta/recipes-core/tasks/task-core-tools.bb +10 -1
index eed4afb..b0eb7d4 100644
@@ -58,6 +58,15 @@ RRECOMMENDS_task-core-tools-profile = "\
 SYSTEMTAP = "systemtap"
 SYSTEMTAP_libc-uclibc = ""
 
+# lttng-ust uses sched_getcpu() which is not there on uclibc
+# for some of the architectures it can be patched to call the
+# syscall directly but for x86_64 __NR_getcpu is a vsyscall
+# which means we can not use syscall() to call it. So we ignore
+# it for x86_64/uclibc
+
+LTTNGUST = "lttng-ust"
+LTTNGUST_libc-uclibc = ""
+
 #    exmap-console
 #    exmap-server
 
@@ -66,7 +75,7 @@ SYSTEMTAP_libc-uclibc = ""
 # (which is required by lttng-ust) may not build on other platforms, like
 # MIPS.
 RDEPENDS_task-core-tools-profile_append_qemux86 = " valgrind lttng-ust ${SYSTEMTAP}"
-RDEPENDS_task-core-tools-profile_append_qemux86-64 = " lttng-ust ${SYSTEMTAP}"
+RDEPENDS_task-core-tools-profile_append_qemux86-64 = " ${LTTNGUST} ${SYSTEMTAP}"
 RDEPENDS_task-core-tools-profile_append_qemuppc = " lttng-ust ${SYSTEMTAP}"
 RDEPENDS_task-core-tools-profile_append_qemuarm = " lttng-ust"
 
Signature · 1 line
1.7.4.1
author
#2 lore raw

PATCH 3/6 libiconv: Fix build failure on 1.13.1

In reply to Khem Raj

It needs a different patch for 1.13.1 for autoconf'ing Rename files to libiconv-1.11.1 and have a separate directory for libiconv-1.13.1

---
 .../{files => libiconv-1.11.1}/autoconf.patch      |    0
 .../shared_preloadable_libiconv_linux.patch        |    0
 .../libiconv/libiconv-1.13.1/autoconf.patch        |16026 ++++++++++++++++++++
 meta/recipes-support/libiconv/libiconv_1.13.1.bb   |    1 -
 4 files changed, 16026 insertions(+), 1 deletions(-)
 rename meta/recipes-support/libiconv/{files => libiconv-1.11.1}/autoconf.patch (100%)
 rename meta/recipes-support/libiconv/{files => libiconv-1.11.1}/shared_preloadable_libiconv_linux.patch (100%)
 create mode 100644 meta/recipes-support/libiconv/libiconv-1.13.1/autoconf.patch
meta/recipes-support/libiconv/libiconv-1.11.1/autoconf.patch renamed from meta/recipes-support/libiconv/files/autoconf.patch +0 -0
similarity index 100%
rename from meta/recipes-support/libiconv/files/autoconf.patch
rename to meta/recipes-support/libiconv/libiconv-1.11.1/autoconf.patch
meta/recipes-support/libiconv/libiconv-1.11.1/shared_preloadable_libiconv_linux.patch renamed from meta/recipes-support/libiconv/files/shared_preloadable_libiconv_linux.patch +0 -0
similarity index 100%
rename from meta/recipes-support/libiconv/files/shared_preloadable_libiconv_linux.patch
rename to meta/recipes-support/libiconv/libiconv-1.11.1/shared_preloadable_libiconv_linux.patch
meta/recipes-support/libiconv/libiconv-1.13.1/autoconf.patch new file +16026 -0

3,000 lines not on this page · raw message

meta/recipes-support/libiconv/libiconv_1.13.1.bb +0 -1
index 026f530..ec985e9 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.7.4.1

Part of the diff is not shown here. View the raw message.

#3 lore raw

Re: [PATCH 3/6] libiconv: Fix build failure on 1.13.1

Hi Khem,

what was the reason to patch out the libtool-macros instead of deleting them? That would be reduce the changelines a lot.

Bye henning

author
#4 lore raw

Re: [PATCH 3/6] libiconv: Fix build failure on 1.13.1

Quoted 4 lines · Henning Heinold

Hi Khem,

what was the reason to patch out the libtool-macros instead of deleting them? That would be reduce the changelines a lot.

I had some problems building but it was long time ago when I did that patch. I can try and see
if that helps. It certainly would be better.

author
#5 lore raw

PATCH 4/6 uclibc: Add patch header for sync_file_range2.patch

In reply to Khem Raj
---
 .../uclibc/uclibc-0.9.32/sync_file_range2.patch    |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
meta/recipes-core/uclibc/uclibc-0.9.32/sync_file_range2.patch +7 -0
index b5e972e..4b85a43 100644
@@ -1,3 +1,10 @@
+Some architectures like ppc, arm use aligned 64 bit inputs so a register is not wasted
+this then uses __NR_sync_file_range2 syscall. Implement is
+
+Singed-off-by: Khem Raj <[email protected]>
+
+Upstream-Status: Pending
+
 Index: git/libc/sysdeps/linux/common/sync_file_range.c
 ===================================================================
 --- git.orig/libc/sysdeps/linux/common/sync_file_range.c	2011-07-19 14:23:35.000000000 -0700
Signature · 1 line
1.7.4.1
author
#6 lore raw

PATCH 5/6 strace: Define own sigmask macro if not defined already in signal.h

In reply to Khem Raj

This is required especially on uclibc systems where BSD compatible obsolete functions are disabled by kconfig. Therefore we check if the macro is undefined then we define it. Therefore eglibc/glibc builds should work as they use to.

---
 .../strace/strace-4.5.20/sigmask.patch             |   22 ++++++++++++++++++++
 meta/recipes-devtools/strace/strace_4.5.20.bb      |    6 +++-
 2 files changed, 26 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-devtools/strace/strace-4.5.20/sigmask.patch
meta/recipes-devtools/strace/strace-4.5.20/sigmask.patch new file +22 -0
new file mode 100644
index 0000000..9bca528
@@ -0,0 +1,22 @@
+sigmask is a macro which is dropped if BSD compatibility is
+not enabled. So we check if the macro does not exist then
+we define it to __sigmask
+
+Signed-off-by: Khem Raj <[email protected]>
+
+Index: strace-4.5.20/signal.c
+===================================================================
+--- strace-4.5.20.orig/signal.c	2010-02-23 13:26:16.000000000 -0800
++++ strace-4.5.20/signal.c	2011-07-20 23:06:35.842339197 -0700
+@@ -140,6 +140,11 @@
+ #endif
+ #endif /* LINUX */
+ 
++#if !defined (sigmask) && defined (__sigmask)
++/* Compute mask for signal SIG.  */
++#define sigmask(sig)   __sigmask(sig)
++#endif /* sigmask */
++
+ const char *const signalent0[] = {
+ #include "signalent.h"
+ };
meta/recipes-devtools/strace/strace_4.5.20.bb +4 -2
index 3dba59f..391669f 100644
@@ -3,9 +3,11 @@ HOMEPAGE = "http://strace.sourceforge.net"
 SECTION = "console/utils"
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=4535377ede62550fdeaf39f595fd550a"
-PR = "r1"
+PR = "r2"
 
-SRC_URI = "${SOURCEFORGE_MIRROR}/strace/strace-${PV}.tar.bz2"
+SRC_URI = "${SOURCEFORGE_MIRROR}/strace/strace-${PV}.tar.bz2 \
+           file://sigmask.patch \
+          "
 
 SRC_URI[md5sum] = "64dfe10d9db0c1e34030891695ffca4b"
 SRC_URI[sha256sum] = "ea8c059369eaa5ad90b246f34eab247d0ee48bfdee2670c7196320a4669ccabd"
Signature · 1 line
1.7.4.1
author
#7 lore raw

PATCH 6/6 util-linux: Replace sigsetmask with posix compliant functions

In reply to Khem Raj

This patch is not needed upstream since the code using sigsetmask has been deleted.

---
 .../util-linux-2.19.1/remove_sigsetmark.patch      |   35 ++++++++++++++++++++
 meta/recipes-core/util-linux/util-linux_2.19.1.bb  |    3 +-
 2 files changed, 37 insertions(+), 1 deletions(-)
 create mode 100644 meta/recipes-core/util-linux/util-linux-2.19.1/remove_sigsetmark.patch
meta/recipes-core/util-linux/util-linux-2.19.1/remove_sigsetmark.patch new file +35 -0
new file mode 100644
index 0000000..02e4d16
@@ -0,0 +1,35 @@
+simpleinit: remove deprecated sigsetmask()
+
+The sigsetmask() is deprecated in favor of sigprocmask().
+
+This is not needed upstream since simpleinit is removed from
+util-linux-ng master
+
+Signed-off-by: Khem Raj <[email protected]>
+
+Upstream-Status: Inappropriate
+
+Index: util-linux-2.19.1/simpleinit/shutdown.c
+===================================================================
+--- util-linux-2.19.1.orig/simpleinit/shutdown.c	2011-03-04 03:47:47.000000000 -0800
++++ util-linux-2.19.1/simpleinit/shutdown.c	2011-07-06 08:43:39.183849752 -0700
+@@ -145,7 +145,7 @@
+ {
+ 	int c, i, fd;
+ 	char *ptr;
+-
++	sigset_t sigmask;
+ 	i = getdtablesize ();
+ 	for (fd = 3; fd < i; fd++) close (fd);
+ 	if (getpid () == 1)
+@@ -153,7 +153,9 @@
+ 	    for (fd = 0; fd < 3; fd++) close (fd);
+ 	    while (1) wait (NULL);  /*  Grim reaper never stops  */
+ 	}
+-	sigsetmask (0); /*  simpleinit(8) blocks all signals: undo for ALRM  */
++	/*  simpleinit(8) blocks all signals: undo for ALRM  */
++	sigemptyset(&sigmask);
++	sigprocmask (SIG_SETMASK, &sigmask, NULL);
+ 	for (i = 1; i < NSIG; i++) signal (i, SIG_DFL);
+ 
+         setlocale(LC_ALL, "");
meta/recipes-core/util-linux/util-linux_2.19.1.bb +2 -1
index 0fd67d1..2ef95e6 100644
@@ -1,5 +1,5 @@
 MAJOR_VERSION = "2.19"
-PR = "r2"
+PR = "r3"
 require util-linux.inc
 
 # note that `lscpu' is under GPLv3+
@@ -8,6 +8,7 @@ LICENSE_util-linux-lscpu = "GPLv3+"
 SRC_URI += "file://util-linux-ng-replace-siginterrupt.patch \
             file://util-linux-ng-2.16-mount_lock_path.patch \
             file://uclibc-__progname-conflict.patch \      
+            file://remove_sigsetmark.patch \
 "
 
 SRC_URI[md5sum] = "3eab06f05163dfa65479c44e5231932c"
Signature · 1 line
1.7.4.1
#8 lore raw
In reply to Khem Raj
Quoted 88 lines · Khem Raj
---
  meta/recipes-graphics/mesa/mesa-dri/uclibc.patch |   40 ++++++++++++++++++++++
  meta/recipes-graphics/mesa/mesa-dri_7.10.2.bb    |    6 ++-
  meta/recipes-graphics/mesa/mesa-xlib_7.10.2.bb   |    5 ++-
  3 files changed, 48 insertions(+), 3 deletions(-)

create mode 100644 meta/recipes-graphics/mesa/mesa-dri/uclibc.patch

meta/recipes-graphics/mesa/mesa-dri/uclibc.patch new file +40 -0
new file mode 100644
index 0000000..bb5af44
@@ -0,0 +1,40 @@
+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-20 19:08:49.441785510 -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 (HAVE_NEWLOCALE)
+    static locale_t loc = NULL;
+    if (!loc) {
+       loc = newlocale(LC_CTYPE_MASK, "C", NULL);
+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-20 19:10:21.441785488 -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 (HAVE_NEWLOCALE)
+    static locale_t loc = NULL;
+    if (!loc) {
+       loc = newlocale(LC_CTYPE_MASK, "C", NULL);
+Index: Mesa-7.10.2/configure.ac
+===================================================================
+--- Mesa-7.10.2.orig/configure.ac	2011-07-20 19:09:02.000000000 -0700
++++ Mesa-7.10.2/configure.ac	2011-07-20 19:09:57.121785492 -0700
+@@ -450,6 +450,9 @@
+ dnl See if posix_memalign is available
+ AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
+
++dnl See if newlocale is available
++AC_CHECK_FUNCS_ONCE(newlocale)
++
+ dnl SELinux awareness.
+ AC_ARG_ENABLE([selinux],
+     [AS_HELP_STRING([--enable-selinux],
meta/recipes-graphics/mesa/mesa-dri_7.10.2.bb +4 -2
index c7bd974..aac7a1c 100644
@@ -8,10 +8,12 @@ LIB_DEPS = "libdrm virtual/libx11 libxext libxxf86vm libxdamage libxfixes expat
 
  DEPENDS = "${PROTO_DEPS}  ${LIB_DEPS} makedepend-native python-native"
 
-PR = "r0"
+PR = "r1"
 
  SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/MesaLib-${PV}.tar.bz2 \
-           file://crossfix.patch"
+           file://crossfix.patch \
+           file://uclibc.patch \
+          "
 
  SRC_URI[md5sum] = "f5de82852f1243f42cc004039e10b771"
  SRC_URI[sha256sum] = "8ced2678ce11cf30804694a92ea3ca6b82f158ae8995bdc626c7e85aac71c7c1"
meta/recipes-graphics/mesa/mesa-xlib_7.10.2.bb +3 -0
index b77df2c..511103d 100644
@@ -1,6 +1,9 @@
  include mesa-common.inc
 
+FILESPATH =. "${FILE_DIRNAME}/mesa-dri:"
+
  SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/MesaLib-${PV}.tar.bz2 \
+           file://uclibc.patch \
             "
 
  SRC_URI[md5sum] = "f5de82852f1243f42cc004039e10b771"

meta/recipes-graphics/mesa/mesa-xlib_7.10.2.bb LIB_DEPS = "virtual/libx11 libxext libxxf86vm libxdamage libxfixes libxml2-nativ · line 22

Quoted 7 lines
meta/recipes-graphics/mesa/mesa-xlib_7.10.2.bb +1 -1
@@ -14,6 +17,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"

The series was merged into OE-Core aside from the libiconv, which I believe is getting re-worked.

Sau!