0002-Fix-runtime-error-with-uClibc.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. Fix runtime error with uClibc
  2. Patch sent upstream:
  3. http://lists.freedesktop.org/archives/mesa-dev/2015-March/079431.html
  4. From b1dae3cae9df36d9c4f64c342cfe7c106e34ec72 Mon Sep 17 00:00:00 2001
  5. From: Bernd Kuhls <bernd.kuhls@t-online.de>
  6. Date: Sun, 15 Mar 2015 12:23:26 +0100
  7. Subject: [PATCH 1/1] Fix runtime error with uClibc
  8. Patch inspired by
  9. https://www.winehq.org/pipermail/wine-bugs/2011-September/288987.html
  10. http://git.alpinelinux.org/cgit/aports/tree/main/wine/uclibc-fmaxf-fminf.patch?id=c9b491b6099eec02a835ffd05539b5c783c6c43a
  11. Starting an app using mesa3d 10.5.x, Kodi for example, fails:
  12. /usr/lib/kodi/kodi.bin: symbol 'fminf': can't resolve symbol in lib '/usr/lib/dri/i965_dri.so'.
  13. libGL error: unable to load driver: i965_dri.so
  14. libGL error: driver pointer missing
  15. libGL error: failed to load driver: i965
  16. libGL error: unable to load driver: swrast_dri.so
  17. libGL error: failed to load driver: swrast
  18. Here is some background information about the fminf/fmaxf situation in uClibc:
  19. http://thread.gmane.org/gmane.comp.lib.uclibc.general/24189
  20. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  21. ---
  22. src/glsl/nir/nir_constant_expressions.py | 12 ++++++++++++
  23. 1 file changed, 12 insertions(+)
  24. diff --git a/src/glsl/nir/nir_constant_expressions.py b/src/glsl/nir/nir_constant_expressions.py
  25. index 22bc4f0..139c25a 100644
  26. --- a/src/glsl/nir/nir_constant_expressions.py
  27. +++ b/src/glsl/nir/nir_constant_expressions.py
  28. @@ -50,6 +50,18 @@ static double copysign(double x, double y)
  29. }
  30. #endif
  31. +#ifdef __UCLIBC__
  32. +float fmaxf(float a, float b)
  33. +{
  34. + return (a > b) ? a : b;
  35. +}
  36. +
  37. +float fminf(float a, float b)
  38. +{
  39. + return (a < b) ? a : b;
  40. +}
  41. +#endif
  42. +
  43. /**
  44. * Evaluate one component of packSnorm4x8.
  45. */
  46. --
  47. 1.7.10.4