1 |
commit: 7a4871deff8ea91706852dfb7aedcf43eec25ce1 |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jan 6 21:11:53 2012 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jan 6 21:11:53 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=7a4871de |
7 |
|
8 |
media-libs/mesa: patch C files where build system's MACROS don't work |
9 |
|
10 |
--- |
11 |
.../mesa/files/remove-GNU_SOURCE-locale.patch | 65 ++++++++++++++++++++ |
12 |
media-libs/mesa/mesa-7.11.2-r99.ebuild | 3 +- |
13 |
2 files changed, 66 insertions(+), 2 deletions(-) |
14 |
|
15 |
diff --git a/media-libs/mesa/files/remove-GNU_SOURCE-locale.patch b/media-libs/mesa/files/remove-GNU_SOURCE-locale.patch |
16 |
new file mode 100644 |
17 |
index 0000000..f197b11 |
18 |
--- /dev/null |
19 |
+++ b/media-libs/mesa/files/remove-GNU_SOURCE-locale.patch |
20 |
@@ -0,0 +1,65 @@ |
21 |
+diff -Naur Mesa-7.11.2.orig/src/gallium/auxiliary/util/u_debug_symbol.c Mesa-7.11.2/src/gallium/auxiliary/util/u_debug_symbol.c |
22 |
+--- Mesa-7.11.2.orig/src/gallium/auxiliary/util/u_debug_symbol.c 2011-07-09 01:32:30.000000000 +0000 |
23 |
++++ Mesa-7.11.2/src/gallium/auxiliary/util/u_debug_symbol.c 2012-01-06 20:45:51.822428420 +0000 |
24 |
+@@ -151,23 +151,6 @@ |
25 |
+ } |
26 |
+ #endif |
27 |
+ |
28 |
+-#ifdef __GLIBC__ |
29 |
+-#include <execinfo.h> |
30 |
+- |
31 |
+-/* This can only provide dynamic symbols, or binary offsets into a file. |
32 |
+- * |
33 |
+- * To fix this, post-process the output with tools/addr2line.sh |
34 |
+- */ |
35 |
+-static INLINE void |
36 |
+-debug_symbol_name_glibc(const void *addr, char* buf, unsigned size) |
37 |
+-{ |
38 |
+- char** syms = backtrace_symbols((void**)&addr, 1); |
39 |
+- strncpy(buf, syms[0], size); |
40 |
+- buf[size - 1] = 0; |
41 |
+- free(syms); |
42 |
+-} |
43 |
+-#endif |
44 |
+- |
45 |
+ void |
46 |
+ debug_symbol_name(const void *addr, char* buf, unsigned size) |
47 |
+ { |
48 |
+diff -Naur Mesa-7.11.2.orig/src/glsl/strtod.c Mesa-7.11.2/src/glsl/strtod.c |
49 |
+--- Mesa-7.11.2.orig/src/glsl/strtod.c 2012-01-06 20:45:34.282662359 +0000 |
50 |
++++ Mesa-7.11.2/src/glsl/strtod.c 2012-01-06 20:42:11.303216873 +0000 |
51 |
+@@ -44,13 +44,5 @@ |
52 |
+ double |
53 |
+ glsl_strtod(const char *s, char **end) |
54 |
+ { |
55 |
+-#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) |
56 |
+- static locale_t loc = NULL; |
57 |
+- if (!loc) { |
58 |
+- loc = newlocale(LC_CTYPE_MASK, "C", NULL); |
59 |
+- } |
60 |
+- return strtod_l(s, end, loc); |
61 |
+-#else |
62 |
+ return strtod(s, end); |
63 |
+-#endif |
64 |
+ } |
65 |
+diff -Naur Mesa-7.11.2.orig/src/mesa/main/imports.c Mesa-7.11.2/src/mesa/main/imports.c |
66 |
+--- Mesa-7.11.2.orig/src/mesa/main/imports.c 2012-01-06 20:45:34.283662859 +0000 |
67 |
++++ Mesa-7.11.2/src/mesa/main/imports.c 2012-01-06 20:42:11.305217873 +0000 |
68 |
+@@ -753,17 +753,7 @@ |
69 |
+ float |
70 |
+ _mesa_strtof( const char *s, char **end ) |
71 |
+ { |
72 |
+-#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) |
73 |
+- static locale_t loc = NULL; |
74 |
+- if (!loc) { |
75 |
+- loc = newlocale(LC_CTYPE_MASK, "C", NULL); |
76 |
+- } |
77 |
+- return strtof_l(s, end, loc); |
78 |
+-#elif defined(_ISOC99_SOURCE) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 600) |
79 |
+ return strtof(s, end); |
80 |
+-#else |
81 |
+- return (float)strtod(s, end); |
82 |
+-#endif |
83 |
+ } |
84 |
+ |
85 |
+ /** Compute simple checksum/hash for a string */ |
86 |
|
87 |
diff --git a/media-libs/mesa/mesa-7.11.2-r99.ebuild b/media-libs/mesa/mesa-7.11.2-r99.ebuild |
88 |
index 6acfe89..98154da 100644 |
89 |
--- a/media-libs/mesa/mesa-7.11.2-r99.ebuild |
90 |
+++ b/media-libs/mesa/mesa-7.11.2-r99.ebuild |
91 |
@@ -97,8 +97,6 @@ S="${WORKDIR}/${MY_P}" |
92 |
QA_EXECSTACK="usr/lib*/opengl/xorg-x11/lib/libGL.so*" |
93 |
QA_WX_LOAD="usr/lib*/opengl/xorg-x11/lib/libGL.so*" |
94 |
|
95 |
-# Think about: ggi, fbcon, no-X configs |
96 |
- |
97 |
pkg_setup() { |
98 |
# recommended by upstream |
99 |
append-flags -ffast-math |
100 |
@@ -126,6 +124,7 @@ src_prepare() { |
101 |
epatch "${FILESDIR}"/glx_ro_text_segm.patch |
102 |
|
103 |
epatch "${FILESDIR}"/respect-user-defines.patch |
104 |
+ epatch "${FILESDIR}"/remove-GNU_SOURCE-locale.patch |
105 |
|
106 |
base_src_prepare |