From patchwork Mon Apr 3 13:49:11 2023 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: 669776 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp1894899wrt; Mon, 3 Apr 2023 06:51:14 -0700 (PDT) X-Google-Smtp-Source: AKy350ZWt7rGu59K5h5d8Vy2gTvWArQEpOXcjQbBnqHRctXaHBj/I5mEL6bs7eFxCocTHZrJ7GwL X-Received: by 2002:a05:622a:2:b0:3e4:dfb6:29a8 with SMTP id x2-20020a05622a000200b003e4dfb629a8mr51071871qtw.44.1680529874298; Mon, 03 Apr 2023 06:51:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680529874; cv=none; d=google.com; s=arc-20160816; b=IJ6nueRx1x/McVaCMeIHb5KiyWRZ1nmDX7vnoOix1r04IR3X6v28oe0ApsJyOuVGG3 48dfmGrdA8okIGhybf0FvH7ViwxC4N56ckCylihP/38ZGyqyY9hx9+84/k4DArfZMGYJ Zy3oTihF8TqqpoDrWuU84KWChERN0PCNuOkx5HSq8PQqLWZshI+7dF0z9SvZUTLv0uBa MWMO22zGvgIKPOAVwNhI71nC2KGtL/JC7Hf27ns/ussrkN/Y2qmQxs8B8reqNzIe41bY zYnb9uWWbO5sPknvXJtyRBhQuakfdYVRrK3ULMenwWN9obUGRsUIGSdyVl0hEc4QcH6p sZCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mN816sNtX5Vdj2G92pvv8I3i5QnGeNTrX25n5LbvU4I=; b=IPkeNqqSxxEH3mmGI0Nhqeh65PiEL9YrNGdrwQXIGQJnUoILfA8tdW3KLTZZoU48Ie xyGbeX0IHLA5WXeE50DT3fc0qe0XvqMiD5TD6yVlg/EfH5Piskt71rtNT1KVGUUufG9a TnNst+s+kzSy6W9Ad+MzAWdK4AzqCPIy7bFR3FLgQabwMyhEb05QJ96wHM4+bnsFZ1W0 BpcwUBDdZVzduMVq1+RlI97tBgsH3/N0wg755U24RtwXl9dXRs8+QFBw+I3tAJGgYMhw oB8JBAk8k64rFJKSMP5//d1QvFZ8PIBn0G5aDT7Mf1/ShdRhP5k+G56glKcWSYPdbPYX 0pAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O5sLqRX3; 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=pass (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 g16-20020ac85810000000b003d2f408a002si6282853qtg.218.2023.04.03.06.51.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Apr 2023 06:51:14 -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=pass header.i=@linaro.org header.s=google header.b=O5sLqRX3; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pjKYr-0002vs-DP; Mon, 03 Apr 2023 09:49:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pjKYq-0002u2-0G for qemu-devel@nongnu.org; Mon, 03 Apr 2023 09:49:28 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pjKYm-0004tH-Ad for qemu-devel@nongnu.org; Mon, 03 Apr 2023 09:49:27 -0400 Received: by mail-wm1-x331.google.com with SMTP id hg25-20020a05600c539900b003f05a99a841so240154wmb.3 for ; Mon, 03 Apr 2023 06:49:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680529762; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mN816sNtX5Vdj2G92pvv8I3i5QnGeNTrX25n5LbvU4I=; b=O5sLqRX3o8wg3JSEuHWQfk7e53SjZslyalKpbNubzgxabPQbImJEAab9cWKIwTylAL WgcyZqFlockFyY+eZ0Bf7vXgYjz2ZTwNjuS2v73b4lgsIVnXRvHaM3qr2WnHPKUdJAQI 5B7WEues0f+SO+CL77LGCSGQrN7h0W/Tk+GIroANmG1yd2r3D4iFC3sC8EHZrTpiedQM sCILzvAqFtezCm6x72Z0UwzZmMlakI+VNU2GyYzB0Ne1NYLNF4GJQVY+tueL2OS5ZQkU bx43IXHTD/y2FJ9UOtFFsIU3eYKPZNE6kaHy0DTyMLxFc6WvKs0qn0lonWM8EUzREfvE 2wSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680529762; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mN816sNtX5Vdj2G92pvv8I3i5QnGeNTrX25n5LbvU4I=; b=0OiRLCRsYem6KPfZy2SlMw8t3M2fukc49xL8UcOX685K8dIBavZfBGA/61m7il2ztW 4YbjIqRX9UrQ29jJJYYJXLAiIWs5x9gtx7siUKJvWmpxtRSjzMLZVAdeuBkSYJ5CM46y RiWO7/XfkA/YbCi+gG3REaIYhtMJD4ga2bygtMpANLXZ1JW+ZFFh75zXqpldDb7TPO8g fUKQY2yuMmSqHOfhbpW2uLN6L/Vxg6OxefjqaJXiuebWrJ2wd2GRYxL/47ADdz1ZoMwb 5HVPTG8J7Tu/OUMp07TuYNaaCjj9hi0PjBGS58Bj/NwGmAsE6p1t20U5o+BAQ4/Vhzdn lSiw== X-Gm-Message-State: AAQBX9d88S9o/uG0L9N3wNxjMmjTCClMNxpmxOPzI8heVB42fOTp4+/a D8ERIVLQH2Ra0T6BKjH1u1AKjcZ5aDojsUpDnMk= X-Received: by 2002:a7b:c045:0:b0:3ef:6fee:8057 with SMTP id u5-20020a7bc045000000b003ef6fee8057mr19211144wmc.25.1680529761833; Mon, 03 Apr 2023 06:49:21 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id l7-20020a05600c4f0700b003ef5deb4188sm19526828wmq.17.2023.04.03.06.49.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 06:49:21 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E356F1FFBA; Mon, 3 Apr 2023 14:49:20 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Reinoud Zandijk , Ryo ONODERA , qemu-block@nongnu.org, Hanna Reitz , Warner Losh , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Kyle Evans , kvm@vger.kernel.org, Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , Cleber Rosa , Thomas Huth , Kevin Wolf , Richard Henderson Subject: [PATCH v2 02/11] gdbstub: Only build libgdb_user.fa / libgdb_softmmu.fa if necessary Date: Mon, 3 Apr 2023 14:49:11 +0100 Message-Id: <20230403134920.2132362-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230403134920.2132362-1-alex.bennee@linaro.org> References: <20230403134920.2132362-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x331.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé It is pointless to build libgdb_user.fa in a system-only build (or libgdb_softmmu.fa in a user-only build). Besides, in some restricted build configurations, some APIs might be restricted / not available. Example in a KVM-only builds where TCG is disabled: $ ninja qemu-system-x86_64 [99/2187] Compiling C object gdbstub/libgdb_user.fa.p/user.c.o FAILED: gdbstub/libgdb_user.fa.p/user.c.o ../../gdbstub/user.c: In function ‘gdb_breakpoint_insert’: ../../gdbstub/user.c:438:19: error: implicit declaration of function ‘cpu_breakpoint_insert’; did you mean ‘gdb_breakpoint_insert’? [-Werror=implicit-function-declaration] 438 | err = cpu_breakpoint_insert(cpu, addr, BP_GDB, NULL); | ^~~~~~~~~~~~~~~~~~~~~ | gdb_breakpoint_insert ../../gdbstub/user.c:438:19: error: nested extern declaration of ‘cpu_breakpoint_insert’ [-Werror=nested-externs] ../../gdbstub/user.c: In function ‘gdb_breakpoint_remove’: ../../gdbstub/user.c:459:19: error: implicit declaration of function ‘cpu_breakpoint_remove’; did you mean ‘gdb_breakpoint_remove’? [-Werror=implicit-function-declaration] 459 | err = cpu_breakpoint_remove(cpu, addr, BP_GDB); | ^~~~~~~~~~~~~~~~~~~~~ | gdb_breakpoint_remove ../../gdbstub/user.c:459:19: error: nested extern declaration of ‘cpu_breakpoint_remove’ [-Werror=nested-externs] cc1: all warnings being treated as errors ninja: build stopped: subcommand failed. Fixes: 61b2e136db ("gdbstub: only compile gdbstub twice for whole build") Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20230329161852.84992-1-philmd@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20230330101141.30199-3-alex.bennee@linaro.org> --- gdbstub/meson.build | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gdbstub/meson.build b/gdbstub/meson.build index bd5c5cd67d..cdb4d28691 100644 --- a/gdbstub/meson.build +++ b/gdbstub/meson.build @@ -20,11 +20,13 @@ gdb_softmmu_ss = gdb_softmmu_ss.apply(config_host, strict: false) libgdb_user = static_library('gdb_user', gdb_user_ss.sources() + genh, name_suffix: 'fa', - c_args: '-DCONFIG_USER_ONLY') + c_args: '-DCONFIG_USER_ONLY', + build_by_default: have_user) libgdb_softmmu = static_library('gdb_softmmu', gdb_softmmu_ss.sources() + genh, - name_suffix: 'fa') + name_suffix: 'fa', + build_by_default: have_system) gdb_user = declare_dependency(link_whole: libgdb_user) user_ss.add(gdb_user)