From patchwork Fri May 28 16:31:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 449511 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp511023jac; Fri, 28 May 2021 09:32:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwX2RNPIIp+hmAjoVJimeaXGyhVT0J5nAhcBEMTdXWJfGhWayQ0743XTdwLqf4Krq8atWd3 X-Received: by 2002:a05:6402:14c1:: with SMTP id f1mr10478768edx.334.1622219527199; Fri, 28 May 2021 09:32:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622219527; cv=none; d=google.com; s=arc-20160816; b=GzJdYULtVaNbywWrAsKqSZ5aLpM3MZM00XmKD798wlVkBxso2HJui+hJwk0fTn4hVv AnM7D4CdallQH+Y2Gy7KJomACLl//QZoFISIEcnUg8oJQr3wn+tO9nOXalvnmZmjljtG CQeEjPFtuLJI51aH3UFIa2jMjYrYeANqo1reQUzxfiXEAj+Lnw4KxJFAU0ndhMMQIMIO DSWwYSgnpMtWIK0tsfTTS9TxtUMbqrDSyIt1Bx5HDhyecboFFKGDaPpolFQ3ekqpmM/M SY4GdUa0RDKPKsVoXb+/t+qs2kupB6tkMMuamqXWXxXBTSFGVSCF/eLpo9pGYF6gLaUY obIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature; bh=Twe5NygAd7RxUtKnZiyqPZSZMsu5AWUKgEuyMuFUC7g=; b=ywI25SO5Sq88wQj91pIQAn72meq/rU9/VDfYZZkW4NzE+pKqzLAePrkyQ/YvImiJKh BZSTZePcGnYIMDtGqchUl6zBIZu6UYU2qMF+5OGgI7LTVk8I2KRwWPWcwSvdGfxmlWKS RugT0bgwEYKZdu6QzialaQnGwVc2MJ9RBMvfMoRT/6/5nAfyHq4u0yfoY4s1uV3mwW3k 1fHnbhXkT9ZUB5qmovij1dF1c6dUl1Jo/HgnszSDe4ofI6xWMMSSJDBSTN0ATfq1zTtN jqIqDVusIgBHU64iUOFQKaMbK22hLkBqAWShm6K9g3xTW1bYDMdJSlqWZgoeh2J8+ShJ 8yBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="J/KUZY2p"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b26si4674793edy.283.2021.05.28.09.32.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 May 2021 09:32:07 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="J/KUZY2p"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmfP4-00056c-2h for patch@linaro.org; Fri, 28 May 2021 12:32:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45552) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmfOV-00056S-Bm for qemu-devel@nongnu.org; Fri, 28 May 2021 12:31:31 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:36799) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lmfOS-0001bx-QY for qemu-devel@nongnu.org; Fri, 28 May 2021 12:31:30 -0400 Received: by mail-wr1-x434.google.com with SMTP id n4so3891334wrw.3 for ; Fri, 28 May 2021 09:31:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Twe5NygAd7RxUtKnZiyqPZSZMsu5AWUKgEuyMuFUC7g=; b=J/KUZY2p8sxKYw8Qfv3YugmpCbGdFeUV+5MStA1VSI3L3Q9hWq3jByba93ceNTa9OQ Y6G+CIkteNegals2Gs5XsW1jbU8LIRY5N/zbArren2UoA5pP6LxDYQT19J26g/KOABmR vJxDazuas7v5wlDRFOz6JacXEpuGNAIVNtgOrZBjbnSKFImO4pxqghhPrl0HWGsQ28ir zRbLcfvCdQSVtRmfhnPwzKjm3ALCgd9lWCgMe8cd82EBjWMElk2//n9hP6dtiCRql18r GO6bLkTtOoY5S7q3sn/HXW8D5RnoWKqF64PvoaVPAgqWJDxPFuRHJMhlgFtwxIz3BJ37 RFJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Twe5NygAd7RxUtKnZiyqPZSZMsu5AWUKgEuyMuFUC7g=; b=kfR9YH72npkpY0Qt5Fe//YSJfQtFUgJJYuFOfK12xZ5llRNzkjxHvE613I73iqVRsX BXswx5FttFjeKoIvH0+6xIuRCn3jyrq7ms9cP51z1wn7uF/VpMYESavTYpM7nSV0MTLN 7vXYtkgd1awweAHta+D+LnJEpQik2MwxrRmiUGHnU19pFonxzW7KjmDQ7hVY1WdAGdn1 PM5FwS1aoCDCUT2OiAwTfo7vV5uD3znpaJqEOuKX7TdGEU9w5GN9EApVAGKh3DIG3jvK x0LIXTpHbtFr3d694rMxWVRt/Ci+44npwZkXRq4E9jH2ozWNs4K+cSDApuBDIJh3SFYn 2NcA== X-Gm-Message-State: AOAM5323mtCcywkkaTrFlVWqk/2xnytbtFPPWWZhoZDgMVw92Jnkb17h iRnNPpXBqRjKFH9H1mcKnKLy2Q== X-Received: by 2002:a05:6000:511:: with SMTP id a17mr9649774wrf.351.1622219486114; Fri, 28 May 2021 09:31:26 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id m9sm7431961wrq.78.2021.05.28.09.31.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 May 2021 09:31:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4325F1FF7E; Fri, 28 May 2021 17:31:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [RFC PATCH] configure: allow the overriding of default-config in the build Date: Fri, 28 May 2021 17:31:16 +0100 Message-Id: <20210528163116.31902-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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?Philippe_Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , f4bug@amsat.org, Paolo Bonzini Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" While the default config works well enough it does end up enabling a lot of stuff. For more minimal builds we can pass a slimmed down list of devices and let Kconfig work out what we want. For example: ../../configure --without-default-features \ --target-list=arm-softmmu,aarch64-softmmu \ --with-devices-aarch64=(pwd)/../../configs/aarch64-softmmu/aarch64-softmmu-64bit-only.mak will override the aarch64-softmmu default devices to one of our own choosing. Signed-off-by: Alex Bennée Cc: Philippe Mathieu-Daudé Cc: Paolo Bonzini --- configure | 16 ++++++++++++++++ .../aarch64-softmmu-64bit-only.mak | 10 ++++++++++ meson.build | 3 ++- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 configs/aarch64-softmmu/aarch64-softmmu-64bit-only.mak -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/configure b/configure index 90c0807347..5acb8b2ed5 100755 --- a/configure +++ b/configure @@ -921,6 +921,12 @@ for opt do ;; --without-default-devices) default_devices="false" ;; + --with-devices-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --with-devices-cc-FOO option" + ;; + --with-devices-*) device_arch=${opt#--with-devices-}; device_arch=${device_arch%%=*} + device_archs="$device_archs $device_arch" + eval "devices_${device_arch}=\$optarg" + ;; --without-default-features) # processed above ;; --enable-gprof) gprof="yes" @@ -1767,6 +1773,7 @@ Advanced options (experts only): --without-default-devices do not include any device that is not needed to start the emulator (only use if you are including desired devices in default-configs/devices/) + --with-devices-ARCH=PATH override default-configs/devices with your own file --enable-debug enable common debug build options --enable-sanitizers enable default sanitizers --enable-tsan enable thread sanitizer @@ -6378,6 +6385,15 @@ if test "$skip_meson" = no; then echo "# Automatically generated by configure - do not modify" > $cross echo "[properties]" >> $cross + + # unroll any custom device configs + if test -n "$device_archs"; then + for a in $device_archs; do + eval "c=\$devices_${a}" + echo "${a}-softmmu = [ '$c' ]" >> $cross + done + fi + test -z "$cxx" && echo "link_language = 'c'" >> $cross echo "[built-in options]" >> $cross echo "c_args = [${CFLAGS:+$(meson_quote $CFLAGS)}]" >> $cross diff --git a/configs/aarch64-softmmu/aarch64-softmmu-64bit-only.mak b/configs/aarch64-softmmu/aarch64-softmmu-64bit-only.mak new file mode 100644 index 0000000000..3626de9e3c --- /dev/null +++ b/configs/aarch64-softmmu/aarch64-softmmu-64bit-only.mak @@ -0,0 +1,10 @@ +# +# A version of the config that only supports 64bits and their devices. +# This doesn't quite eliminate all 32 bit devices as some boards like +# "virt" support both. +# + +CONFIG_ARM_VIRT=y +CONFIG_XLNX_ZYNQMP_ARM=y +CONFIG_XLNX_VERSAL=y +CONFIG_SBSA_REF=y diff --git a/meson.build b/meson.build index 3f065f53f2..656ebde513 100644 --- a/meson.build +++ b/meson.build @@ -1350,9 +1350,10 @@ foreach target : target_dirs configuration: config_target_data)} if target.endswith('-softmmu') + config_input = meson.get_external_property(target, 'default-configs/devices' / target + '.mak') config_devices_mak = target + '-config-devices.mak' config_devices_mak = configure_file( - input: ['default-configs/devices' / target + '.mak', 'Kconfig'], + input: [config_input, 'Kconfig'], output: config_devices_mak, depfile: config_devices_mak + '.d', capture: true,