From patchwork Thu Sep 5 11:24:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Milan_P=2E_Stani=C4=87?= X-Patchwork-Id: 1981272 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X00Lp0tHtz1yXY for ; Thu, 5 Sep 2024 23:19:14 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1smCNF-0002CL-28; Thu, 05 Sep 2024 09:18:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smAc2-0002r3-0M for qemu-devel@nongnu.org; Thu, 05 Sep 2024 07:25:21 -0400 Received: from 93-87-244-166.static.isp.telekom.rs ([93.87.244.166] helo=fx.arvanta.net) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smAc0-0003hk-7W for qemu-devel@nongnu.org; Thu, 05 Sep 2024 07:25:17 -0400 Received: from m1pro.arvanta.net (m1pro.arvanta.net [10.5.1.11]) by fx.arvanta.net (Postfix) with ESMTP id E7E294B32; Thu, 05 Sep 2024 13:25:10 +0200 (CEST) From: =?utf-8?q?Milan_P=2E_Stani=C4=87?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Milan_P_=2E_Stani=C4=87?= Subject: [PATCH] util/util/cpuinfo-riscv.c: fix riscv64 build on musl libc Date: Thu, 5 Sep 2024 13:24:37 +0200 Message-ID: <20240905112440.10438-1-mps@arvanta.net> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Received-SPF: pass client-ip=93.87.244.166; envelope-from=mps@arvanta.net; helo=fx.arvanta.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, TVD_RCVD_IP=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 05 Sep 2024 09:17:59 -0400 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org build fails on musl libc (alpine linux) with this error: ../util/cpuinfo-riscv.c: In function 'cpuinfo_init': ../util/cpuinfo-riscv.c:63:21: error: '__NR_riscv_hwprobe' undeclared (first use in this function); did you mean 'riscv_hwprobe'? 63 | if (syscall(__NR_riscv_hwprobe, &pair, 1, 0, NULL, 0) == 0 | ^~~~~~~~~~~~~~~~~~ | riscv_hwprobe ../util/cpuinfo-riscv.c:63:21: note: each undeclared identifier is reported only once for each function it appears in ninja: subcommand failed add '#include "asm/unistd.h"' to util/cpuinfo-riscv.c fixes build Signed-off-by: Milan P. Stanić --- util/cpuinfo-riscv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/cpuinfo-riscv.c b/util/cpuinfo-riscv.c index 497ce12680..f4779ed1fb 100644 --- a/util/cpuinfo-riscv.c +++ b/util/cpuinfo-riscv.c @@ -5,6 +5,7 @@ #include "qemu/osdep.h" #include "host/cpuinfo.h" +#include "asm/unistd.h" #ifdef CONFIG_ASM_HWPROBE_H #include