From nobody Mon Feb 9 12:09:35 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1611346416; cv=none; d=zohomail.com; s=zohoarc; b=RnJZn9ajtO0YdQlW2u/t6C9aklENJR2u0VzC6Sl7d+ZiqG5nDbCSvenx0HbKy2p5x+CcDq8fWkIeQievFuc8hbDIYsxoCYr1POh/grwkHnLvmewM4xfyNiq0wVVdRdlFe0Y+UomUoKoweXoIu4dmsRsF4O4DBHRW00xR6sPO5IA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611346416; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=O/ETCdKXydJNzx0rW+CikghF8e1mV5AV5I0qUIMj/2g=; b=nB628DFTXsh8Eipimjl0Uq67TKgvncF+iT8KZxNtPUrghlmuBGnryZUPdGGpr/vzo5Nj5WOXhnUDK3s9VKkazPUnZHQxi80m1PLEiacC+5blh7/vzoUrmq4C0vI+emSZQI/+4PA5iXWEK0wgNe7N6amuwDNbh0Krefvj9EqYiHM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1611346416323904.3653288892349; Fri, 22 Jan 2021 12:13:36 -0800 (PST) Received: from localhost ([::1]:47940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l32oJ-0006lG-8r for importer@patchew.org; Fri, 22 Jan 2021 15:13:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50504) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l32mC-0004tl-FM for qemu-devel@nongnu.org; Fri, 22 Jan 2021 15:11:24 -0500 Received: from mail-pl1-f171.google.com ([209.85.214.171]:41204) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l32mA-0004b3-My for qemu-devel@nongnu.org; Fri, 22 Jan 2021 15:11:24 -0500 Received: by mail-pl1-f171.google.com with SMTP id h15so1435813pli.8 for ; Fri, 22 Jan 2021 12:11:22 -0800 (PST) Received: from localhost.localdomain ([73.93.152.129]) by smtp.gmail.com with ESMTPSA id u12sm8741839pgi.91.2021.01.22.12.11.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2021 12:11:20 -0800 (PST) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=O/ETCdKXydJNzx0rW+CikghF8e1mV5AV5I0qUIMj/2g=; b=QgREHlsctRHMzxIZro4TmfsvePHZpMhGpDuzTf/HIEooe2Y+cV65w6sMwL+XBWw0QP U4dJhKVAnV40fERchJ4lbPDO1K60ayBEyZudarQCPnREkmR1Rr3AqfEX1NbJd3HjFcGS xPO8dDtD0ypDjrMoalmc3ImU5qEUHWuQZPTeDj8Bae2SM/4+nCcey4rFmDNioglbDUpz Ifkyvr0xtVC1epYjwb4SF5RL2ybIlTqwGI4rtMK+fZL+5pmaq1DqZarQMV851cVMSgBN atxWZkhGn+QxY7Ja0KjDey0iBd9JzZ8Ej+neJ6dCcQyy+YfsAgHrbNB3OyMMFPmhoQED jFaQ== X-Gm-Message-State: AOAM533J6fSIjggwnY9m4Z2/LvLFTOF9aLO+rtrPJaOL90kzNfcv6qtl 1CsU52RGFhPYw1cvt8hj5O+HdCnya0Q= X-Google-Smtp-Source: ABdhPJzwr9pxoM2ImHWMN1X1mChTynUMRGscZA1C0Dg0YpkIThwBFnIhCHfatCRD0D95Soa6G8zq7g== X-Received: by 2002:a17:90a:6bc3:: with SMTP id w61mr7353832pjj.214.1611346281281; Fri, 22 Jan 2021 12:11:21 -0800 (PST) From: Joelle van Dyne To: qemu-devel@nongnu.org Subject: [PATCH v7 05/11] osdep: build with non-working system() function Date: Fri, 22 Jan 2021 12:11:07 -0800 Message-Id: <20210122201113.63788-6-j@getutm.app> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210122201113.63788-1-j@getutm.app> References: <20210122201113.63788-1-j@getutm.app> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=209.85.214.171; envelope-from=osy86github@gmail.com; helo=mail-pl1-f171.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joelle van Dyne Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Build without error on hosts without a working system(). An assertion will trigger if system() is called. Signed-off-by: Joelle van Dyne --- configure | 19 +++++++++++++++++++ include/qemu/osdep.h | 11 +++++++++++ 2 files changed, 30 insertions(+) diff --git a/configure b/configure index 92da27846e..82ce28c660 100755 --- a/configure +++ b/configure @@ -5318,6 +5318,21 @@ else sys_disk_h=3Dno fi =20 +########################################## +# check for system() + +have_system_function=3Dno +cat > $TMPC << EOF +#include +int main(void) { + return system(""); +} +EOF +if compile_prog "" "" ; then + have_system_function=3Dyes +fi + + ########################################## # End of CC checks # After here, no more $cc or $ld runs @@ -6222,6 +6237,10 @@ if test "$secret_keyring" =3D "yes" ; then echo "CONFIG_SECRET_KEYRING=3Dy" >> $config_host_mak fi =20 +if test "$have_system_function" =3D "yes" ; then + echo "HAVE_SYSTEM_FUNCTION=3Dy" >> $config_host_mak +fi + echo "ROMS=3D$roms" >> $config_host_mak echo "MAKE=3D$make" >> $config_host_mak echo "PYTHON=3D$python" >> $config_host_mak diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index a434382c58..73346c4349 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -682,4 +682,15 @@ char *qemu_get_host_name(Error **errp); */ size_t qemu_get_host_physmem(void); =20 +/** + * Platforms which do not support system() gets an assertion failure. + */ +#ifndef HAVE_SYSTEM_FUNCTION +#define system platform_does_not_support_system +static inline int platform_does_not_support_system(const char *command) +{ + assert(0); +} +#endif /* !HAVE_SYSTEM_FUNCTION */ + #endif --=20 2.28.0