[OE-core] [PATCH 1/2] glib-2.0: Don't check function qsort_r
Xiaofeng Yan
xiaofeng.yan at windriver.com
Mon Feb 6 06:41:12 UTC 2012
From: Xiaofeng Yan <xiaofeng.yan at windriver.com>
function "g_qsort_with_data" has two kinds of realization. One calls qsort_r
from libglib, the other realize itself.
qsort_r from libglib cause sort error.
For fixing this problem no checking "qsort_r" in configure.ac.
[YOCTO #1959]
Signed-off-by: Xiaofeng Yan <xiaofeng.yan at windriver.com>
---
.../glib-2.0/glib-2.0/no-check-qsort_r.patch | 61 ++++++++++++++++++++
1 files changed, 61 insertions(+), 0 deletions(-)
create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/no-check-qsort_r.patch
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/no-check-qsort_r.patch b/meta/recipes-core/glib-2.0/glib-2.0/no-check-qsort_r.patch
new file mode 100644
index 0000000..99e229c
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/no-check-qsort_r.patch
@@ -0,0 +1,61 @@
+Upstream-Status: Pending
+
+function "g_qsort_with_data" has two kinds of realization. One calls qsort_r
+from libglib, the other realize itself.
+qsort_r from libglib cause sort error. Don't check qsort_r for fixing this problem.
+
+Xiaofeng Yan <xiaofeng.yan at windriver.com>
+
+Index: glib-2.30.0/configure.ac
+===================================================================
+--- a/configure.ac 2012-02-06 11:15:37.885295264 +0800
++++ b/configure.ac.new 2012-02-06 11:16:04.239795382 +0800
+@@ -584,47 +584,7 @@
+ dnl don't use AC_CHECK_FUNCS here, otherwise HAVE_QSORT_R will
+ dnl be automatically defined, which we don't want to do
+ dnl until we have checked this function is actually usable
+-AC_CHECK_FUNC([qsort_r])
+-
+-# BSD has a qsort_r with wrong argument order
+-if test x$ac_cv_func_qsort_r = xyes ; then
+- AC_CACHE_CHECK([if qsort_r uses glibc compatible argument order], glib_cv_have_qsort_r, [
+- AC_RUN_IFELSE([AC_LANG_SOURCE([[
+- #define _GNU_SOURCE
+- #include <stdlib.h>
+-
+- static int
+- cmp (const void *a, const void *b, void *c)
+- {
+- const int *ia = a;
+- const int *ib = b;
+-
+- if (*ia < *ib)
+- return -1;
+- else if (*ia > *ib)
+- return 1;
+- else
+- return 0;
+- }
+-
+- int
+- main (int argc, char **argv)
+- {
+- int arr[3] = { 1, 2, 0 };
+- int d = 3;
+-
+- qsort_r (arr, 3, sizeof (int), cmp, &d);
+-
+- if (arr[0] == 0 && arr[1] == 1 && arr[2] == 2)
+- return 0;
+- else
+- return 1;
+- }]])],[glib_cv_have_qsort_r=yes],[glib_cv_have_qsort_r=no])])
+-fi
+-
+-if test x$glib_cv_have_qsort_r = xyes ; then
+- AC_DEFINE(HAVE_QSORT_R, 1, [Define to 1 if you have the 'qsort_r' function])
+-fi
++#AC_CHECK_FUNC([qsort_r])
+
+ AC_CHECK_SIZEOF(char)
+ AC_CHECK_SIZEOF(short)
--
1.7.0.4
More information about the Openembedded-core
mailing list