From patchwork Fri Dec 20 16:04:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 1214214 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=crapouillou.net Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=crapouillou.net header.i=@crapouillou.net header.b="RPju/i9k"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47fYVF4VQhz9sPJ for ; Sat, 21 Dec 2019 03:04:53 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id AB16887120; Fri, 20 Dec 2019 16:04:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YdP8jm9ZvI1M; Fri, 20 Dec 2019 16:04:51 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 0CB9087D77; Fri, 20 Dec 2019 16:04:51 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id AAFEE1BF311 for ; Fri, 20 Dec 2019 16:04:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 98DFF87D77 for ; Fri, 20 Dec 2019 16:04:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 92a8fh4dxjSj for ; Fri, 20 Dec 2019 16:04:47 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from crapouillou.net (outils.crapouillou.net [89.234.176.41]) by whitealder.osuosl.org (Postfix) with ESMTPS id 7307587120 for ; Fri, 20 Dec 2019 16:04:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1576857883; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=Z6Hge+4Tzi1550wxbULip/4pzLBNb+hiLLR3m9R2hdo=; b=RPju/i9k4T0yU/bG0vBBW3fh+JowGoHgQ5PlyJAeWyjxZPpFvftEbf3VkBfaLOBvOVMvHJ 2FrU3zyNymdSLbxtLfA2xpJeGGYHEBnUp5I9XFDSFlGexVEXgxq/dd4haAyZW3xk3ezhaF YYiGX3Wlu6veDZiQMYz9bSM+OZk7MeU= From: Paul Cercueil To: buildroot@busybox.net Date: Fri, 20 Dec 2019 17:04:38 +0100 Message-Id: <20191220160438.102444-1-paul@crapouillou.net> MIME-Version: 1.0 Subject: [Buildroot] [PATCH] sdl2: add patch to fix busy-loop in C library X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Cercueil , od@zcrc.me Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" 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. Signed-off-by: Paul Cercueil --- .../sdl2/0002-fix-busy-loop-in-dlopen.patch | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 package/sdl2/0002-fix-busy-loop-in-dlopen.patch diff --git a/package/sdl2/0002-fix-busy-loop-in-dlopen.patch b/package/sdl2/0002-fix-busy-loop-in-dlopen.patch new file mode 100644 index 0000000000..984a80d9c1 --- /dev/null +++ b/package/sdl2/0002-fix-busy-loop-in-dlopen.patch @@ -0,0 +1,37 @@ + +# HG changeset patch +# User Paul Cercueil +# Date 1576820863 28800 +# Node ID 4f5bef55183c677d12a7da8f3392879ed50670a3 +# Parent 01f16d7f36cb9f4fa02016e57fbe915fdea71cc8 +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 + +diff -r 01f16d7f36cb -r 4f5bef55183c src/video/kmsdrm/SDL_kmsdrmdyn.c +--- a/src/video/kmsdrm/SDL_kmsdrmdyn.c Thu Dec 19 21:45:44 2019 -0800 ++++ b/src/video/kmsdrm/SDL_kmsdrmdyn.c Thu Dec 19 21:47:43 2019 -0800 +@@ -50,8 +50,8 @@ + #endif + + static kmsdrmdynlib kmsdrmlibs[] = { +- {NULL, SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC}, +- {NULL, SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM} ++ {NULL, SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM}, ++ {NULL, SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC} + }; + + static void * +