From patchwork Sat Oct 19 02:09:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 1179727 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.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qdl0jHW+"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46w5w43R69z9sP3 for ; Sat, 19 Oct 2019 13:10:26 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 7A5A388770; Sat, 19 Oct 2019 02:10:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MAue0GTVjNa2; Sat, 19 Oct 2019 02:10:17 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id D235188522; Sat, 19 Oct 2019 02:10:16 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id CC61F1BF389 for ; Sat, 19 Oct 2019 02:10:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id C97158587E for ; Sat, 19 Oct 2019 02:10:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id egp9sLVLg6OG for ; Sat, 19 Oct 2019 02:10:15 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qt1-f193.google.com (mail-qt1-f193.google.com [209.85.160.193]) by fraxinus.osuosl.org (Postfix) with ESMTPS id C89AB820DA for ; Sat, 19 Oct 2019 02:09:38 +0000 (UTC) Received: by mail-qt1-f193.google.com with SMTP id r5so11993217qtd.0 for ; Fri, 18 Oct 2019 19:09:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=hKkXpIT6Na3AlJxlLdV/rNsKAASfk8slSuI0uU3tAzs=; b=qdl0jHW+3QUYwUg7GSLFzNhRv9OOSM0g3X3ZRTWVs2RmPVaal+7VpF1nxqkXA+qR+E zw8AyvJsA0+N8zzrFkJRX7JHMywod+OlUaprsCU/7Omd0m+mectk5lVnA9w8hM/PdfVK 9kTG0zju+v+9xL4mJ1D9K7hVghuJbbGxBvw8dn+dAqKR7OkGpCjd2e2PkOMsd7f9Hqqs iAojUZ0bPEIeXO9EcJsjP6ys4LR5RnoYR40lEGc3Tjyx0bUuRbDti4mbwDDXVqRyUpwO rLMt7JXVeoCwuykz28YznAZ1J8XwBfiEvDzIs2VvzVF9+e3AvQP8gW1r1jKuDBeGUOPD o5uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=hKkXpIT6Na3AlJxlLdV/rNsKAASfk8slSuI0uU3tAzs=; b=pQ7vrFGaS4Del9wAl7Fbqi/4jtlw8m3Ux2q8oB72uzCx4vTViSdqzM5dti4dbWs/kT /27Rxja5sl+o79WkJ41ZOcccBRsRkjBMtn7Du3CGTakf7i3G4K1ApQ5xSqff+vvBH75I GzZCqPJrLyZMKX3Jnsjizknw+GKtRgaUv9eWl4LCecNHj225Cy7y4sTQ7ecUpkbtdh4y ZOO20LF2pGP8EQ1xrEE1Kl+oiF7L/L/sNr78usSV4/6T0ZKNzIjaOrs2ag6d/X//6YiA aNX3mg99EweGWNoybp3xtPJr6YXdCejhVnS+cpjSE71Ft6FxFPlDcDROToTn2Du6EyYK 1z8g== X-Gm-Message-State: APjAAAXXslSVqKEoUONRoxgXRn4dEblSpXPtI0cH5HWHXEc59miGobfe bcL08mnQwW5GP8loT7lknA0AFJcdfF8= X-Google-Smtp-Source: APXvYqy8NevAW0ih2W73Oo7VOYQrFSVsZft2J6aXkStA4FdY+hUmT3zQgyxDDdFLBVgzaziK+UkuCw== X-Received: by 2002:a0c:c10d:: with SMTP id f13mr12939389qvh.88.1571450977296; Fri, 18 Oct 2019 19:09:37 -0700 (PDT) Received: from casantos.remote.csb ([179.176.188.90]) by smtp.gmail.com with ESMTPSA id p3sm3238232qkm.52.2019.10.18.19.09.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2019 19:09:36 -0700 (PDT) From: unixmania@gmail.com To: buildroot@buildroot.org Date: Fri, 18 Oct 2019 23:09:28 -0300 Message-Id: <20191019020928.2931-1-unixmania@gmail.com> X-Mailer: git-send-email 2.18.1 Subject: [Buildroot] [PATCH] package/qemu: fix crash with uClibc-ng 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: Carlos Santos MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Carlos Santos On uClibc-ng sysconf(_SC_LEVEL1_{I,D}CACHE_LINESIZE) returns -1, which is a valid result, meaning that the limit is indeterminate. Add a patch that handles this situation using fallback values instead of crashing due to an assertion failure. Upstream status: https://lists.nongnu.org/archive/html/qemu-devel/2019-10/msg04115.html Signed-off-by: Carlos Santos --- ...fix-crash-when-compiling-with-uClibc.patch | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 package/qemu/3.1.1/0003-util-cacheinfo-fix-crash-when-compiling-with-uClibc.patch diff --git a/package/qemu/3.1.1/0003-util-cacheinfo-fix-crash-when-compiling-with-uClibc.patch b/package/qemu/3.1.1/0003-util-cacheinfo-fix-crash-when-compiling-with-uClibc.patch new file mode 100644 index 0000000000..d1b9e35709 --- /dev/null +++ b/package/qemu/3.1.1/0003-util-cacheinfo-fix-crash-when-compiling-with-uClibc.patch @@ -0,0 +1,43 @@ +From d82b8540ecaf3cb09a033e4971d8645d3343211e Mon Sep 17 00:00:00 2001 +From: Carlos Santos +Date: Wed, 16 Oct 2019 22:27:30 -0300 +Subject: [PATCH] util/cacheinfo: fix crash when compiling with uClibc + +uClibc defines _SC_LEVEL1_ICACHE_LINESIZE and _SC_LEVEL1_DCACHE_LINESIZE +but the corresponding sysconf calls returns -1, which is a valid result, +meaning that the limit is indeterminate. + +Handle this situation using the fallback values instead of crashing due +to an assertion failure. + +Signed-off-by: Carlos Santos +--- + util/cacheinfo.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/util/cacheinfo.c b/util/cacheinfo.c +index ea6f3e99bf..d94dc6adc8 100644 +--- a/util/cacheinfo.c ++++ b/util/cacheinfo.c +@@ -93,10 +93,16 @@ static void sys_cache_info(int *isize, int *dsize) + static void sys_cache_info(int *isize, int *dsize) + { + # ifdef _SC_LEVEL1_ICACHE_LINESIZE +- *isize = sysconf(_SC_LEVEL1_ICACHE_LINESIZE); ++ int tmp_isize = (int) sysconf(_SC_LEVEL1_ICACHE_LINESIZE); ++ if (tmp_isize > 0) { ++ *isize = tmp_isize; ++ } + # endif + # ifdef _SC_LEVEL1_DCACHE_LINESIZE +- *dsize = sysconf(_SC_LEVEL1_DCACHE_LINESIZE); ++ int tmp_dsize = (int) sysconf(_SC_LEVEL1_DCACHE_LINESIZE); ++ if (tmp_dsize > 0) { ++ *dsize = tmp_dsize; ++ } + # endif + } + #endif /* sys_cache_info */ +-- +2.18.1 +