0002-fix-busy-loop-in-dlopen.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # HG changeset patch
  2. # User Paul Cercueil <paul@crapouillou.net>
  3. # Date 1576820863 28800
  4. # Node ID 4f5bef55183c677d12a7da8f3392879ed50670a3
  5. # Parent 01f16d7f36cb9f4fa02016e57fbe915fdea71cc8
  6. kmsdrm: Fix busy-loop within libc's dlopen()
  7. For some obscure reason, the order in which the libdrm/libgbm libraries
  8. are loaded matters.
  9. Without this fix, the first call to check_modesetting() will work and
  10. load then unload all symbols properly, but the second call to this
  11. function will lock up as soon as dlopen() is called on libdrm.
  12. Swapping the order in which the libdrm and libgbm libraries are loaded
  13. is enough to fix (or work around?) this issue.
  14. Fixes #4891:
  15. https://bugzilla.libsdl.org/show_bug.cgi?id=4891
  16. Upstream: https://hg.libsdl.org/SDL/rev/4f5bef55183c
  17. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
  18. [yann.morin.1998@free.fr: add upstream commit URL]
  19. Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
  20. diff -r 01f16d7f36cb -r 4f5bef55183c src/video/kmsdrm/SDL_kmsdrmdyn.c
  21. --- a/src/video/kmsdrm/SDL_kmsdrmdyn.c Thu Dec 19 21:45:44 2019 -0800
  22. +++ b/src/video/kmsdrm/SDL_kmsdrmdyn.c Thu Dec 19 21:47:43 2019 -0800
  23. @@ -50,8 +50,8 @@
  24. #endif
  25. static kmsdrmdynlib kmsdrmlibs[] = {
  26. - {NULL, SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC},
  27. - {NULL, SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM}
  28. + {NULL, SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM},
  29. + {NULL, SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC}
  30. };
  31. static void *