kmsdrm: Fix busy-loop within libc's dlopen()
authorPaul Cercueil <paul@crapouillou.net>
Thu, 19 Dec 2019 21:47:43 -0800
changeset 133664f5bef55183c
parent 13365 01f16d7f36cb
child 13367 aa6c25160e67
kmsdrm: Fix busy-loop within libc's dlopen()
For some obscure reason, the order in which the libdrm/libgbm libraries
are loaded matters.

Without this fix, the first call to check_modesetting() will work and
load then unload all symbols properly, but the second call to this
function will lock up as soon as dlopen() is called on libdrm.

Swapping the order in which the libdrm and libgbm libraries are loaded
is enough to fix (or work around?) this issue.

Fixes #4891:
https://bugzilla.libsdl.org/show_bug.cgi?id=4891

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
src/video/kmsdrm/SDL_kmsdrmdyn.c
     1.1 --- a/src/video/kmsdrm/SDL_kmsdrmdyn.c	Thu Dec 19 21:45:44 2019 -0800
     1.2 +++ b/src/video/kmsdrm/SDL_kmsdrmdyn.c	Thu Dec 19 21:47:43 2019 -0800
     1.3 @@ -50,8 +50,8 @@
     1.4  #endif
     1.5  
     1.6  static kmsdrmdynlib kmsdrmlibs[] = {
     1.7 -    {NULL, SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC},
     1.8 -    {NULL, SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM}
     1.9 +    {NULL, SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM},
    1.10 +    {NULL, SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC}
    1.11  };
    1.12  
    1.13  static void *