From patchwork Wed Mar 29 16:18:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 668120 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp454038wrt; Wed, 29 Mar 2023 09:19:23 -0700 (PDT) X-Google-Smtp-Source: AKy350bdHlg9OVP02QY3vP6+nUvwOOvLE7M+PV6wrN8fS4Gat1F+yu4lR3zbC63xEaCmPznJGy/Q X-Received: by 2002:ad4:5fcb:0:b0:56b:340c:ee1a with SMTP id jq11-20020ad45fcb000000b0056b340cee1amr32099769qvb.49.1680106763519; Wed, 29 Mar 2023 09:19:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680106763; cv=none; d=google.com; s=arc-20160816; b=y1r5wGVYf444OMDFCQql8kRWtUy7Xhtf4L/WGY95HbVTDuZ9xgedp9+gUET9Zfj9c9 rigrSBetA2/OnRBxWvYFpGGTsoUF1lCgIjisLUxsGvXuWaN2XWueHhtQZWHvYNYI23FU RYbT2g/FTmVKNOirc7MVxSPoNakrO6RIAn+ikxjBTv240Nte67d+FRSoZC5vASu+Fk47 /GEn7ag5kCnBkOAGjGzEOK6PbTCiwxbfUgKtZUlp0t0mNUlGToNxk4YMM+xbpamzS2wl hGFB5/5Lisum7vXwB5kLC5XmDEkFcroiUo8KNFLAnx/Nmq0Vf6Xu1v2Yzm2UAG+S4vc+ wYOA== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=5lB4Rp5WTzNb0p6CwHhrEQVJ55MnHtlqKkVK6rXKMiU=; b=rQR9GeZiOVhOChKGXJG2FH26ldzg+YDOmEiMM8M+lzjUK2P2ffZF50+2Cqnv0oCtQN DAO1MRJiWKYoJj4dP049bYsFGAfB9UJnxayji89FjEsh5s8UwyxYAAgv/eepxki3AsV4 j0u6e8w6MVZoxg4pEEPgOEU2ryp1Sar/LpcLHahldW940K2qxiWpwUCTpwSq4bRr6Vxl wzO9ODeioLTd9mJS6NIK/QOdTbVvhgOEIAGWp1VMZI1GOCpFq/3rg+Y5cwIqHqGuthWb N83GB4rWQPKtbg0fq2OxMdclwdU3+Ge3tpvJL5tXZSYy9C8sQkvxLdSW6r3vqxOVcGns 6nmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d+gaGyiu; 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 f5-20020a056214164500b005af46f8fd21si21591688qvw.389.2023.03.29.09.19.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Mar 2023 09:19:23 -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=d+gaGyiu; 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 1phYVn-0008GM-9P; Wed, 29 Mar 2023 12:18:59 -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 1phYVl-0008Ft-Vc for qemu-devel@nongnu.org; Wed, 29 Mar 2023 12:18:57 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1phYVk-0008RH-E9 for qemu-devel@nongnu.org; Wed, 29 Mar 2023 12:18:57 -0400 Received: by mail-wm1-x32d.google.com with SMTP id u11-20020a05600c19cb00b003edcc414997so10081117wmq.3 for ; Wed, 29 Mar 2023 09:18:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680106734; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=5lB4Rp5WTzNb0p6CwHhrEQVJ55MnHtlqKkVK6rXKMiU=; b=d+gaGyiuPrYvgMLG8jgG+tgZUubrWhEg8EqFY2MFTpkRbZZKY0eRg8DOuWZ/OOMOTg +OcbISBropoMmHe6wayBojCxXTxRm/gVVGOSxv304e72y8dn5GQS6BdNLW+79OPhb209 nFTodls8lfzmEYukaVK5qsiir8JwRAo7TKmvKVGTJo22XHgv30go0IhZMnq0VPGi7MDL p4K2mu4AtgjmLaMrNweyM3B1CFDtYyU4amHjLWcGPAb9c4NlpLRSr4Ms7Gpalw54qKgP B3SYhYLBAYkwUXS5o9jJP0O0XrYLUDcI9QK/L4ZQCPmI4OVOVHebDW2S+a2/EBFvEX5Z RMFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680106734; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5lB4Rp5WTzNb0p6CwHhrEQVJ55MnHtlqKkVK6rXKMiU=; b=H+D2/GgLZEjlOBcgNEfPtXjqLReIs6L+3KlouhRkxduucvhu5DewKoX82EOJBciHPr /zURffXXlfH4H28cckCOtOimGcBJSiecC3l/SKkTFYcdfZcVRPRVgPaqV9i6xQTlNETs jZvrsdFmJ1RVW82V4+z0RE8HOB7NZ9naUq2vMiOWiat1wd/KJMWY3swiLvjot01Fy0u2 0vcWN/lnLq4e1/uW+7onsz7g9bSeY4b/EdfQkX/lojvLvk7ey131cRy/+EIxRgVrKbND /foYSdpYhtv+Jq7gY+zSkDJb6kaDwg7wrXbsfn2v23bsBDlcrnvh1XWT6LjBHHZkm0kx WWHg== X-Gm-Message-State: AAQBX9eCUQm+yeowbvnqJV9i4p4Rptfw5kmLkX6e57+xOJkgDvH903cz xd1hdeNOosHfznJahXVSg/gBT1ai/I5L0mhSIEvNSg== X-Received: by 2002:a05:600c:35c5:b0:3ee:136f:bcf4 with SMTP id r5-20020a05600c35c500b003ee136fbcf4mr2191844wmq.5.1680106734173; Wed, 29 Mar 2023 09:18:54 -0700 (PDT) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id u16-20020a05600c211000b003ed243222adsm2648155wml.42.2023.03.29.09.18.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 29 Mar 2023 09:18:53 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , Thomas Huth , Laurent Vivier Subject: [PATCH] gdbstub: Only build libgdb_user.fa / libgdb_softmmu.fa if necessary Date: Wed, 29 Mar 2023 18:18:52 +0200 Message-Id: <20230329161852.84992-1-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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.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 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 --- 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)