From patchwork Thu Oct 14 16:29:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541009 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=A5g4kO4d; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVZfx3Mm5z9sPB for ; Fri, 15 Oct 2021 03:31:53 +1100 (AEDT) Received: from localhost ([::1]:48914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3e3-0003N1-6G for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:31:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3c3-0003Kl-JA for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:47 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:44610) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3c0-0000VV-Kb for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:46 -0400 Received: by mail-ed1-x532.google.com with SMTP id w14so26389836edv.11 for ; Thu, 14 Oct 2021 09:29:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dgfNB2Fsj8uFWhaG5Y5cwfJz/jOZOBmzfZCOPa/OCdA=; b=A5g4kO4dBv5ip0CV/Gw4hneogSPbZmSyfuDWBai2SS4hzWYtqu5oTW9lIb1fRFI1Cz k3J9ky1KKahrra+IiCyDRD1ZMjzmTh3EWG/u1Dwl8xI1GzGTtzeqe8y4tZzEPxXust6B Y3aKzGZQUySnWl4fNTB04ehTgXgPIlMZFKLqrT/YltiiHejpnNHVZ3pfWAJkAIIdj3Qr JlNyXNNYx6pJuH+thaITuy02xnLT/MUvk+Jtotu2SzvdJ1HD/v025PUd8C7HCKEJDLca jG/xvIJ3XuuiED8/RmKzic8cygg7JNpPf8stkRR/xpkfbPC2D5LJMPr1Zm2GjjlVODq3 8Hrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=dgfNB2Fsj8uFWhaG5Y5cwfJz/jOZOBmzfZCOPa/OCdA=; b=ciYeTP7jTLpOd1/yj/1a0sldtuEL0kOW1kkFdW1mAWGepoU3zmAbYzO0PCf2Ml73EI Zst4wKhewUoMbqVjPBjL3eUbxyrOu9eQLjLuDW6g5GAFFM772+eAaL+UoBd32jocfXV1 c9V5L9+QftUsQwgD+iVKjZCnLNnFSbzxCyw7/uGN8aAuPK1C2nmSte0P1Sr08dACEUDI ElIGp/sePuNYGxmihXFwv5ZtcZsZtlInlhGARuuF0f2tBU24lwkOHHL0/9eMDAS+UsKu +a0RXm4LKbAXbTQaP2rPuPGLmOzoenWrG+x8LUNiKIRiUQbFNtsh77S3mytY/AoAovTC YuGA== X-Gm-Message-State: AOAM530AtNotb8mEnUN7WRlQRkbvNdwtqdEjJg6wJE9dIcQWzUgi0Ftc Y7cfZZceUBNyxdRIVXcch2Dmhwh5FWU= X-Google-Smtp-Source: ABdhPJwAC7xKpjW9uXMYw78sR+1f5aMuwGLlTacYdXsjKhUDeXeKq9iJRmKSfbYXAw2k6ACUh4EG0A== X-Received: by 2002:a17:906:a1da:: with SMTP id bx26mr4918085ejb.558.1634228981693; Thu, 14 Oct 2021 09:29:41 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.29.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:29:41 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 01/26] configure: remove --oss-lib Date: Thu, 14 Oct 2021 18:29:13 +0200 Message-Id: <20211014162938.430211-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x532.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , =?utf-8?q?Volker_R=C3=BCmelin?= , Gerd Hoffman Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" OSS is a kernel API, so the option should not be needed. The library is used on NetBSD, where OSS is emulated, so keep the variable. Cc: Gerd Hoffman Cc: Volker Rümelin Reviewed-by: Marc-André Lureau Reviewed-by: Thomas Huth Message-Id: <20211007130630.632028-2-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 3 --- 1 file changed, 3 deletions(-) diff --git a/configure b/configure index e2750810e2..c280c0e4b5 100755 --- a/configure +++ b/configure @@ -1007,8 +1007,6 @@ for opt do ;; --enable-gettext) gettext="enabled" ;; - --oss-lib=*) oss_lib="$optarg" - ;; --audio-drv-list=*) audio_drv_list="$optarg" ;; --block-drv-rw-whitelist=*|--block-drv-whitelist=*) block_drv_rw_whitelist=$(echo "$optarg" | sed -e 's/,/ /g') @@ -1817,7 +1815,6 @@ Advanced options (experts only): --disable-slirp disable SLIRP userspace network connectivity --enable-tcg-interpreter enable TCI (TCG with bytecode interpreter, experimental and slow) --enable-malloc-trim enable libc malloc_trim() for memory optimization - --oss-lib path to OSS library --cpu=CPU Build for host CPU [$cpu] --with-coroutine=BACKEND coroutine backend. Supported options: ucontext, sigaltstack, windows From patchwork Thu Oct 14 16:29:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541008 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=cvA2zxsR; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVZfw2jZVz9sNH for ; Fri, 15 Oct 2021 03:31:51 +1100 (AEDT) Received: from localhost ([::1]:48908 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3e1-0003Mg-EK for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:31:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3c2-0003Km-P2 for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:46 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]:37739) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3c0-0000Vx-VP for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:46 -0400 Received: by mail-ed1-x529.google.com with SMTP id y12so27677326eda.4 for ; Thu, 14 Oct 2021 09:29:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0R8344mGQ6SPe6NhWtj1MzuMX9sSmu9aHAIlZPLSqOo=; b=cvA2zxsRDVsXVzJfMH21IfrM7/oDFy1OR0P4BA+O4auhb/g1JIoXkZySaVUN7co0E5 PyvtjU7o52L3tjU3tpxw1iKVP35kf+nDgwWPfCD5yHvf6tydFuWcJ0P0IhU1pUBKduxX CBbdF0s6/ZmvKfgCVgYHamS83V6lBf8eEW25e6sXqxgb5XE3s83TD52jEKjaYRDklkhe f2xPnDTStwIZlS2z+hLq7i/0bpXDH+HniQWy4P/7dcX7ZqkphqEdc0bdManswYhu6PGf 1gU3e2cWFQFG/JLsvOMZTF3gaqyIb2Felu66sLdlr+XA8+DpA8iTxsPfcjDLixCCA0mE EMLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=0R8344mGQ6SPe6NhWtj1MzuMX9sSmu9aHAIlZPLSqOo=; b=MRZH0VRF+LwPLCzuKmYhcwuAyU9hpETQULd1YS2pCvaYmU2DCeXyf1ByrTfSjUEdMY q/xlNMd2bEl2KrJ8HM4O79dFspyO5N70ZcoGpZcIY+io6vBkEnGF7keLvPYIzg/aXkZQ kXKQ9V/LJmVnr9UKSW6KkyXdodYun6SffQv5Ky7NHZFguYW4XvHqsj5es/BElwyVI8Z/ mbz/pwG0N+yNf8mFYx/larwy/zlYpuex2OGApNJ8jeh/tOzL58Bonkq3eMNu75nuQvVp e5nFDhV0BAGpalW21S6xUVai4uYGbC3Y/hMSDYUBqPt000XD2QlfXOjqJGvqB3ShVucG C9mw== X-Gm-Message-State: AOAM531XsdHqfn7f9ifLt0ijJklNoLjeNbFeYSRA2XVQLJDarTZXDT1o DPhzNkdfjNjTDb6jhnIggBQff4WHMr8= X-Google-Smtp-Source: ABdhPJzUmMLTzrwgLEcp4jmqpzNTdCVOT5vTG9ypA5kfeln+jJs9aaL3C/UODO/FsWmLn1S+zggpMg== X-Received: by 2002:a17:906:ae53:: with SMTP id lf19mr4948822ejb.97.1634228982460; Thu, 14 Oct 2021 09:29:42 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.29.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:29:42 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 02/26] audio: remove CONFIG_AUDIO_WIN_INT Date: Thu, 14 Oct 2021 18:29:14 +0200 Message-Id: <20211014162938.430211-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x529.google.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Volker_R=C3=BCmelin?= , Gerd Hoffman Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Ever since winwaveaudio was removed in 2015, CONFIG_AUDIO_WIN_INT is only set if dsound is in use, so use CONFIG_AUDIO_DSOUND directly. Cc: Gerd Hoffman Cc: Volker Rümelin Reviewed-by: Marc-André Lureau Message-Id: <20211007130630.632028-3-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- audio/meson.build | 4 ++-- configure | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/audio/meson.build b/audio/meson.build index 7d53b0f920..9a95c58f18 100644 --- a/audio/meson.build +++ b/audio/meson.build @@ -8,8 +8,8 @@ softmmu_ss.add(files( )) softmmu_ss.add(when: [coreaudio, 'CONFIG_AUDIO_COREAUDIO'], if_true: files('coreaudio.c')) -softmmu_ss.add(when: [dsound, 'CONFIG_AUDIO_DSOUND'], if_true: files('dsoundaudio.c')) -softmmu_ss.add(when: ['CONFIG_AUDIO_WIN_INT'], if_true: files('audio_win_int.c')) +softmmu_ss.add(when: [dsound, 'CONFIG_AUDIO_DSOUND'], + if_true: files('dsoundaudio.c', 'audio_win_int.c')) audio_modules = {} foreach m : [ diff --git a/configure b/configure index c280c0e4b5..174fa84b60 100755 --- a/configure +++ b/configure @@ -245,7 +245,6 @@ block_drv_rw_whitelist="" block_drv_ro_whitelist="" block_drv_whitelist_tools="no" host_cc="cc" -audio_win_int="" libs_qga="" debug_info="yes" lto="false" @@ -3077,7 +3076,6 @@ for drv in $audio_drv_list; do dsound) dsound_libs="-lole32 -ldxguid" - audio_win_int="yes" ;; oss) @@ -4562,9 +4560,6 @@ if test "$libjack" = "yes" ; then echo "CONFIG_LIBJACK=y" >> $config_host_mak fi echo "JACK_LIBS=$jack_libs" >> $config_host_mak -if test "$audio_win_int" = "yes" ; then - echo "CONFIG_AUDIO_WIN_INT=y" >> $config_host_mak -fi echo "CONFIG_BDRV_RW_WHITELIST=$block_drv_rw_whitelist" >> $config_host_mak echo "CONFIG_BDRV_RO_WHITELIST=$block_drv_ro_whitelist" >> $config_host_mak if test "$block_drv_whitelist_tools" = "yes" ; then From patchwork Thu Oct 14 16:29:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541013 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=DhmiiShs; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVZkN3lYXz9s0r for ; Fri, 15 Oct 2021 03:34:52 +1100 (AEDT) Received: from localhost ([::1]:57386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3gw-000115-BB for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:34:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3c5-0003OI-Ic for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:49 -0400 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:33636) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3c2-0000XR-CE for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:49 -0400 Received: by mail-ed1-x52e.google.com with SMTP id y30so9621491edi.0 for ; Thu, 14 Oct 2021 09:29:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xaasexh4mPKMeYz8dpt8X2vCl2N3rYg+2fxPcY/JubU=; b=DhmiiShsyHmIUARfI26yxs+bnOgvQESs0NK3pxErRp6FoYjNDOrIG4hdKyTTVJbYKc egtqjEviKWbRce3GOktis80MBbF8NAZB7U5A2Mn8xYmA8HrhZ2sRl3B9YefXRtIMaE6n qQzod487J+vyDp8WtL7REkNbn4TSR3at/0LA1K+lGA8DngQ54FbabUUnKUonTDgdXu3f PK/llsF9mULw+Ly1UG+9a+VLOz5MExBTGPt3UrArtzsReYV7mVIDW816HqtMANFXChlE 9gbgu/Aq1sVBtcWBVASceKa9nzHJ438bL14hPjLxGfADaeFAsxAfsxraXQAC14Yp75Z7 kbQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=xaasexh4mPKMeYz8dpt8X2vCl2N3rYg+2fxPcY/JubU=; b=sSp4A87VuHh6Hf91V3QQdZc/5RHRtDWwLizhmWghX4J+kQt6rV+AYcRRBWeiA6VZ/m wf2v2wv3r/qQK6dnTusRgtQq4uZLXE7d5Ct3ULYQU7mtp6o6Gs5eDIK+DGZiSsRnAj/T VN7v4hDOaS+n877MIrNMyf3nSLAEbqhs799LgEs9KRmHWciMrOkTKn4GIRzxAvm98iiq pxzUSspquuhUTebmUhqgRZ5pWob1B2t48FdmSzOpdlQlRDJEhkcyXpGYyPtpYiu97KsR li9ji0s32HU0uRQQk9B6da5Adf3Be0b7iAk0/Ry4sWbn60U9UJMOgja9V01oQ1wRbF5B EeUA== X-Gm-Message-State: AOAM533l3UVG1p7wu8IwSc0JHCbF2iD4JFwz1B5dfykxz9R8dYvkPVa0 cjxWNMVkvEJOs6GWPXe9WTgfhQH2Vcg= X-Google-Smtp-Source: ABdhPJwJ2yfxsS7N60V5Mwzrx+6NwUf6W6w86H1WJLjrNK/xpIGw8dl/PzfRc/D1I3kruI+Met2tUw== X-Received: by 2002:a17:907:3e03:: with SMTP id hp3mr5020280ejc.183.1634228983730; Thu, 14 Oct 2021 09:29:43 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.29.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:29:43 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 03/26] configure, meson: move audio driver detection to Meson Date: Thu, 14 Oct 2021 18:29:15 +0200 Message-Id: <20211014162938.430211-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52e.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Volker_R=C3=BCmelin?= , Gerd Hoffman Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This brings a change that makes audio drivers more similar to all other modules. All drivers are built by default, while --audio-drv-list only governs the default choice of the audio driver. Meson options are added to disable the drivers, and the next patches will fix the help messages and command line options, and especially make the non-default drivers available via -audiodev. Cc: Gerd Hoffman Cc: Volker Rümelin Reviewed-by: Marc-André Lureau Message-Id: <20211007130630.632028-4-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- audio/meson.build | 23 +++--- configure | 186 +--------------------------------------------- meson.build | 137 +++++++++++++++++++++++++++++----- meson_options.txt | 18 ++++- 4 files changed, 148 insertions(+), 216 deletions(-) diff --git a/audio/meson.build b/audio/meson.build index 9a95c58f18..462533bb8c 100644 --- a/audio/meson.build +++ b/audio/meson.build @@ -7,23 +7,22 @@ softmmu_ss.add(files( 'wavcapture.c', )) -softmmu_ss.add(when: [coreaudio, 'CONFIG_AUDIO_COREAUDIO'], if_true: files('coreaudio.c')) -softmmu_ss.add(when: [dsound, 'CONFIG_AUDIO_DSOUND'], - if_true: files('dsoundaudio.c', 'audio_win_int.c')) +softmmu_ss.add(when: coreaudio, if_true: files('coreaudio.c')) +softmmu_ss.add(when: dsound, if_true: files('dsoundaudio.c', 'audio_win_int.c')) audio_modules = {} foreach m : [ - ['CONFIG_AUDIO_ALSA', 'alsa', alsa, 'alsaaudio.c'], - ['CONFIG_AUDIO_OSS', 'oss', oss, 'ossaudio.c'], - ['CONFIG_AUDIO_PA', 'pa', pulse, 'paaudio.c'], - ['CONFIG_AUDIO_SDL', 'sdl', sdl, 'sdlaudio.c'], - ['CONFIG_AUDIO_JACK', 'jack', jack, 'jackaudio.c'], - ['CONFIG_SPICE', 'spice', spice, 'spiceaudio.c'] + ['alsa', alsa, files('alsaaudio.c')], + ['oss', oss, files('ossaudio.c')], + ['pa', pulse, files('paaudio.c')], + ['sdl', sdl, files('sdlaudio.c')], + ['jack', jack, files('jackaudio.c')], + ['spice', spice, files('spiceaudio.c')] ] - if config_host.has_key(m[0]) + if m[1].found() module_ss = ss.source_set() - module_ss.add(when: m[2], if_true: files(m[3])) - audio_modules += {m[1] : module_ss} + module_ss.add(m[1], m[2]) + audio_modules += {m[0] : module_ss} endif endforeach diff --git a/configure b/configure index 174fa84b60..b9a457a02f 100755 --- a/configure +++ b/configure @@ -240,7 +240,7 @@ interp_prefix="/usr/gnemul/qemu-%M" static="no" cross_compile="no" cross_prefix="" -audio_drv_list="" +audio_drv_list="default" block_drv_rw_whitelist="" block_drv_ro_whitelist="" block_drv_whitelist_tools="no" @@ -299,7 +299,6 @@ fdt="auto" netmap="no" sdl="auto" sdl_image="auto" -coreaudio="auto" virtiofsd="auto" virtfs="auto" libudev="auto" @@ -356,7 +355,6 @@ module_upgrades="no" prefix="/usr/local" qemu_suffix="qemu" slirp="auto" -oss_lib="" bsd="no" linux="no" solaris="no" @@ -703,54 +701,35 @@ fi case $targetos in MINGW32*) mingw32="yes" - audio_possible_drivers="dsound sdl" - if check_include dsound.h; then - audio_drv_list="dsound" - else - audio_drv_list="" - fi supported_os="yes" plugins="no" pie="no" ;; GNU/kFreeBSD) bsd="yes" - audio_drv_list="oss try-sdl" - audio_possible_drivers="oss sdl pa" ;; FreeBSD) bsd="yes" bsd_user="yes" make="${MAKE-gmake}" - audio_drv_list="oss try-sdl" - audio_possible_drivers="oss sdl pa" # needed for kinfo_getvmmap(3) in libutil.h netmap="" # enable netmap autodetect ;; DragonFly) bsd="yes" make="${MAKE-gmake}" - audio_drv_list="oss try-sdl" - audio_possible_drivers="oss sdl pa" ;; NetBSD) bsd="yes" make="${MAKE-gmake}" - audio_drv_list="oss try-sdl" - audio_possible_drivers="oss sdl" - oss_lib="-lossaudio" ;; OpenBSD) bsd="yes" make="${MAKE-gmake}" - audio_drv_list="try-sdl" - audio_possible_drivers="sdl" ;; Darwin) bsd="yes" darwin="yes" - audio_drv_list="try-coreaudio try-sdl" - audio_possible_drivers="coreaudio sdl" # Disable attempts to use ObjectiveC features in os/object.h since they # won't work when we're compiling with gcc as a C compiler. QEMU_CFLAGS="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS" @@ -759,10 +738,6 @@ SunOS) solaris="yes" make="${MAKE-gmake}" smbd="${SMBD-/usr/sfw/sbin/smbd}" - if test -f /usr/include/sys/soundcard.h ; then - audio_drv_list="oss try-sdl" - fi - audio_possible_drivers="oss sdl" # needed for CMSG_ macros in sys/socket.h QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS" # needed for TIOCWIN* defines in termios.h @@ -774,8 +749,6 @@ Haiku) QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS -D_BSD_SOURCE -fPIC $QEMU_CFLAGS" ;; Linux) - audio_drv_list="try-pa oss" - audio_possible_drivers="oss alsa sdl pa" linux="yes" linux_user="yes" vhost_user=${default_feature:-yes} @@ -1796,8 +1769,7 @@ Advanced options (experts only): --disable-strip disable stripping binaries --disable-werror disable compilation abort on warning --disable-stack-protector disable compiler-provided stack protection - --audio-drv-list=LIST set audio drivers list: - Available drivers: $audio_possible_drivers + --audio-drv-list=LIST set audio drivers list --block-drv-whitelist=L Same as --block-drv-rw-whitelist=L --block-drv-rw-whitelist=L set block driver read-write whitelist @@ -2400,12 +2372,6 @@ if test -z "$want_tools"; then fi fi -########################################## -# Disable features only meaningful for system-mode emulation -if test "$softmmu" = "no"; then - audio_drv_list="" -fi - ########################################## # L2TPV3 probe @@ -2984,130 +2950,6 @@ EOF fi fi -########################################## -# detect CoreAudio -if test "$coreaudio" != "no" ; then - coreaudio_libs="-framework CoreAudio" - cat > $TMPC << EOF -#include -int main(void) -{ - return (int)AudioGetCurrentHostTime(); -} -EOF - if compile_prog "" "$coreaudio_libs" ; then - coreaudio=yes - else - coreaudio=no - fi -fi - -########################################## -# Sound support libraries probe - -audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/,/ /g') -for drv in $audio_drv_list; do - case $drv in - alsa | try-alsa) - if $pkg_config alsa --exists; then - alsa_libs=$($pkg_config alsa --libs) - alsa_cflags=$($pkg_config alsa --cflags) - alsa=yes - if test "$drv" = "try-alsa"; then - audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-alsa/alsa/') - fi - else - if test "$drv" = "try-alsa"; then - audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-alsa//') - else - error_exit "$drv check failed" \ - "Make sure to have the $drv libs and headers installed." - fi - fi - ;; - - pa | try-pa) - if $pkg_config libpulse --exists; then - libpulse=yes - pulse_libs=$($pkg_config libpulse --libs) - pulse_cflags=$($pkg_config libpulse --cflags) - if test "$drv" = "try-pa"; then - audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-pa/pa/') - fi - else - if test "$drv" = "try-pa"; then - audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-pa//') - else - error_exit "$drv check failed" \ - "Make sure to have the $drv libs and headers installed." - fi - fi - ;; - - sdl) - if test "$sdl" = "no"; then - error_exit "sdl not found or disabled, can not use sdl audio driver" - fi - ;; - - try-sdl) - if test "$sdl" = "no"; then - audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-sdl//') - else - audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-sdl/sdl/') - fi - ;; - - coreaudio | try-coreaudio) - if test "$coreaudio" = "no"; then - if test "$drv" = "try-coreaudio"; then - audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-coreaudio//') - else - error_exit "$drv check failed" \ - "Make sure to have the $drv is available." - fi - else - coreaudio_libs="-framework CoreAudio" - if test "$drv" = "try-coreaudio"; then - audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-coreaudio/coreaudio/') - fi - fi - ;; - - dsound) - dsound_libs="-lole32 -ldxguid" - ;; - - oss) - oss_libs="$oss_lib" - ;; - - jack | try-jack) - if $pkg_config jack --exists; then - libjack=yes - jack_libs=$($pkg_config jack --libs) - if test "$drv" = "try-jack"; then - audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-jack/jack/') - fi - else - if test "$drv" = "try-jack"; then - audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-jack//') - else - error_exit "$drv check failed" \ - "Make sure to have the $drv libs and headers installed." - fi - fi - ;; - - *) - echo "$audio_possible_drivers" | grep -q "\<$drv\>" || { - error_exit "Unknown driver '$drv' selected" \ - "Possible drivers are: $audio_possible_drivers" - } - ;; - esac -done - ########################################## # plugin linker support probe @@ -4538,28 +4380,6 @@ fi if test "$gprof" = "yes" ; then echo "CONFIG_GPROF=y" >> $config_host_mak fi -echo "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak -for drv in $audio_drv_list; do - def=CONFIG_AUDIO_$(echo $drv | LC_ALL=C tr '[a-z]' '[A-Z]') - echo "$def=y" >> $config_host_mak -done -if test "$alsa" = "yes" ; then - echo "CONFIG_ALSA=y" >> $config_host_mak -fi -echo "ALSA_LIBS=$alsa_libs" >> $config_host_mak -echo "ALSA_CFLAGS=$alsa_cflags" >> $config_host_mak -if test "$libpulse" = "yes" ; then - echo "CONFIG_LIBPULSE=y" >> $config_host_mak -fi -echo "PULSE_LIBS=$pulse_libs" >> $config_host_mak -echo "PULSE_CFLAGS=$pulse_cflags" >> $config_host_mak -echo "COREAUDIO_LIBS=$coreaudio_libs" >> $config_host_mak -echo "DSOUND_LIBS=$dsound_libs" >> $config_host_mak -echo "OSS_LIBS=$oss_libs" >> $config_host_mak -if test "$libjack" = "yes" ; then - echo "CONFIG_LIBJACK=y" >> $config_host_mak -fi -echo "JACK_LIBS=$jack_libs" >> $config_host_mak echo "CONFIG_BDRV_RW_WHITELIST=$block_drv_rw_whitelist" >> $config_host_mak echo "CONFIG_BDRV_RO_WHITELIST=$block_drv_ro_whitelist" >> $config_host_mak if test "$block_drv_whitelist_tools" = "yes" ; then @@ -5197,7 +5017,7 @@ if test "$skip_meson" = no; then -Dvhost_user_blk_server=$vhost_user_blk_server -Dmultiprocess=$multiprocess \ -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek -Dguest_agent_msi=$guest_agent_msi -Dbpf=$bpf\ $(if test "$default_feature" = no; then echo "-Dauto_features=disabled"; fi) \ - -Dtcg_interpreter=$tcg_interpreter \ + -Daudio_drv_list=$audio_drv_list -Dtcg_interpreter=$tcg_interpreter \ $cross_arg \ "$PWD" "$source_path" diff --git a/meson.build b/meson.build index c1314baace..90d1b7ab61 100644 --- a/meson.build +++ b/meson.build @@ -428,20 +428,23 @@ vde = not_found if config_host.has_key('CONFIG_VDE') vde = declare_dependency(link_args: config_host['VDE_LIBS'].split()) endif + pulse = not_found -if 'CONFIG_LIBPULSE' in config_host - pulse = declare_dependency(compile_args: config_host['PULSE_CFLAGS'].split(), - link_args: config_host['PULSE_LIBS'].split()) +if not get_option('pa').auto() or (targetos == 'linux' and have_system) + pulse = dependency('libpulse', required: get_option('pa'), + method: 'pkg-config', kwargs: static_kwargs) endif alsa = not_found -if 'CONFIG_ALSA' in config_host - alsa = declare_dependency(compile_args: config_host['ALSA_CFLAGS'].split(), - link_args: config_host['ALSA_LIBS'].split()) +if not get_option('alsa').auto() or (targetos == 'linux' and have_system) + alsa = dependency('alsa', required: get_option('alsa'), + method: 'pkg-config', kwargs: static_kwargs) endif jack = not_found -if 'CONFIG_LIBJACK' in config_host - jack = declare_dependency(link_args: config_host['JACK_LIBS'].split()) +if not get_option('jack').auto() or have_system + jack = dependency('jack', required: get_option('jack'), + method: 'pkg-config', kwargs: static_kwargs) endif + spice = not_found spice_headers = not_found spice_protocol = not_found @@ -801,16 +804,59 @@ if liblzfse.found() and not cc.links(''' endif oss = not_found -if 'CONFIG_AUDIO_OSS' in config_host - oss = declare_dependency(link_args: config_host['OSS_LIBS'].split()) +if not get_option('oss').auto() or have_system + if not cc.has_header('sys/soundcard.h') + # not found + elif targetos == 'netbsd' + oss = cc.find_library('ossaudio', required: get_option('oss'), + kwargs: static_kwargs) + else + oss = declare_dependency() + endif + + if not oss.found() + if get_option('oss').enabled() + error('OSS not found') + else + warning('OSS not found, disabling') + endif + endif endif dsound = not_found -if 'CONFIG_AUDIO_DSOUND' in config_host - dsound = declare_dependency(link_args: config_host['DSOUND_LIBS'].split()) +if not get_option('dsound').auto() or (targetos == 'windows' and have_system) + if cc.has_header('dsound.h') + dsound = declare_dependency(link_args: ['-lole32', '-ldxguid']) + endif + + if not dsound.found() + if get_option('dsound').enabled() + error('DirectSound not found') + else + warning('DirectSound not found, disabling') + endif + endif endif + coreaudio = not_found -if 'CONFIG_AUDIO_COREAUDIO' in config_host - coreaudio = declare_dependency(link_args: config_host['COREAUDIO_LIBS'].split()) +if not get_option('coreaudio').auto() or (targetos == 'darwin' and have_system) + coreaudio = dependency('appleframeworks', modules: 'CoreAudio', + required: get_option('coreaudio')) + if coreaudio.found() and not cc.links(''' + #include + int main(void) + { + return (int)AudioGetCurrentHostTime(); + }''') + coreaudio = not_found + endif + + if not coreaudio.found() + if get_option('coreaudio').enabled() + error('CoreAudio not found') + else + warning('CoreAudio not found, disabling') + endif + endif endif opengl = not_found @@ -1156,6 +1202,49 @@ if libbpf.found() and not cc.links(''' endif endif +################# +# config-host.h # +################# + +audio_drivers_selected = [] +if have_system + audio_drivers_available = { + 'alsa': alsa.found(), + 'coreaudio': coreaudio.found(), + 'dsound': dsound.found(), + 'jack': jack.found(), + 'oss': oss.found(), + 'pa': pulse.found(), + 'sdl': sdl.found(), + } + + # Default to native drivers first, OSS second, SDL third + audio_drivers_priority = \ + [ 'pa', 'coreaudio', 'dsound', 'oss' ] + \ + (targetos == 'linux' ? [] : [ 'sdl' ]) + audio_drivers_default = [] + foreach k: audio_drivers_priority + if audio_drivers_available[k] + audio_drivers_default += k + endif + endforeach + + foreach k: get_option('audio_drv_list') + if k == 'default' + audio_drivers_selected += audio_drivers_default + elif not audio_drivers_available[k] + error('Audio driver "@0@" not available.'.format(k)) + else + audio_drivers_selected += k + endif + endforeach +endif +foreach k: audio_drivers_selected + config_host_data.set('CONFIG_AUDIO_' + k.to_upper(), true) +endforeach +config_host_data.set('CONFIG_AUDIO_DRIVERS', + '"' + '", "'.join(audio_drivers_selected) + '", ') + if get_option('cfi') cfi_flags=[] # Check for dependency on LTO @@ -1199,10 +1288,6 @@ endif have_host_block_device = (targetos != 'darwin' or cc.has_header('IOKit/storage/IOMedia.h')) -################# -# config-host.h # -################# - have_virtfs = (targetos == 'linux' and have_system and libattr.found() and @@ -1446,7 +1531,7 @@ config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles(''' ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target -arrays = ['CONFIG_AUDIO_DRIVERS', 'CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST'] +arrays = ['CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST'] strings = ['HOST_DSOSUF', 'CONFIG_IASL'] foreach k, v: config_host if ignored.contains(k) @@ -2880,7 +2965,7 @@ if config_host.has_key('CONFIG_MODULES') endif summary_info += {'fuzzing support': config_host.has_key('CONFIG_FUZZ')} if have_system - summary_info += {'Audio drivers': config_host['CONFIG_AUDIO_DRIVERS']} + summary_info += {'Audio drivers': ' '.join(audio_drivers_selected)} endif summary_info += {'Trace backends': config_host['TRACE_BACKENDS']} if config_host['TRACE_BACKENDS'].split().contains('simple') @@ -3068,6 +3153,18 @@ if vnc.found() summary_info += {'VNC JPEG support': jpeg} summary_info += {'VNC PNG support': png} endif +if targetos not in ['darwin', 'haiku', 'windows'] + summary_info += {'OSS support': oss} +elif targetos == 'darwin' + summary_info += {'CoreAudio support': coreaudio} +elif targetos == 'windows' + summary_info += {'DirectSound support': dsound} +endif +if targetos == 'linux' + summary_info += {'ALSA support': alsa} + summary_info += {'PulseAudio support': pulse} +endif +summary_info += {'JACK support': jack} summary_info += {'brlapi support': brlapi} summary_info += {'vde support': config_host.has_key('CONFIG_VDE')} summary_info += {'netmap support': config_host.has_key('CONFIG_NETMAP')} diff --git a/meson_options.txt b/meson_options.txt index 2c89e79e8b..052c4f088e 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -6,9 +6,12 @@ option('qemu_firmwarepath', type : 'string', value : '', description: 'search PATH for firmware files') option('sphinx_build', type : 'string', value : '', description: 'Use specified sphinx-build [$sphinx_build] for building document (default to be empty)') - option('default_devices', type : 'boolean', value : true, description: 'Include a default selection of devices in emulators') +option('audio_drv_list', type: 'array', value: ['default'], + choices: ['alsa', 'coreaudio', 'default', 'dsound', 'jack', 'oss', 'pa', 'sdl'], + description: 'Set audio driver list') + option('docs', type : 'feature', value : 'auto', description: 'Documentations build support') option('gettext', type : 'feature', value : 'auto', @@ -139,6 +142,19 @@ option('fuse', type: 'feature', value: 'auto', option('fuse_lseek', type : 'feature', value : 'auto', description: 'SEEK_HOLE/SEEK_DATA support for FUSE exports') +option('alsa', type: 'feature', value: 'auto', + description: 'ALSA sound support') +option('coreaudio', type: 'feature', value: 'auto', + description: 'CoreAudio sound support') +option('dsound', type: 'feature', value: 'auto', + description: 'DirectSound sound support') +option('jack', type: 'feature', value: 'auto', + description: 'JACK sound support') +option('oss', type: 'feature', value: 'auto', + description: 'OSS sound support') +option('pa', type: 'feature', value: 'auto', + description: 'PulseAudio sound support') + option('vhost_user_blk_server', type: 'feature', value: 'auto', description: 'build vhost-user-blk server') option('virtfs', type: 'feature', value: 'auto', From patchwork Thu Oct 14 16:29:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541011 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=BKk2BTBh; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVZkL5SMHz9s0r for ; Fri, 15 Oct 2021 03:34:50 +1100 (AEDT) Received: from localhost ([::1]:57266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3gt-0000wp-Qk for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:34:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3c3-0003LB-JI for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:47 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:34378) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3c1-0000Wy-QY for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:47 -0400 Received: by mail-ed1-x532.google.com with SMTP id g10so26618898edj.1 for ; Thu, 14 Oct 2021 09:29:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=i00g5dv3ub0z8f0ZPTko4cFX4lVcc7Tu0/Tq5pcaoas=; b=BKk2BTBh1Vyq2s58zOt7G0QpuwILSEt3djti0DFycPkLue0HOVNm2rVm6vuEKXBTsp /WQzHed8wXd195dO3XA6ITMKO2bjnYz8Q7Y7fT3hATBnEGgEQ06nbWuYsT+1ztYXwm8+ xFBXGOWvaUQKtW/eXUlxAl/qkZB8+rT5udf2+f3DTNm2R4/k49nC9jxEPc7WqfSL8+7I yuMc/ruq9Kfi8owuOPvE8zKq/tuh4w39w6L5H61xq1OF67XsvpWcriWzVPUYhvXFMRZ6 evV6f3hiy9PfOf5XuFgtGXf6oxXzi+DgjwZarYKuEGn7mWDm4ixP55bB4qm3ZRnHGoDQ OIyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=i00g5dv3ub0z8f0ZPTko4cFX4lVcc7Tu0/Tq5pcaoas=; b=eC2pRCf9XbtE3nQ1hF5LukzFdP/HZZ3Cagr5As8NMFbXvhNL8nlrdkMPN1PGDjBpqE i2cg0ptPIj1k+ri3jWT3hUlolrOFAV4VD+/bnzQej30ySXcZ2duawfpHdXLyvczx8sB9 WejfEkqiIrT6YBTCr6l1MRuLkLqXtDKxZulL+qsWYAIUWLvZs2jyoFc3XxC/1zaAYI+D TVc2NdUZnEP/6qXLAis7nV4RA9UYN7m5hfIE9oyO4ppJ2MsU32oXbFnJc7VyIi0NWaB3 YE9FFvTOnglXAbVgZqbdpiCWSGqIYYKytJVIZgOs3aFUrTpek0zfVOEvsnhY3KW97agT mKtQ== X-Gm-Message-State: AOAM53021YOG8DMOuIGfQnoanncN8ALyMUKu1Q7j3RBtntlA+yXHaKkC a/OtPk0DZq7WYb1daY9GoMunTNRYrl8= X-Google-Smtp-Source: ABdhPJzSG0xNomy0eSOpimh6O07k1emgUq8tZI/HFblHX+zaI+mZZ6qq9hCE+L8EF1RjzWjVxEf8lw== X-Received: by 2002:a50:e14c:: with SMTP id i12mr9811124edl.125.1634228984496; Thu, 14 Oct 2021 09:29:44 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.29.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:29:44 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 04/26] meson: define symbols for all available audio drivers Date: Thu, 14 Oct 2021 18:29:16 +0200 Message-Id: <20211014162938.430211-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x532.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: =?utf-8?q?Volker_R=C3=BCmelin?= , Gerd Hoffman Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" All drivers are now built by default if the corresponding libraries are available, similar to how all other modules behave; --audio-drv-list only governs the default choice of the audio driver. Adjust the CONFIG_AUDIO_* preprocessor symbols so that they are based on library availability rather than --audio-drv-list, so that the tests and -audiodev help follow the new logic. Cc: Gerd Hoffman Cc: Volker Rümelin Message-Id: <20211007130630.632028-5-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 90d1b7ab61..0b9ebf9bfb 100644 --- a/meson.build +++ b/meson.build @@ -1217,6 +1217,9 @@ if have_system 'pa': pulse.found(), 'sdl': sdl.found(), } + foreach k, v: audio_drivers_available + config_host_data.set('CONFIG_AUDIO_' + k.to_upper(), v) + endforeach # Default to native drivers first, OSS second, SDL third audio_drivers_priority = \ @@ -1239,9 +1242,6 @@ if have_system endif endforeach endif -foreach k: audio_drivers_selected - config_host_data.set('CONFIG_AUDIO_' + k.to_upper(), true) -endforeach config_host_data.set('CONFIG_AUDIO_DRIVERS', '"' + '", "'.join(audio_drivers_selected) + '", ') From patchwork Thu Oct 14 16:29:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541012 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=FwuDnnvd; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVZkL6p25z9sNH for ; Fri, 15 Oct 2021 03:34:50 +1100 (AEDT) Received: from localhost ([::1]:57312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3gu-0000ya-9U for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:34:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3c4-0003M9-Mb for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:48 -0400 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:41755) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3c3-0000YF-3x for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:48 -0400 Received: by mail-ed1-x52e.google.com with SMTP id a25so26569129edx.8 for ; Thu, 14 Oct 2021 09:29:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mSnZL1jG9+y6XU4K3OU5eki1vBIFFfko4zZP+7xfuR8=; b=FwuDnnvdUzciizQdY3bTTvKrCyJACHtvivc4zS8MM+OntI1MtG8Dg2tdqxo2bFp/Bz GcyrQhcv+1/Rsy5YJCGHt4VMG6fxZsstj9lH+ZahasNU+Hp5EmIOy1PQKLcpzGnc2sHc HCU8gxQp0GCxIiYrSywkdY2FvsFxYzpP/BROmItD48F6g2rcLEoBQgfbRED7huLfx7+p 1zfW+eTUEmzgOK1NxhWUCxZxq5v+bnTtdNBMdbUZ70gIdmCXk4lwSTCDAhssRRuXQRgL yDBfyBnM1i9/3QWn5Szf0JO9CmVLGSaUvFqqLtu4J1aiKDWvrJhD0WFOwOGM7AZZI4wo ltUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=mSnZL1jG9+y6XU4K3OU5eki1vBIFFfko4zZP+7xfuR8=; b=V9Jaeo08YZSSgnFoRjv9VovY8iaW8V+Oc1GjzT+5+YDQ/CXbg/qFgQOzB1gg6Nd7Rr oan9XpXk6hi3Qx4Zg3TN+bCTDOCCPAq4z4yL5PFtumA0d3AKSKhGubTQyvn2jvb1nNj4 9/jJ8BCqHihVg/IDIWEf+DmDjkSFB435qLC1RkbpwRfQnYDQvGNsC1086uOa3NmPZSWQ XCoXhCyWgXaym1zSe2u5HLo6DNpwAYpypYxkYRkB5mNTJIi1bwNYjfZggsSXStbbbJzN FQThED8bCjnl6uoCfJR4Ly/U1lJJ0ryiDg6GGtziLvl0C7Ny/rSc1g4cqAzFykUPOyUi gdEw== X-Gm-Message-State: AOAM531uwCoMiAezzp0tMaXeK5WjwlvUY1TdKKBiwup5FR+xevTFVm9H /OqCoyvJWGvr2dRT4J1uFmc+5iP/8sI= X-Google-Smtp-Source: ABdhPJwmrm6yNxWUcf+BeWMOIhF0ms98FLuNstkN3xJJBH1iR3VXXQk0iT2E8PdeO+Ahm8x4TSICVA== X-Received: by 2002:a17:906:270e:: with SMTP id z14mr4991482ejc.414.1634228985791; Thu, 14 Oct 2021 09:29:45 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.29.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:29:45 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 05/26] configure: add command line options for audio drivers Date: Thu, 14 Oct 2021 18:29:17 +0200 Message-Id: <20211014162938.430211-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52e.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Volker_R=C3=BCmelin?= , Gerd Hoffman Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Handle the choice of audio drivers the same as all other dependencies. Cc: Gerd Hoffman Cc: Volker Rümelin Reviewed-by: Marc-André Lureau Message-Id: <20211007130630.632028-6-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/configure b/configure index b9a457a02f..2dd9460d20 100755 --- a/configure +++ b/configure @@ -310,6 +310,12 @@ vnc_sasl="auto" vnc_jpeg="auto" vnc_png="auto" xkbcommon="auto" +alsa="auto" +coreaudio="auto" +dsound="auto" +jack="auto" +oss="auto" +pa="auto" xen=${default_feature:+disabled} xen_ctrl_version="$default_feature" xen_pci_passthrough="auto" @@ -1051,6 +1057,30 @@ for opt do ;; --enable-xen-pci-passthrough) xen_pci_passthrough="enabled" ;; + --disable-alsa) alsa="disabled" + ;; + --enable-alsa) alsa="enabled" + ;; + --disable-coreaudio) coreaudio="disabled" + ;; + --enable-coreaudio) coreaudio="enabled" + ;; + --disable-dsound) dsound="disabled" + ;; + --enable-dsound) dsound="enabled" + ;; + --disable-jack) jack="disabled" + ;; + --enable-jack) jack="enabled" + ;; + --disable-oss) oss="disabled" + ;; + --enable-oss) oss="enabled" + ;; + --disable-pa) pa="disabled" + ;; + --enable-pa) pa="enabled" + ;; --disable-brlapi) brlapi="disabled" ;; --enable-brlapi) brlapi="enabled" @@ -1851,6 +1881,12 @@ disabled with --disable-FEATURE, default is enabled if available mpath Multipath persistent reservation passthrough xen xen backend driver support xen-pci-passthrough PCI passthrough support for Xen + alsa ALSA sound support + coreaudio CoreAudio sound support + dsound DirectSound sound support + jack JACK sound support + oss OSS sound support + pa PulseAudio sound support brlapi BrlAPI (Braile) curl curl connectivity membarrier membarrier system call (for Linux 4.14+ or Windows) @@ -5017,7 +5053,8 @@ if test "$skip_meson" = no; then -Dvhost_user_blk_server=$vhost_user_blk_server -Dmultiprocess=$multiprocess \ -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek -Dguest_agent_msi=$guest_agent_msi -Dbpf=$bpf\ $(if test "$default_feature" = no; then echo "-Dauto_features=disabled"; fi) \ - -Daudio_drv_list=$audio_drv_list -Dtcg_interpreter=$tcg_interpreter \ + -Dalsa=$alsa -Dcoreaudio=$coreaudio -Ddsound=$dsound -Djack=$jack -Doss=$oss \ + -Dpa=$pa -Daudio_drv_list=$audio_drv_list -Dtcg_interpreter=$tcg_interpreter \ $cross_arg \ "$PWD" "$source_path" From patchwork Thu Oct 14 16:29:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541015 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=XGlD6//2; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVZpn57w9z9s0r for ; Fri, 15 Oct 2021 03:38:40 +1100 (AEDT) Received: from localhost ([::1]:37388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3kZ-0006oF-W5 for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:38:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34686) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3c5-0003OT-Ke for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:49 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:46823) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3c3-0000Z5-Vk for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:49 -0400 Received: by mail-ed1-x52f.google.com with SMTP id z20so26711290edc.13 for ; Thu, 14 Oct 2021 09:29:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4r8ruIMiMACId6+oi2EXdJJ3oxJ3e4Hahu0xkzRBXf8=; b=XGlD6//24MSwYI7Wy/kGzyVYELQq+UjXljSTaHpvOPsleS/M+XHu2T/wriVDFU6B9S F1VLPoV/bWf7hmM43iekFuXBltyPjB81EVsjzuXcgpTUoKctgd5Klh4BlJY8P9pPKnv1 WZKBl9PZdfxB1RxGUSdXg3JlkVhOd/F0uENiqg89FMmnbeRB1v+uVhWQm+nDVdeKzEQr XN5ae63CJGPJA13lwP9s+f0NoSlMDajuPt1RTkGirdaTsROP0L1e9HvRAiTFaGrcU7T1 vqzedBqoWV2yvba+WsU9Cdj99VGppQHYhVtjHPeG9E/k/dsq18OyfPgqdibMJrCkRcK0 7GsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=4r8ruIMiMACId6+oi2EXdJJ3oxJ3e4Hahu0xkzRBXf8=; b=p+YVI5SqeLOZYzqh6boX9zzxUDqtXcRMIAtXKTRWYrIR6MNPLEzhZ5aFnGovkvXfRE trbqNp/T2ZgGB/WMEOFHBlWNa9DEkxd+Hd+6cQwWip+OSbyXBJ1IIhO7HlSNm0oiyQO9 4s2AMw3PIGVJuTZKsrtnkobs7ErhEk/AYz6y8pdddB8haMTg/Y7WSER78k6UK8tnjJgV MjMHQpJ3eTW8sV96Vu6E/WSs3AkG81IN+4flbgA1vPfxRMNYSZ0yK990KJtjZcssG/Nf yPwnSX3/PjR/K001tOhdMDVEEdeMlJxDSJRbU5I98c233IOih6QLyLRmmSmWSRmURryd Mkzw== X-Gm-Message-State: AOAM5306ZHn54S6H3jUMt2ql15FWGveuzs2hXDexssZwq5FpJOPEuLRB wFJE//APF8iNATUANvhuib1edxvpOTg= X-Google-Smtp-Source: ABdhPJxyJEM4lgUrCCQ8A/Kj+jZ2U5mPy0JVDuS+hwRm6K7Xisi33g71LujsF544NnxmPntRhbGpJw== X-Received: by 2002:a17:907:208c:: with SMTP id pv12mr5215497ejb.314.1634228986662; Thu, 14 Oct 2021 09:29:46 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.29.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:29:46 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 06/26] kconfig: split CONFIG_SPARSE_MEM from fuzzing Date: Thu, 14 Oct 2021 18:29:18 +0200 Message-Id: <20211014162938.430211-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52f.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: Alexander Oleinik , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc?= =?utf-8?q?-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Pass CONFIG_FUZZ via host_kconfig, and use it to select the sparse-mem device. Cc: Alexander Oleinik Reviewed-by: Alexander Bulekov Reviewed-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Tested-by: Alexander Bulekov Message-Id: <20211007130829.632254-1-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- Kconfig.host | 4 ++++ hw/mem/Kconfig | 3 +++ hw/mem/meson.build | 2 +- meson.build | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Kconfig.host b/Kconfig.host index 24255ef441..60b9c07b5e 100644 --- a/Kconfig.host +++ b/Kconfig.host @@ -41,3 +41,7 @@ config PVRDMA config MULTIPROCESS_ALLOWED bool imply MULTIPROCESS + +config FUZZ + bool + select SPARSE_MEM diff --git a/hw/mem/Kconfig b/hw/mem/Kconfig index 8b19fdc49f..03dbb3c7df 100644 --- a/hw/mem/Kconfig +++ b/hw/mem/Kconfig @@ -8,3 +8,6 @@ config MEM_DEVICE config NVDIMM bool select MEM_DEVICE + +config SPARSE_MEM + bool diff --git a/hw/mem/meson.build b/hw/mem/meson.build index 3c8fdef9f9..82f86d117e 100644 --- a/hw/mem/meson.build +++ b/hw/mem/meson.build @@ -6,4 +6,4 @@ mem_ss.add(when: 'CONFIG_NVDIMM', if_true: files('nvdimm.c')) softmmu_ss.add_all(when: 'CONFIG_MEM_DEVICE', if_true: mem_ss) -softmmu_ss.add(when: 'CONFIG_FUZZ', if_true: files('sparse-mem.c')) +softmmu_ss.add(when: 'CONFIG_SPARSE_MEM', if_true: files('sparse-mem.c')) diff --git a/meson.build b/meson.build index 0b9ebf9bfb..4a584760aa 100644 --- a/meson.build +++ b/meson.build @@ -1599,6 +1599,7 @@ endif have_ivshmem = config_host_data.get('CONFIG_EVENTFD') host_kconfig = \ + ('CONFIG_FUZZ' in config_host ? ['CONFIG_FUZZ=y'] : []) + \ ('CONFIG_TPM' in config_host ? ['CONFIG_TPM=y'] : []) + \ ('CONFIG_SPICE' in config_host ? ['CONFIG_SPICE=y'] : []) + \ (have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \ From patchwork Thu Oct 14 16:29:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541010 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=XtPV1xpf; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVZg14xx8z9s0r for ; Fri, 15 Oct 2021 03:31:57 +1100 (AEDT) Received: from localhost ([::1]:49286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3e7-0003eh-Ca for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:31:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3c8-0003XA-RT for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:53 -0400 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:43771) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3c5-0000b3-Jo for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:51 -0400 Received: by mail-ed1-x52e.google.com with SMTP id i20so25745062edj.10 for ; Thu, 14 Oct 2021 09:29:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hUPbrX31NjhgF9odnKMwAjnuYtUcmXmeiU2bpBxSoAA=; b=XtPV1xpfsaEkvTfUDtW/KMUozNBgZbLoH4eW0mAZ5uP927O4x/Fuvdk45JoX2UUgmb oFuewUXTCNJCgRSr/urf9pc6XWtgSPYixcWJ6QYYorXFYYXmae4ChAHyR2I32l5hXwhW SkegEMIo3/xD9gO6ByL/9KSuCXFZpZxNSnvYj1qNlOD33caO+7WYGSKNTOoVDwjf477K io1m+XMNZ62fpyyt2Pea+10KJJT6zP37blxGhMRhc5/c2omfIFqZMnG2IBwigKwzZU1G pp1eo9NYpKgkZLM0LjIcxrD+8gcy8HzhoxK91ASuoyoOnLOPap0AXgQhuUCGywTmNjP7 Goyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=hUPbrX31NjhgF9odnKMwAjnuYtUcmXmeiU2bpBxSoAA=; b=vN27hGdhLWIeVJjFWjf+tWQTJwjzaOXNC49bL4MbxS3rFwyfdomwJnGxUyfavJKfL9 SLJv1dw1CbQwzKc3ArrUO657D1bT2ykMG/VKjHyAbvMSWfzhiYo+9u2Hr2XTikRPayvU d8UpPL1xI8OHlhIJPPL+hRm8k4/wap0wRRskQE1ujO1/ftWTGIWkqXLfL5niKKa3/H1b J9gn3Gx3s1+oNpeke/rHRcE2glPputpcFUBTiVjamsN5ZaEA/m7JjWAgGc8SUx3urUkn BXqdjqqsPmwB82i1tPF3zVky2W3DZFFf+G2iq4XwplUHFLeOUuyFbmC+fUa4ZmtA6c7F a9Gg== X-Gm-Message-State: AOAM532xcjvnwx/NY+4inihrPCpnCRUIaQjI2Z2m3rUiT48UOSJVAIIf +MqzELY0Vm1slUZIEfXDHk3AfcraB4U= X-Google-Smtp-Source: ABdhPJymM4J0teJZUgaQJUrvtnrb+ijeSrKXNnrmgOKnmwD8JypaaoN9q7V46cA1dnwkuU1Suv7XLQ== X-Received: by 2002:a17:906:1456:: with SMTP id q22mr4841154ejc.291.1634228987313; Thu, 14 Oct 2021 09:29:47 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.29.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:29:46 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 07/26] configure, meson: move fuzzing configuration to Meson Date: Thu, 14 Oct 2021 18:29:19 +0200 Message-Id: <20211014162938.430211-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52e.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: Alexander Oleinik Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Cc: Alexander Oleinik Reviewed-by: Alexander Bulekov Tested-by: Alexander Bulekov Message-Id: <20211007130829.632254-2-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 71 +++--------------------------------- meson.build | 51 +++++++++++++++++++++++--- meson_options.txt | 4 ++ tests/qtest/fuzz/meson.build | 6 ++- 4 files changed, 59 insertions(+), 73 deletions(-) diff --git a/configure b/configure index 2dd9460d20..a9a424948c 100755 --- a/configure +++ b/configure @@ -436,7 +436,7 @@ debug_mutex="no" libpmem="auto" default_devices="true" plugins="$default_feature" -fuzzing="no" +fuzzing="false" rng_none="no" secret_keyring="$default_feature" libdaxctl="auto" @@ -566,15 +566,6 @@ int main(void) { return 0; } EOF } -write_c_fuzzer_skeleton() { - cat > $TMPC < -#include -int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size); -int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { return 0; } -EOF -} - if check_define __linux__ ; then targetos="Linux" elif check_define _WIN32 ; then @@ -1538,9 +1529,9 @@ for opt do ;; --disable-containers) use_containers="no" ;; - --enable-fuzzing) fuzzing=yes + --enable-fuzzing) fuzzing=true ;; - --disable-fuzzing) fuzzing=no + --disable-fuzzing) fuzzing=false ;; --gdb=*) gdb_bin="$optarg" ;; @@ -4057,26 +4048,6 @@ EOF fi fi -########################################## -# checks for fuzzer -if test "$fuzzing" = "yes" ; then - write_c_fuzzer_skeleton - if test -z "${LIB_FUZZING_ENGINE+xxx}"; then - if compile_prog "$CPU_CFLAGS -Werror -fsanitize=fuzzer" ""; then - have_fuzzer=yes - else - error_exit "Your compiler doesn't support -fsanitize=fuzzer" - exit 1 - fi - fi - - have_clang_coverage_filter=no - echo > $TMPTXT - if compile_prog "$CPU_CFLAGS -Werror -fsanitize=fuzzer -fsanitize-coverage-allowlist=$TMPTXT" ""; then - have_clang_coverage_filter=yes - fi -fi - # Thread sanitizer is, for now, much noisier than the other sanitizers; # keep it separate until that is not the case. if test "$tsan" = "yes" && test "$sanitizers" = "yes"; then @@ -4702,34 +4673,6 @@ fi if test "$have_mlockall" = "yes" ; then echo "HAVE_MLOCKALL=y" >> $config_host_mak fi -if test "$fuzzing" = "yes" ; then - # If LIB_FUZZING_ENGINE is set, assume we are running on OSS-Fuzz, and the - # needed CFLAGS have already been provided - if test -z "${LIB_FUZZING_ENGINE+xxx}" ; then - # Add CFLAGS to tell clang to add fuzzer-related instrumentation to all the - # compiled code. - QEMU_CFLAGS="$QEMU_CFLAGS -fsanitize=fuzzer-no-link" - # To build non-fuzzer binaries with --enable-fuzzing, link everything with - # fsanitize=fuzzer-no-link. Otherwise, the linker will be unable to bind - # the fuzzer-related callbacks added by instrumentation. - QEMU_LDFLAGS="$QEMU_LDFLAGS -fsanitize=fuzzer-no-link" - # For the actual fuzzer binaries, we need to link against the libfuzzer - # library. Provide the flags for doing this in FUZZ_EXE_LDFLAGS. The meson - # rule for the fuzzer adds these to the link_args. They need to be - # configurable, to support OSS-Fuzz - FUZZ_EXE_LDFLAGS="-fsanitize=fuzzer" - else - FUZZ_EXE_LDFLAGS="$LIB_FUZZING_ENGINE" - fi - - # Specify a filter to only instrument code that is directly related to - # virtual-devices. - if test "$have_clang_coverage_filter" = "yes" ; then - cp "$source_path/scripts/oss-fuzz/instrumentation-filter-template" \ - instrumentation-filter - QEMU_CFLAGS="$QEMU_CFLAGS -fsanitize-coverage-allowlist=instrumentation-filter" - fi -fi if test "$plugins" = "yes" ; then echo "CONFIG_PLUGIN=y" >> $config_host_mak @@ -4793,11 +4736,6 @@ if test "$gcov" = "yes" ; then echo "CONFIG_GCOV=y" >> $config_host_mak fi -if test "$fuzzing" != "no"; then - echo "CONFIG_FUZZ=y" >> $config_host_mak -fi -echo "FUZZ_EXE_LDFLAGS=$FUZZ_EXE_LDFLAGS" >> $config_host_mak - if test "$rng_none" = "yes"; then echo "CONFIG_RNG_NONE=y" >> $config_host_mak fi @@ -5033,7 +4971,8 @@ if test "$skip_meson" = no; then -Dstrip=$(if test "$strip_opt" = yes; then echo true; else echo false; fi) \ -Db_pie=$(if test "$pie" = yes; then echo true; else echo false; fi) \ -Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false; fi) \ - -Db_lto=$lto -Dcfi=$cfi -Dcfi_debug=$cfi_debug \ + -Db_lto=$lto -Dcfi=$cfi -Dcfi_debug=$cfi_debug -Dfuzzing=$fuzzing \ + $(test -n "${LIB_FUZZING_ENGINE+xxx}" && echo "-Dfuzzing_engine=$LIB_FUZZING_ENGINE") \ -Dmalloc=$malloc -Dmalloc_trim=$malloc_trim -Dsparse=$sparse \ -Dkvm=$kvm -Dhax=$hax -Dwhpx=$whpx -Dhvf=$hvf -Dnvmm=$nvmm \ -Dxen=$xen -Dxen_pci_passthrough=$xen_pci_passthrough -Dtcg=$tcg \ diff --git a/meson.build b/meson.build index 4a584760aa..a3424bce7d 100644 --- a/meson.build +++ b/meson.build @@ -117,10 +117,37 @@ endforeach # Specify linker-script with add_project_link_arguments so that it is not placed # within a linker --start-group/--end-group pair -if 'CONFIG_FUZZ' in config_host - add_project_link_arguments(['-Wl,-T,', - (meson.current_source_dir() / 'tests/qtest/fuzz/fork_fuzz.ld')], +if get_option('fuzzing') + add_project_link_arguments(['-Wl,-T,', + (meson.current_source_dir() / 'tests/qtest/fuzz/fork_fuzz.ld')], + native: false, language: ['c', 'cpp', 'objc']) + + # Specify a filter to only instrument code that is directly related to + # virtual-devices. + configure_file(output: 'instrumentation-filter', + input: 'scripts/oss-fuzz/instrumentation-filter-template', + copy: true) + add_global_arguments( + cc.get_supported_arguments('-fsanitize-coverage-allowlist=instrumentation-filter'), + native: false, language: ['c', 'cpp', 'objc']) + + if get_option('fuzzing_engine') == '' + # Add CFLAGS to tell clang to add fuzzer-related instrumentation to all the + # compiled code. To build non-fuzzer binaries with --enable-fuzzing, link + # everything with fsanitize=fuzzer-no-link. Otherwise, the linker will be + # unable to bind the fuzzer-related callbacks added by instrumentation. + add_global_arguments('-fsanitize=fuzzer-no-link', + native: false, language: ['c', 'cpp', 'objc']) + add_global_link_arguments('-fsanitize=fuzzer-no-link', native: false, language: ['c', 'cpp', 'objc']) + # For the actual fuzzer binaries, we need to link against the libfuzzer + # library. They need to be configurable, to support OSS-Fuzz + fuzz_exe_ldflags = ['-fsanitize=fuzzer'] + else + # LIB_FUZZING_ENGINE was set; assume we are running on OSS-Fuzz, and + # the needed CFLAGS have already been provided + fuzz_exe_ldflags = get_option('fuzzing_engine').split() + endif endif add_global_arguments(config_host['QEMU_CFLAGS'].split(), @@ -163,6 +190,17 @@ endif # Target-specific checks and dependencies # ########################################### +if get_option('fuzzing') and get_option('fuzzing_engine') == '' and \ + not cc.links(''' + #include + #include + int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size); + int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { return 0; } + ''', + args: ['-Werror', '-fsanitize=fuzzer']) + error('Your compiler does not support -fsanitize=fuzzer') +endif + if targetos != 'linux' and get_option('mpath').enabled() error('Multipath is supported only on Linux') endif @@ -1325,6 +1363,7 @@ config_host_data.set_quoted('CONFIG_SYSCONFDIR', get_option('prefix') / get_opti config_host_data.set('CONFIG_ATTR', libattr.found()) config_host_data.set('CONFIG_BRLAPI', brlapi.found()) config_host_data.set('CONFIG_COCOA', cocoa.found()) +config_host_data.set('CONFIG_FUZZ', get_option('fuzzing')) config_host_data.set('CONFIG_LIBUDEV', libudev.found()) config_host_data.set('CONFIG_LZO', lzo.found()) config_host_data.set('CONFIG_MPATH', mpathpersist.found()) @@ -1599,7 +1638,7 @@ endif have_ivshmem = config_host_data.get('CONFIG_EVENTFD') host_kconfig = \ - ('CONFIG_FUZZ' in config_host ? ['CONFIG_FUZZ=y'] : []) + \ + (get_option('fuzzing') ? ['CONFIG_FUZZ=y'] : []) + \ ('CONFIG_TPM' in config_host ? ['CONFIG_TPM=y'] : []) + \ ('CONFIG_SPICE' in config_host ? ['CONFIG_SPICE=y'] : []) + \ (have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \ @@ -2724,7 +2763,7 @@ foreach target : target_dirs 'dependencies': [] }] endif - if config_host.has_key('CONFIG_FUZZ') + if get_option('fuzzing') specific_fuzz = specific_fuzz_ss.apply(config_target, strict: false) execs += [{ 'name': 'qemu-fuzz-' + target_name, @@ -2964,7 +3003,7 @@ summary_info += {'module support': config_host.has_key('CONFIG_MODULES')} if config_host.has_key('CONFIG_MODULES') summary_info += {'alternative module path': config_host.has_key('CONFIG_MODULE_UPGRADES')} endif -summary_info += {'fuzzing support': config_host.has_key('CONFIG_FUZZ')} +summary_info += {'fuzzing support': get_option('fuzzing')} if have_system summary_info += {'Audio drivers': ' '.join(audio_drivers_selected)} endif diff --git a/meson_options.txt b/meson_options.txt index 052c4f088e..100c30e967 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -11,9 +11,13 @@ option('default_devices', type : 'boolean', value : true, option('audio_drv_list', type: 'array', value: ['default'], choices: ['alsa', 'coreaudio', 'default', 'dsound', 'jack', 'oss', 'pa', 'sdl'], description: 'Set audio driver list') +option('fuzzing_engine', type : 'string', value : '', + description: 'fuzzing engine library for OSS-Fuzz') option('docs', type : 'feature', value : 'auto', description: 'Documentations build support') +option('fuzzing', type : 'boolean', value: false, + description: 'build fuzzing targets') option('gettext', type : 'feature', value : 'auto', description: 'Localization of the GTK+ user interface') option('install_blobs', type : 'boolean', value : true, diff --git a/tests/qtest/fuzz/meson.build b/tests/qtest/fuzz/meson.build index 8af6848cd5..189901d4a2 100644 --- a/tests/qtest/fuzz/meson.build +++ b/tests/qtest/fuzz/meson.build @@ -1,3 +1,7 @@ +if not get_option('fuzzing') + subdir_done() +endif + specific_fuzz_ss.add(files('fuzz.c', 'fork_fuzz.c', 'qos_fuzz.c', 'qtest_wrappers.c'), qos) @@ -9,7 +13,7 @@ specific_fuzz_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio_blk_fuzz. specific_fuzz_ss.add(files('generic_fuzz.c')) fork_fuzz = declare_dependency( - link_args: config_host['FUZZ_EXE_LDFLAGS'].split() + + link_args: fuzz_exe_ldflags + ['-Wl,-wrap,qtest_inb', '-Wl,-wrap,qtest_inw', '-Wl,-wrap,qtest_inl', From patchwork Thu Oct 14 16:29:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541019 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=JYJYFPF/; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVZtX0Pnpz9s0r for ; Fri, 15 Oct 2021 03:41:55 +1100 (AEDT) Received: from localhost ([::1]:45702 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3nl-0004CP-9W for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:41:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34710) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3c7-0003UE-1g for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:51 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]:34373) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3c5-0000ah-ED for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:50 -0400 Received: by mail-ed1-x52b.google.com with SMTP id g10so26619594edj.1 for ; Thu, 14 Oct 2021 09:29:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ymag38oEBbrqHm3cPd24eKF4QvmHP4oq+k1kIJYRu9c=; b=JYJYFPF/mLdjTVlG4dLQamL8tzWO7D3g5LqeVKiP9ORzIP+AV78gkI6oeKTsE+eWcC 4vVBGBGdA8ZDw6NFQK76QFyFZg3Av3DGAQ1blLkg6bWjmJJLGE8OxLqCDf3AgHgvx7/4 VA11KxvpmzFHBgwJgztwxAq050nCmsFlmykY+obIt+8VopZkI+ya27nzEP2ZXmZs0qnY wnq+wFymSn4FISYaE2iNyWf5ELd4PUJQSuvf6hEr/1ngOJ5mL5A58y5OwYLRoX16HL9z THlL8IJm8RyzqZfRimOUqgXwMTyazbNvCaeG3bbA39qBAXswz2vNV4SIjw0B/P3sVsB3 XOMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ymag38oEBbrqHm3cPd24eKF4QvmHP4oq+k1kIJYRu9c=; b=VK1AAKC1juo6gVf4Ze1kvJdu1VDnmRvAZ3FlwfIajqR0mCj34DAOob4MVUOYjTaNs9 oUDwnwcObSD/abc8s3gE6EcYebtJPo9Puhz/v5BUTRzmElz2zGjzKWXdmWM1HkDJ5xVX aK2AjS62gZAlnb4QyqHvKqqJcT5vEbh5onIQOK0WJtyJoHD5aNWqZD59gNM40Rmd8pRC 4snMW0vC9KVe+l8jsDJQtOw9BTV4wVqHFqGvMRZNTnxuBlfSOZUnt9kcWFLd6DY5yTno DsUNoOARQ8dMiIYWn+Cufpkt6+qkZ5bZyceLgrYK5f+XINBUB+7JVXM15qO4kHWbJ6S3 3A2Q== X-Gm-Message-State: AOAM530RIV2XZARk7fAfuijpWHQrhvLdrv7BfXcOqJ/Pr2p6TE+xm/Gu xpUplEOcc1zgQlXpDxH1s4Tq238WSpA= X-Google-Smtp-Source: ABdhPJxm+o467aSy6rV837fkAedTnTJhu9Xh7z5Ur/M7Pw6MMeAFNGJpAxH3MYk6edD54fZQf1i7ZA== X-Received: by 2002:a17:906:c055:: with SMTP id bm21mr4922597ejb.350.1634228988098; Thu, 14 Oct 2021 09:29:48 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.29.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:29:47 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 08/26] trace: simple: pass trace_file unmodified to config-host.h Date: Thu, 14 Oct 2021 18:29:20 +0200 Message-Id: <20211014162938.430211-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52b.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Stefan Hajnoczi Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Add the suffix directly in trace/simple.c, so that quoting is done properly by Meson. Cc: Stefan Hajnoczi Reviewed-by: Marc-André Lureau Message-Id: <20211007130829.632254-3-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 2 -- meson.build | 2 +- trace/simple.c | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/configure b/configure index a9a424948c..c27c4d6f1c 100755 --- a/configure +++ b/configure @@ -4580,8 +4580,6 @@ if have_backend "nop"; then fi if have_backend "simple"; then echo "CONFIG_TRACE_SIMPLE=y" >> $config_host_mak - # Set the appropriate trace file. - trace_file="\"$trace_file-\" FMT_pid" fi if have_backend "log"; then echo "CONFIG_TRACE_LOG=y" >> $config_host_mak diff --git a/meson.build b/meson.build index a3424bce7d..5418083db7 100644 --- a/meson.build +++ b/meson.build @@ -1571,7 +1571,7 @@ config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles(''' ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target arrays = ['CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST'] -strings = ['HOST_DSOSUF', 'CONFIG_IASL'] +strings = ['HOST_DSOSUF', 'CONFIG_IASL', 'CONFIG_TRACE_FILE'] foreach k, v: config_host if ignored.contains(k) # do nothing diff --git a/trace/simple.c b/trace/simple.c index ac499edee0..18af590cf7 100644 --- a/trace/simple.c +++ b/trace/simple.c @@ -364,7 +364,7 @@ void st_set_trace_file(const char *file) if (!file) { /* Type cast needed for Windows where getpid() returns an int. */ - trace_file_name = g_strdup_printf(CONFIG_TRACE_FILE, (pid_t)getpid()); + trace_file_name = g_strdup_printf(CONFIG_TRACE_FILE "-" FMT_pid, (pid_t)getpid()); } else { trace_file_name = g_strdup_printf("%s", file); } From patchwork Thu Oct 14 16:29:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541014 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=pomaevXr; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVZkT1KKpz9s0r for ; Fri, 15 Oct 2021 03:34:57 +1100 (AEDT) Received: from localhost ([::1]:57764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3h0-0001HG-Su for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:34:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3c8-0003Zb-UH for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:53 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:44612) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3c6-0000bl-GU for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:52 -0400 Received: by mail-ed1-x531.google.com with SMTP id w14so26391295edv.11 for ; Thu, 14 Oct 2021 09:29:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZR86lkgLEbr4AVIndNBkhlYBbqhsVzO0lOsORJTCbfs=; b=pomaevXrabRkSQbOMEHpDM20lDM2j9+6mcWwtTvHRLXeIbzmwsuO/yuzJciBPVNodZ QlXHcBcUegfZ/67TSsj3kmr1CvCVYyvxsOymtaYE8t7t9LJw3pNR96VqPiiWBNr9v8O9 D8aTcGHRaHOf7R9aSo+x8jdexlMyEevO97Ghz/k4ZmSiZDxNnq9EJWEJ/QF1LCbjjwj4 ShGrFRsRYJrmWoLietLIAVy5CANrlreB24Uwl7NeJv774Oa3FriIlQHVA6VVhuOIy3e9 aXIkEtkb/8DHqdv2f6mSy41fOIWxg2FxjbTUJwT1X4441TlMaRko5+gM+kSojeDkl0Wc x9lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ZR86lkgLEbr4AVIndNBkhlYBbqhsVzO0lOsORJTCbfs=; b=a8sgx7iW0WUP6lQ9MFamrFG04iqoVC33EaHrN4AMKlkjPxyOlTeOyL3tG5RIBTOcAw LdDdT7Na6lUj97u4S/zlOrf7YH4eieyjg76hY4wu3mF0ynDJ5NXX0lGNaj0kh311L9s2 g7SmYaZSPvMFL2U2yN/GmfBvGKzJP9NsfH241Amft/bQZWJYvlGurEB3GgRVlPLN98Ne t17oHdxMwciLtJtwmTZhe+NkLpP7omXTwIcLJbTH246iThKrAo9nuCmMjkyFQXV/bZCc IVjW4eBgpf+KM4uQYj+S3+fKcuwKNpIxBTAQh5xr4ceqbpVtCXVtIGiYo89V8CNg2xMf 3h7Q== X-Gm-Message-State: AOAM530rNsoVoiK4tkXfi71YVJLKa04v/GmO9/cCl2HC68NeGcQXJduM yCf07SY2fOJhMcsd7s3OvIQ4YE5HTW8= X-Google-Smtp-Source: ABdhPJyKlWvbZJ0pA/Jw5wBTQvvuiLB30hNjladBcHTtN0Ep2D8HyyaDe80U4hovEaH7ISYRPBB4Cw== X-Received: by 2002:aa7:dbd2:: with SMTP id v18mr9874845edt.315.1634228988965; Thu, 14 Oct 2021 09:29:48 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.29.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:29:48 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 09/26] trace: move configuration from configure to Meson Date: Thu, 14 Oct 2021 18:29:21 +0200 Message-Id: <20211014162938.430211-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x531.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Stefan Hajnoczi Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Cc: Stefan Hajnoczi Reviewed-by: Marc-André Lureau Message-Id: <20211007130829.632254-4-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 91 +-------------------------------------------- docs/meson.build | 2 +- meson.build | 51 +++++++++++++++++++++---- meson_options.txt | 6 +++ scripts/meson.build | 2 +- trace/meson.build | 15 +++++--- 6 files changed, 61 insertions(+), 106 deletions(-) diff --git a/configure b/configure index c27c4d6f1c..ba508b70b9 100755 --- a/configure +++ b/configure @@ -216,10 +216,6 @@ version_ge () { done } -have_backend () { - echo "$trace_backends" | grep "$1" >/dev/null -} - glob() { eval test -z '"${1#'"$2"'}"' } @@ -3514,56 +3510,6 @@ case "$capstone" in ;; esac -########################################## -# check if we have posix_syslog - -posix_syslog=no -cat > $TMPC << EOF -#include -int main(void) { openlog("qemu", LOG_PID, LOG_DAEMON); syslog(LOG_INFO, "configure"); return 0; } -EOF -if compile_prog "" "" ; then - posix_syslog=yes -fi - -########################################## -# check if trace backend exists - -$python "$source_path/scripts/tracetool.py" "--backends=$trace_backends" --check-backends > /dev/null 2> /dev/null -if test "$?" -ne 0 ; then - error_exit "invalid trace backends" \ - "Please choose supported trace backends." -fi - -########################################## -# For 'ust' backend, test if ust headers are present -if have_backend "ust"; then - if $pkg_config lttng-ust --exists; then - lttng_ust_libs=$($pkg_config --libs lttng-ust) - else - error_exit "Trace backend 'ust' missing lttng-ust header files" - fi -fi - -########################################## -# For 'dtrace' backend, test if 'dtrace' command is present -if have_backend "dtrace"; then - if ! has 'dtrace' ; then - error_exit "dtrace command is not found in PATH $PATH" - fi - trace_backend_stap="no" - if has 'stap' ; then - trace_backend_stap="yes" - - # Workaround to avoid dtrace(1) producing a file with 'hidden' symbol - # visibility. Define STAP_SDT_V2 to produce 'default' symbol visibility - # instead. QEMU --enable-modules depends on this because the SystemTap - # semaphores are linked into the main binary and not the module's shared - # object. - QEMU_CFLAGS="$QEMU_CFLAGS -DSTAP_SDT_V2" - fi -fi - ########################################## # check and set a backend for coroutine @@ -4574,42 +4520,6 @@ if test "$tpm" = "yes"; then echo 'CONFIG_TPM=y' >> $config_host_mak fi -echo "TRACE_BACKENDS=$trace_backends" >> $config_host_mak -if have_backend "nop"; then - echo "CONFIG_TRACE_NOP=y" >> $config_host_mak -fi -if have_backend "simple"; then - echo "CONFIG_TRACE_SIMPLE=y" >> $config_host_mak -fi -if have_backend "log"; then - echo "CONFIG_TRACE_LOG=y" >> $config_host_mak -fi -if have_backend "ust"; then - echo "CONFIG_TRACE_UST=y" >> $config_host_mak - echo "LTTNG_UST_LIBS=$lttng_ust_libs" >> $config_host_mak -fi -if have_backend "dtrace"; then - echo "CONFIG_TRACE_DTRACE=y" >> $config_host_mak - if test "$trace_backend_stap" = "yes" ; then - echo "CONFIG_TRACE_SYSTEMTAP=y" >> $config_host_mak - fi -fi -if have_backend "ftrace"; then - if test "$linux" = "yes" ; then - echo "CONFIG_TRACE_FTRACE=y" >> $config_host_mak - else - feature_not_found "ftrace(trace backend)" "ftrace requires Linux" - fi -fi -if have_backend "syslog"; then - if test "$posix_syslog" = "yes" ; then - echo "CONFIG_TRACE_SYSLOG=y" >> $config_host_mak - else - feature_not_found "syslog(trace backend)" "syslog not available" - fi -fi -echo "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak - if test "$rdma" = "yes" ; then echo "CONFIG_RDMA=y" >> $config_host_mak echo "RDMA_LIBS=$rdma_libs" >> $config_host_mak @@ -4992,6 +4902,7 @@ if test "$skip_meson" = no; then $(if test "$default_feature" = no; then echo "-Dauto_features=disabled"; fi) \ -Dalsa=$alsa -Dcoreaudio=$coreaudio -Ddsound=$dsound -Djack=$jack -Doss=$oss \ -Dpa=$pa -Daudio_drv_list=$audio_drv_list -Dtcg_interpreter=$tcg_interpreter \ + -Dtrace_backends=$trace_backends -Dtrace_file=$trace_file \ $cross_arg \ "$PWD" "$source_path" diff --git a/docs/meson.build b/docs/meson.build index be4dc30f39..19cce670a2 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -57,7 +57,7 @@ if build_docs 'qemu-nbd.8': (have_tools ? 'man8' : ''), 'qemu-pr-helper.8': (have_tools ? 'man8' : ''), 'qemu-storage-daemon.1': (have_tools ? 'man1' : ''), - 'qemu-trace-stap.1': (config_host.has_key('CONFIG_TRACE_SYSTEMTAP') ? 'man1' : ''), + 'qemu-trace-stap.1': (stap.found() ? 'man1' : ''), 'virtfs-proxy-helper.1': (have_virtfs_proxy_helper ? 'man1' : ''), 'virtiofsd.1': (have_virtiofsd ? 'man1' : ''), 'qemu.1': 'man1', diff --git a/meson.build b/meson.build index 5418083db7..6a5e7254ed 100644 --- a/meson.build +++ b/meson.build @@ -111,6 +111,22 @@ foreach target : edk2_targets endif endforeach +dtrace = not_found +stap = not_found +if 'dtrace' in get_option('trace_backends') + dtrace = find_program('dtrace', required: true) + stap = find_program('stap', required: false) + if stap.found() + # Workaround to avoid dtrace(1) producing a file with 'hidden' symbol + # visibility. Define STAP_SDT_V2 to produce 'default' symbol visibility + # instead. QEMU --enable-modules depends on this because the SystemTap + # semaphores are linked into the main binary and not the module's shared + # object. + add_global_arguments('-DSTAP_SDT_V2', + native: false, language: ['c', 'cpp', 'objc']) + endif +endif + ################## # Compiler flags # ################## @@ -201,6 +217,19 @@ if get_option('fuzzing') and get_option('fuzzing_engine') == '' and \ error('Your compiler does not support -fsanitize=fuzzer') endif +if 'ftrace' in get_option('trace_backends') and targetos != 'linux' + error('ftrace is supported only on Linux') +endif +if 'syslog' in get_option('trace_backends') and not cc.compiles(''' + #include + int main(void) { + openlog("qemu", LOG_PID, LOG_DAEMON); + syslog(LOG_INFO, "configure"); + return 0; + }''') + error('syslog is not supported on this system') +endif + if targetos != 'linux' and get_option('mpath').enabled() error('Multipath is supported only on Linux') endif @@ -359,8 +388,9 @@ if 'CONFIG_GIO' in config_host link_args: config_host['GIO_LIBS'].split()) endif lttng = not_found -if 'CONFIG_TRACE_UST' in config_host - lttng = declare_dependency(link_args: config_host['LTTNG_UST_LIBS'].split()) +if 'ust' in get_option('trace_backends') + lttng = dependency('lttng-ust', required: true, method: 'pkg-config', + kwargs: static_kwargs) endif pixman = not_found if have_system or have_tools @@ -1347,6 +1377,11 @@ elif get_option('virtfs').disabled() have_virtfs = false endif +foreach k : get_option('trace_backends') + config_host_data.set('CONFIG_TRACE_' + k.to_upper(), true) +endforeach +config_host_data.set_quoted('CONFIG_TRACE_FILE', get_option('trace_file')) + config_host_data.set_quoted('CONFIG_BINDIR', get_option('prefix') / get_option('bindir')) config_host_data.set_quoted('CONFIG_PREFIX', get_option('prefix')) config_host_data.set_quoted('CONFIG_QEMU_CONFDIR', get_option('prefix') / qemu_confdir) @@ -1571,7 +1606,7 @@ config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles(''' ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target arrays = ['CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST'] -strings = ['HOST_DSOSUF', 'CONFIG_IASL', 'CONFIG_TRACE_FILE'] +strings = ['HOST_DSOSUF', 'CONFIG_IASL'] foreach k, v: config_host if ignored.contains(k) # do nothing @@ -2109,7 +2144,7 @@ qapi_gen_depends = [ meson.current_source_dir() / 'scripts/qapi/__init__.py', tracetool = [ python, files('scripts/tracetool.py'), - '--backend=' + config_host['TRACE_BACKENDS'] + '--backend=' + ','.join(get_option('trace_backends')) ] tracetool_depends = files( 'scripts/tracetool/backend/log.py', @@ -2826,7 +2861,7 @@ foreach target : target_dirs emulators += {exe['name']: emulator} endif - if 'CONFIG_TRACE_SYSTEMTAP' in config_host + if stap.found() foreach stp: [ {'ext': '.stp-build', 'fmt': 'stap', 'bin': meson.current_build_dir() / exe['name'], 'install': false}, {'ext': '.stp', 'fmt': 'stap', 'bin': get_option('prefix') / get_option('bindir') / exe['name'], 'install': true}, @@ -3007,9 +3042,9 @@ summary_info += {'fuzzing support': get_option('fuzzing')} if have_system summary_info += {'Audio drivers': ' '.join(audio_drivers_selected)} endif -summary_info += {'Trace backends': config_host['TRACE_BACKENDS']} -if config_host['TRACE_BACKENDS'].split().contains('simple') - summary_info += {'Trace output file': config_host['CONFIG_TRACE_FILE'] + '-'} +summary_info += {'Trace backends': ','.join(get_option('trace_backends'))} +if 'simple' in get_option('trace_backends') + summary_info += {'Trace output file': get_option('trace_file') + '-'} endif summary_info += {'QOM debugging': config_host.has_key('CONFIG_QOM_CAST_DEBUG')} summary_info += {'vhost-kernel support': config_host.has_key('CONFIG_VHOST_KERNEL')} diff --git a/meson_options.txt b/meson_options.txt index 100c30e967..8f9c3b5b17 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -13,6 +13,8 @@ option('audio_drv_list', type: 'array', value: ['default'], description: 'Set audio driver list') option('fuzzing_engine', type : 'string', value : '', description: 'fuzzing engine library for OSS-Fuzz') +option('trace_file', type: 'string', value: 'trace', + description: 'Trace file prefix for simple backend') option('docs', type : 'feature', value : 'auto', description: 'Documentations build support') @@ -146,6 +148,10 @@ option('fuse', type: 'feature', value: 'auto', option('fuse_lseek', type : 'feature', value : 'auto', description: 'SEEK_HOLE/SEEK_DATA support for FUSE exports') +option('trace_backends', type: 'array', value: ['log'], + choices: ['dtrace', 'ftrace', 'log', 'nop', 'simple', 'syslog', 'ust'], + description: 'Set available tracing backends') + option('alsa', type: 'feature', value: 'auto', description: 'ALSA sound support') option('coreaudio', type: 'feature', value: 'auto', diff --git a/scripts/meson.build b/scripts/meson.build index e8cc63896d..1c89e10a76 100644 --- a/scripts/meson.build +++ b/scripts/meson.build @@ -1,3 +1,3 @@ -if 'CONFIG_TRACE_SYSTEMTAP' in config_host +if stap.found() install_data('qemu-trace-stap', install_dir: get_option('bindir')) endif diff --git a/trace/meson.build b/trace/meson.build index b8f95de200..573dd699c6 100644 --- a/trace/meson.build +++ b/trace/meson.build @@ -2,7 +2,6 @@ specific_ss.add(files('control-target.c')) trace_events_files = [] -dtrace = find_program('dtrace', required: 'CONFIG_TRACE_DTRACE' in config_host) foreach dir : [ '.' ] + trace_events_subdirs trace_events_file = meson.project_source_root() / dir / 'trace-events' trace_events_files += [ trace_events_file ] @@ -21,7 +20,7 @@ foreach dir : [ '.' ] + trace_events_subdirs input: trace_events_file, command: [ tracetool, group, '--format=c', '@INPUT@', '@OUTPUT@' ], depend_files: tracetool_depends) - if 'CONFIG_TRACE_UST' in config_host + if 'ust' in get_option('trace_backends') trace_ust_h = custom_target(fmt.format('trace-ust', 'h'), output: fmt.format('trace-ust', 'h'), input: trace_events_file, @@ -31,7 +30,7 @@ foreach dir : [ '.' ] + trace_events_subdirs genh += trace_ust_h endif trace_ss.add(trace_h, trace_c) - if 'CONFIG_TRACE_DTRACE' in config_host + if 'dtrace' in get_option('trace_backends') trace_dtrace = custom_target(fmt.format('trace-dtrace', 'dtrace'), output: fmt.format('trace-dtrace', 'dtrace'), input: trace_events_file, @@ -76,7 +75,7 @@ foreach d : [ specific_ss.add(when: 'CONFIG_TCG', if_true: gen) endforeach -if 'CONFIG_TRACE_UST' in config_host +if 'ust' in get_option('trace_backends') trace_ust_all_h = custom_target('trace-ust-all.h', output: 'trace-ust-all.h', input: trace_events_files, @@ -91,7 +90,11 @@ if 'CONFIG_TRACE_UST' in config_host genh += trace_ust_all_h endif -trace_ss.add(when: 'CONFIG_TRACE_SIMPLE', if_true: files('simple.c')) -trace_ss.add(when: 'CONFIG_TRACE_FTRACE', if_true: files('ftrace.c')) +if 'simple' in get_option('trace_backends') + trace_ss.add(files('simple.c')) +endif +if 'ftrace' in get_option('trace_backends') + trace_ss.add(files('ftrace.c')) +endif trace_ss.add(files('control.c')) trace_ss.add(files('qmp.c')) From patchwork Thu Oct 14 16:29:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541017 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=TTuiaMVC; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVZq26h4fz9s0r for ; Fri, 15 Oct 2021 03:38:54 +1100 (AEDT) Received: from localhost ([::1]:37648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3kq-00070j-NJ for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:38:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3c9-0003aE-Av for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:53 -0400 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]:46820) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3c7-0000cs-Fd for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:52 -0400 Received: by mail-ed1-x52a.google.com with SMTP id z20so26712074edc.13 for ; Thu, 14 Oct 2021 09:29:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eKjiEwE8hfNYasZYSdQWkiVZ51rVQWPwlrU39zH9G7E=; b=TTuiaMVCUdDO1SuwDsx3eDjCqXlc2713Va1MuBoiIwJLcOzDktLUtJhpCBPG6bg7Gb Q5ukOS5bBlTxWsA2phIHgtu0hQTnaM59RI/SoXpuMvScv7Td2QMtA3f4CEv0gOQ+fAW3 8QCNUROzwBNSNKE0uFSQzj1g+DlU6KVo7m7zlKJMDKsqH67TJZd7f81WEAlWj7oIeH9a tMqY3BVKhdcm5gBfwVPylPRF3tkAGupA6LxhNMdUWSHebwU90QCLWJ4BqiwsrSnXgVQZ DOMXTbY6pWRg6tXQH2vKBP/pqUUdiFMNlzB7XpEvt19vPLGRmYEFq/7uIUwNQW2ibGNn agQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=eKjiEwE8hfNYasZYSdQWkiVZ51rVQWPwlrU39zH9G7E=; b=sDyJl48WkXi8nQRNm1uoVWHfoVemxnLHr1LT41dtQjFIkEHdYeFAuokPgf8XFpEbGc i8jIAUtwtfdlTS19juPR/IoQIwu2lmGCAkSK5RwijzL/2y/73dfNPnursnYgdUTY+79p p9zBmNobe3E1bL9A1AYkwMRTUg1ttVJSzeJy2vIdW0+3yiwVUdW8U9s/KQAOhnwto2cJ D0l9b+MSlCEa2YFb9jUKG2Eeev8fs07L61veZ7ffDffHkFl/ZOYjrK2Jo5FCMnP4DLZA hd1QNxxL9jQUrm1gn8u/lfJNvKYYFodHFjN06y6arcZcdUqfE/psNrFGvdIvJvFxqtUF 6mgg== X-Gm-Message-State: AOAM531OHLcURIKJg0nGCOAFIQTH5p2KW73lAQo+1D45w8pkgRs/FuUT 3i72AM5dM/nIMKsW0WhWGvoojr5+AwQ= X-Google-Smtp-Source: ABdhPJy5Tlvwv9gyfaf7w8uAv4jK06t2DEEBVok9IugHx2WxWirdgWeja6BXZP/NG6+DmCxjbq7toA== X-Received: by 2002:a05:6402:1914:: with SMTP id e20mr9922347edz.304.1634228990112; Thu, 14 Oct 2021 09:29:50 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.29.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:29:49 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 10/26] configure, meson: move CONFIG_HOST_DSOSUF to Meson Date: Thu, 14 Oct 2021 18:29:22 +0200 Message-Id: <20211014162938.430211-11-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52a.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This is just a constant string, there is no need to pass it in config-host.mak. Reviewed-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211007130829.632254-5-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 6 ------ meson.build | 10 +++++----- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/configure b/configure index ba508b70b9..a5411c834d 100755 --- a/configure +++ b/configure @@ -351,7 +351,6 @@ bigendian="no" mingw32="no" gcov="no" EXESUF="" -HOST_DSOSUF=".so" modules="no" module_upgrades="no" prefix="/usr/local" @@ -594,9 +593,6 @@ fi # cross-compiling to one of these OSes then you'll need to specify # the correct CPU with the --cpu option. case $targetos in -Darwin) - HOST_DSOSUF=".dylib" - ;; SunOS) # $(uname -m) returns i86pc even on an x86_64 box, so default based on isainfo if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then @@ -785,7 +781,6 @@ fi if test "$mingw32" = "yes" ; then EXESUF=".exe" - HOST_DSOSUF=".dll" # MinGW needs -mthreads for TLS and macro _MT. CONFIGURE_CFLAGS="-mthreads $CONFIGURE_CFLAGS" write_c_skeleton; @@ -4638,7 +4633,6 @@ echo "GLIB_LIBS=$glib_libs" >> $config_host_mak echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak echo "EXESUF=$EXESUF" >> $config_host_mak -echo "HOST_DSOSUF=$HOST_DSOSUF" >> $config_host_mak echo "LIBS_QGA=$libs_qga" >> $config_host_mak if test "$gcov" = "yes" ; then echo "CONFIG_GCOV=y" >> $config_host_mak diff --git a/meson.build b/meson.build index 6a5e7254ed..94b092ce4f 100644 --- a/meson.build +++ b/meson.build @@ -250,6 +250,7 @@ iokit = [] emulator_link_args = [] nvmm =not_found hvf = not_found +host_dsosuf = '.so' if targetos == 'windows' socket = cc.find_library('ws2_32') winmm = cc.find_library('winmm') @@ -258,9 +259,11 @@ if targetos == 'windows' version_res = win.compile_resources('version.rc', depend_files: files('pc-bios/qemu-nsis.ico'), include_directories: include_directories('.')) + host_dsosuf = '.dll' elif targetos == 'darwin' coref = dependency('appleframeworks', modules: 'CoreFoundation') iokit = dependency('appleframeworks', modules: 'IOKit', required: false) + host_dsosuf = '.dylib' elif targetos == 'sunos' socket = [cc.find_library('socket'), cc.find_library('nsl'), @@ -1458,6 +1461,7 @@ config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0] config_host_data.set('QEMU_VERSION_MINOR', meson.project_version().split('.')[1]) config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2]) +config_host_data.set_quoted('CONFIG_HOST_DSOSUF', host_dsosuf) config_host_data.set('HAVE_HOST_BLOCK_DEVICE', have_host_block_device) # has_header @@ -1603,10 +1607,9 @@ config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles(''' return printf("%zu", SIZE_MAX); }''', args: ['-Werror'])) - ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target arrays = ['CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST'] -strings = ['HOST_DSOSUF', 'CONFIG_IASL'] +strings = ['CONFIG_IASL'] foreach k, v: config_host if ignored.contains(k) # do nothing @@ -1618,9 +1621,6 @@ foreach k, v: config_host elif k == 'ARCH' config_host_data.set('HOST_' + v.to_upper(), 1) elif strings.contains(k) - if not k.startswith('CONFIG_') - k = 'CONFIG_' + k.to_upper() - endif config_host_data.set_quoted(k, v) elif k.startswith('CONFIG_') or k.startswith('HAVE_') or k.startswith('HOST_') config_host_data.set(k, v == 'y' ? 1 : v) From patchwork Thu Oct 14 16:29:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541030 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=WLg7jqoG; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVZwm14n9z9s0r for ; Fri, 15 Oct 2021 03:43:50 +1100 (AEDT) Received: from localhost ([::1]:54060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3pb-0001cG-Q7 for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:43:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34760) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3cA-0003dM-55 for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:54 -0400 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]:45851) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3c8-0000du-JP for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:53 -0400 Received: by mail-ed1-x52a.google.com with SMTP id r18so26590410edv.12 for ; Thu, 14 Oct 2021 09:29:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3AJ7J9pjFiYD04BWEyd16opDsWTc8+PpWplGqhXdlSY=; b=WLg7jqoGK5dStuxZy6WOdYcebUGrs1gs9430c6/EWnfXJLgttNh1T3+bGC9OXElVuj FhQ08ZPxIverqM7vIy90YnJoEJ26H/WjhjZoBpPYaYqnaS+z6SshXYWjAFtwmBo07a7j wiB4g7KEVwKFYKZv3sBmhCoPn5REMoEXjfvvMsAad716BGjkEkPpqtUiX3jYYXAXdlyo BVjRd3JDgt4UA8veK+lLjfZf6EsJx5oYR6n8ITbAyVV00iQ8wW9V7iAYaFSDqPiGOMuP ptGeUB6r44ZFTm7bcjSLvG2qzHSKNUzPHKOMQqaeVrfv7mzyAKzwiOvqMQDp+w696xk7 kLAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=3AJ7J9pjFiYD04BWEyd16opDsWTc8+PpWplGqhXdlSY=; b=zFdB2inaDBPc562ZTBrMDzQmtG12Hxp+kdaMe5vR3u1EnS7OsLMplid7LbI+7SOv34 MVPIJ1zw3hPzSNBSs2zOeht1i/DJ8fUUwIq7i0KB61sk2A88UlXRb2h+xR2mZaGzwID2 xQuPamWE3e71NPW3tVTBFWRh3Z0AdeHon2vvB4gqbsCFFJBBVy/4ostKLiiFmT8TUm4p ksfetxzB554K3oIg+kvNSLVEOVJ/hhe8y3NUe82IpTnO3ZEoUFSFe/TTW3IcXhfjDNBD U4jWdFRk0NOwyVGZDALl2TgP4sgvqNxaGUf4CzvLxcS0XZbJljymEjnh/ngPCXZndF7I KPNQ== X-Gm-Message-State: AOAM533WiJLYhnFvOrvdg4qwQGW3HcAbwQj7CG5rM1joD2Va6JSPLqVX SM4ZJXICmU15A8/VbwFr4LwwywihREA= X-Google-Smtp-Source: ABdhPJzfDbHMg5ZxUOAizHtUsfwIUpRIP3Yf/qPCAhor+STfQ46uOAmNLUYbSoz5cWHqL58q06yxMA== X-Received: by 2002:a50:cf4c:: with SMTP id d12mr9737851edk.115.1634228990796; Thu, 14 Oct 2021 09:29:50 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.29.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:29:50 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 11/26] configure, meson: get HOST_WORDS_BIGENDIAN via the machine object Date: Thu, 14 Oct 2021 18:29:23 +0200 Message-Id: <20211014162938.430211-12-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52a.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" No need to pass it in config-host.mak. Reviewed-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211007130829.632254-6-pbonzini@redhat.com> Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- configure | 4 ---- meson.build | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/configure b/configure index a5411c834d..648ba09f70 100755 --- a/configure +++ b/configure @@ -347,7 +347,6 @@ tsan="no" fortify_source="$default_feature" strip_opt="yes" tcg_interpreter="false" -bigendian="no" mingw32="no" gcov="no" EXESUF="" @@ -4264,9 +4263,6 @@ fi if test "$strip_opt" = "yes" ; then echo "STRIP=${strip}" >> $config_host_mak fi -if test "$bigendian" = "yes" ; then - echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak -fi if test "$mingw32" = "yes" ; then echo "CONFIG_WIN32=y" >> $config_host_mak if test "$guest_agent_with_vss" = "yes" ; then diff --git a/meson.build b/meson.build index 94b092ce4f..5c3823d143 100644 --- a/meson.build +++ b/meson.build @@ -1463,6 +1463,7 @@ config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2] config_host_data.set_quoted('CONFIG_HOST_DSOSUF', host_dsosuf) config_host_data.set('HAVE_HOST_BLOCK_DEVICE', have_host_block_device) +config_host_data.set('HOST_WORDS_BIGENDIAN', host_machine.endian() == 'big') # has_header config_host_data.set('CONFIG_EPOLL', cc.has_header('sys/epoll.h')) @@ -1622,7 +1623,7 @@ foreach k, v: config_host config_host_data.set('HOST_' + v.to_upper(), 1) elif strings.contains(k) config_host_data.set_quoted(k, v) - elif k.startswith('CONFIG_') or k.startswith('HAVE_') or k.startswith('HOST_') + elif k.startswith('CONFIG_') or k.startswith('HAVE_') config_host_data.set(k, v == 'y' ? 1 : v) endif endforeach From patchwork Thu Oct 14 16:29:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541021 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=MciX2ZTN; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVZtc0kSHz9s0r for ; Fri, 15 Oct 2021 03:42:00 +1100 (AEDT) Received: from localhost ([::1]:46106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3np-0004Tq-Qm for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:41:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3cA-0003dZ-7O for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:54 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]:40707) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3c8-0000dy-LG for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:53 -0400 Received: by mail-ed1-x529.google.com with SMTP id g8so26693263edt.7 for ; Thu, 14 Oct 2021 09:29:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gsm23bgs7Pj7klX00892e7fbNkblmLvDLJsh6ZqSJ/M=; b=MciX2ZTNrt8mdMqpnMLDnNCmkf8pFdyt/5IuOSdSA8K7VcM5pnTD4aMlCWLjtaXMwe 0m/vMJXJZXSxDfWw0DieFX05hcCNSRUQ7v0ptLorm0O39w5m4tFDEG597R/EnsP3Oq7i bVg2pl7xgm1zfDtELqjQS0U0Dl2Rsm5X98NoqI6Kh2sSPnGWoI90Xf/PHXnNKVDPO8xz GB6LXxI9qek7zB6zx3+P+MF6/LcNuNgz5iY6XMkGbGnRRu/epdWD6wpBNc2BvdspnZs5 W1MFbO27dF5gHOJpisCVnbGQ58z6iQXyX4Ux7XqdNlljivRqbm/4FuIutxPwzhsxafPE sPmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=gsm23bgs7Pj7klX00892e7fbNkblmLvDLJsh6ZqSJ/M=; b=lTDyuxWKazpYw067YUNXkwfqgs27MHrapHPvC9j0WgU43n78H2GfTWbWbEygiM9tIv FJaofJeGmy5NT3FyPYwCtJZ6haIJYyJXUrQSTxgE+HLbhViCccex9jxK3T0AmWs1hFNR qlcrQmOmPFUQ7Hhun31lW2Hez4Ks1/aZafUrXngAoRpnoGWHlByt3mT3kDNQVo7cAsL1 YqTm9IP0kXPNvB60WZ/733mZcoC0nogcjjrcjXqw1Q+Sov2T9O79/kvozLps5JR8fDQM jCww3Edi4kflZIE5wdCPIJ9yr634TkPl8KcwmndlvazUJzIyYzmuMv7CKWhdUu4t1Uzr 5O2Q== X-Gm-Message-State: AOAM5317IEZcYt5uxM50Vj4LFilsVnaIVd4yGTLQjjroTd+hDGadMrj5 WTz9mrP3rnQvFss/zVWs18eMR+ph6Dc= X-Google-Smtp-Source: ABdhPJz0AXnVaw0ZuPH8rxQ+ia30TW34iHynUy0FGVRvoUFY/2yfYBl8lNzfhUXfbWGyD2chRi2pAQ== X-Received: by 2002:a17:906:eda6:: with SMTP id sa6mr4819874ejb.443.1634228991408; Thu, 14 Oct 2021 09:29:51 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.29.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:29:51 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 12/26] configure, meson: remove CONFIG_GCOV from config-host.mak Date: Thu, 14 Oct 2021 18:29:24 +0200 Message-Id: <20211014162938.430211-13-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x529.google.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Marc-André Lureau Message-Id: <20211007130829.632254-7-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 3 --- meson.build | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/configure b/configure index 648ba09f70..6efea3cfc6 100755 --- a/configure +++ b/configure @@ -4630,9 +4630,6 @@ echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak echo "EXESUF=$EXESUF" >> $config_host_mak echo "LIBS_QGA=$libs_qga" >> $config_host_mak -if test "$gcov" = "yes" ; then - echo "CONFIG_GCOV=y" >> $config_host_mak -fi if test "$rng_none" = "yes"; then echo "CONFIG_RNG_NONE=y" >> $config_host_mak diff --git a/meson.build b/meson.build index 5c3823d143..ff19d54fc6 100644 --- a/meson.build +++ b/meson.build @@ -1402,6 +1402,7 @@ config_host_data.set('CONFIG_ATTR', libattr.found()) config_host_data.set('CONFIG_BRLAPI', brlapi.found()) config_host_data.set('CONFIG_COCOA', cocoa.found()) config_host_data.set('CONFIG_FUZZ', get_option('fuzzing')) +config_host_data.set('CONFIG_GCOV', get_option('b_coverage')) config_host_data.set('CONFIG_LIBUDEV', libudev.found()) config_host_data.set('CONFIG_LZO', lzo.found()) config_host_data.set('CONFIG_MPATH', mpathpersist.found()) From patchwork Thu Oct 14 16:29:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541016 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=PLGJCZj0; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVZq13V8Sz9s0r for ; Fri, 15 Oct 2021 03:38:53 +1100 (AEDT) Received: from localhost ([::1]:37594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3kp-0006yA-8k for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:38:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3cB-0003kF-V5 for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:55 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]:45857) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3cA-0000fl-DL for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:55 -0400 Received: by mail-ed1-x530.google.com with SMTP id r18so26590680edv.12 for ; Thu, 14 Oct 2021 09:29:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yKX+0RY9dKnvtMGdHrAusBKgI+02YSB+9Ufsypua5fU=; b=PLGJCZj01V5XxuTzz/WCKchSWQtp05HBQxxKP1eh603LDnLLAUjH7kTpLlBkkR5Pag uth0e0+oDzhrF4MV5xLAFub25BC5pnitIaa3I7v4Nead2F7LhwoqaGtZTGXkfLTAV4wm Bqx2cmsH4+5NwNt1lBdFm6K97P3+RImBgkpkdKRKZkHcwYsmZ79ceQmPQbUqM3esj2yu G52nFbM0a1Zt+uB8CIF+EuxHdursA9Q0ORucW97uHLmIiB74ilUO0WbV6wcJUyDlA84o 7acv6v7EgZcmV/zRWd0euGAD8+RnRPBEE9tkcCp783FPq1/2ICnc5vv6o0l31LS5/5XI HRaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=yKX+0RY9dKnvtMGdHrAusBKgI+02YSB+9Ufsypua5fU=; b=D6gWROmioeFw5VHfoYYWkFjyk2hRW5Rrmg2fetos0rZcIWEuO8yxXuLwgUYpSYSOc+ EWDdfpuWizr9xw8cFh/tutOlci/u9P/UxO3Qn8M3njg/IJEiQwlf57y+ZC3v+evM43D4 XYMRqmVMpF9z7VqMCkmK8t5JL4TszzmsZoHR6gWH/JyMGBewkG0qKrXI7Q/T7QwyHgpZ 6bfSsnstxNPyLrf6e9iV2AYBA3ezCbBAuXZ7Jekokjz0YjNlLVsi5eZsvXh6bc5Dpi25 QgXRkvLu+0nYfDs7YuuJHPz2e+JdCmR/1GyG55GuVWoANW49RRYsh8JV3xHSFYCLAihX zE6g== X-Gm-Message-State: AOAM531iDF//rYddK1vsRsYuZlse3/cAWLP1L3ZhH1qFQAWQ7tNcgz/w +ddaVDRucROjeuutba6zUI92UsszMI4= X-Google-Smtp-Source: ABdhPJwi4e/GLgvWPgdawypdUTWkDpiE2yRlmGVfjLOD2XDIetcrPaqxUOa2QzElBnMMSfCXyO/kGw== X-Received: by 2002:a05:6402:3488:: with SMTP id v8mr9676697edc.106.1634228991994; Thu, 14 Oct 2021 09:29:51 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.29.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:29:51 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 13/26] meson: HAVE_GDB_BIN is not used by C code Date: Thu, 14 Oct 2021 18:29:25 +0200 Message-Id: <20211014162938.430211-14-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x530.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It is only used by the TCG tests, remove it from config-host.h. Signed-off-by: Paolo Bonzini --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index ff19d54fc6..bdcedf2eef 100644 --- a/meson.build +++ b/meson.build @@ -1609,7 +1609,8 @@ config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles(''' return printf("%zu", SIZE_MAX); }''', args: ['-Werror'])) -ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target +ignored = ['CONFIG_QEMU_INTERP_PREFIX', # actually per-target + 'HAVE_GDB_BIN'] arrays = ['CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST'] strings = ['CONFIG_IASL'] foreach k, v: config_host From patchwork Thu Oct 14 16:29:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541032 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=WaJlV4lV; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVZwq1fRbz9s0r for ; Fri, 15 Oct 2021 03:43:55 +1100 (AEDT) Received: from localhost ([::1]:54452 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3ph-0001rl-0a for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:43:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34786) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3cB-0003jP-Nj for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:55 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]:43770) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3c9-0000f6-V0 for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:55 -0400 Received: by mail-ed1-x52b.google.com with SMTP id i20so25746014edj.10 for ; Thu, 14 Oct 2021 09:29:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ncrd4Iry7De5PP7WGyTpKaYN3ujrNzg5cS7gtoDsikk=; b=WaJlV4lVfgUHg4dhOVsvFGvUwM+7mkaPdCRWD/RddwgeJtNJXido/iYO3nl0InF0k0 E1aumPlMUlpnU2qxCQdcCaOBngyhwyA8x6P7eSHU8gNHycjIgfgGWvGS2TrtaeN85yXC gVQ1ZHiyFJXaTdfGr0OjX6Rh/4SOFuNOMipe5EDWKPEfNmO95D6CxqQRrh4saB8YdUq8 DkeUN+qekyVfLKlOYfyg7A1LuYc7EZmQ4Yh2noMr3kdRWEAbtPre4rd1Oc+IPiK5ZAU2 4oCFvT/vrn28WqmmnigTa3dTMUkYD4I8C/SW33KZdkmUMEuyjC2xUx2m161d5zar5ag7 H8AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ncrd4Iry7De5PP7WGyTpKaYN3ujrNzg5cS7gtoDsikk=; b=bs2LvET+bvzX0ZOZGx3gwKZSUnCpqsBpZy8xHCnxTLYji64qQt8mSSqIPnQwL8mzKo uY+MFrrV81Jbpu80TGj2e/pifXunTdA6nD239+VajJ8EUkRJS9z5TC5oRR2Gg3nPj72A +VI+dvBvhxZcpwsjaljZebEwtJV0u07U8gcLjmb6kTIi6u+/2HaxHjaASpNU8QO0b5xC 6xhH2bCQCyWSy+ZSpwvT19/7v2+dwTazstjPUHupbSZLAU5SGupkqxnGqKnqoSQJh/cw ZlgMVgkhdJ/4cxyNWZT9IARQXXkHVVf8/FBrBkBKUqwnWTMeFVyeQORILLATg0q+Xdyt k7ew== X-Gm-Message-State: AOAM5315le8b9BM2q7u85UXfLErDOkiGE8ovOFsopXQ1RWVANs3kShjX JMe0gdNPWS6ctKYLRO+qPDYT+e+15Kk= X-Google-Smtp-Source: ABdhPJxUeGauGg5dkTCWktpaKOJWpUVlRL9c5Vvs2vpE1ESKyJO371vMHOUs04l8/O3ZEALasnLJkA== X-Received: by 2002:a50:e183:: with SMTP id k3mr10223223edl.22.1634228992672; Thu, 14 Oct 2021 09:29:52 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.29.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:29:52 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 14/26] configure, meson: move remaining HAVE_* compiler tests to Meson Date: Thu, 14 Oct 2021 18:29:26 +0200 Message-Id: <20211014162938.430211-15-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52b.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Remove some special cases by moving them to Meson. Reviewed-by: Marc-André Lureau Message-Id: <20211007130829.632254-8-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 37 ------------------------------------- meson.build | 19 ++++++++++++++++++- 2 files changed, 18 insertions(+), 38 deletions(-) diff --git a/configure b/configure index 6efea3cfc6..e78f58978f 100755 --- a/configure +++ b/configure @@ -2403,18 +2403,6 @@ else l2tpv3=no fi -cat > $TMPC < -int main(int argc, char *argv[]) { - return mlockall(MCL_FUTURE); -} -EOF -if compile_prog "" "" ; then - have_mlockall=yes -else - have_mlockall=no -fi - ######################################### # vhost interdependencies and host support @@ -3842,21 +3830,6 @@ if test "$fortify_source" != "no"; then fi fi -########################################## -# check if struct fsxattr is available via linux/fs.h - -have_fsxattr=no -cat > $TMPC << EOF -#include -struct fsxattr foo; -int main(void) { - return 0; -} -EOF -if compile_prog "" "" ; then - have_fsxattr=yes -fi - ########################################## # check for usable membarrier system call if test "$membarrier" = "yes"; then @@ -4358,13 +4331,6 @@ if test "$gdbus_codegen" != "" ; then fi echo "CONFIG_TLS_PRIORITY=\"$tls_priority\"" >> $config_host_mak -# Work around a system header bug with some kernel/XFS header -# versions where they both try to define 'struct fsxattr': -# xfs headers will not try to redefine structs from linux headers -# if this macro is set. -if test "$have_fsxattr" = "yes" ; then - echo "HAVE_FSXATTR=y" >> $config_host_mak -fi if test "$xen" = "enabled" ; then echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak @@ -4569,9 +4535,6 @@ fi if test "$parallels" = "yes" ; then echo "CONFIG_PARALLELS=y" >> $config_host_mak fi -if test "$have_mlockall" = "yes" ; then - echo "HAVE_MLOCKALL=y" >> $config_host_mak -fi if test "$plugins" = "yes" ; then echo "CONFIG_PLUGIN=y" >> $config_host_mak diff --git a/meson.build b/meson.build index bdcedf2eef..e8e728bf72 100644 --- a/meson.build +++ b/meson.build @@ -1601,6 +1601,23 @@ config_host_data.set('CONFIG_SPLICE', cc.links(gnu_source_prefix + ''' return 0; }''')) +config_host_data.set('HAVE_MLOCKALL', cc.links(gnu_source_prefix + ''' + #include + int main(int argc, char *argv[]) { + return mlockall(MCL_FUTURE); + }''')) + +# Work around a system header bug with some kernel/XFS header +# versions where they both try to define 'struct fsxattr': +# xfs headers will not try to redefine structs from linux headers +# if this macro is set. +config_host_data.set('HAVE_FSXATTR', cc.links(''' + #include ' + struct fsxattr foo; + int main(void) { + return 0; + }''')) + # Some versions of Mac OS X incorrectly define SIZE_MAX config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles(''' #include @@ -1625,7 +1642,7 @@ foreach k, v: config_host config_host_data.set('HOST_' + v.to_upper(), 1) elif strings.contains(k) config_host_data.set_quoted(k, v) - elif k.startswith('CONFIG_') or k.startswith('HAVE_') + elif k.startswith('CONFIG_') config_host_data.set(k, v == 'y' ? 1 : v) endif endforeach From patchwork Thu Oct 14 16:29:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541018 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=UDdQQAac; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVZr66xzlz9s0r for ; Fri, 15 Oct 2021 03:39:50 +1100 (AEDT) Received: from localhost ([::1]:40982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3lj-0000zH-7y for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:39:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3cF-0003q0-Sv for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:01 -0400 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]:45863) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3cB-0000gf-Dc for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:57 -0400 Received: by mail-ed1-x536.google.com with SMTP id r18so26590896edv.12 for ; Thu, 14 Oct 2021 09:29:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cRGcDab/7KtkOV2wgwRktDP6rJietk9FxZXpo7LUmyw=; b=UDdQQAacKdRJKCoenb8CsxE2xuWk86oTuRDwVoV4C2i5moQ1lYionSBoWUpHEQDoaY M06SafZrjK2KIZQRpGGNaz3NoSvIXnl7LEslTkMrG5Y9ONtoTy3YrbvrUTNf0MAXh7ss mq8O01oxhpJwGVW+qZQVlRvBXz1GfBL+P4CpdtGF9ImX3ZFR+IjYTofapST1k/YMWE9B nra2ddznDjzPU2KVXEENWPm6uuXCO+ZSqvfsMRvfcJ1mV0+flCadlCyFgl/wEYZEzICY qEuJuz0Q5OrzijNM2sRR6EWFfCyB1OiqFa9M5YfcdXLfObq9lQND7dvyFGfmTA1VCdkN qywg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=cRGcDab/7KtkOV2wgwRktDP6rJietk9FxZXpo7LUmyw=; b=cwvOApC9plebMMc++ORYaXcrx9Qld7YE4tJSfe4ojmxDPBmjWlsLU4kMpMoGJtifAu IBIMIpVMpfXss6smZNEO2Khupb0tZawZEWuDGFuNc1LLtUcigNM28WhQJvrroRrX2Htp G0bj+i+ibufpMb0BKhO0ars1fDTgCfWiddSZUS385jtEYjNEG4uoZkC+LdwrFxc+YmOF MPOINhTOZ0z+6QEjlTETEe5eSgWf6OAy3h1AVSGDk3R7FY6wa9e9AAAZ7/VRf5FolGdr Ny3PfvNthgZGMWrB+YU3iEAfADTtaxjIuvS1R1ma3qaLQrl2b29UFa/Lq6j5S0npWUri wfkg== X-Gm-Message-State: AOAM5317DVdMb/R6UNIbu2PgTJvESarCK5WTP1tfFgwRL/n4RXM8ZZ+d sdFhHnI36nE4gJSNRa73dvraBA5QdAY= X-Google-Smtp-Source: ABdhPJzDAFTWSiKIrK1lga63DZpDBOxlgbtBBSjJaP6O8BwDgObMYNE5wE2fi+TQrs1DfL2/f1Igcw== X-Received: by 2002:a17:906:1bb1:: with SMTP id r17mr4800155ejg.533.1634228993322; Thu, 14 Oct 2021 09:29:53 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.29.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:29:53 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 15/26] configure, meson: move pthread_setname_np checks to Meson Date: Thu, 14 Oct 2021 18:29:27 +0200 Message-Id: <20211014162938.430211-16-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x536.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This makes the pthreads check dead in configure, so remove it as well. Reviewed-by: Marc-André Lureau Message-Id: <20211007130829.632254-9-pbonzini@redhat.com> Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- configure | 78 ---------------------------------------- meson.build | 23 ++++++++++++ util/qemu-thread-posix.c | 5 ++- 3 files changed, 25 insertions(+), 81 deletions(-) diff --git a/configure b/configure index e78f58978f..c7e95e59cc 100755 --- a/configure +++ b/configure @@ -3148,71 +3148,6 @@ if test "$modules" = yes; then fi fi -########################################## -# pthread probe -PTHREADLIBS_LIST="-pthread -lpthread -lpthreadGC2" - -pthread=no -cat > $TMPC << EOF -#include -static void *f(void *p) { return NULL; } -int main(void) { - pthread_t thread; - pthread_create(&thread, 0, f, 0); - return 0; -} -EOF -if compile_prog "" "" ; then - pthread=yes -else - for pthread_lib in $PTHREADLIBS_LIST; do - if compile_prog "" "$pthread_lib" ; then - pthread=yes - break - fi - done -fi - -if test "$mingw32" != yes && test "$pthread" = no; then - error_exit "pthread check failed" \ - "Make sure to have the pthread libs and headers installed." -fi - -# check for pthread_setname_np with thread id -pthread_setname_np_w_tid=no -cat > $TMPC << EOF -#include - -static void *f(void *p) { return NULL; } -int main(void) -{ - pthread_t thread; - pthread_create(&thread, 0, f, 0); - pthread_setname_np(thread, "QEMU"); - return 0; -} -EOF -if compile_prog "" "$pthread_lib" ; then - pthread_setname_np_w_tid=yes -fi - -# check for pthread_setname_np without thread id -pthread_setname_np_wo_tid=no -cat > $TMPC << EOF -#include - -static void *f(void *p) { pthread_setname_np("QEMU"); return NULL; } -int main(void) -{ - pthread_t thread; - pthread_create(&thread, 0, f, 0); - return 0; -} -EOF -if compile_prog "" "$pthread_lib" ; then - pthread_setname_np_wo_tid=yes -fi - ########################################## # libssh probe if test "$libssh" != "no" ; then @@ -4498,19 +4433,6 @@ if test "$debug_mutex" = "yes" ; then echo "CONFIG_DEBUG_MUTEX=y" >> $config_host_mak fi -# Hold two types of flag: -# CONFIG_THREAD_SETNAME_BYTHREAD - we've got a way of setting the name on -# a thread we have a handle to -# CONFIG_PTHREAD_SETNAME_NP_W_TID - A way of doing it on a particular -# platform -if test "$pthread_setname_np_w_tid" = "yes" ; then - echo "CONFIG_THREAD_SETNAME_BYTHREAD=y" >> $config_host_mak - echo "CONFIG_PTHREAD_SETNAME_NP_W_TID=y" >> $config_host_mak -elif test "$pthread_setname_np_wo_tid" = "yes" ; then - echo "CONFIG_THREAD_SETNAME_BYTHREAD=y" >> $config_host_mak - echo "CONFIG_PTHREAD_SETNAME_NP_WO_TID=y" >> $config_host_mak -fi - if test "$bochs" = "yes" ; then echo "CONFIG_BOCHS=y" >> $config_host_mak fi diff --git a/meson.build b/meson.build index e8e728bf72..26fc4e5792 100644 --- a/meson.build +++ b/meson.build @@ -1584,6 +1584,29 @@ config_host_data.set('CONFIG_POSIX_MADVISE', cc.links(gnu_source_prefix + ''' #include #include int main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); }''')) + +config_host_data.set('CONFIG_PTHREAD_SETNAME_NP_W_TID', cc.links(''' + #include + + static void *f(void *p) { return NULL; } + int main(void) + { + pthread_t thread; + pthread_create(&thread, 0, f, 0); + pthread_setname_np(thread, "QEMU"); + return 0; + }''', dependencies: threads)) +config_host_data.set('CONFIG_PTHREAD_SETNAME_NP_WO_TID', cc.links(''' + #include + + static void *f(void *p) { pthread_setname_np("QEMU"); return NULL; } + int main(void) + { + pthread_t thread; + pthread_create(&thread, 0, f, 0); + return 0; + }''', dependencies: threads)) + config_host_data.set('CONFIG_SIGNALFD', cc.links(gnu_source_prefix + ''' #include #include diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c index 6c5004220d..e1225b63bd 100644 --- a/util/qemu-thread-posix.c +++ b/util/qemu-thread-posix.c @@ -23,7 +23,8 @@ void qemu_thread_naming(bool enable) { name_threads = enable; -#ifndef CONFIG_THREAD_SETNAME_BYTHREAD +#if !defined CONFIG_PTHREAD_SETNAME_NP_W_TID && \ + !defined CONFIG_PTHREAD_SETNAME_NP_WO_TID /* This is a debugging option, not fatal */ if (enable) { fprintf(stderr, "qemu: thread naming not supported on this host\n"); @@ -522,7 +523,6 @@ static void *qemu_thread_start(void *args) void *arg = qemu_thread_args->arg; void *r; -#ifdef CONFIG_THREAD_SETNAME_BYTHREAD /* Attempt to set the threads name; note that this is for debug, so * we're not going to fail if we can't set it. */ @@ -533,7 +533,6 @@ static void *qemu_thread_start(void *args) pthread_setname_np(qemu_thread_args->name); # endif } -#endif QEMU_TSAN_ANNOTATE_THREAD_NAME(qemu_thread_args->name); g_free(qemu_thread_args->name); g_free(qemu_thread_args); From patchwork Thu Oct 14 16:29:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541035 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=HMpiNSGU; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVb135LxBz9s0r for ; Fri, 15 Oct 2021 03:47:35 +1100 (AEDT) Received: from localhost ([::1]:34684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3tF-0007ex-Gs for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:47:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3cF-0003pz-Sx for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:01 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]:41755) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3cB-0000gg-9F for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:29:57 -0400 Received: by mail-ed1-x52b.google.com with SMTP id a25so26570633edx.8 for ; Thu, 14 Oct 2021 09:29:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a2ANbA6kY7zPaL6M2knILxN8hhl5/cMV32lk1V0axWM=; b=HMpiNSGUSOFmV5vcEHkZZWAePz6Dnj1Ae6AEMwbZZm10qgC8jfI2ayYhtIvjhpqB4C 87dyObd6rLXarlI0ZyykolTDPwKfm7/3tJ70HakoI94EmuReuMIm+6Dxsx9qS9vETUUK zZAhA7SKYRPEcL/nXqMhISNqs5qm6ocYvzJKSMXWvjQv0hX1sLCaLrU+/8Jk2DAqapxq GQ8Vhh4763/y/7HbqfFwWjjEMHHtfc5yd++8gTcBylTm9d1ukNCyGwKzdNpB545ZVS3y vL++u6X6StZtm/P/AV5X54A62daCm9+t0bhNsZrK7EJY+Qi6WTLHei5sCDXXSx9aqrIo dAfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=a2ANbA6kY7zPaL6M2knILxN8hhl5/cMV32lk1V0axWM=; b=cMIsNIyTlcNa2elNzUyIq1oZpn+Oj9rda/52LlsUf+jlLjJSa1Ar4Bj3AXHjnjN5aL wjMlTxZZOkcbPu17dfbiKlMALUJBa3oLpcYyxoJuUbWWf/1zRRjJhNQE/+rTKITW5LQv J5MIVn1wjB0htWcX01WXw4HV/l9AwRhDa+4Qiq7HYBEcpyvW93/kF/UrS1qTLuvwZ1G4 b87XnZwUwix8U+xvjw8TnVUmFHZd687LAXq2R/pWs4lZHc6Wv/hBl8/C7GdZ8kl8B6zK FHlsHxtSl+ps0a1v/hSlOMw5frEvXzSJ3YRiqm6LT9IAJ6YsmsPzl2yynOE5RSEtQV2x ukIw== X-Gm-Message-State: AOAM530iIrwYEJO/AideLtJoSGT9x+8n2r7pbXO63to+FJFHDnB9H/E0 S9EhlpY5uW3ta6n1eXYhh73MbDFkSco= X-Google-Smtp-Source: ABdhPJxYbjHZSW3VIEE7jZ3vFW+aWV6YflGqRA9USphncdngWSf4sg58JbihpgA+9jYDvAVP1scZ3A== X-Received: by 2002:a05:6402:d5a:: with SMTP id ec26mr10182890edb.364.1634228993943; Thu, 14 Oct 2021 09:29:53 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.29.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:29:53 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 16/26] configure, meson: move libaio check to meson.build Date: Thu, 14 Oct 2021 18:29:28 +0200 Message-Id: <20211014162938.430211-17-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52b.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Message-Id: <20211007130829.632254-10-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- block/meson.build | 2 +- configure | 31 ++++--------------------------- meson.build | 10 ++++++++-- meson_options.txt | 2 ++ stubs/meson.build | 4 +++- 5 files changed, 18 insertions(+), 31 deletions(-) diff --git a/block/meson.build b/block/meson.build index 66ee11e62c..deb73ca389 100644 --- a/block/meson.build +++ b/block/meson.build @@ -65,7 +65,7 @@ block_ss.add(when: 'CONFIG_POSIX', if_true: [files('file-posix.c'), coref, iokit block_ss.add(when: libiscsi, if_true: files('iscsi-opts.c')) block_ss.add(when: 'CONFIG_LINUX', if_true: files('nvme.c')) block_ss.add(when: 'CONFIG_REPLICATION', if_true: files('replication.c')) -block_ss.add(when: ['CONFIG_LINUX_AIO', libaio], if_true: files('linux-aio.c')) +block_ss.add(when: libaio, if_true: files('linux-aio.c')) block_ss.add(when: linux_io_uring, if_true: files('io_uring.c')) block_modules = {} diff --git a/configure b/configure index c7e95e59cc..670d82847f 100755 --- a/configure +++ b/configure @@ -315,7 +315,7 @@ pa="auto" xen=${default_feature:+disabled} xen_ctrl_version="$default_feature" xen_pci_passthrough="auto" -linux_aio="$default_feature" +linux_aio="auto" linux_io_uring="auto" cap_ng="auto" attr="auto" @@ -1196,9 +1196,9 @@ for opt do ;; --enable-fdt=system) fdt="system" ;; - --disable-linux-aio) linux_aio="no" + --disable-linux-aio) linux_aio="disabled" ;; - --enable-linux-aio) linux_aio="yes" + --enable-linux-aio) linux_aio="enabled" ;; --disable-linux-io-uring) linux_io_uring="disabled" ;; @@ -3163,26 +3163,6 @@ if test "$libssh" != "no" ; then fi fi -########################################## -# linux-aio probe - -if test "$linux_aio" != "no" ; then - cat > $TMPC < -#include -#include -int main(void) { io_setup(0, NULL); io_set_eventfd(NULL, 0); eventfd(0, 0); return 0; } -EOF - if compile_prog "" "-laio" ; then - linux_aio=yes - else - if test "$linux_aio" = "yes" ; then - feature_not_found "linux AIO" "Install libaio devel" - fi - linux_aio=no - fi -fi - ########################################## # TPM emulation is only on POSIX @@ -4272,9 +4252,6 @@ if test "$xen" = "enabled" ; then echo "XEN_CFLAGS=$xen_cflags" >> $config_host_mak echo "XEN_LIBS=$xen_libs" >> $config_host_mak fi -if test "$linux_aio" = "yes" ; then - echo "CONFIG_LINUX_AIO=y" >> $config_host_mak -fi if test "$vhost_scsi" = "yes" ; then echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak fi @@ -4774,7 +4751,7 @@ if test "$skip_meson" = no; then $(if test "$default_feature" = no; then echo "-Dauto_features=disabled"; fi) \ -Dalsa=$alsa -Dcoreaudio=$coreaudio -Ddsound=$dsound -Djack=$jack -Doss=$oss \ -Dpa=$pa -Daudio_drv_list=$audio_drv_list -Dtcg_interpreter=$tcg_interpreter \ - -Dtrace_backends=$trace_backends -Dtrace_file=$trace_file \ + -Dtrace_backends=$trace_backends -Dtrace_file=$trace_file -Dlinux_aio=$linux_aio \ $cross_arg \ "$PWD" "$source_path" diff --git a/meson.build b/meson.build index 26fc4e5792..0ecb220af1 100644 --- a/meson.build +++ b/meson.build @@ -400,9 +400,14 @@ if have_system or have_tools pixman = dependency('pixman-1', required: have_system, version:'>=0.21.8', method: 'pkg-config', kwargs: static_kwargs) endif -libaio = cc.find_library('aio', required: false) zlib = dependency('zlib', required: true, kwargs: static_kwargs) +libaio = not_found +if not get_option('linux_aio').auto() or have_block + libaio = cc.find_library('aio', has_headers: ['libaio.h'], + required: get_option('linux_aio'), + kwargs: static_kwargs) +endif linux_io_uring = not_found if not get_option('linux_io_uring').auto() or have_block linux_io_uring = dependency('liburing', required: get_option('linux_io_uring'), @@ -1427,6 +1432,7 @@ config_host_data.set('CONFIG_EBPF', libbpf.found()) config_host_data.set('CONFIG_LIBDAXCTL', libdaxctl.found()) config_host_data.set('CONFIG_LIBISCSI', libiscsi.found()) config_host_data.set('CONFIG_LIBNFS', libnfs.found()) +config_host_data.set('CONFIG_LINUX_AIO', libaio.found()) config_host_data.set('CONFIG_LINUX_IO_URING', linux_io_uring.found()) config_host_data.set('CONFIG_LIBPMEM', libpmem.found()) config_host_data.set('CONFIG_RBD', rbd.found()) @@ -3286,7 +3292,7 @@ summary_info += {'JACK support': jack} summary_info += {'brlapi support': brlapi} summary_info += {'vde support': config_host.has_key('CONFIG_VDE')} summary_info += {'netmap support': config_host.has_key('CONFIG_NETMAP')} -summary_info += {'Linux AIO support': config_host.has_key('CONFIG_LINUX_AIO')} +summary_info += {'Linux AIO support': libaio} summary_info += {'Linux io_uring support': linux_io_uring} summary_info += {'ATTR/XATTR support': libattr} summary_info += {'RDMA support': config_host.has_key('CONFIG_RDMA')} diff --git a/meson_options.txt b/meson_options.txt index 8f9c3b5b17..904e15d54c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -103,6 +103,8 @@ option('libusb', type : 'feature', value : 'auto', description: 'libusb support for USB passthrough') option('libxml2', type : 'feature', value : 'auto', description: 'libxml2 support for Parallels image format') +option('linux_aio', type : 'feature', value : 'auto', + description: 'Linux AIO support') option('linux_io_uring', type : 'feature', value : 'auto', description: 'Linux io_uring support') option('lzfse', type : 'feature', value : 'auto', diff --git a/stubs/meson.build b/stubs/meson.build index beee31ec73..f6aa3aa94f 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -20,7 +20,9 @@ endif stub_ss.add(files('iothread-lock.c')) stub_ss.add(files('isa-bus.c')) stub_ss.add(files('is-daemonized.c')) -stub_ss.add(when: 'CONFIG_LINUX_AIO', if_true: files('linux-aio.c')) +if libaio.found() + stub_ss.add(files('linux-aio.c')) +endif stub_ss.add(files('migr-blocker.c')) stub_ss.add(files('module-opts.c')) stub_ss.add(files('monitor.c')) From patchwork Thu Oct 14 16:29:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541020 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=pbk5XRu1; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVZtX6Cl1z9s0r for ; Fri, 15 Oct 2021 03:41:56 +1100 (AEDT) Received: from localhost ([::1]:45758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3nm-0004EM-JF for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:41:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3cH-0003rZ-Qc for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:03 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]:38788) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3cF-0000iv-K6 for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:01 -0400 Received: by mail-ed1-x529.google.com with SMTP id d9so26306400edh.5 for ; Thu, 14 Oct 2021 09:29:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=M4D1LP+sxameie6INBr225kvbwxVf9TySz5pgxyOzGo=; b=pbk5XRu13SoOn8Meb/BdGSs6BvEIUB733sMuzUjAqvGYdAtv70pEPsHtXs/YZqGd7/ NvsLd4vzmMy5cdPSflFrXixTlD5sMOm4LtgnZmfgFYYnzzN3XyZV3zX4WharwLY6J5zO K+BVsmEoFV/OcgsKlFRnFSST/Kyk9q3jfFrXIeEGFRk6NOt9d3YCMlHmfnnrJlbDEFhz fU2YcC3m5dpMHIU5UZzTCBTVoKDYEd1l8UxyRvFF9V9tYev8qe1EuSeIAQf0eGrmef7q nBCKkd+CE3nt7pfM7Qev8i2uXyrM4R15KUzujkKS+SWze7Rg3aD/d7LS2Q35ZDVn51ZQ Ry5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=M4D1LP+sxameie6INBr225kvbwxVf9TySz5pgxyOzGo=; b=PCtw1cGtnP5nZF49m3qUvVxx0AL+g0Nx/Ufj/ys71HY7FpKKk8oH0uaKTe2hpprjQy KxcQvCGLv5TQWYts2LdnITxQTm3Y/NTCo9Q0h0PSc/KMK/0T0Q7CLx9rHv2UycIIEwkm 3RSwWNOu9+/ZupJyOQmJtzlB/lUXgqIZw6DVWG2HPwJZHelDDQrVK7P5LD5iAa8jkvXj +fp299nxOLLw9oYjQP/TDH/xnmO54Hs/xqgbX3qOaCDiKLh3WOoPnycvH/Aoh0a6g5G1 S92Asdv/RAcOXiy5CEzTCqm80vD1GzOpbkn2SsLDW0+a2YzauTw5PA8VYq6n2GmVmule D0BA== X-Gm-Message-State: AOAM533LRA8dBWr4c4z9/ijRLefxx9UYV3yrnpRAg9UGxgtAN/vgIpjc dW2J59QsAU91OilRbWsv5Ehq/2O5Wg0= X-Google-Smtp-Source: ABdhPJx/r2G9MiQ0MTXjuhp2ABD/PwIpYs/9OFKSVqFMbLYY80UACC5Q8rYSXN5/tkb/su6PePZEqA== X-Received: by 2002:a05:6402:5113:: with SMTP id m19mr10018671edd.231.1634228996506; Thu, 14 Oct 2021 09:29:56 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.29.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:29:56 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 17/26] configure, meson: move vde detection to meson Date: Thu, 14 Oct 2021 18:29:29 +0200 Message-Id: <20211014162938.430211-18-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x529.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Marc-André Lureau Message-Id: <20211007130829.632254-11-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 35 ++++------------------------------- meson.build | 26 +++++++++++++++++++++++--- meson_options.txt | 2 ++ net/meson.build | 2 +- 4 files changed, 30 insertions(+), 35 deletions(-) diff --git a/configure b/configure index 670d82847f..0c077f3f5e 100755 --- a/configure +++ b/configure @@ -301,7 +301,7 @@ libudev="auto" mpath="auto" vnc="auto" sparse="auto" -vde="$default_feature" +vde="auto" vnc_sasl="auto" vnc_jpeg="auto" vnc_png="auto" @@ -1022,9 +1022,9 @@ for opt do ;; --enable-slirp=system) slirp="system" ;; - --disable-vde) vde="no" + --disable-vde) vde="disabled" ;; - --enable-vde) vde="yes" + --enable-vde) vde="enabled" ;; --disable-netmap) netmap="no" ;; @@ -2903,30 +2903,6 @@ EOF fi fi -########################################## -# vde libraries probe -if test "$vde" != "no" ; then - vde_libs="-lvdeplug" - cat > $TMPC << EOF -#include -int main(void) -{ - struct vde_open_args a = {0, 0, 0}; - char s[] = ""; - vde_open(s, s, &a); - return 0; -} -EOF - if compile_prog "" "$vde_libs" ; then - vde=yes - else - if test "$vde" = "yes" ; then - feature_not_found "vde" "Install vde (Virtual Distributed Ethernet) devel" - fi - vde=no - fi -fi - ########################################## # netmap support probe # Apart from looking for netmap headers, we make sure that the host API version @@ -4199,10 +4175,6 @@ if test "$slirp_smbd" = "yes" ; then echo "CONFIG_SLIRP_SMBD=y" >> $config_host_mak echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak fi -if test "$vde" = "yes" ; then - echo "CONFIG_VDE=y" >> $config_host_mak - echo "VDE_LIBS=$vde_libs" >> $config_host_mak -fi if test "$netmap" = "yes" ; then echo "CONFIG_NETMAP=y" >> $config_host_mak fi @@ -4752,6 +4724,7 @@ if test "$skip_meson" = no; then -Dalsa=$alsa -Dcoreaudio=$coreaudio -Ddsound=$dsound -Djack=$jack -Doss=$oss \ -Dpa=$pa -Daudio_drv_list=$audio_drv_list -Dtcg_interpreter=$tcg_interpreter \ -Dtrace_backends=$trace_backends -Dtrace_file=$trace_file -Dlinux_aio=$linux_aio \ + -Dvde=$vde \ $cross_arg \ "$PWD" "$source_path" diff --git a/meson.build b/meson.build index 0ecb220af1..0e948a8024 100644 --- a/meson.build +++ b/meson.build @@ -500,9 +500,28 @@ else xkbcommon = dependency('xkbcommon', required: get_option('xkbcommon'), method: 'pkg-config', kwargs: static_kwargs) endif + vde = not_found -if config_host.has_key('CONFIG_VDE') - vde = declare_dependency(link_args: config_host['VDE_LIBS'].split()) +if not get_option('vde').auto() or have_system or have_tools + vde = cc.find_library('vdeplug', has_headers: ['libvdeplug.h'], + required: get_option('vde'), + kwargs: static_kwargs) +endif +if vde.found() and not cc.links(''' + #include + int main(void) + { + struct vde_open_args a = {0, 0, 0}; + char s[] = ""; + vde_open(s, s, &a); + return 0; + }''', dependencies: vde) + vde = not_found + if get_option('cap_ng').enabled() + error('could not link libvdeplug') + else + warning('could not link libvdeplug, disabling') + endif endif pulse = not_found @@ -1441,6 +1460,7 @@ config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) config_host_data.set('CONFIG_SECCOMP', seccomp.found()) config_host_data.set('CONFIG_SNAPPY', snappy.found()) config_host_data.set('CONFIG_USB_LIBUSB', libusb.found()) +config_host_data.set('CONFIG_VDE', vde.found()) config_host_data.set('CONFIG_VHOST_USER_BLK_SERVER', have_vhost_user_blk_server) config_host_data.set('CONFIG_VNC', vnc.found()) config_host_data.set('CONFIG_VNC_JPEG', jpeg.found()) @@ -3290,7 +3310,7 @@ if targetos == 'linux' endif summary_info += {'JACK support': jack} summary_info += {'brlapi support': brlapi} -summary_info += {'vde support': config_host.has_key('CONFIG_VDE')} +summary_info += {'vde support': vde} summary_info += {'netmap support': config_host.has_key('CONFIG_NETMAP')} summary_info += {'Linux AIO support': libaio} summary_info += {'Linux io_uring support': linux_io_uring} diff --git a/meson_options.txt b/meson_options.txt index 904e15d54c..7d0fa1c7f4 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -129,6 +129,8 @@ option('u2f', type : 'feature', value : 'auto', description: 'U2F emulation support') option('usb_redir', type : 'feature', value : 'auto', description: 'libusbredir support') +option('vde', type : 'feature', value : 'auto', + description: 'vde network backend support') option('virglrenderer', type : 'feature', value : 'auto', description: 'virgl rendering support') option('vnc', type : 'feature', value : 'auto', diff --git a/net/meson.build b/net/meson.build index 1076b0a7ab..491144a697 100644 --- a/net/meson.build +++ b/net/meson.build @@ -20,7 +20,7 @@ softmmu_ss.add(when: 'CONFIG_TCG', if_true: files('filter-replay.c')) softmmu_ss.add(when: 'CONFIG_L2TPV3', if_true: files('l2tpv3.c')) softmmu_ss.add(when: slirp, if_true: files('slirp.c')) -softmmu_ss.add(when: ['CONFIG_VDE', vde], if_true: files('vde.c')) +softmmu_ss.add(when: vde, if_true: files('vde.c')) softmmu_ss.add(when: 'CONFIG_NETMAP', if_true: files('netmap.c')) vhost_user_ss = ss.source_set() vhost_user_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('vhost-user.c'), if_false: files('vhost-user-stub.c')) From patchwork Thu Oct 14 16:29:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541031 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=UlNIIFbH; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVZwn1ZDtz9sNH for ; Fri, 15 Oct 2021 03:43:53 +1100 (AEDT) Received: from localhost ([::1]:54128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3pf-0001er-0B for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:43:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3cH-0003ra-RJ for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:03 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]:38792) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3cF-0000jK-K9 for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:01 -0400 Received: by mail-ed1-x52d.google.com with SMTP id d9so26306550edh.5 for ; Thu, 14 Oct 2021 09:29:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XRSuK+bPtuorOXI6SqdpPSmiLRjrsDmQS3bDT+tnFWY=; b=UlNIIFbH5jSfBLKtpnPinDLK8NwOLr6HsYwfiijJ3VeCjiOg/vi+kLKufRPiCFh+Oe AMUR49R3pXJqoxAgpEIsLqj1gRB54bGoTolN7jH6OfH+y/8Xk1swOkdk1TkS0S7khbB+ IAsHMwmmulh7qq+/U67HbZMnaH0A+21dlfIysXkYb7K/DTev4t8eqWTtf9kvCMNft0kB j1F9J0bxZ3A9xSlGkQxwcS9k8nprUF6ZC6cevdULutHbCvaEZ6zi3fgzTKTTFV1nnqFA ZTDC2XIeCwOh5D7ZesKPy/haJ0al8j1LkY+dbdxbqzxS+BV8O/iazh5VbRZqrXIunk+4 tkHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=XRSuK+bPtuorOXI6SqdpPSmiLRjrsDmQS3bDT+tnFWY=; b=HsCEfPAkDsYzw95Mpz87p51Vvuqjg3M0HRv5bRfuWSOY8rvaxVuplNUHvhr66YK7LZ VAIZrU96+ZQnJzrco2/oJYshX4h5me7QHzSoZLhvo3dZ0JvC++uTA8rnBj1LAtk2YfoC VM3Lm1RwIVsHeQVxojzeI5j86uktjOSRMAdn3h+ae/12Y4SsdYUyMAGlIsirAXvZePs6 /dXBGFxVXB24s/lq3iFPzHCS7k6G66m4yimhwtMFEZ79S8kri3NfPfByWfw44KFMt/g3 3qern4j9La5r/Wmd9NPwmgjQgXAfC32jviiHdh6QuReX/AA3vfXvmdhE/8PyZ/esEoGO IheQ== X-Gm-Message-State: AOAM533/Y2d5jXQrMJtm5dPztShEzvo/HDIqLaIm4uPvcBuSyyCRxFFA ljB74nJC/MS0gANNAHPKhxEPg6Qq14Q= X-Google-Smtp-Source: ABdhPJx2GFcrcW0PbNc7K0ZORfpEozDNO/EhJk8Zxma3V8L8FjGBZMzIGACablkIJC3ccjeFuTrqMA== X-Received: by 2002:aa7:d84a:: with SMTP id f10mr10148288eds.132.1634228997223; Thu, 14 Oct 2021 09:29:57 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.29.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:29:56 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 18/26] configure, meson: move netmap detection to meson Date: Thu, 14 Oct 2021 18:29:30 +0200 Message-Id: <20211014162938.430211-19-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52d.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Message-Id: <20211007130829.632254-12-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 40 ++++------------------------------------ meson.build | 19 ++++++++++++++++++- meson_options.txt | 2 ++ net/meson.build | 4 +++- 4 files changed, 27 insertions(+), 38 deletions(-) diff --git a/configure b/configure index 0c077f3f5e..3544024166 100755 --- a/configure +++ b/configure @@ -292,7 +292,7 @@ iconv="auto" curses="auto" docs="auto" fdt="auto" -netmap="no" +netmap="auto" sdl="auto" sdl_image="auto" virtiofsd="auto" @@ -701,7 +701,6 @@ FreeBSD) bsd_user="yes" make="${MAKE-gmake}" # needed for kinfo_getvmmap(3) in libutil.h - netmap="" # enable netmap autodetect ;; DragonFly) bsd="yes" @@ -1026,9 +1025,9 @@ for opt do ;; --enable-vde) vde="enabled" ;; - --disable-netmap) netmap="no" + --disable-netmap) netmap="disabled" ;; - --enable-netmap) netmap="yes" + --enable-netmap) netmap="enabled" ;; --disable-xen) xen="disabled" ;; @@ -2903,34 +2902,6 @@ EOF fi fi -########################################## -# netmap support probe -# Apart from looking for netmap headers, we make sure that the host API version -# supports the netmap backend (>=11). The upper bound (15) is meant to simulate -# a minor/major version number. Minor new features will be marked with values up -# to 15, and if something happens that requires a change to the backend we will -# move above 15, submit the backend fixes and modify this two bounds. -if test "$netmap" != "no" ; then - cat > $TMPC << EOF -#include -#include -#include -#include -#if (NETMAP_API < 11) || (NETMAP_API > 15) -#error -#endif -int main(void) { return 0; } -EOF - if compile_prog "" "" ; then - netmap=yes - else - if test "$netmap" = "yes" ; then - feature_not_found "netmap" - fi - netmap=no - fi -fi - ########################################## # plugin linker support probe @@ -4175,9 +4146,6 @@ if test "$slirp_smbd" = "yes" ; then echo "CONFIG_SLIRP_SMBD=y" >> $config_host_mak echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak fi -if test "$netmap" = "yes" ; then - echo "CONFIG_NETMAP=y" >> $config_host_mak -fi if test "$l2tpv3" = "yes" ; then echo "CONFIG_L2TPV3=y" >> $config_host_mak fi @@ -4724,7 +4692,7 @@ if test "$skip_meson" = no; then -Dalsa=$alsa -Dcoreaudio=$coreaudio -Ddsound=$dsound -Djack=$jack -Doss=$oss \ -Dpa=$pa -Daudio_drv_list=$audio_drv_list -Dtcg_interpreter=$tcg_interpreter \ -Dtrace_backends=$trace_backends -Dtrace_file=$trace_file -Dlinux_aio=$linux_aio \ - -Dvde=$vde \ + -Dnetmap=$netmap -Dvde=$vde \ $cross_arg \ "$PWD" "$source_path" diff --git a/meson.build b/meson.build index 0e948a8024..40563e3c24 100644 --- a/meson.build +++ b/meson.build @@ -1656,6 +1656,23 @@ config_host_data.set('HAVE_MLOCKALL', cc.links(gnu_source_prefix + ''' return mlockall(MCL_FUTURE); }''')) +have_netmap = false +if not get_option('netmap').disabled() and have_system + have_netmap = cc.compiles(''' + #include + #include + #include + #include + #if (NETMAP_API < 11) || (NETMAP_API > 15) + #error + #endif + int main(void) { return 0; }''') + if not have_netmap and get_option('netmap').enabled() + error('Netmap headers not available') + endif +endif +config_host_data.set('CONFIG_NETMAP', have_netmap) + # Work around a system header bug with some kernel/XFS header # versions where they both try to define 'struct fsxattr': # xfs headers will not try to redefine structs from linux headers @@ -3311,7 +3328,7 @@ endif summary_info += {'JACK support': jack} summary_info += {'brlapi support': brlapi} summary_info += {'vde support': vde} -summary_info += {'netmap support': config_host.has_key('CONFIG_NETMAP')} +summary_info += {'netmap support': have_netmap} summary_info += {'Linux AIO support': libaio} summary_info += {'Linux io_uring support': linux_io_uring} summary_info += {'ATTR/XATTR support': libattr} diff --git a/meson_options.txt b/meson_options.txt index 7d0fa1c7f4..d8e67ae481 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -129,6 +129,8 @@ option('u2f', type : 'feature', value : 'auto', description: 'U2F emulation support') option('usb_redir', type : 'feature', value : 'auto', description: 'libusbredir support') +option('netmap', type : 'feature', value : 'auto', + description: 'netmap network backend support') option('vde', type : 'feature', value : 'auto', description: 'vde network backend support') option('virglrenderer', type : 'feature', value : 'auto', diff --git a/net/meson.build b/net/meson.build index 491144a697..94383e7460 100644 --- a/net/meson.build +++ b/net/meson.build @@ -21,7 +21,9 @@ softmmu_ss.add(when: 'CONFIG_TCG', if_true: files('filter-replay.c')) softmmu_ss.add(when: 'CONFIG_L2TPV3', if_true: files('l2tpv3.c')) softmmu_ss.add(when: slirp, if_true: files('slirp.c')) softmmu_ss.add(when: vde, if_true: files('vde.c')) -softmmu_ss.add(when: 'CONFIG_NETMAP', if_true: files('netmap.c')) +if have_netmap + softmmu_ss.add(files('netmap.c')) +endif vhost_user_ss = ss.source_set() vhost_user_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('vhost-user.c'), if_false: files('vhost-user-stub.c')) softmmu_ss.add_all(when: 'CONFIG_VHOST_NET_USER', if_true: vhost_user_ss) From patchwork Thu Oct 14 16:29:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541028 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=ZSLyXIso; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVZvb4rZ5z9s0r for ; Fri, 15 Oct 2021 03:42:51 +1100 (AEDT) Received: from localhost ([::1]:49266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3of-0006l2-Fu for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:42:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3cH-0003rb-UF for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:03 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]:45863) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3cF-0000kG-Rq for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:01 -0400 Received: by mail-ed1-x534.google.com with SMTP id r18so26591737edv.12 for ; Thu, 14 Oct 2021 09:29:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HdCS+pnyJcqDSe0D9EI5q1AE4JxhmLuwAmB41kvECl0=; b=ZSLyXIso+R+Dv28lUcaWIm/oEQLDDDHEF/FDoja3RI0fqc33kPeVVb3EcyHX9kSvPN Ya9JYwZhg/OXL34mtEXnb/vlGm0X82rFhTLC9a6b5RR62uFBQs58joNyL/az8XKKy3sN q0umEyc7LUN7XLEHNxbCN2A8/7xnWzKn3dhJMxvG+IZB4lSdkYkd0ERwJuyrnrjCwZVt QiiztsVdu4sk9LTHGoexd1+weTr5E582gPvVBu2muAGL9/z/xYPKDw9ACrYGMKPGfeOO NpjeXHJj28vbD5OhU9BBx31M761mo5KUIeggKC25ty03elfxzqZxy/ah+ii5zsTl0fJF WexQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=HdCS+pnyJcqDSe0D9EI5q1AE4JxhmLuwAmB41kvECl0=; b=boghYCBJn8nHhgmyb+oDIJ1SnJ5pTXzMXAFJI2cWW8kNpIn/qW+nh2skl3gU4Xvtd0 X/DL9ZPbLAMKvb9+sYUFEuF6wdVk6FY66mP7BvLy5mdoCGXovXbgTk36Lq/RyiFXvJb8 2UzagfbMnX7aFK8GcSVrK4Ku/+w0KIp+idJEHHQqEaON8qTnS0X/V6zRGpEs1oHQAoej ZDRm6A5NuUzVvj+APn6Sj/3hXc+GWT1O+X6fxHw2bQ66b3jRbJyw6zLlkV3xUERcJkDE v/XooKl2Lw1eiXa7FoReKrOYF92JRJGjEOqkvN0FwrFBHUxe+Qu7yyEZYY5LC4txuxTG Oo3g== X-Gm-Message-State: AOAM531B0oPJB1z1cIbfxgr5wrGbxwGNIPjRTqS2Pp+DIAVXzPkGeiie lWnrMmLiaPbKWQX6jHjr6H51Bqqk6xQ= X-Google-Smtp-Source: ABdhPJy+XqZek561wmyg3VewX+dPNyHIJTxJ+VYo07QP12v+YArWQGVb2C80PEt40MlAuc67Lf+mcQ== X-Received: by 2002:a17:906:6011:: with SMTP id o17mr4847276ejj.157.1634228997901; Thu, 14 Oct 2021 09:29:57 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.29.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:29:57 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 19/26] configure, meson: move Spice configure handling to meson Date: Thu, 14 Oct 2021 18:29:31 +0200 Message-Id: <20211014162938.430211-20-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x534.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Add meson feature options for Spice and Spice protocol, and move detection logic out of configure. Signed-off-by: Marc-André Lureau Message-Id: <20211007102453.978041-1-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini Message-Id: <20211007130829.632254-13-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- chardev/meson.build | 2 +- configure | 47 +-------------------------------------------- meson.build | 29 +++++++++++++++++----------- meson_options.txt | 4 ++++ ui/meson.build | 4 ++-- 5 files changed, 26 insertions(+), 60 deletions(-) diff --git a/chardev/meson.build b/chardev/meson.build index 32377af383..325ba2bdb9 100644 --- a/chardev/meson.build +++ b/chardev/meson.build @@ -35,7 +35,7 @@ if brlapi.found() chardev_modules += { 'baum': module_ss } endif -if config_host.has_key('CONFIG_SPICE') +if spice.found() module_ss = ss.source_set() module_ss.add(when: [spice], if_true: files('spice.c')) chardev_modules += { 'spice': module_ss } diff --git a/configure b/configure index 3544024166..5ad1b5194e 100755 --- a/configure +++ b/configure @@ -369,7 +369,7 @@ pie="" qom_cast_debug="yes" trace_backends="log" trace_file="trace" -spice="$default_feature" +spice="auto" spice_protocol="auto" rbd="auto" smartcard="auto" @@ -3231,41 +3231,6 @@ EOF fi fi -########################################## -# spice probe -if test "$spice_protocol" != "no" ; then - spice_protocol_cflags=$($pkg_config --cflags spice-protocol 2>/dev/null) - if $pkg_config --atleast-version=0.12.3 spice-protocol; then - spice_protocol="yes" - else - if test "$spice_protocol" = "yes" ; then - feature_not_found "spice_protocol" \ - "Install spice-protocol(>=0.12.3) devel" - fi - spice_protocol="no" - fi -fi - -if test "$spice" != "no" ; then - cat > $TMPC << EOF -#include -int main(void) { spice_server_new(); return 0; } -EOF - spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null) - spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null) - if $pkg_config --atleast-version=0.12.5 spice-server && \ - test "$spice_protocol" = "yes" && \ - compile_prog "$spice_cflags" "$spice_libs" ; then - spice="yes" - else - if test "$spice" = "yes" ; then - feature_not_found "spice" \ - "Install spice-server(>=0.12.5) devel" - fi - spice="no" - fi -fi - ########################################## # check if we have VSS SDK headers for win @@ -4235,16 +4200,6 @@ if test "$tcg" = "enabled" -a "$tcg_interpreter" = "true" ; then echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak fi -if test "$spice_protocol" = "yes" ; then - echo "CONFIG_SPICE_PROTOCOL=y" >> $config_host_mak - echo "SPICE_PROTOCOL_CFLAGS=$spice_protocol_cflags" >> $config_host_mak -fi -if test "$spice" = "yes" ; then - echo "CONFIG_SPICE=y" >> $config_host_mak - echo "SPICE_CFLAGS=$spice_cflags $spice_protocol_cflags" >> $config_host_mak - echo "SPICE_LIBS=$spice_libs" >> $config_host_mak -fi - if test "$opengl" = "yes" ; then echo "CONFIG_OPENGL=y" >> $config_host_mak echo "OPENGL_CFLAGS=$opengl_cflags" >> $config_host_mak diff --git a/meson.build b/meson.build index 40563e3c24..6bf43e6d30 100644 --- a/meson.build +++ b/meson.build @@ -540,17 +540,20 @@ if not get_option('jack').auto() or have_system method: 'pkg-config', kwargs: static_kwargs) endif -spice = not_found -spice_headers = not_found spice_protocol = not_found -if 'CONFIG_SPICE' in config_host - spice = declare_dependency(compile_args: config_host['SPICE_CFLAGS'].split(), - link_args: config_host['SPICE_LIBS'].split()) - spice_headers = declare_dependency(compile_args: config_host['SPICE_CFLAGS'].split()) +if not get_option('spice_protocol').auto() or have_system + spice_protocol = dependency('spice-protocol', version: '>=0.12.3', + required: get_option('spice_protocol'), + method: 'pkg-config', kwargs: static_kwargs) endif -if 'CONFIG_SPICE_PROTOCOL' in config_host - spice_protocol = declare_dependency(compile_args: config_host['SPICE_PROTOCOL_CFLAGS'].split()) +spice = not_found +if not get_option('spice').auto() or have_system + spice = dependency('spice-server', version: '>=0.12.5', + required: get_option('spice'), + method: 'pkg-config', kwargs: static_kwargs) endif +spice_headers = spice.partial_dependency(compile_args: true, includes: true) + rt = cc.find_library('rt', required: false) libdl = not_found if 'CONFIG_PLUGIN' in config_host @@ -1481,6 +1484,8 @@ config_host_data.set('CONFIG_STATX', has_statx) config_host_data.set('CONFIG_ZSTD', zstd.found()) config_host_data.set('CONFIG_FUSE', fuse.found()) config_host_data.set('CONFIG_FUSE_LSEEK', fuse_lseek.found()) +config_host_data.set('CONFIG_SPICE_PROTOCOL', spice_protocol.found()) +config_host_data.set('CONFIG_SPICE', spice.found()) config_host_data.set('CONFIG_X11', x11.found()) config_host_data.set('CONFIG_CFI', get_option('cfi')) config_host_data.set('QEMU_VERSION', '"@0@"'.format(meson.project_version())) @@ -1761,7 +1766,7 @@ have_ivshmem = config_host_data.get('CONFIG_EVENTFD') host_kconfig = \ (get_option('fuzzing') ? ['CONFIG_FUZZ=y'] : []) + \ ('CONFIG_TPM' in config_host ? ['CONFIG_TPM=y'] : []) + \ - ('CONFIG_SPICE' in config_host ? ['CONFIG_SPICE=y'] : []) + \ + (spice.found() ? ['CONFIG_SPICE=y'] : []) + \ (have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \ ('CONFIG_OPENGL' in config_host ? ['CONFIG_OPENGL=y'] : []) + \ (x11.found() ? ['CONFIG_X11=y'] : []) + \ @@ -3337,8 +3342,10 @@ summary_info += {'PVRDMA support': config_host.has_key('CONFIG_PVRDMA')} summary_info += {'fdt support': fdt_opt == 'disabled' ? false : fdt_opt} summary_info += {'libcap-ng support': libcap_ng} summary_info += {'bpf support': libbpf} -# TODO: add back protocol and server version -summary_info += {'spice support': config_host.has_key('CONFIG_SPICE')} +summary_info += {'spice protocol support': spice_protocol} +if spice_protocol.found() + summary_info += {' spice server support': spice} +endif summary_info += {'rbd support': rbd} summary_info += {'xfsctl support': config_host.has_key('CONFIG_XFS')} summary_info += {'smartcard support': cacard} diff --git a/meson_options.txt b/meson_options.txt index d8e67ae481..5a140af7f7 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -125,6 +125,10 @@ option('smartcard', type : 'feature', value : 'auto', description: 'CA smartcard emulation support') option('snappy', type : 'feature', value : 'auto', description: 'snappy compression support') +option('spice', type : 'feature', value : 'auto', + description: 'Spice server support') +option('spice_protocol', type : 'feature', value : 'auto', + description: 'Spice protocol support') option('u2f', type : 'feature', value : 'auto', description: 'U2F emulation support') option('usb_redir', type : 'feature', value : 'auto', diff --git a/ui/meson.build b/ui/meson.build index a73beb0e54..ee8ef27714 100644 --- a/ui/meson.build +++ b/ui/meson.build @@ -89,7 +89,7 @@ if sdl.found() ui_modules += {'sdl' : sdl_ss} endif -if config_host.has_key('CONFIG_SPICE') +if spice.found() spice_core_ss = ss.source_set() spice_core_ss.add(spice, pixman, files( 'spice-core.c', @@ -99,7 +99,7 @@ if config_host.has_key('CONFIG_SPICE') ui_modules += {'spice-core' : spice_core_ss} endif -if config_host.has_key('CONFIG_SPICE') and config_host.has_key('CONFIG_GIO') +if spice.found() and config_host.has_key('CONFIG_GIO') spice_ss = ss.source_set() spice_ss.add(spice, gio, pixman, files('spice-app.c')) ui_modules += {'spice-app': spice_ss} From patchwork Thu Oct 14 16:29:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541033 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=kR6Be/o2; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVZy23wnzz9s0r for ; Fri, 15 Oct 2021 03:44:58 +1100 (AEDT) Received: from localhost ([::1]:57484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3qi-0003y7-0X for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:44:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3cJ-0003re-3u for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:03 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]:43777) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3cH-0000kL-FI for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:02 -0400 Received: by mail-ed1-x530.google.com with SMTP id i20so25747223edj.10 for ; Thu, 14 Oct 2021 09:30:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JtCFTjFLCvoG6A/vS5nNftsygQ/qqCaasJjvtEZaOvk=; b=kR6Be/o2OpEUYtJrF/a65Mvt0R30k5bSRGIV+qyfhg3twFirhgWV+neKGDMvt3t7Oi loirKteTVdyp4uOQBy06StQyexeD/DCMQ6/KeLlq8oDIsYAvK8fGBZKOCkEevRoSG1tn 7fHCpmOV+pbPF2cGe9torVnVpikco4RtpcJSRIHFenJkbDC2xI8lsAJ8DSvB7+v7/w+j J+x/qxpfPNnFWp0eBCiEV83Nx1v+4C+vuewcFFJ2LphQuI8JmH3C7Z0kWqdZXkvMSUsM k1SDagmQP0OKxpPBHaVRP6UUTJbvA8oPZZeUjf5/S9q/1ehPkPqwihrVloKKUXJLu9bG e+DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=JtCFTjFLCvoG6A/vS5nNftsygQ/qqCaasJjvtEZaOvk=; b=V+B0j6b/Yy3JUJDh7WigLZJvOZdmMbpi9NbF2G9ACpz+MVkhQSZhr54AZ+03iPQ0KF V1NNSm4/wqhsMq5ObbOV+HfqTEvWxk6nwB0iVzOp2Xp8edfPNgd/qBonFCSR+fg88/FF XQmh3M4oS8wqaIN/20f4lxxZCaZmtW20oUeH3Glek7jsIsfhhtiIn5JsY6m/V4faCPF+ 28/uH26XV8c8scZ8+2yBnjLi6E6h7T6J18ADzleSogI1t8PHINFX4l7OsbpUBSKbRAJE Hu9MRDRISgezGExcsXd3l5LtUh0z1nP00WztJMhw0CPnQIPRJzgvhG/+BNVAY0/X8cyf 73hQ== X-Gm-Message-State: AOAM532vAc5eJub/C1PCz+SZq+7lBT7girseMpJwssPASdX5FegQK3ss 379XEDGkoh1mHMuoWqrkofmisyUUIGs= X-Google-Smtp-Source: ABdhPJwSjR3tleFZt2cHmpoU3g03Ek7g0+zp5gVqqGrt4TysEPl3CiuUNi/j5H1AefRE1aigTRUaiw== X-Received: by 2002:a05:6402:5187:: with SMTP id q7mr9773740edd.374.1634228999049; Thu, 14 Oct 2021 09:29:59 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.29.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:29:58 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 20/26] configure: remove obsolete Solaris ar check Date: Thu, 14 Oct 2021 18:29:32 +0200 Message-Id: <20211014162938.430211-21-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x530.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Meson already has its own logic to find the "ar" binary, so remove the Solaris specific check. Reviewed-by: Marc-André Lureau Reviewed-by: Thomas Huth Message-Id: <20211007130829.632254-14-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/configure b/configure index 5ad1b5194e..9b59dce2f8 100755 --- a/configure +++ b/configure @@ -2286,21 +2286,6 @@ EOF fi fi -######################################### -# Solaris specific configure tool chain decisions - -if test "$solaris" = "yes" ; then - if has ar; then - : - else - if test -f /usr/ccs/bin/ar ; then - error_exit "No path includes ar" \ - "Add /usr/ccs/bin to your path and rerun configure" - fi - error_exit "No path includes ar" - fi -fi - if test "$tcg" = "enabled"; then git_submodules="$git_submodules tests/fp/berkeley-testfloat-3" git_submodules="$git_submodules tests/fp/berkeley-softfloat-3" From patchwork Thu Oct 14 16:29:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541036 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=qqtnP8Sn; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVb1d5h6nz9s0r for ; Fri, 15 Oct 2021 03:48:05 +1100 (AEDT) Received: from localhost ([::1]:37698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3tj-0001F7-H9 for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:48:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34958) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3cN-0003uM-0A for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:07 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:45863) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3cI-0000mo-MN for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:04 -0400 Received: by mail-ed1-x533.google.com with SMTP id r18so26592126edv.12 for ; Thu, 14 Oct 2021 09:30:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8A1fFUBoVK/iFegjzGxtIdAetdjErL7XP7hSIXdyZCA=; b=qqtnP8SnOzR3g62DRV8r3a41BUQJM+KV8egIijGyn5TcvVEDIHDARrqfNR4NSuO7Vn 7tseOpopAVY4huTQQjx2agJAh7fo27COz6Whu/yk6zsJziMhe2rPKG/dEwzjiF6wiDP4 R/Pj3y4sIqbnXHUL783w3T5r9ojzp/j4uDGJeCfwQx58KSy2k6yvVM7anUuc/NR+arl4 pg+yDgIc6mopk6aPdPMoKKiGaG6fP57p6G3306BUGwf7yS1UED3KwpwqC5dDtuolr0/S HbXuWvHT4mb/XvM9af4bqE/xOAJJEpSng7F6P3cYWeBsi9alIGry8fwU+PhSZN6g6Mx0 cMIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=8A1fFUBoVK/iFegjzGxtIdAetdjErL7XP7hSIXdyZCA=; b=ZQSSBNim/x6NrVvry/ezbPPnJ27TvpvS70N5boaPxePzIfPVTb8WyWAUkb+z6cV3vi 8Lq1LQWDUx04BA0v2aMhAaIzwcY9vv99vdWmWNIGAnNbh4OLDX0L1olHqgFaXMQalhzS jTGbhMbR+p9JLtMyEEckf/74AJv8Fsxe3vfsxD/aMqllpCp6Yga4WWLtZMh8HzqveMT2 HKasmmOvetqKRdSx05oN+Aqw9WcdOqTKVE51aRTpK+xoEwKao6GJaqcUj2HJuGXq+YyA /Wkgn7qN1wXv6dPY+EjkwhVyTRAFDp0SDn3uvyF1VUEAnijqeItrXLewC0dvubD9Yvr7 /PTg== X-Gm-Message-State: AOAM533B8MS2MVQgwPUC6tBbHuBJLDX4LCG6z3okMVLQMQYj2KOQTG+E UJgfyETqJrB/BsO5Z2St4qUM2jE9AYc= X-Google-Smtp-Source: ABdhPJx3l9/mwEbwIKyafes1YaT9V24XcdZnowvvgQSpRHm0OcHTEDHkS+uSKD1f8MQ+tX7ksTx2pg== X-Received: by 2002:a50:fc17:: with SMTP id i23mr9632396edr.213.1634228999723; Thu, 14 Oct 2021 09:29:59 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.29.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:29:59 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 21/26] configure, meson: move more compiler checks to Meson Date: Thu, 14 Oct 2021 18:29:33 +0200 Message-Id: <20211014162938.430211-22-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x533.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Marc-André Lureau Message-Id: <20211007130829.632254-15-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 91 ------------------------------------------------ meson.build | 44 +++++++++++++++++++++++ util/meson.build | 4 ++- 3 files changed, 47 insertions(+), 92 deletions(-) diff --git a/configure b/configure index 9b59dce2f8..7c58c7c28d 100755 --- a/configure +++ b/configure @@ -3110,19 +3110,6 @@ elif test "$tpm" = "yes"; then fi fi -########################################## -# iovec probe -cat > $TMPC < -#include -#include -int main(void) { return sizeof(struct iovec); } -EOF -iovec=no -if compile_prog "" "" ; then - iovec=yes -fi - ########################################## # fdt probe @@ -3564,42 +3551,6 @@ EOF fi fi -######################################### -# See if 64-bit atomic operations are supported. -# Note that without __atomic builtins, we can only -# assume atomic loads/stores max at pointer size. - -cat > $TMPC << EOF -#include -int main(void) -{ - uint64_t x = 0, y = 0; - y = __atomic_load_n(&x, __ATOMIC_RELAXED); - __atomic_store_n(&x, y, __ATOMIC_RELAXED); - __atomic_compare_exchange_n(&x, &y, x, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED); - __atomic_exchange_n(&x, y, __ATOMIC_RELAXED); - __atomic_fetch_add(&x, y, __ATOMIC_RELAXED); - return 0; -} -EOF -if compile_prog "" "" ; then - atomic64=yes -fi - -######################################## -# check if getauxval is available. - -getauxval=no -cat > $TMPC << EOF -#include -int main(void) { - return getauxval(AT_HWCAP) == 0; -} -EOF -if compile_prog "" "" ; then - getauxval=yes -fi - ######################################## # check if ccache is interfering with # semantic analysis of macros @@ -3673,33 +3624,6 @@ else membarrier=no fi -########################################## -# check for usable AF_VSOCK environment -have_af_vsock=no -cat > $TMPC << EOF -#include -#include -#include -#if !defined(AF_VSOCK) -# error missing AF_VSOCK flag -#endif -#include -int main(void) { - int sock, ret; - struct sockaddr_vm svm; - socklen_t len = sizeof(svm); - sock = socket(AF_VSOCK, SOCK_STREAM, 0); - ret = getpeername(sock, (struct sockaddr *)&svm, &len); - if ((ret == -1) && (errno == ENOTCONN)) { - return 0; - } - return -1; -} -EOF -if compile_prog "" "" ; then - have_af_vsock=yes -fi - ########################################## # check for usable AF_ALG environment have_afalg=no @@ -4175,9 +4099,6 @@ fi if test "$vhost_user_fs" = "yes" ; then echo "CONFIG_VHOST_USER_FS=y" >> $config_host_mak fi -if test "$iovec" = "yes" ; then - echo "CONFIG_IOVEC=y" >> $config_host_mak -fi if test "$membarrier" = "yes" ; then echo "CONFIG_MEMBARRIER=y" >> $config_host_mak fi @@ -4247,14 +4168,6 @@ if test "$cmpxchg128" = "yes" ; then echo "CONFIG_CMPXCHG128=y" >> $config_host_mak fi -if test "$atomic64" = "yes" ; then - echo "CONFIG_ATOMIC64=y" >> $config_host_mak -fi - -if test "$getauxval" = "yes" ; then - echo "CONFIG_GETAUXVAL=y" >> $config_host_mak -fi - if test "$libssh" = "yes" ; then echo "CONFIG_LIBSSH=y" >> $config_host_mak echo "LIBSSH_CFLAGS=$libssh_cflags" >> $config_host_mak @@ -4282,10 +4195,6 @@ if test "$replication" = "yes" ; then echo "CONFIG_REPLICATION=y" >> $config_host_mak fi -if test "$have_af_vsock" = "yes" ; then - echo "CONFIG_AF_VSOCK=y" >> $config_host_mak -fi - if test "$debug_mutex" = "yes" ; then echo "CONFIG_DEBUG_MUTEX=y" >> $config_host_mak fi diff --git a/meson.build b/meson.build index 6bf43e6d30..6b7487b725 100644 --- a/meson.build +++ b/meson.build @@ -1550,6 +1550,8 @@ config_host_data.set('CONFIG_INOTIFY', cc.has_header_symbol('sys/inotify.h', 'inotify_init')) config_host_data.set('CONFIG_INOTIFY1', cc.has_header_symbol('sys/inotify.h', 'inotify_init1')) +config_host_data.set('CONFIG_IOVEC', + cc.has_header_symbol('sys/uio.h', 'struct iovec')) config_host_data.set('CONFIG_MACHINE_BSWAP_H', cc.has_header_symbol('machine/bswap.h', 'bswap32', prefix: '''#include @@ -1697,6 +1699,48 @@ config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles(''' return printf("%zu", SIZE_MAX); }''', args: ['-Werror'])) +# See if 64-bit atomic operations are supported. +# Note that without __atomic builtins, we can only +# assume atomic loads/stores max at pointer size. +config_host_data.set('CONFIG_ATOMIC64', cc.links(''' + #include + int main(void) + { + uint64_t x = 0, y = 0; + y = __atomic_load_n(&x, __ATOMIC_RELAXED); + __atomic_store_n(&x, y, __ATOMIC_RELAXED); + __atomic_compare_exchange_n(&x, &y, x, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED); + __atomic_exchange_n(&x, y, __ATOMIC_RELAXED); + __atomic_fetch_add(&x, y, __ATOMIC_RELAXED); + return 0; + }''')) + +config_host_data.set('CONFIG_GETAUXVAL', cc.links(gnu_source_prefix + ''' + #include + int main(void) { + return getauxval(AT_HWCAP) == 0; + }''')) + +config_host_data.set('CONFIG_AF_VSOCK', cc.compiles(gnu_source_prefix + ''' + #include + #include + #include + #if !defined(AF_VSOCK) + # error missing AF_VSOCK flag + #endif + #include + int main(void) { + int sock, ret; + struct sockaddr_vm svm; + socklen_t len = sizeof(svm); + sock = socket(AF_VSOCK, SOCK_STREAM, 0); + ret = getpeername(sock, (struct sockaddr *)&svm, &len); + if ((ret == -1) && (errno == ENOTCONN)) { + return 0; + } + return -1; + }''')) + ignored = ['CONFIG_QEMU_INTERP_PREFIX', # actually per-target 'HAVE_GDB_BIN'] arrays = ['CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST'] diff --git a/util/meson.build b/util/meson.build index 779f413c86..05b593055a 100644 --- a/util/meson.build +++ b/util/meson.build @@ -1,5 +1,7 @@ util_ss.add(files('osdep.c', 'cutils.c', 'unicode.c', 'qemu-timer-common.c')) -util_ss.add(when: 'CONFIG_ATOMIC64', if_false: files('atomic64.c')) +if not config_host_data.get('CONFIG_ATOMIC64') + util_ss.add(files('atomic64.c')) +endif util_ss.add(when: 'CONFIG_POSIX', if_true: files('aio-posix.c')) util_ss.add(when: 'CONFIG_POSIX', if_true: files('fdmon-poll.c')) if config_host_data.get('CONFIG_EPOLL_CREATE1') From patchwork Thu Oct 14 16:29:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541039 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=JQg6pEaW; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVb4W6Rrhz9s0r for ; Fri, 15 Oct 2021 03:50:35 +1100 (AEDT) Received: from localhost ([::1]:44462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3w8-0005m0-Os for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:50:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34954) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3cM-0003uK-Vv for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:07 -0400 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]:33648) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3cJ-0000nY-QE for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:04 -0400 Received: by mail-ed1-x536.google.com with SMTP id y30so9624311edi.0 for ; Thu, 14 Oct 2021 09:30:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/1uOyLYgtnVUV173Bs2NRWW3tMeXyLbby9vcQkuvwxs=; b=JQg6pEaWkAIPLBaDCS7INMo1jiZwq4Y2RjTSOVCuUhQX8tTtkahN+imLITwkSoM7q2 ch+74VRR6KUfQxqijAfu40Qd19wQhWKlGz62QZgCSQ6yxXWe8zPnP0dlzL1058Bo9juc 0t27FGnxYEBDBZO6+cevn2vOr7xesT3ztJsOsDsrroyO4nba1rYufj49FReRnV5E6tQI i0Pla/fAWNiNergyZZ79uehIt+R3UHouUKlEYHnpd86Fb/dlzTPPQB2Xtt4rIeb7sa6R 7bTYToAEkdhUxMpycTJTkRyPokmVutElhuPnnAdJUVqdNScrG3h24ZgI6n4NnCe8pbsp kq7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=/1uOyLYgtnVUV173Bs2NRWW3tMeXyLbby9vcQkuvwxs=; b=LvUwRPhupziha0VgSGGfZ5G4oVlF8G8EUe0l2iLx25r5K0DuCWNTuJmWnPHJnPxbGD +W0yDpfVnvG/mYRh71mTt3CpAALZ8IPUUH+u8pol6ijtGVWByXZc32nW0vBLajS3D0E1 Wos8wygUHqaM3V8ZlxSqASLbp/UAYHaYjZjtjNyH4qdNmGPwTCor8pS3CEmK3K7R/3fz kkVkexvRsR8tH+6bbJKj0nRcRXrMMBLweAM/NjuOPOxlunWdewgUTjLzi5s2wL68bGQs 6btCheB53jxESvWOD2kguaRolWW9yLTsaIhTXWNPjRFrQBOHR0WZoVa5VCO+Ocfq+o5Y O0jQ== X-Gm-Message-State: AOAM533oG8dpOtWIMazl4smfr0Mu8TuvrKnH3SGEDkBmUmrK781f6tBD JBQhMEiyBvXYtZLwZpRw6RAEVeG/Img= X-Google-Smtp-Source: ABdhPJyJPpW6AbF+610hMQWIHpvmIE5j9gK9LbSxkBFmvnNEDyMRl/YpZIy/FyIUm3SfcuWi2x3Ljg== X-Received: by 2002:a17:906:ae54:: with SMTP id lf20mr4905086ejb.195.1634229000352; Thu, 14 Oct 2021 09:30:00 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.29.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:30:00 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 22/26] configure: remove deprecated --{enable, disable}-git-update Date: Thu, 14 Oct 2021 18:29:34 +0200 Message-Id: <20211014162938.430211-23-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x536.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The options were deprecated in 6.0. That said, we do not really have a formal deprecation cycle for build-time changes, since they do not affect users. Reviewed-by: Marc-André Lureau Message-Id: <20211007130829.632254-16-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 8 -------- 1 file changed, 8 deletions(-) diff --git a/configure b/configure index 7c58c7c28d..b12b5f26b0 100755 --- a/configure +++ b/configure @@ -1483,14 +1483,6 @@ for opt do ;; --with-git=*) git="$optarg" ;; - --enable-git-update) - git_submodules_action="update" - echo "--enable-git-update deprecated, use --with-git-submodules=update" - ;; - --disable-git-update) - git_submodules_action="validate" - echo "--disable-git-update deprecated, use --with-git-submodules=validate" - ;; --with-git-submodules=*) git_submodules_action="$optarg" ;; From patchwork Thu Oct 14 16:29:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541037 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=lSp49Q+B; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVb371XDvz9s0r for ; Fri, 15 Oct 2021 03:49:22 +1100 (AEDT) Received: from localhost ([::1]:41488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3uw-0003ks-2t for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:49:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3cN-0003uL-07 for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:07 -0400 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]:37749) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3cI-0000nQ-TL for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:04 -0400 Received: by mail-ed1-x52c.google.com with SMTP id y12so27680837eda.4 for ; Thu, 14 Oct 2021 09:30:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UY522I05rY+w4U+vf8hois7xkhx1heiogYfR44nWEcw=; b=lSp49Q+BPK9jtfAaQP6lrq1WVjVbG20KJp2aObglcUF8UPYVhEMxY0AZfBzJyx3VMN RlqI+2y/nGVgIBlhD1gWsPzSxYLXoIb834zf1O999B+26adK2DyC9Cnk4mNm7uu/r08h f8bbXo4fWcZ53M1JWCCHoEm8fG/rXc4HY9jJgiyewr0R+qy5ATgzFJfzifrrj9+AFCAT VtyULD3neXd1mYRlnGVTgNygR/SxG9FGpOfLHwpRJ3aHhvHQkYLUQezf+4rK1cPqt0fT Q9GL7dtM7myuVd/tIa2KW3gmPuB/WDcCE9kQk+XC/KwTevB/6uRqVdivcaCvQQkwrMUv yHQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=UY522I05rY+w4U+vf8hois7xkhx1heiogYfR44nWEcw=; b=DngqjzRDKrJ5QreHulQ7Lg0l2ylPaYG37iGsC3o772Pz5f9uS0dqxR3zZ/cZmGY/3P ovElJc7KLjQ7PTOJcaHKO9SVykrfOw5Cd3E9Nw1Rf9YySshudFGzL86gwETOwbQMU11P uD2Xi0Tx2DKCzw6Uc1KPQgXz2u+SYQeopC5NFLm4VJfRmVmUFhrHCCWVsXiBWf8AbCZq ruTiPy887tm8DPHR6GcQsoRQGJaUPQln9DVGdw1Cs4Z9h/N7qCQu27j2xj+ifZui1wPl UCaUXxX2r79YDfAI0OjDpAQHmuull4YuuKV8s72tyD8Etle1pQJbS6kabOV2KatnJwGh OYcQ== X-Gm-Message-State: AOAM531pe9RX02rsczv7DSFCu3vIZCASxj0//DLgP2X28qr+U+427Kgo lF537JFhOUQdUZXWCXp06XUkpZNGzR0= X-Google-Smtp-Source: ABdhPJxoJx5UbutmjybHzQLucGJbEMik7KsPfhsI3Xe+914tn7N/D6BMJmBXDjYT5t7KeELJbcMUJA== X-Received: by 2002:a17:906:b819:: with SMTP id dv25mr5117492ejb.21.1634229001054; Thu, 14 Oct 2021 09:30:01 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.30.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:30:00 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 23/26] configure: accept "internal" for --enable-capstone/slirp/fdt Date: Thu, 14 Oct 2021 18:29:35 +0200 Message-Id: <20211014162938.430211-24-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52c.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Options such as "--enable-capstone=git" do not make much sense when building from a tarball. Accept "internal" for consistency with the meson options. Reviewed-by: Marc-André Lureau Message-Id: <20211007130829.632254-17-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure b/configure index b12b5f26b0..2ec410378e 100755 --- a/configure +++ b/configure @@ -1019,7 +1019,7 @@ for opt do ;; --enable-slirp=git) slirp="internal" ;; - --enable-slirp=system) slirp="system" + --enable-slirp=*) slirp="$optarg" ;; --disable-vde) vde="disabled" ;; @@ -1193,7 +1193,7 @@ for opt do ;; --enable-fdt=git) fdt="internal" ;; - --enable-fdt=system) fdt="system" + --enable-fdt=*) fdt="$optarg" ;; --disable-linux-aio) linux_aio="disabled" ;; @@ -1479,7 +1479,7 @@ for opt do ;; --enable-capstone=git) capstone="internal" ;; - --enable-capstone=system) capstone="system" + --enable-capstone=*) capstone="$optarg" ;; --with-git=*) git="$optarg" ;; From patchwork Thu Oct 14 16:29:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541034 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=YhpMgJeU; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVb0s2D1Xz9s0r for ; Fri, 15 Oct 2021 03:47:24 +1100 (AEDT) Received: from localhost ([::1]:34100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3t4-0007I5-HC for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:47:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3cN-0003uN-0N for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:07 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:37756) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3cJ-0000nc-QP for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:06 -0400 Received: by mail-ed1-x533.google.com with SMTP id y12so27680991eda.4 for ; Thu, 14 Oct 2021 09:30:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZR12s/8/FdEGVacS0g5r0FyAnbXeOeyVgE4QTLyfZ7k=; b=YhpMgJeUUXbl10N0XtIkYpGqVSQ5EKPidSGexwQBue69GffLKzv0U0XS9331eyzPP8 WhLsao4D/GEK6+whl2z/d6MCji+/y+ohCoOTBEJPKaJFvzmPaSh46fD1hg14Zlp3NgZE 6K3PqMNE7db9MxT0+iAhtCMifoZjY9OaMBNlvy3ZVVYc4UyItMPf7UoBg0lT5Q78PQi8 PKJzd9AcZNZxI9zYN3E8riyvKfA+w6NpEQjrPwO678Ft8erYRen8E8QVZq/uAcy4/bsE Nv1wk6Za7rtiqpUdTAzSxxrRvBHzdO5wMzxKepegeM7e/AS1k9/Q1CnDBz4W/ag2HAz0 YUFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ZR12s/8/FdEGVacS0g5r0FyAnbXeOeyVgE4QTLyfZ7k=; b=YTDr+iqJNlt/PMh8U1xW7bgFjj9ZhIk/zOJthVG6uXo/8Ksl/Zi31KdmJVuUaAfR1q Jpn2Ruxy4LebJzP/79PjzfeGfRIKULUhiGU8X23ZkSlc9zcUsOf/ixfYHUAtLxMmmRoY uWosJLfR7dLXZymBd4k/sqcH+u/nz4+pmugKH4ngTPwbFpvghRbzQecxnoqvb/c9UO4G 0XT+qPn4U6pO4NmgBOpwPOMNEG86ufIGTbN0osN8aUjCmu05gS471wtra8maYxVGiuke 0TXRnKgi8jfgbB8oC/3aAX+MI1RJ6pPjHim1YzdtKGS6VkP36Kgf113JUJCtX71sPmQW T8sA== X-Gm-Message-State: AOAM533hru2kjXI6s2ZCuoTC/PAULdPxCe6Fa+sVeKTzO0A8D9UsMddF Edmb+l2kFHxrORZVwK2YuYQV3bnOUL0= X-Google-Smtp-Source: ABdhPJz5pWF+8Q7s0V783YGjkAfMo4ehTAkRYMmX8MYf6g8kxu2rI1hV7CgdKKj8/zK2PxTUQVoHyA== X-Received: by 2002:a17:907:7212:: with SMTP id dr18mr4989391ejc.298.1634229002319; Thu, 14 Oct 2021 09:30:02 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.30.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:30:01 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 24/26] configure: prepare for auto-generated option parsing Date: Thu, 14 Oct 2021 18:29:36 +0200 Message-Id: <20211014162938.430211-25-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x533.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: Thomas Huth Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Prepare the configure script and Makefile for automatically generated help and parsing. Because we need to run the script to generate the full help, we cannot rely on the user supplying the path to a Python interpreter with --python; therefore, the introspection output is parsed into shell functions and stored in scripts/. The converter is written in Python as standard for QEMU, and this commit contains a stub. Tested-by: Thomas Huth Message-Id: <20211007130829.632254-18-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- Makefile | 8 ++++- configure | 31 ++++++++++++----- scripts/meson-buildoptions.py | 64 +++++++++++++++++++++++++++++++++++ scripts/meson-buildoptions.sh | 13 +++++++ 4 files changed, 106 insertions(+), 10 deletions(-) create mode 100755 scripts/meson-buildoptions.py create mode 100644 scripts/meson-buildoptions.sh diff --git a/Makefile b/Makefile index 401c623a65..fe9415ac64 100644 --- a/Makefile +++ b/Makefile @@ -87,7 +87,7 @@ x := $(shell rm -rf meson-private meson-info meson-logs) endif # 1. ensure config-host.mak is up-to-date -config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/pc-bios $(SRC_PATH)/VERSION +config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/scripts/meson-buildoptions.sh $(SRC_PATH)/pc-bios $(SRC_PATH)/VERSION @echo config-host.mak is out-of-date, running configure @if test -f meson-private/coredata.dat; then \ ./config.status --skip-meson; \ @@ -124,6 +124,12 @@ ifneq ($(MESON),) Makefile.mtest: build.ninja scripts/mtest2make.py $(MESON) introspect --targets --tests --benchmarks | $(PYTHON) scripts/mtest2make.py > $@ -include Makefile.mtest + +.PHONY: update-buildoptions +all update-buildoptions: $(SRC_PATH)/scripts/meson-buildoptions.sh +$(SRC_PATH)/scripts/meson-buildoptions.sh: $(SRC_PATH)/meson_options.txt + $(MESON) introspect --buildoptions $(SRC_PATH)/meson.build | $(PYTHON) \ + scripts/meson-buildoptions.py > $@.tmp && mv $@.tmp $@ endif # 4. Rules to bridge to other makefiles diff --git a/configure b/configure index 2ec410378e..8eb0ef160f 100755 --- a/configure +++ b/configure @@ -789,6 +789,18 @@ fi werror="" +. $source_path/scripts/meson-buildoptions.sh + +meson_options= +meson_option_parse() { + meson_options="$meson_options $(_meson_option_parse "$@")" + if test $? -eq 1; then + echo "ERROR: unknown option $1" + echo "Try '$0 --help' for more information" + exit 1 + fi +} + for opt do optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)') case "$opt" in @@ -1548,6 +1560,8 @@ for opt do ;; --disable-slirp-smbd) slirp_smbd=no ;; + --enable-* | --disable-*) meson_option_parse "$opt" "$optarg" + ;; *) echo "ERROR: unknown option $opt" echo "Try '$0 --help' for more information" @@ -1804,11 +1818,9 @@ Advanced options (experts only): enable plugins via shared library loading --disable-containers don't use containers for cross-building --gdb=GDB-path gdb to use for gdbstub tests [$gdb_bin] - -Optional features, enabled with --enable-FEATURE and -disabled with --disable-FEATURE, default is enabled if available -(unless built with --without-default-features): - +EOF + meson_options_help +cat << EOF system all system emulation targets user supported user emulation targets linux-user all linux usermode emulation targets @@ -4489,7 +4501,8 @@ if test "$skip_meson" = no; then mv $cross config-meson.cross rm -rf meson-private meson-info meson-logs - NINJA=$ninja $meson setup \ + run_meson() { + NINJA=$ninja $meson setup \ --prefix "$prefix" \ --libdir "$libdir" \ --libexecdir "$libexecdir" \ @@ -4534,9 +4547,9 @@ if test "$skip_meson" = no; then -Dpa=$pa -Daudio_drv_list=$audio_drv_list -Dtcg_interpreter=$tcg_interpreter \ -Dtrace_backends=$trace_backends -Dtrace_file=$trace_file -Dlinux_aio=$linux_aio \ -Dnetmap=$netmap -Dvde=$vde \ - $cross_arg \ - "$PWD" "$source_path" - + "$@" $cross_arg "$PWD" "$source_path" + } + eval run_meson $meson_options if test "$?" -ne 0 ; then error_exit "meson setup failed" fi diff --git a/scripts/meson-buildoptions.py b/scripts/meson-buildoptions.py new file mode 100755 index 0000000000..71ee56bd22 --- /dev/null +++ b/scripts/meson-buildoptions.py @@ -0,0 +1,64 @@ +#! /usr/bin/env python3 + +# Generate configure command line options handling code, based on Meson's +# user build options introspection data +# +# Copyright (C) 2021 Red Hat, Inc. +# +# Author: Paolo Bonzini +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import json +import textwrap +import shlex +import sys + +def sh_print(line=""): + print(' printf "%s\\n"', shlex.quote(line)) + + +def load_options(json): + json = [ + x + for x in json + if x["section"] == "user" + and ":" not in x["name"] + and x["name"] not in SKIP_OPTIONS + ] + return sorted(json, key=lambda x: x["name"]) + + +def print_help(options): + print("meson_options_help() {") + sh_print() + sh_print("Optional features, enabled with --enable-FEATURE and") + sh_print("disabled with --disable-FEATURE, default is enabled if available") + sh_print("(unless built with --without-default-features):") + sh_print() + print("}") + + +def print_parse(options): + print("_meson_option_parse() {") + print(" case $1 in") + print(" *) return 1 ;;") + print(" esac") + print("}") + + +options = load_options(json.load(sys.stdin)) +print("# This file is generated by meson-buildoptions.py, do not edit!") +print_help(options) +print_parse(options) diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh new file mode 100644 index 0000000000..c8ae205601 --- /dev/null +++ b/scripts/meson-buildoptions.sh @@ -0,0 +1,13 @@ +# This file is generated by meson-buildoptions.py, do not edit! +meson_options_help() { + printf "%s\n" '' + printf "%s\n" 'Optional features, enabled with --enable-FEATURE and' + printf "%s\n" 'disabled with --disable-FEATURE, default is enabled if available' + printf "%s\n" '(unless built with --without-default-features):' + printf "%s\n" '' +} +_meson_option_parse() { + case $1 in + *) return 1 ;; + esac +} From patchwork Thu Oct 14 16:29:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541038 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=XvHmCR8I; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVb3W6VSjz9s0r for ; Fri, 15 Oct 2021 03:49:43 +1100 (AEDT) Received: from localhost ([::1]:41884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3vJ-00041s-Kv for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:49:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34988) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3cP-0003vS-CO for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:12 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:39912) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3cM-0000q7-Np for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:08 -0400 Received: by mail-ed1-x533.google.com with SMTP id ec8so26616234edb.6 for ; Thu, 14 Oct 2021 09:30:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Lm4cSr3hwZFhtpL9gf7YtW4ZZpF9fqVta4celsFuw+E=; b=XvHmCR8IB5pVXUM7o9x5fkz1pcpGz5yTuT0/kSUa8RE4mHFm473zFmSG07FEzmjarT uRDkt05zQ6g6w92Xe7qpBVgsltmSbcBM6a3AJwzU4Xm3vV1nKpgT5vKgvtps9cnDDgZg qpc7BDPhfXy7UTj9Q+ZhvcFu231nis411nAtGj1k+HqqZlarmD+jKwjq+TEfY8nqIpWq BUhbbX3nHJH//niftDEwhzS6kCDznJw5t0hTlQwhguS/bfSXN8OeZjvR5xkgnOkGk0wp cLtXfLCUEaqrgb8HEuCyGKZeXQk6j6CTxe8HB1i/OtydIrStLCJ8cn+YaEd4TL0qt1js 3uug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Lm4cSr3hwZFhtpL9gf7YtW4ZZpF9fqVta4celsFuw+E=; b=x14ZY2+CzbF93p9npjdbY0cmeK32AubpAXKN0jHyW6w/qQCRcY8d2Nak7CtV0CDUlf fd2UdZK4a7wMMvNQ+HFi628lxd3O+IiV1nZs332dLg+0dYriE9Jrovp1+RqiPMqCR/Ec elFQUAZqkWlXkHegPqAQO5yW/QxKEGw9CnzQom7GKVrkb0Rsmae4XPKRFlHQBkjz9R6C k2IB/eyp7qif9qAwRuUn4GGMZklvg1F/wswmxYdJGMUgpQr2vmLHibbyOjF9b1Mhpy4Z T7Qh0SdtYkTpJQi/6Uz6/c78/E9P1F/Qwhs5+sg3g/NsZ6OkXYaaF+l8Kl/2rljceX9i UaPQ== X-Gm-Message-State: AOAM533ZIva9KHsSQvGLfLjiC6vT1gUqb+QP2L2LHBUujGKvKbCpLqDV QCSAj+j9jlgkCJXxbOuW2heG4jKw7t0= X-Google-Smtp-Source: ABdhPJxVnLN1ESeZydIdmTIP6qtq6fRt5zrNFMObSOcucHdVQhkIimcekp2El5gZ39NkkZS+FXTr1g== X-Received: by 2002:a17:906:a3c4:: with SMTP id ca4mr4866771ejb.529.1634229003432; Thu, 14 Oct 2021 09:30:03 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.30.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:30:02 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 25/26] meson-buildoptions: include list of tracing backends Date: Thu, 14 Oct 2021 18:29:37 +0200 Message-Id: <20211014162938.430211-26-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x533.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Manually patch the introspection data to include the tracing backends. This works around a deficiency in Meson that will be fixed by https://github.com/mesonbuild/meson/pull/9395. Signed-off-by: Paolo Bonzini --- scripts/meson-buildoptions.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/meson-buildoptions.py b/scripts/meson-buildoptions.py index 71ee56bd22..d48af99aaf 100755 --- a/scripts/meson-buildoptions.py +++ b/scripts/meson-buildoptions.py @@ -58,7 +58,23 @@ def print_parse(options): print("}") +def fixup_options(options): + # Meson <= 0.60 does not include the choices in array options, fix that up + for opt in options: + if opt["name"] == "trace_backends": + opt["choices"] = [ + "dtrace", + "ftrace", + "log", + "nop", + "simple", + "syslog", + "ust", + ] + + options = load_options(json.load(sys.stdin)) +fixup_options(options) print("# This file is generated by meson-buildoptions.py, do not edit!") print_help(options) print_parse(options) From patchwork Thu Oct 14 16:29:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1541040 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=MA1aplkW; dkim-atps=neutral Authentication-Results: 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=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVb6b0ltLz9s0r for ; Fri, 15 Oct 2021 03:52:23 +1100 (AEDT) Received: from localhost ([::1]:50950 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3xs-0001jP-Tw for incoming@patchwork.ozlabs.org; Thu, 14 Oct 2021 12:52:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3cT-0003wp-06 for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:18 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]:44618) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3cM-0000sE-OL for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:11 -0400 Received: by mail-ed1-x530.google.com with SMTP id w14so26394523edv.11 for ; Thu, 14 Oct 2021 09:30:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nJMY6tw0TNF27/bRMeNYIxvIfy8u0dOObIn8EaOKMK4=; b=MA1aplkWGdp5/qImL93gBjZeI5PnVzdxfCPaSIVkbzXYP4+vpM7koUyNH2D1OhuyJA xYGZutoj96IbOxL2B9Hhif251w+jLLUVKd6qBum0ABVlV99EWQrWHC8HohEaooFiihWn 6Z5LCAdSMXQ753ATuKOkEeRdYNwQ43TSjeDtfpomQLiwo2/kt8kAej9gqBA05oxoFXlN S4W2VbWTLKClSujOPM7O57lJHbGuaL9uN5culgf2zPSwBNkkTjxgbQVV8RfUtf60Tz9h d7NFwM1p6kNCllW4ifyInfCIGmO6v2hpl3/3H2ciXwOsd17mHMGjMAxeu4GxaZT3tnCc tdBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=nJMY6tw0TNF27/bRMeNYIxvIfy8u0dOObIn8EaOKMK4=; b=zOO4Sj8oJfDT0DN+F965cFxlVHfLyW8BPN/JxmvcDLl/8WsBDLeOJilJTuKSVoGRmX eeHkNyzPowpAvw0UoSm0vVEgJ+PI7YIcmzaj0imVyWT9IAyej9HCKLkYSZVpZ05SHuJt wbCARlQ35MjGYCi4odHsqLf2f2A/YtIYKlJQ/B2fye4p9lxJqNi1JuFZM7Zq+LEwhfdB PtRJiTlI6GiTlz0BhfnYlniaEIgeUps2tLiwnq/tSSd47yfFUYj+M7wdgW7Us9NdIRF+ rqSVncNSHqi3by9HPjVERXgj5ebeGSYHeUSCM8TIG5kh7Z2zVUWXMXJFeyGQu6ZQN+Hx WEWQ== X-Gm-Message-State: AOAM533A/vKQP19OXZbiRF/w3qURRjhmOqazEIzY6JYIbzUu6MK9qKTL 0HCdRVJsxhSPcT/OuXiNPrIp++dMDl4= X-Google-Smtp-Source: ABdhPJztBUFmcmXVg3TWYo1sn9z26CMLJAyCUBKWkYBrJkIYhSQzRQPPJ/tkWBTSUR6OLx3Zknce1A== X-Received: by 2002:a17:907:208c:: with SMTP id pv12mr5217793ejb.314.1634229004878; Thu, 14 Oct 2021 09:30:04 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.30.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:30:04 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 26/26] configure: automatically parse command line for meson -D options Date: Thu, 14 Oct 2021 18:29:38 +0200 Message-Id: <20211014162938.430211-27-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x530.google.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Right now meson_options.txt lists about 90 options. Each option needs code in configure to parse it and pass the option down to Meson as a -D command-line argument; in addition the default must be duplicated between configure and meson_options.txt. This series tries to remove the code duplication by generating the case statement for those --enable and --disable options, as well as the corresponding help text. About 80% of the options can be handled completely by the new mechanism. Eight meson options are not of the --enable/--disable kind. Six more need to be parsed in configure for various reasons documented in the patch, but they still have their help automatically generated. The advantages are: - less code in configure - parsing and help is more consistent (for example --enable-blobs was not supported) - options are described entirely in one place, meson_options.txt. This make it more attractive to use Meson options instead of hand-crafted configure options and config-host.mak A few options change name: --enable-tcmalloc and --enable-jemalloc become --enable-malloc={tcmalloc,jemalloc}; --disable-blobs becomes --disable-install-blobs; --enable-trace-backend becomes --enable-trace-backends. However, the old names are allowed for backwards compatibility. Message-Id: <20211007130829.632254-19-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 556 +++------------------------------- docs/devel/build-system.rst | 132 ++++---- meson_options.txt | 8 + scripts/meson-buildoptions.py | 92 ++++++ scripts/meson-buildoptions.sh | 257 ++++++++++++++++ 5 files changed, 459 insertions(+), 586 deletions(-) diff --git a/configure b/configure index 8eb0ef160f..039467c04b 100755 --- a/configure +++ b/configure @@ -286,41 +286,8 @@ for opt do esac done -brlapi="auto" -curl="auto" -iconv="auto" -curses="auto" -docs="auto" -fdt="auto" -netmap="auto" -sdl="auto" -sdl_image="auto" -virtiofsd="auto" -virtfs="auto" -libudev="auto" -mpath="auto" -vnc="auto" -sparse="auto" -vde="auto" -vnc_sasl="auto" -vnc_jpeg="auto" -vnc_png="auto" -xkbcommon="auto" -alsa="auto" -coreaudio="auto" -dsound="auto" -jack="auto" -oss="auto" -pa="auto" -xen=${default_feature:+disabled} xen_ctrl_version="$default_feature" -xen_pci_passthrough="auto" -linux_aio="auto" -linux_io_uring="auto" -cap_ng="auto" -attr="auto" xfs="$default_feature" -tcg="enabled" membarrier="$default_feature" vhost_kernel="$default_feature" vhost_net="$default_feature" @@ -328,15 +295,8 @@ vhost_crypto="$default_feature" vhost_scsi="$default_feature" vhost_vsock="$default_feature" vhost_user="no" -vhost_user_blk_server="auto" vhost_user_fs="$default_feature" vhost_vdpa="$default_feature" -bpf="auto" -kvm="auto" -hax="auto" -hvf="auto" -whpx="auto" -nvmm="auto" rdma="$default_feature" pvrdma="$default_feature" gprof="no" @@ -346,7 +306,6 @@ sanitizers="no" tsan="no" fortify_source="$default_feature" strip_opt="yes" -tcg_interpreter="false" mingw32="no" gcov="no" EXESUF="" @@ -354,68 +313,36 @@ modules="no" module_upgrades="no" prefix="/usr/local" qemu_suffix="qemu" -slirp="auto" bsd="no" linux="no" solaris="no" profiler="no" -cocoa="auto" softmmu="yes" linux_user="no" bsd_user="no" -blobs="true" pkgversion="" pie="" qom_cast_debug="yes" trace_backends="log" trace_file="trace" -spice="auto" -spice_protocol="auto" -rbd="auto" -smartcard="auto" -u2f="auto" -libusb="auto" -usb_redir="auto" opengl="$default_feature" cpuid_h="no" avx2_opt="$default_feature" -capstone="auto" -lzo="auto" -snappy="auto" -bzip2="auto" -lzfse="auto" -zstd="auto" guest_agent="$default_feature" guest_agent_with_vss="no" guest_agent_ntddscsi="no" -guest_agent_msi="auto" vss_win32_sdk="$default_feature" win_sdk="no" want_tools="$default_feature" -libiscsi="auto" -libnfs="auto" coroutine="" coroutine_pool="$default_feature" debug_stack_usage="no" crypto_afalg="no" -cfi="false" -cfi_debug="false" -seccomp="auto" -glusterfs="auto" -gtk="auto" tls_priority="NORMAL" -gnutls="auto" -nettle="auto" -gcrypt="auto" -auth_pam="auto" -vte="auto" -virglrenderer="auto" tpm="$default_feature" libssh="$default_feature" live_block_migration=${default_feature:-yes} numa="$default_feature" -tcmalloc="no" -jemalloc="no" replication=${default_feature:-yes} bochs=${default_feature:-yes} cloop=${default_feature:-yes} @@ -425,26 +352,34 @@ vdi=${default_feature:-yes} vvfat=${default_feature:-yes} qed=${default_feature:-yes} parallels=${default_feature:-yes} -libxml2="auto" debug_mutex="no" -libpmem="auto" -default_devices="true" plugins="$default_feature" -fuzzing="false" rng_none="no" secret_keyring="$default_feature" -libdaxctl="auto" meson="" +meson_args="" ninja="" +gio="$default_feature" skip_meson=no -gettext="auto" -fuse="auto" -fuse_lseek="auto" -multiprocess="auto" slirp_smbd="$default_feature" -malloc_trim="auto" -gio="$default_feature" +# The following Meson options are handled manually (still they +# are included in the automatically generated help message) + +# 1. Track which submodules are needed +capstone="auto" +fdt="auto" +slirp="auto" + +# 2. Support --with/--without option +default_devices="true" + +# 3. Automatically enable/disable other options +tcg="enabled" +cfi="false" + +# 4. Detection partly done in configure +xen=${default_feature:+disabled} # parse CC options second for opt do @@ -874,11 +809,6 @@ for opt do error_exit "Can't mix --target-list-exclude with --target-list" fi ;; - --enable-trace-backends=*) trace_backends="$optarg" - ;; - # XXX: backwards compatibility - --enable-trace-backend=*) trace_backends="$optarg" - ;; --with-trace-file=*) trace_file="$optarg" ;; --with-default-devices) default_devices="true" @@ -941,42 +871,10 @@ for opt do # configure to be used by RPM and similar macros that set # lots of directory switches by default. ;; - --disable-sdl) sdl="disabled" - ;; - --enable-sdl) sdl="enabled" - ;; - --disable-sdl-image) sdl_image="disabled" - ;; - --enable-sdl-image) sdl_image="enabled" - ;; --disable-qom-cast-debug) qom_cast_debug="no" ;; --enable-qom-cast-debug) qom_cast_debug="yes" ;; - --disable-virtfs) virtfs="disabled" - ;; - --enable-virtfs) virtfs="enabled" - ;; - --disable-libudev) libudev="disabled" - ;; - --enable-libudev) libudev="enabled" - ;; - --disable-virtiofsd) virtiofsd="disabled" - ;; - --enable-virtiofsd) virtiofsd="enabled" - ;; - --disable-mpath) mpath="disabled" - ;; - --enable-mpath) mpath="enabled" - ;; - --disable-vnc) vnc="disabled" - ;; - --enable-vnc) vnc="enabled" - ;; - --disable-gettext) gettext="disabled" - ;; - --enable-gettext) gettext="enabled" - ;; --audio-drv-list=*) audio_drv_list="$optarg" ;; --block-drv-rw-whitelist=*|--block-drv-whitelist=*) block_drv_rw_whitelist=$(echo "$optarg" | sed -e 's/,/ /g') @@ -1007,24 +905,8 @@ for opt do ;; --disable-tsan) tsan="no" ;; - --enable-sparse) sparse="enabled" - ;; - --disable-sparse) sparse="disabled" - ;; --disable-strip) strip_opt="no" ;; - --disable-vnc-sasl) vnc_sasl="disabled" - ;; - --enable-vnc-sasl) vnc_sasl="enabled" - ;; - --disable-vnc-jpeg) vnc_jpeg="disabled" - ;; - --enable-vnc-jpeg) vnc_jpeg="enabled" - ;; - --disable-vnc-png) vnc_png="disabled" - ;; - --enable-vnc-png) vnc_png="enabled" - ;; --disable-slirp) slirp="disabled" ;; --enable-slirp) slirp="enabled" @@ -1033,113 +915,17 @@ for opt do ;; --enable-slirp=*) slirp="$optarg" ;; - --disable-vde) vde="disabled" - ;; - --enable-vde) vde="enabled" - ;; - --disable-netmap) netmap="disabled" - ;; - --enable-netmap) netmap="enabled" - ;; --disable-xen) xen="disabled" ;; --enable-xen) xen="enabled" ;; - --disable-xen-pci-passthrough) xen_pci_passthrough="disabled" - ;; - --enable-xen-pci-passthrough) xen_pci_passthrough="enabled" - ;; - --disable-alsa) alsa="disabled" - ;; - --enable-alsa) alsa="enabled" - ;; - --disable-coreaudio) coreaudio="disabled" - ;; - --enable-coreaudio) coreaudio="enabled" - ;; - --disable-dsound) dsound="disabled" - ;; - --enable-dsound) dsound="enabled" - ;; - --disable-jack) jack="disabled" - ;; - --enable-jack) jack="enabled" - ;; - --disable-oss) oss="disabled" - ;; - --enable-oss) oss="enabled" - ;; - --disable-pa) pa="disabled" - ;; - --enable-pa) pa="enabled" - ;; - --disable-brlapi) brlapi="disabled" - ;; - --enable-brlapi) brlapi="enabled" - ;; - --disable-kvm) kvm="disabled" - ;; - --enable-kvm) kvm="enabled" - ;; - --disable-hax) hax="disabled" - ;; - --enable-hax) hax="enabled" - ;; - --disable-hvf) hvf="disabled" - ;; - --enable-hvf) hvf="enabled" - ;; - --disable-nvmm) nvmm="disabled" - ;; - --enable-nvmm) nvmm="enabled" - ;; - --disable-whpx) whpx="disabled" - ;; - --enable-whpx) whpx="enabled" - ;; - --disable-tcg-interpreter) tcg_interpreter="false" - ;; - --enable-tcg-interpreter) tcg_interpreter="true" - ;; - --disable-cap-ng) cap_ng="disabled" - ;; - --enable-cap-ng) cap_ng="enabled" - ;; --disable-tcg) tcg="disabled" plugins="no" ;; --enable-tcg) tcg="enabled" ;; - --disable-malloc-trim) malloc_trim="disabled" - ;; - --enable-malloc-trim) malloc_trim="enabled" - ;; - --disable-spice) spice="no" - ;; - --enable-spice) - spice_protocol="yes" - spice="yes" - ;; - --disable-spice-protocol) - spice_protocol="no" - spice="no" - ;; - --enable-spice-protocol) spice_protocol="yes" - ;; - --disable-libiscsi) libiscsi="disabled" - ;; - --enable-libiscsi) libiscsi="enabled" - ;; - --disable-libnfs) libnfs="disabled" - ;; - --enable-libnfs) libnfs="enabled" - ;; --enable-profiler) profiler="yes" ;; - --disable-cocoa) cocoa="disabled" - ;; - --enable-cocoa) cocoa="enabled" - ;; --disable-system) softmmu="no" ;; --enable-system) softmmu="yes" @@ -1183,22 +969,6 @@ for opt do ;; --disable-cfi) cfi="false" ;; - --enable-cfi-debug) cfi_debug="true" - ;; - --disable-cfi-debug) cfi_debug="false" - ;; - --disable-curses) curses="disabled" - ;; - --enable-curses) curses="enabled" - ;; - --disable-iconv) iconv="disabled" - ;; - --enable-iconv) iconv="enabled" - ;; - --disable-curl) curl="disabled" - ;; - --enable-curl) curl="enabled" - ;; --disable-fdt) fdt="disabled" ;; --enable-fdt) fdt="enabled" @@ -1207,28 +977,10 @@ for opt do ;; --enable-fdt=*) fdt="$optarg" ;; - --disable-linux-aio) linux_aio="disabled" - ;; - --enable-linux-aio) linux_aio="enabled" - ;; - --disable-linux-io-uring) linux_io_uring="disabled" - ;; - --enable-linux-io-uring) linux_io_uring="enabled" - ;; - --disable-attr) attr="disabled" - ;; - --enable-attr) attr="enabled" - ;; --disable-membarrier) membarrier="no" ;; --enable-membarrier) membarrier="yes" ;; - --disable-bpf) bpf="disabled" - ;; - --enable-bpf) bpf="enabled" - ;; - --disable-blobs) blobs="false" - ;; --with-pkgversion=*) pkgversion="$optarg" ;; --with-coroutine=*) coroutine="$optarg" @@ -1243,10 +995,6 @@ for opt do ;; --disable-crypto-afalg) crypto_afalg="no" ;; - --disable-docs) docs="disabled" - ;; - --enable-docs) docs="enabled" - ;; --disable-vhost-net) vhost_net="no" ;; --enable-vhost-net) vhost_net="yes" @@ -1263,10 +1011,6 @@ for opt do ;; --enable-vhost-vsock) vhost_vsock="yes" ;; - --disable-vhost-user-blk-server) vhost_user_blk_server="disabled" - ;; - --enable-vhost-user-blk-server) vhost_user_blk_server="enabled" - ;; --disable-vhost-user-fs) vhost_user_fs="no" ;; --enable-vhost-user-fs) vhost_user_fs="yes" @@ -1275,60 +1019,16 @@ for opt do ;; --enable-opengl) opengl="yes" ;; - --disable-rbd) rbd="disabled" - ;; - --enable-rbd) rbd="enabled" - ;; --disable-xfsctl) xfs="no" ;; --enable-xfsctl) xfs="yes" ;; - --disable-smartcard) smartcard="disabled" - ;; - --enable-smartcard) smartcard="enabled" - ;; - --disable-u2f) u2f="disabled" - ;; - --enable-u2f) u2f="enabled" - ;; - --disable-libusb) libusb="disabled" - ;; - --enable-libusb) libusb="enabled" - ;; - --disable-usb-redir) usb_redir="disabled" - ;; - --enable-usb-redir) usb_redir="enabled" - ;; --disable-zlib-test) ;; - --disable-lzo) lzo="disabled" - ;; - --enable-lzo) lzo="enabled" - ;; - --disable-snappy) snappy="disabled" - ;; - --enable-snappy) snappy="enabled" - ;; - --disable-bzip2) bzip2="disabled" - ;; - --enable-bzip2) bzip2="enabled" - ;; - --enable-lzfse) lzfse="enabled" - ;; - --disable-lzfse) lzfse="disabled" - ;; - --disable-zstd) zstd="disabled" - ;; - --enable-zstd) zstd="enabled" - ;; --enable-guest-agent) guest_agent="yes" ;; --disable-guest-agent) guest_agent="no" ;; - --enable-guest-agent-msi) guest_agent_msi="enabled" - ;; - --disable-guest-agent-msi) guest_agent_msi="disabled" - ;; --with-vss-sdk) vss_win32_sdk="" ;; --with-vss-sdk=*) vss_win32_sdk="$optarg" @@ -1345,12 +1045,6 @@ for opt do ;; --disable-tools) want_tools="no" ;; - --enable-seccomp) seccomp="enabled" - ;; - --disable-seccomp) seccomp="disabled" - ;; - --disable-glusterfs) glusterfs="disabled" - ;; --disable-avx2) avx2_opt="no" ;; --enable-avx2) avx2_opt="yes" @@ -1359,9 +1053,6 @@ for opt do ;; --enable-avx512f) avx512f_opt="yes" ;; - - --enable-glusterfs) glusterfs="enabled" - ;; --disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane) echo "$0: $opt is obsolete, virtio-blk data-plane is always on" >&2 ;; @@ -1371,28 +1062,8 @@ for opt do --enable-uuid|--disable-uuid) echo "$0: $opt is obsolete, UUID support is always built" >&2 ;; - --disable-gtk) gtk="disabled" - ;; - --enable-gtk) gtk="enabled" - ;; --tls-priority=*) tls_priority="$optarg" ;; - --disable-gnutls) gnutls="disabled" - ;; - --enable-gnutls) gnutls="enabled" - ;; - --disable-nettle) nettle="disabled" - ;; - --enable-nettle) nettle="enabled" - ;; - --disable-gcrypt) gcrypt="disabled" - ;; - --enable-gcrypt) gcrypt="enabled" - ;; - --disable-auth-pam) auth_pam="disabled" - ;; - --enable-auth-pam) auth_pam="enabled" - ;; --enable-rdma) rdma="yes" ;; --disable-rdma) rdma="no" @@ -1401,14 +1072,6 @@ for opt do ;; --disable-pvrdma) pvrdma="no" ;; - --disable-vte) vte="disabled" - ;; - --enable-vte) vte="enabled" - ;; - --disable-virglrenderer) virglrenderer="disabled" - ;; - --enable-virglrenderer) virglrenderer="enabled" - ;; --disable-tpm) tpm="no" ;; --enable-tpm) tpm="yes" @@ -1425,18 +1088,6 @@ for opt do ;; --enable-numa) numa="yes" ;; - --disable-libxml2) libxml2="disabled" - ;; - --enable-libxml2) libxml2="enabled" - ;; - --disable-tcmalloc) tcmalloc="no" - ;; - --enable-tcmalloc) tcmalloc="yes" - ;; - --disable-jemalloc) jemalloc="no" - ;; - --enable-jemalloc) jemalloc="yes" - ;; --disable-replication) replication="no" ;; --enable-replication) replication="yes" @@ -1502,14 +1153,6 @@ for opt do ;; --disable-debug-mutex) debug_mutex=no ;; - --enable-libpmem) libpmem="enabled" - ;; - --disable-libpmem) libpmem="disabled" - ;; - --enable-xkbcommon) xkbcommon="enabled" - ;; - --disable-xkbcommon) xkbcommon="disabled" - ;; --enable-plugins) if test "$mingw32" = "yes"; then error_exit "TCG plugins not currently supported on Windows platforms" else @@ -1522,10 +1165,6 @@ for opt do ;; --disable-containers) use_containers="no" ;; - --enable-fuzzing) fuzzing=true - ;; - --disable-fuzzing) fuzzing=false - ;; --gdb=*) gdb_bin="$optarg" ;; --enable-rng-none) rng_none=yes @@ -1536,22 +1175,6 @@ for opt do ;; --disable-keyring) secret_keyring="no" ;; - --enable-libdaxctl) libdaxctl="enabled" - ;; - --disable-libdaxctl) libdaxctl="disabled" - ;; - --enable-fuse) fuse="enabled" - ;; - --disable-fuse) fuse="disabled" - ;; - --enable-fuse-lseek) fuse_lseek="enabled" - ;; - --disable-fuse-lseek) fuse_lseek="disabled" - ;; - --enable-multiprocess) multiprocess="enabled" - ;; - --disable-multiprocess) multiprocess="disabled" - ;; --enable-gio) gio=yes ;; --disable-gio) gio=no @@ -1560,6 +1183,16 @@ for opt do ;; --disable-slirp-smbd) slirp_smbd=no ;; + # backwards compatibility options + --enable-trace-backend=*) meson_option_parse "--enable-trace-backends=$optarg" "$optarg" + ;; + --disable-blobs) meson_option_parse --disable-install-blobs "" + ;; + --enable-tcmalloc) meson_option_parse --enable-malloc=tcmalloc tcmalloc + ;; + --enable-jemalloc) meson_option_parse --enable-malloc=jemalloc jemalloc + ;; + # everything else has the same name in configure and meson --enable-* | --disable-*) meson_option_parse "$opt" "$optarg" ;; *) @@ -1716,9 +1349,6 @@ for config in $mak_wilds; do fi done -# Enumerate public trace backends for --help output -trace_backend_list=$(echo $(grep -le '^PUBLIC = True$' "$source_path"/scripts/tracetool/backend/*.py | sed -e 's/^.*\/\(.*\)\.py$/\1/')) - if test x"$show_help" = x"yes" ; then cat << EOF @@ -1795,18 +1425,12 @@ Advanced options (experts only): (by default affects only QEMU, not tools like qemu-img) --enable-block-drv-whitelist-in-tools use block whitelist also in tools instead of only QEMU - --enable-trace-backends=B Set trace backend - Available backends: $trace_backend_list --with-trace-file=NAME Full PATH,NAME of file to store traces Default:trace- - --disable-slirp disable SLIRP userspace network connectivity - --enable-tcg-interpreter enable TCI (TCG with bytecode interpreter, experimental and slow) - --enable-malloc-trim enable libc malloc_trim() for memory optimization --cpu=CPU Build for host CPU [$cpu] --with-coroutine=BACKEND coroutine backend. Supported options: ucontext, sigaltstack, windows --enable-gcov enable test coverage analysis with gcov - --disable-blobs disable installing provided firmware blobs --with-vss-sdk=SDK-path enable Windows VSS support in QEMU Guest Agent --with-win-sdk=SDK-path path to Windows Platform SDK (to build VSS .tlb) --tls-priority default TLS protocol/cipher priority string @@ -1825,110 +1449,34 @@ cat << EOF user supported user emulation targets linux-user all linux usermode emulation targets bsd-user all BSD usermode emulation targets - docs build documentation guest-agent build the QEMU Guest Agent - guest-agent-msi build guest agent Windows MSI installation package pie Position Independent Executables modules modules support (non-Windows) module-upgrades try to load modules from alternate paths for upgrades debug-tcg TCG debugging (default is disabled) debug-info debugging information lto Enable Link-Time Optimization. - sparse sparse checker safe-stack SafeStack Stack Smash Protection. Depends on clang/llvm >= 3.7 and requires coroutine backend ucontext. - cfi Enable Control-Flow Integrity for indirect function calls. - In case of a cfi violation, QEMU is terminated with SIGILL - Depends on lto and is incompatible with modules - Automatically enables Link-Time Optimization (lto) - cfi-debug In case of a cfi violation, a message containing the line that - triggered the error is written to stderr. After the error, - QEMU is still terminated with SIGILL - gnutls GNUTLS cryptography support - nettle nettle cryptography support - gcrypt libgcrypt cryptography support - auth-pam PAM access control - sdl SDL UI - sdl-image SDL Image support for icons - gtk gtk UI - vte vte support for the gtk UI - curses curses UI - iconv font glyph conversion support - vnc VNC UI support - vnc-sasl SASL encryption for VNC server - vnc-jpeg JPEG lossy compression for VNC server - vnc-png PNG compression for VNC server - cocoa Cocoa UI (Mac OS X only) - virtfs VirtFS - virtiofsd build virtiofs daemon (virtiofsd) - libudev Use libudev to enumerate host devices - mpath Multipath persistent reservation passthrough - xen xen backend driver support - xen-pci-passthrough PCI passthrough support for Xen - alsa ALSA sound support - coreaudio CoreAudio sound support - dsound DirectSound sound support - jack JACK sound support - oss OSS sound support - pa PulseAudio sound support - brlapi BrlAPI (Braile) - curl curl connectivity membarrier membarrier system call (for Linux 4.14+ or Windows) - fdt fdt device tree - kvm KVM acceleration support - hax HAX acceleration support - hvf Hypervisor.framework acceleration support - nvmm NVMM acceleration support - whpx Windows Hypervisor Platform acceleration support rdma Enable RDMA-based migration pvrdma Enable PVRDMA support - vde support for vde network - netmap support for netmap network - linux-aio Linux AIO support - linux-io-uring Linux io_uring support - cap-ng libcap-ng support - attr attr and xattr support vhost-net vhost-net kernel acceleration support vhost-vsock virtio sockets device support vhost-scsi vhost-scsi kernel target support vhost-crypto vhost-user-crypto backend support vhost-kernel vhost kernel backend support vhost-user vhost-user backend support - vhost-user-blk-server vhost-user-blk server support vhost-vdpa vhost-vdpa kernel backend support - bpf BPF kernel support - spice spice - spice-protocol spice-protocol - rbd rados block device (rbd) - libiscsi iscsi support - libnfs nfs support - smartcard smartcard support (libcacard) - u2f U2F support (u2f-emu) - libusb libusb (for usb passthrough) live-block-migration Block migration in the main migration stream - usb-redir usb network redirection support - lzo support of lzo compression library - snappy support of snappy compression library - bzip2 support of bzip2 compression library - (for reading bzip2-compressed dmg images) - lzfse support of lzfse compression library - (for reading lzfse-compressed dmg images) - zstd support for zstd compression library - (for migration compression and qcow2 cluster compression) - seccomp seccomp support coroutine-pool coroutine freelist (better performance) - glusterfs GlusterFS backend tpm TPM support libssh ssh block device support numa libnuma support - libxml2 for Parallels image format - tcmalloc tcmalloc support - jemalloc jemalloc support avx2 AVX2 optimization support avx512f AVX512F optimization support replication replication support opengl opengl support - virglrenderer virgl rendering support xfsctl xfsctl support qom-cast-debug cast debugging support tools build qemu-io, qemu-nbd and qemu-img tools @@ -1941,15 +1489,8 @@ cat << EOF qed qed image format support parallels parallels image format support crypto-afalg Linux AF_ALG crypto backend driver - capstone capstone disassembler support debug-mutex mutex debugging support - libpmem libpmem support - xkbcommon xkbcommon support rng-none dummy RNG, avoid using /dev/(u)random and getrandom() - libdaxctl libdaxctl support - fuse FUSE block device export - fuse-lseek SEEK_HOLE/SEEK_DATA support for FUSE exports - multiprocess Out of process device emulation support gio libgio support slirp-smbd use smbd (at path --smbd=*) in slirp networking @@ -3173,16 +2714,6 @@ EOF fi fi -malloc=system -if test "$tcmalloc" = "yes" && test "$jemalloc" = "yes" ; then - echo "ERROR: tcmalloc && jemalloc can't be used at the same time" - exit 1 -elif test "$tcmalloc" = "yes" ; then - malloc=tcmalloc -elif test "$jemalloc" = "yes" ; then - malloc=jemalloc -fi - # check for usbfs have_usbfs=no if test "$linux_user" = "yes"; then @@ -4513,40 +4044,23 @@ if test "$skip_meson" = no; then --sysconfdir "$sysconfdir" \ --localedir "$localedir" \ --localstatedir "$local_statedir" \ + -Daudio_drv_list=$audio_drv_list \ + -Ddefault_devices=$default_devices \ -Ddocdir="$docdir" \ -Dqemu_firmwarepath="$firmwarepath" \ -Dqemu_suffix="$qemu_suffix" \ + -Dsphinx_build="$sphinx_build" \ + -Dtrace_file="$trace_file" \ -Doptimization=$(if test "$debug" = yes; then echo 0; else echo 2; fi) \ -Ddebug=$(if test "$debug_info" = yes; then echo true; else echo false; fi) \ -Dwerror=$(if test "$werror" = yes; then echo true; else echo false; fi) \ -Dstrip=$(if test "$strip_opt" = yes; then echo true; else echo false; fi) \ -Db_pie=$(if test "$pie" = yes; then echo true; else echo false; fi) \ -Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false; fi) \ - -Db_lto=$lto -Dcfi=$cfi -Dcfi_debug=$cfi_debug -Dfuzzing=$fuzzing \ + -Db_lto=$lto -Dcfi=$cfi -Dtcg=$tcg -Dxen=$xen \ + -Dcapstone=$capstone -Dfdt=$fdt -Dslirp=$slirp \ $(test -n "${LIB_FUZZING_ENGINE+xxx}" && echo "-Dfuzzing_engine=$LIB_FUZZING_ENGINE") \ - -Dmalloc=$malloc -Dmalloc_trim=$malloc_trim -Dsparse=$sparse \ - -Dkvm=$kvm -Dhax=$hax -Dwhpx=$whpx -Dhvf=$hvf -Dnvmm=$nvmm \ - -Dxen=$xen -Dxen_pci_passthrough=$xen_pci_passthrough -Dtcg=$tcg \ - -Dcocoa=$cocoa -Dgtk=$gtk -Dmpath=$mpath -Dsdl=$sdl -Dsdl_image=$sdl_image \ - -Dlibusb=$libusb -Dsmartcard=$smartcard -Dusb_redir=$usb_redir -Dvte=$vte \ - -Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \ - -Dgettext=$gettext -Dxkbcommon=$xkbcommon -Du2f=$u2f -Dvirtiofsd=$virtiofsd \ - -Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt -Dbrlapi=$brlapi \ - -Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 -Dlibiscsi=$libiscsi \ - -Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ - -Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy -Dlzfse=$lzfse -Dlibxml2=$libxml2 \ - -Dlibdaxctl=$libdaxctl -Dlibpmem=$libpmem -Dlinux_io_uring=$linux_io_uring \ - -Dgnutls=$gnutls -Dnettle=$nettle -Dgcrypt=$gcrypt -Dauth_pam=$auth_pam \ - -Dzstd=$zstd -Dseccomp=$seccomp -Dvirtfs=$virtfs -Dcap_ng=$cap_ng \ - -Dattr=$attr -Ddefault_devices=$default_devices -Dvirglrenderer=$virglrenderer \ - -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \ - -Dvhost_user_blk_server=$vhost_user_blk_server -Dmultiprocess=$multiprocess \ - -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek -Dguest_agent_msi=$guest_agent_msi -Dbpf=$bpf\ $(if test "$default_feature" = no; then echo "-Dauto_features=disabled"; fi) \ - -Dalsa=$alsa -Dcoreaudio=$coreaudio -Ddsound=$dsound -Djack=$jack -Doss=$oss \ - -Dpa=$pa -Daudio_drv_list=$audio_drv_list -Dtcg_interpreter=$tcg_interpreter \ - -Dtrace_backends=$trace_backends -Dtrace_file=$trace_file -Dlinux_aio=$linux_aio \ - -Dnetmap=$netmap -Dvde=$vde \ "$@" $cross_arg "$PWD" "$source_path" } eval run_meson $meson_options diff --git a/docs/devel/build-system.rst b/docs/devel/build-system.rst index 0f636d620e..7f106d2f1c 100644 --- a/docs/devel/build-system.rst +++ b/docs/devel/build-system.rst @@ -42,73 +42,21 @@ perform a build: ../configure make -For now, checks on the compilation environment are found in configure -rather than meson.build, though this is expected to change. The command -line is parsed in the configure script and, whenever needed, converted -into the appropriate options to Meson. - -New checks should be added to Meson, which usually comprises the -following tasks: - - - Add a Meson build option to meson_options.txt. - - - Add support to the command line arg parser to handle any new - ``--enable-XXX``/``--disable-XXX`` flags required by the feature. - - - Add information to the help output message to report on the new - feature flag. - - - Add code to perform the actual feature check. - - - Add code to include the feature status in ``config-host.h`` - - - Add code to print out the feature status in the configure summary - upon completion. - - -Taking the probe for SDL2_Image as an example, we have the following pieces -in configure:: - - # Initial variable state - sdl_image=auto - - ..snip.. - - # Configure flag processing - --disable-sdl-image) sdl_image=disabled - ;; - --enable-sdl-image) sdl_image=enabled - ;; - - ..snip.. - - # Help output feature message - sdl-image SDL Image support for icons - - ..snip.. - - # Meson invocation - -Dsdl_image=$sdl_image - -In meson_options.txt:: - - option('sdl', type : 'feature', value : 'auto', - description: 'SDL Image support for icons') - -In meson.build:: - - # Detect dependency - sdl_image = dependency('SDL2_image', required: get_option('sdl_image'), - method: 'pkg-config', - kwargs: static_kwargs) - - # Create config-host.h (if applicable) - config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) - - # Summary - summary_info += {'SDL image support': sdl_image.found()} +The configure script automatically recognizes +command line options for which a same-named Meson option exists; +dashes in the command line are replaced with underscores. +Many checks on the compilation environment are still found in configure +rather than `meson.build`, but new checks should be added directly to +`meson.build`. +Patches are also welcome to move existing checks from the configure +phase to `meson.build`. When doing so, ensure that `meson.build` does +not use anymore the keys that you have removed from `config-host.mak`. +Typically these will be replaced in `meson.build` by boolean variables, +``get_option('optname')`` invocations, or `dep.found()` expressions. +In general, the remaining checks have little or no interdependencies, +so they can be moved one by one. Helper functions ---------------- @@ -335,6 +283,60 @@ new target, or enabling new devices or hardware for a particular system/userspace emulation target +Adding checks +------------- + +New checks should be added to Meson. Compiler checks can be as simple as +the following:: + + config_host_data.set('HAVE_BTRFS_H', cc.has_header('linux/btrfs.h')) + +A more complex task such as adding a new dependency usually +comprises the following tasks: + + - Add a Meson build option to meson_options.txt. + + - Add code to perform the actual feature check. + + - Add code to include the feature status in `config-host.h` + + - Add code to print out the feature status in the configure summary + upon completion. + +Taking the probe for SDL2_Image as an example, we have the following +in ``meson_options.txt``:: + + option('sdl_image', type : 'feature', value : 'auto', + description: 'SDL Image support for icons') + +Unless the option was given a non-``auto`` value (on the configure +command line), the detection code must be performed only if the +dependency will be used:: + + sdl_image = not_found + if not get_option('sdl_image').auto() or have_system + sdl_image = dependency('SDL2_image', required: get_option('sdl_image'), + method: 'pkg-config', + static: enable_static) + endif + +This avoids warnings on static builds of user-mode emulators, for example. +Most of the libraries used by system-mode emulators are not available for +static linking. + +The other supporting code is generally simple:: + + # Create config-host.h (if applicable) + config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) + + # Summary + summary_info += {'SDL image support': sdl_image.found()} + +For the configure script to parse the new option, the +``scripts/meson-buildoptions.sh`` file must be up-to-date; ``make +update-buildoptions`` (or just `make`) will take care of updating it. + + Support scripts --------------- diff --git a/meson_options.txt b/meson_options.txt index 5a140af7f7..4ab4570125 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,7 @@ +# These options do not correspond to a --enable/--disable-* option +# on the configure script command line. If you add more, list them in +# scripts/meson-buildoptions.py's SKIP_OPTIONS constant too. + option('qemu_suffix', type : 'string', value: 'qemu', description: 'Suffix for QEMU data/modules/config directories (can be empty)') option('docdir', type : 'string', value : 'doc', @@ -16,6 +20,10 @@ option('fuzzing_engine', type : 'string', value : '', option('trace_file', type: 'string', value: 'trace', description: 'Trace file prefix for simple backend') +# Everything else can be set via --enable/--disable-* option +# on the configure script command line. After adding an option +# here make sure to run "make update-buildoptions". + option('docs', type : 'feature', value : 'auto', description: 'Documentations build support') option('fuzzing', type : 'boolean', value: false, diff --git a/scripts/meson-buildoptions.py b/scripts/meson-buildoptions.py index d48af99aaf..256523c09d 100755 --- a/scripts/meson-buildoptions.py +++ b/scripts/meson-buildoptions.py @@ -25,10 +25,71 @@ import shlex import sys +SKIP_OPTIONS = { + "audio_drv_list", + "default_devices", + "docdir", + "fuzzing_engine", + "qemu_firmwarepath", + "qemu_suffix", + "sphinx_build", + "trace_file", +} + +LINE_WIDTH = 76 + + +# Convert the default value of an option to the string used in +# the help message +def value_to_help(value): + if isinstance(value, list): + return ",".join(value) + if isinstance(value, bool): + return "enabled" if value else "disabled" + return str(value) + + +def wrap(left, text, indent): + spaces = " " * indent + if len(left) >= indent: + yield left + left = spaces + else: + left = (left + spaces)[0:indent] + yield from textwrap.wrap( + text, width=LINE_WIDTH, initial_indent=left, subsequent_indent=spaces + ) + + def sh_print(line=""): print(' printf "%s\\n"', shlex.quote(line)) +def help_line(left, opt, indent, long): + right = f'{opt["description"]}' + if long: + value = value_to_help(opt["value"]) + if value != "auto": + right += f" [{value}]" + if "choices" in opt and long: + choices = "/".join(sorted(opt["choices"])) + right += f" (choices: {choices})" + for x in wrap(" " + left, right, indent): + sh_print(x) + + +# Return whether the option (a dictionary) can be used with +# arguments. Booleans can never be used with arguments; +# combos allow an argument only if they accept other values +# than "auto", "enabled", and "disabled". +def allow_arg(opt): + if opt["type"] == "boolean": + return False + if opt["type"] != "combo": + return True + return not (set(opt["choices"]) <= {"auto", "disabled", "enabled"}) + + def load_options(json): json = [ x @@ -42,17 +103,48 @@ def load_options(json): def print_help(options): print("meson_options_help() {") + for opt in options: + key = opt["name"].replace("_", "-") + # The first section includes options that have an arguments, + # and booleans (i.e., only one of enable/disable makes sense) + if opt["type"] == "boolean": + left = f"--disable-{key}" if opt["value"] else f"--enable-{key}" + help_line(left, opt, 27, False) + elif allow_arg(opt): + if opt["type"] == "combo" and "enabled" in opt["choices"]: + left = f"--enable-{key}[=CHOICE]" + else: + left = f"--enable-{key}=CHOICE" + help_line(left, opt, 27, True) + sh_print() sh_print("Optional features, enabled with --enable-FEATURE and") sh_print("disabled with --disable-FEATURE, default is enabled if available") sh_print("(unless built with --without-default-features):") sh_print() + for opt in options: + key = opt["name"].replace("_", "-") + if opt["type"] != "boolean" and not allow_arg(opt): + help_line(key, opt, 18, False) print("}") def print_parse(options): print("_meson_option_parse() {") print(" case $1 in") + for opt in options: + key = opt["name"].replace("_", "-") + name = opt["name"] + if opt["type"] == "boolean": + print(f' --enable-{key}) printf "%s" -D{name}=true ;;') + print(f' --disable-{key}) printf "%s" -D{name}=false ;;') + else: + if opt["type"] == "combo" and "enabled" in opt["choices"]: + print(f' --enable-{key}) printf "%s" -D{name}=enabled ;;') + if opt["type"] == "combo" and "disabled" in opt["choices"]: + print(f' --disable-{key}) printf "%s" -D{name}=disabled ;;') + if allow_arg(opt): + print(f' --enable-{key}=*) quote_sh "-D{name}=$2" ;;') print(" *) return 1 ;;") print(" esac") print("}") diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index c8ae205601..c795a13020 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -1,13 +1,270 @@ # This file is generated by meson-buildoptions.py, do not edit! meson_options_help() { + printf "%s\n" ' --enable-capstone[=CHOICE]' + printf "%s\n" ' Whether and how to find the capstone library' + printf "%s\n" ' (choices: auto/disabled/enabled/internal/system)' + printf "%s\n" ' --enable-cfi Control-Flow Integrity (CFI)' + printf "%s\n" ' --enable-cfi-debug Verbose errors in case of CFI violation' + printf "%s\n" ' --enable-fdt[=CHOICE] Whether and how to find the libfdt library' + printf "%s\n" ' (choices: auto/disabled/enabled/internal/system)' + printf "%s\n" ' --enable-fuzzing build fuzzing targets' + printf "%s\n" ' --disable-install-blobs install provided firmware blobs' + printf "%s\n" ' --enable-malloc=CHOICE choose memory allocator to use [system] (choices:' + printf "%s\n" ' jemalloc/system/tcmalloc)' + printf "%s\n" ' --enable-slirp[=CHOICE] Whether and how to find the slirp library' + printf "%s\n" ' (choices: auto/disabled/enabled/internal/system)' + printf "%s\n" ' --enable-tcg-interpreter TCG with bytecode interpreter (experimental and' + printf "%s\n" ' slow)' + printf "%s\n" ' --enable-trace-backends=CHOICE' + printf "%s\n" ' Set available tracing backends [log] (choices:' + printf "%s\n" ' dtrace/ftrace/log/nop/simple/syslog/ust)' printf "%s\n" '' printf "%s\n" 'Optional features, enabled with --enable-FEATURE and' printf "%s\n" 'disabled with --disable-FEATURE, default is enabled if available' printf "%s\n" '(unless built with --without-default-features):' printf "%s\n" '' + printf "%s\n" ' alsa ALSA sound support' + printf "%s\n" ' attr attr/xattr support' + printf "%s\n" ' auth-pam PAM access control' + printf "%s\n" ' bpf eBPF support' + printf "%s\n" ' brlapi brlapi character device driver' + printf "%s\n" ' bzip2 bzip2 support for DMG images' + printf "%s\n" ' cap-ng cap_ng support' + printf "%s\n" ' cocoa Cocoa user interface (macOS only)' + printf "%s\n" ' coreaudio CoreAudio sound support' + printf "%s\n" ' curl CURL block device driver' + printf "%s\n" ' curses curses UI' + printf "%s\n" ' docs Documentations build support' + printf "%s\n" ' dsound DirectSound sound support' + printf "%s\n" ' fuse FUSE block device export' + printf "%s\n" ' fuse-lseek SEEK_HOLE/SEEK_DATA support for FUSE exports' + printf "%s\n" ' gcrypt libgcrypt cryptography support' + printf "%s\n" ' gettext Localization of the GTK+ user interface' + printf "%s\n" ' glusterfs Glusterfs block device driver' + printf "%s\n" ' gnutls GNUTLS cryptography support' + printf "%s\n" ' gtk GTK+ user interface' + printf "%s\n" ' guest-agent-msi Build MSI package for the QEMU Guest Agent' + printf "%s\n" ' hax HAX acceleration support' + printf "%s\n" ' hvf HVF acceleration support' + printf "%s\n" ' iconv Font glyph conversion support' + printf "%s\n" ' jack JACK sound support' + printf "%s\n" ' kvm KVM acceleration support' + printf "%s\n" ' libdaxctl libdaxctl support' + printf "%s\n" ' libiscsi libiscsi userspace initiator' + printf "%s\n" ' libnfs libnfs block device driver' + printf "%s\n" ' libpmem libpmem support' + printf "%s\n" ' libudev Use libudev to enumerate host devices' + printf "%s\n" ' libusb libusb support for USB passthrough' + printf "%s\n" ' libxml2 libxml2 support for Parallels image format' + printf "%s\n" ' linux-aio Linux AIO support' + printf "%s\n" ' linux-io-uring Linux io_uring support' + printf "%s\n" ' lzfse lzfse support for DMG images' + printf "%s\n" ' lzo lzo compression support' + printf "%s\n" ' malloc-trim enable libc malloc_trim() for memory optimization' + printf "%s\n" ' mpath Multipath persistent reservation passthrough' + printf "%s\n" ' multiprocess Out of process device emulation support' + printf "%s\n" ' netmap netmap network backend support' + printf "%s\n" ' nettle nettle cryptography support' + printf "%s\n" ' nvmm NVMM acceleration support' + printf "%s\n" ' oss OSS sound support' + printf "%s\n" ' pa PulseAudio sound support' + printf "%s\n" ' rbd Ceph block device driver' + printf "%s\n" ' sdl SDL user interface' + printf "%s\n" ' sdl-image SDL Image support for icons' + printf "%s\n" ' seccomp seccomp support' + printf "%s\n" ' smartcard CA smartcard emulation support' + printf "%s\n" ' snappy snappy compression support' + printf "%s\n" ' sparse sparse checker' + printf "%s\n" ' spice Spice server support' + printf "%s\n" ' spice-protocol Spice protocol support' + printf "%s\n" ' tcg TCG support' + printf "%s\n" ' u2f U2F emulation support' + printf "%s\n" ' usb-redir libusbredir support' + printf "%s\n" ' vde vde network backend support' + printf "%s\n" ' vhost-user-blk-server' + printf "%s\n" ' build vhost-user-blk server' + printf "%s\n" ' virglrenderer virgl rendering support' + printf "%s\n" ' virtfs virtio-9p support' + printf "%s\n" ' virtiofsd build virtiofs daemon (virtiofsd)' + printf "%s\n" ' vnc VNC server' + printf "%s\n" ' vnc-jpeg JPEG lossy compression for VNC server' + printf "%s\n" ' vnc-png PNG compression for VNC server' + printf "%s\n" ' vnc-sasl SASL authentication for VNC server' + printf "%s\n" ' vte vte support for the gtk UI' + printf "%s\n" ' whpx WHPX acceleration support' + printf "%s\n" ' xen Xen backend support' + printf "%s\n" ' xen-pci-passthrough' + printf "%s\n" ' Xen PCI passthrough support' + printf "%s\n" ' xkbcommon xkbcommon support' + printf "%s\n" ' zstd zstd compression support' } _meson_option_parse() { case $1 in + --enable-alsa) printf "%s" -Dalsa=enabled ;; + --disable-alsa) printf "%s" -Dalsa=disabled ;; + --enable-attr) printf "%s" -Dattr=enabled ;; + --disable-attr) printf "%s" -Dattr=disabled ;; + --enable-auth-pam) printf "%s" -Dauth_pam=enabled ;; + --disable-auth-pam) printf "%s" -Dauth_pam=disabled ;; + --enable-bpf) printf "%s" -Dbpf=enabled ;; + --disable-bpf) printf "%s" -Dbpf=disabled ;; + --enable-brlapi) printf "%s" -Dbrlapi=enabled ;; + --disable-brlapi) printf "%s" -Dbrlapi=disabled ;; + --enable-bzip2) printf "%s" -Dbzip2=enabled ;; + --disable-bzip2) printf "%s" -Dbzip2=disabled ;; + --enable-cap-ng) printf "%s" -Dcap_ng=enabled ;; + --disable-cap-ng) printf "%s" -Dcap_ng=disabled ;; + --enable-capstone) printf "%s" -Dcapstone=enabled ;; + --disable-capstone) printf "%s" -Dcapstone=disabled ;; + --enable-capstone=*) quote_sh "-Dcapstone=$2" ;; + --enable-cfi) printf "%s" -Dcfi=true ;; + --disable-cfi) printf "%s" -Dcfi=false ;; + --enable-cfi-debug) printf "%s" -Dcfi_debug=true ;; + --disable-cfi-debug) printf "%s" -Dcfi_debug=false ;; + --enable-cocoa) printf "%s" -Dcocoa=enabled ;; + --disable-cocoa) printf "%s" -Dcocoa=disabled ;; + --enable-coreaudio) printf "%s" -Dcoreaudio=enabled ;; + --disable-coreaudio) printf "%s" -Dcoreaudio=disabled ;; + --enable-curl) printf "%s" -Dcurl=enabled ;; + --disable-curl) printf "%s" -Dcurl=disabled ;; + --enable-curses) printf "%s" -Dcurses=enabled ;; + --disable-curses) printf "%s" -Dcurses=disabled ;; + --enable-docs) printf "%s" -Ddocs=enabled ;; + --disable-docs) printf "%s" -Ddocs=disabled ;; + --enable-dsound) printf "%s" -Ddsound=enabled ;; + --disable-dsound) printf "%s" -Ddsound=disabled ;; + --enable-fdt) printf "%s" -Dfdt=enabled ;; + --disable-fdt) printf "%s" -Dfdt=disabled ;; + --enable-fdt=*) quote_sh "-Dfdt=$2" ;; + --enable-fuse) printf "%s" -Dfuse=enabled ;; + --disable-fuse) printf "%s" -Dfuse=disabled ;; + --enable-fuse-lseek) printf "%s" -Dfuse_lseek=enabled ;; + --disable-fuse-lseek) printf "%s" -Dfuse_lseek=disabled ;; + --enable-fuzzing) printf "%s" -Dfuzzing=true ;; + --disable-fuzzing) printf "%s" -Dfuzzing=false ;; + --enable-gcrypt) printf "%s" -Dgcrypt=enabled ;; + --disable-gcrypt) printf "%s" -Dgcrypt=disabled ;; + --enable-gettext) printf "%s" -Dgettext=enabled ;; + --disable-gettext) printf "%s" -Dgettext=disabled ;; + --enable-glusterfs) printf "%s" -Dglusterfs=enabled ;; + --disable-glusterfs) printf "%s" -Dglusterfs=disabled ;; + --enable-gnutls) printf "%s" -Dgnutls=enabled ;; + --disable-gnutls) printf "%s" -Dgnutls=disabled ;; + --enable-gtk) printf "%s" -Dgtk=enabled ;; + --disable-gtk) printf "%s" -Dgtk=disabled ;; + --enable-guest-agent-msi) printf "%s" -Dguest_agent_msi=enabled ;; + --disable-guest-agent-msi) printf "%s" -Dguest_agent_msi=disabled ;; + --enable-hax) printf "%s" -Dhax=enabled ;; + --disable-hax) printf "%s" -Dhax=disabled ;; + --enable-hvf) printf "%s" -Dhvf=enabled ;; + --disable-hvf) printf "%s" -Dhvf=disabled ;; + --enable-iconv) printf "%s" -Diconv=enabled ;; + --disable-iconv) printf "%s" -Diconv=disabled ;; + --enable-install-blobs) printf "%s" -Dinstall_blobs=true ;; + --disable-install-blobs) printf "%s" -Dinstall_blobs=false ;; + --enable-jack) printf "%s" -Djack=enabled ;; + --disable-jack) printf "%s" -Djack=disabled ;; + --enable-kvm) printf "%s" -Dkvm=enabled ;; + --disable-kvm) printf "%s" -Dkvm=disabled ;; + --enable-libdaxctl) printf "%s" -Dlibdaxctl=enabled ;; + --disable-libdaxctl) printf "%s" -Dlibdaxctl=disabled ;; + --enable-libiscsi) printf "%s" -Dlibiscsi=enabled ;; + --disable-libiscsi) printf "%s" -Dlibiscsi=disabled ;; + --enable-libnfs) printf "%s" -Dlibnfs=enabled ;; + --disable-libnfs) printf "%s" -Dlibnfs=disabled ;; + --enable-libpmem) printf "%s" -Dlibpmem=enabled ;; + --disable-libpmem) printf "%s" -Dlibpmem=disabled ;; + --enable-libudev) printf "%s" -Dlibudev=enabled ;; + --disable-libudev) printf "%s" -Dlibudev=disabled ;; + --enable-libusb) printf "%s" -Dlibusb=enabled ;; + --disable-libusb) printf "%s" -Dlibusb=disabled ;; + --enable-libxml2) printf "%s" -Dlibxml2=enabled ;; + --disable-libxml2) printf "%s" -Dlibxml2=disabled ;; + --enable-linux-aio) printf "%s" -Dlinux_aio=enabled ;; + --disable-linux-aio) printf "%s" -Dlinux_aio=disabled ;; + --enable-linux-io-uring) printf "%s" -Dlinux_io_uring=enabled ;; + --disable-linux-io-uring) printf "%s" -Dlinux_io_uring=disabled ;; + --enable-lzfse) printf "%s" -Dlzfse=enabled ;; + --disable-lzfse) printf "%s" -Dlzfse=disabled ;; + --enable-lzo) printf "%s" -Dlzo=enabled ;; + --disable-lzo) printf "%s" -Dlzo=disabled ;; + --enable-malloc=*) quote_sh "-Dmalloc=$2" ;; + --enable-malloc-trim) printf "%s" -Dmalloc_trim=enabled ;; + --disable-malloc-trim) printf "%s" -Dmalloc_trim=disabled ;; + --enable-mpath) printf "%s" -Dmpath=enabled ;; + --disable-mpath) printf "%s" -Dmpath=disabled ;; + --enable-multiprocess) printf "%s" -Dmultiprocess=enabled ;; + --disable-multiprocess) printf "%s" -Dmultiprocess=disabled ;; + --enable-netmap) printf "%s" -Dnetmap=enabled ;; + --disable-netmap) printf "%s" -Dnetmap=disabled ;; + --enable-nettle) printf "%s" -Dnettle=enabled ;; + --disable-nettle) printf "%s" -Dnettle=disabled ;; + --enable-nvmm) printf "%s" -Dnvmm=enabled ;; + --disable-nvmm) printf "%s" -Dnvmm=disabled ;; + --enable-oss) printf "%s" -Doss=enabled ;; + --disable-oss) printf "%s" -Doss=disabled ;; + --enable-pa) printf "%s" -Dpa=enabled ;; + --disable-pa) printf "%s" -Dpa=disabled ;; + --enable-rbd) printf "%s" -Drbd=enabled ;; + --disable-rbd) printf "%s" -Drbd=disabled ;; + --enable-sdl) printf "%s" -Dsdl=enabled ;; + --disable-sdl) printf "%s" -Dsdl=disabled ;; + --enable-sdl-image) printf "%s" -Dsdl_image=enabled ;; + --disable-sdl-image) printf "%s" -Dsdl_image=disabled ;; + --enable-seccomp) printf "%s" -Dseccomp=enabled ;; + --disable-seccomp) printf "%s" -Dseccomp=disabled ;; + --enable-slirp) printf "%s" -Dslirp=enabled ;; + --disable-slirp) printf "%s" -Dslirp=disabled ;; + --enable-slirp=*) quote_sh "-Dslirp=$2" ;; + --enable-smartcard) printf "%s" -Dsmartcard=enabled ;; + --disable-smartcard) printf "%s" -Dsmartcard=disabled ;; + --enable-snappy) printf "%s" -Dsnappy=enabled ;; + --disable-snappy) printf "%s" -Dsnappy=disabled ;; + --enable-sparse) printf "%s" -Dsparse=enabled ;; + --disable-sparse) printf "%s" -Dsparse=disabled ;; + --enable-spice) printf "%s" -Dspice=enabled ;; + --disable-spice) printf "%s" -Dspice=disabled ;; + --enable-spice-protocol) printf "%s" -Dspice_protocol=enabled ;; + --disable-spice-protocol) printf "%s" -Dspice_protocol=disabled ;; + --enable-tcg) printf "%s" -Dtcg=enabled ;; + --disable-tcg) printf "%s" -Dtcg=disabled ;; + --enable-tcg-interpreter) printf "%s" -Dtcg_interpreter=true ;; + --disable-tcg-interpreter) printf "%s" -Dtcg_interpreter=false ;; + --enable-trace-backends=*) quote_sh "-Dtrace_backends=$2" ;; + --enable-u2f) printf "%s" -Du2f=enabled ;; + --disable-u2f) printf "%s" -Du2f=disabled ;; + --enable-usb-redir) printf "%s" -Dusb_redir=enabled ;; + --disable-usb-redir) printf "%s" -Dusb_redir=disabled ;; + --enable-vde) printf "%s" -Dvde=enabled ;; + --disable-vde) printf "%s" -Dvde=disabled ;; + --enable-vhost-user-blk-server) printf "%s" -Dvhost_user_blk_server=enabled ;; + --disable-vhost-user-blk-server) printf "%s" -Dvhost_user_blk_server=disabled ;; + --enable-virglrenderer) printf "%s" -Dvirglrenderer=enabled ;; + --disable-virglrenderer) printf "%s" -Dvirglrenderer=disabled ;; + --enable-virtfs) printf "%s" -Dvirtfs=enabled ;; + --disable-virtfs) printf "%s" -Dvirtfs=disabled ;; + --enable-virtiofsd) printf "%s" -Dvirtiofsd=enabled ;; + --disable-virtiofsd) printf "%s" -Dvirtiofsd=disabled ;; + --enable-vnc) printf "%s" -Dvnc=enabled ;; + --disable-vnc) printf "%s" -Dvnc=disabled ;; + --enable-vnc-jpeg) printf "%s" -Dvnc_jpeg=enabled ;; + --disable-vnc-jpeg) printf "%s" -Dvnc_jpeg=disabled ;; + --enable-vnc-png) printf "%s" -Dvnc_png=enabled ;; + --disable-vnc-png) printf "%s" -Dvnc_png=disabled ;; + --enable-vnc-sasl) printf "%s" -Dvnc_sasl=enabled ;; + --disable-vnc-sasl) printf "%s" -Dvnc_sasl=disabled ;; + --enable-vte) printf "%s" -Dvte=enabled ;; + --disable-vte) printf "%s" -Dvte=disabled ;; + --enable-whpx) printf "%s" -Dwhpx=enabled ;; + --disable-whpx) printf "%s" -Dwhpx=disabled ;; + --enable-xen) printf "%s" -Dxen=enabled ;; + --disable-xen) printf "%s" -Dxen=disabled ;; + --enable-xen-pci-passthrough) printf "%s" -Dxen_pci_passthrough=enabled ;; + --disable-xen-pci-passthrough) printf "%s" -Dxen_pci_passthrough=disabled ;; + --enable-xkbcommon) printf "%s" -Dxkbcommon=enabled ;; + --disable-xkbcommon) printf "%s" -Dxkbcommon=disabled ;; + --enable-zstd) printf "%s" -Dzstd=enabled ;; + --disable-zstd) printf "%s" -Dzstd=disabled ;; *) return 1 ;; esac }