diff options
author | Khem Raj <raj.khem@gmail.com> | 2015-04-06 17:36:46 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-04-10 18:10:27 +0100 |
commit | bcd9f0578fd3bb1569635e78a0d7d315213bd25f (patch) | |
tree | a6154008c41ef20f391c205cc94c634c845b5c6e /meta/recipes-graphics | |
parent | 62980ea8ac6e56aa3b192ed3a53199d563f2df59 (diff) | |
download | poky-bcd9f0578fd3bb1569635e78a0d7d315213bd25f.tar.gz |
mesa: Fix building with musl
backport needed patches
add a patch to use _NP macros only on glibc
based linux and not on all linux
Change-Id: Ib43bec9d222856f8e7acb9f0143b406517f049c8
(From OE-Core rev: 7dcd8f532fef71e711bf11a00f0e246a36b6138a)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics')
3 files changed, 86 insertions, 1 deletions
diff --git a/meta/recipes-graphics/mesa/mesa/0001-PTHREAD_MUTEX_RECURSIVE_NP-is-specific-to-glibc.patch b/meta/recipes-graphics/mesa/mesa/0001-PTHREAD_MUTEX_RECURSIVE_NP-is-specific-to-glibc.patch new file mode 100644 index 0000000000..52443d8422 --- /dev/null +++ b/meta/recipes-graphics/mesa/mesa/0001-PTHREAD_MUTEX_RECURSIVE_NP-is-specific-to-glibc.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From 46cdd464efbada13478f5e39a50aef85599ff91b Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 4 Apr 2015 15:50:53 -0700 | ||
4 | Subject: [PATCH 1/2] PTHREAD_MUTEX_RECURSIVE_NP is specific to glibc | ||
5 | |||
6 | use glibc guard around it | ||
7 | |||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | Upstream-Status: Pending | ||
10 | --- | ||
11 | include/c11/threads_posix.h | 2 +- | ||
12 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
13 | |||
14 | diff --git a/include/c11/threads_posix.h b/include/c11/threads_posix.h | ||
15 | index f9c165d..c641de4 100644 | ||
16 | --- a/include/c11/threads_posix.h | ||
17 | +++ b/include/c11/threads_posix.h | ||
18 | @@ -178,7 +178,7 @@ mtx_init(mtx_t *mtx, int type) | ||
19 | return thrd_error; | ||
20 | pthread_mutexattr_init(&attr); | ||
21 | if ((type & mtx_recursive) != 0) { | ||
22 | -#if defined(__linux__) || defined(__linux) | ||
23 | +#if defined __GLIBC__ && (defined(__linux__) || defined(__linux)) | ||
24 | pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP); | ||
25 | #else | ||
26 | pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); | ||
27 | -- | ||
28 | 2.1.4 | ||
29 | |||
diff --git a/meta/recipes-graphics/mesa/mesa/0002-mesa-simplify-detection-of-fpclassify.patch b/meta/recipes-graphics/mesa/mesa/0002-mesa-simplify-detection-of-fpclassify.patch new file mode 100644 index 0000000000..dd7a188a2f --- /dev/null +++ b/meta/recipes-graphics/mesa/mesa/0002-mesa-simplify-detection-of-fpclassify.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From c09606093c6b8e47d7cb6745eff192184eaaae07 Mon Sep 17 00:00:00 2001 | ||
2 | From: Felix Janda <felix.janda@posteo.de> | ||
3 | Date: Fri, 23 Jan 2015 17:57:15 +0100 | ||
4 | Subject: [PATCH 2/2] mesa: simplify detection of fpclassify | ||
5 | |||
6 | Fixes compilation with musl libc. | ||
7 | |||
8 | Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> | ||
9 | Upstream-Status: Backport | ||
10 | --- | ||
11 | src/mesa/main/querymatrix.c | 18 +++++++----------- | ||
12 | 1 file changed, 7 insertions(+), 11 deletions(-) | ||
13 | |||
14 | diff --git a/src/mesa/main/querymatrix.c b/src/mesa/main/querymatrix.c | ||
15 | index eb36c76..ef85175 100644 | ||
16 | --- a/src/mesa/main/querymatrix.c | ||
17 | +++ b/src/mesa/main/querymatrix.c | ||
18 | @@ -37,8 +37,12 @@ | ||
19 | #define INT_TO_FIXED(x) ((GLfixed) ((x) << 16)) | ||
20 | #define FLOAT_TO_FIXED(x) ((GLfixed) ((x) * 65536.0)) | ||
21 | |||
22 | -#if defined(_MSC_VER) | ||
23 | -#if _MSC_VER < 1800 /* Not required on VS2013 and above. */ | ||
24 | +#if defined(fpclassify) | ||
25 | +/* ISO C99 says that fpclassify is a macro. Assume that any implementation | ||
26 | + * of fpclassify, whether it's in a C99 compiler or not, will be a macro. | ||
27 | + */ | ||
28 | +#elif defined(_MSC_VER) | ||
29 | +/* Not required on VS2013 and above. */ | ||
30 | /* Oddly, the fpclassify() function doesn't exist in such a form | ||
31 | * on MSVC. This is an implementation using slightly different | ||
32 | * lower-level Windows functions. | ||
33 | @@ -71,16 +75,8 @@ fpclassify(double x) | ||
34 | return FP_NAN; | ||
35 | } | ||
36 | } | ||
37 | -#endif /* _MSC_VER < 1800 */ | ||
38 | - | ||
39 | -#elif defined(__APPLE__) || defined(__CYGWIN__) || defined(__FreeBSD__) || \ | ||
40 | - defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || \ | ||
41 | - (defined(__sun) && defined(__C99FEATURES__)) || defined(__MINGW32__) || \ | ||
42 | - (defined(__sun) && defined(__GNUC__)) || defined(ANDROID) || defined(__HAIKU__) | ||
43 | - | ||
44 | -/* fpclassify is available. */ | ||
45 | |||
46 | -#elif !defined(_XOPEN_SOURCE) || _XOPEN_SOURCE < 600 | ||
47 | +#else | ||
48 | |||
49 | enum {FP_NAN, FP_INFINITE, FP_ZERO, FP_SUBNORMAL, FP_NORMAL} | ||
50 | fpclassify(double x) | ||
51 | -- | ||
52 | 2.1.4 | ||
53 | |||
diff --git a/meta/recipes-graphics/mesa/mesa_10.4.4.bb b/meta/recipes-graphics/mesa/mesa_10.4.4.bb index 8140411752..8472408001 100644 --- a/meta/recipes-graphics/mesa/mesa_10.4.4.bb +++ b/meta/recipes-graphics/mesa/mesa_10.4.4.bb | |||
@@ -1,6 +1,9 @@ | |||
1 | require ${BPN}.inc | 1 | require ${BPN}.inc |
2 | 2 | ||
3 | SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/MesaLib-${PV}.tar.bz2" | 3 | SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/MesaLib-${PV}.tar.bz2 \ |
4 | file://0001-PTHREAD_MUTEX_RECURSIVE_NP-is-specific-to-glibc.patch \ | ||
5 | file://0002-mesa-simplify-detection-of-fpclassify.patch \ | ||
6 | " | ||
4 | 7 | ||
5 | SRC_URI[md5sum] = "62faf98ac79c5587f8e917e187419e6c" | 8 | SRC_URI[md5sum] = "62faf98ac79c5587f8e917e187419e6c" |
6 | SRC_URI[sha256sum] = "f18a967e9c4d80e054b2fdff8c130ce6e6d1f8eecfc42c9f354f8628d8b4df1c" | 9 | SRC_URI[sha256sum] = "f18a967e9c4d80e054b2fdff8c130ce6e6d1f8eecfc42c9f354f8628d8b4df1c" |