c85f88ab9c692b70d66176a7d31bd27ea0443be1
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / mesa3d / 0002-Fix-runtime-error-with-uClibc.patch
1 Fix runtime error with uClibc
2
3 Patch inspired by
4 https://www.winehq.org/pipermail/wine-bugs/2011-September/288987.html
5 http://git.alpinelinux.org/cgit/aports/tree/main/wine/uclibc-fmaxf-fminf.patch?id=c9b491b6099eec02a835ffd05539b5c783c6c43a
6
7 Starting an app using mesa3d 10.5.x, Kodi for example, fails:
8
9 /usr/lib/kodi/kodi.bin: symbol 'fminf': can't resolve symbol in lib '/usr/lib/dri/i965_dri.so'.
10 libGL error: unable to load driver: i965_dri.so
11 libGL error: driver pointer missing
12 libGL error: failed to load driver: i965
13 libGL error: unable to load driver: swrast_dri.so
14 libGL error: failed to load driver: swrast
15
16 This patch was rejected by upstream mesa3d:
17 http://lists.freedesktop.org/archives/mesa-dev/2015-March/079436.html
18
19 The real fix was committed to uClibc:
20 http://git.uclibc.org/uClibc/commit/?id=6c4538905e65ceb203f59aaa9a61728e81c6bc0a
21
22 Until the external toolchains do not contain this uClibc patch we keep this
23 patch: http://lists.busybox.net/pipermail/buildroot/2015-March/123410.html
24
25 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
26 ---
27 diff -uNr mesa-10.5.3.org/src/glsl/nir/nir_constant_expressions.c mesa-10.5.3/src/glsl/nir/nir_constant_expressions.c
28 --- mesa-10.5.3.org/src/glsl/nir/nir_constant_expressions.c     2015-04-12 23:31:29.000000000 +0200
29 +++ mesa-10.5.3/src/glsl/nir/nir_constant_expressions.c 2015-04-13 19:59:37.819786541 +0200
30 @@ -48,6 +48,18 @@
31  }
32  #endif
33  
34 +#ifdef __UCLIBC__
35 +float fmaxf(float a, float b)
36 +{
37 +       return (a > b) ? a : b;
38 +}
39 +
40 +float fminf(float a, float b)
41 +{
42 +       return (a < b) ? a : b;
43 +}
44 +#endif
45 +
46  /**
47   * Evaluate one component of packSnorm4x8.
48   */