From patchwork Tue Mar 7 21:21:31 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: 659875 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2611607wrb; Tue, 7 Mar 2023 13:40:11 -0800 (PST) X-Google-Smtp-Source: AK7set8GcXWdQlx/hV0X5uTlBKOMRxO5MKSGQBBYWh6SMpudKAtD0kZPGFfAm3XyBpBAA6YXcaq+ X-Received: by 2002:a05:6214:2423:b0:56e:fe7b:8bcd with SMTP id gy3-20020a056214242300b0056efe7b8bcdmr30394051qvb.37.1678225211327; Tue, 07 Mar 2023 13:40:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678225211; cv=none; d=google.com; s=arc-20160816; b=YWRrn1XccL1qam64zv6I9s2cJ95eknGzYL7CDbtP5r0hcixpKUuFKmzAYeuwRfOYQj hTE61rN4PVKGm5/HwXQpDTewvLqeJPuSQpeaZyji9tJS1iG2bIEHSWvDy4zQKLvoRpRf uSHJJa4DDuNBJi3VOpDi8h+0FYrWUQDyYKIMBKrlGY+acYgOutC0BVYIujLWubGgj/d2 b0maDfRZss2Dz2csbyfD8hY5GOkyjQn32zOy8NbJZbLvoAY0quVlkBKd/XkolC74o5K5 IHvI2SJn5BlcC9wtGBPMzbKODVzgOXCLkJQrtNnh/qEKtLGvSYGjTQ+jXIgo9N4P3Ul7 w4Rw== 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=BDCwQpt2b+FEq/4plC2udpKZMAb+w8VXBXnKnibWH1w=; b=lIwfeaXiYBLndZfAI+7pAR4m5aIPO+4AJCGfWCBi9MYCz9d51UCQvaGFjTygpzOVJa /y4ikeXMQSaVfm/t3Ie9F0eP/mpgpvUPJ6oVUQF5y/3BHXvL/iGamirEEjtuwm9lBTiK d29+9tK/DDmnXUYulLfQaJ8kjKJaXA7PnyLL/PTZdTyyIIYLLrNUG2lJm6PD0IzI44xr WrjjRRupjYTBKRx/7+1uAo6lUzCTESeA045NTGLysVd3X7D2n1WB30eThi1RZN+qWuFT r6x15/HiShAPnhQyh4e/S6tn8aX/2UZjBUJinTOexUSb+LjNurw1ATfROCG8dAubkigb OFLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oC9hyFMt; 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 fh15-20020a0562141a0f00b0057220961445si10864150qvb.135.2023.03.07.13.40.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 13:40:11 -0800 (PST) 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=oC9hyFMt; 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 1pZf1p-0003uE-7z; Tue, 07 Mar 2023 16:39:25 -0500 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 1pZf1o-0003u6-Gz for qemu-devel@nongnu.org; Tue, 07 Mar 2023 16:39:24 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZf1m-0002wy-LQ for qemu-devel@nongnu.org; Tue, 07 Mar 2023 16:39:24 -0500 Received: by mail-wr1-x434.google.com with SMTP id j2so13529188wrh.9 for ; Tue, 07 Mar 2023 13:39:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678225160; 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=BDCwQpt2b+FEq/4plC2udpKZMAb+w8VXBXnKnibWH1w=; b=oC9hyFMti+/cFFo18kX/JQN341QcvtHuCnUlCk7ZSXzpfrrzzptbPZ/5vroLSGhT30 WN7XRue+X79PRFTbZPISMR50bdygAs4swYwkmm4d3vqIAlB3l8q41GSJDy5ySjBu9Wvl tJVoBhf8BOaUQgMFdJI2ecc6N7KL8ELbG1vdIBscuNzKA+1KpdyCfs72yR1Ptah+qMg4 9xl/RzGn5nAMXmGmRCprXqVkbZrLAYsCzDChMxoznme9U7SRCF+k8IoQzvWQvIhk7j9f 0hg1CSm8Qzo2yO7GbQxh9qtov+13TCrv+OiwiHxDRJTJTlUg5lDj2BvgCK3+ihGO47Kf yn0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678225160; 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=BDCwQpt2b+FEq/4plC2udpKZMAb+w8VXBXnKnibWH1w=; b=UI31I0FDBgpF7Bdwy7RAyvsuquXPCInOVaGp2eqoLTr1OkH8sa9nFCHYpvL++qnA+m uEgNuDtk+1VEe0bdr4yagkE2f4qdrTg0RTaip3bumPW0+Z1qppmSOhq/zLDOJeOMs1jk zgdRufHnO2zfA2p+nqkprcOqfRplHzLLMFvqwISzlbGGZ91rRG4ASuc01FmvdZyfaqmA pazDm1IYUiJcH0sAvLPfin8bBpac9fnyek9pYf8gPAMIlFIrgy4BEUtqbtut3Y1h/u6c xNF8psUk7s7Vi8Ei0ly6bcJsXDo2p0iTuG6yfhOC4ZwwQqCx3kzeYOr6ArsXmGYbk/2y nBUg== X-Gm-Message-State: AO0yUKWT/P+IE4+oQWU2sOeEDTUQ4v42SBS5zwMsizaZ8UatqkLhYKoQ coxS6sP4IGgvpw+d8XnkfdVNug== X-Received: by 2002:a5d:5489:0:b0:2c5:6182:5f6b with SMTP id h9-20020a5d5489000000b002c561825f6bmr11433308wrv.18.1678225160523; Tue, 07 Mar 2023 13:39:20 -0800 (PST) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id u8-20020a5d4688000000b002c5544b3a69sm13685745wrq.89.2023.03.07.13.39.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 13:39:20 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 88FB91FFB7; Tue, 7 Mar 2023 21:21:42 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PULL 22/30] gdbstub: only compile gdbstub twice for whole build Date: Tue, 7 Mar 2023 21:21:31 +0000 Message-Id: <20230307212139.883112-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307212139.883112-1-alex.bennee@linaro.org> References: <20230307212139.883112-1-alex.bennee@linaro.org> 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.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 Now we have removed any target specific bits from the core gdbstub code we only need to build it twice. We have to jump a few meson hoops to manually define the CONFIG_USER_ONLY symbol but it seems to work. Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230302190846.2593720-23-alex.bennee@linaro.org> Message-Id: <20230303025805.625589-23-richard.henderson@linaro.org> diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index e264ed04e7..d9e9bf9294 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -39,9 +39,7 @@ #include "sysemu/hw_accel.h" #include "sysemu/runstate.h" -#include "exec/exec-all.h" #include "exec/replay-core.h" -#include "exec/tb-flush.h" #include "exec/hwaddr.h" #include "internals.h" @@ -1612,7 +1610,7 @@ static const GdbCmdParseEntry gdb_gen_query_table[] = { .cmd_startswith = 1, .schema = "s:l,l0" }, -#if defined(CONFIG_USER_ONLY) && defined(CONFIG_LINUX_USER) +#if defined(CONFIG_USER_ONLY) && defined(CONFIG_LINUX) { .handler = gdb_handle_query_xfer_auxv, .cmd = "Xfer:auxv:read::", diff --git a/gdbstub/meson.build b/gdbstub/meson.build index c876222b9c..d679c7ab86 100644 --- a/gdbstub/meson.build +++ b/gdbstub/meson.build @@ -4,13 +4,35 @@ # types such as hwaddr. # -specific_ss.add(files('gdbstub.c')) +# We need to build the core gdb code via a library to be able to tweak +# cflags so: + +gdb_user_ss = ss.source_set() +gdb_softmmu_ss = ss.source_set() + +# We build two versions of gdbstub, one for each mode +gdb_user_ss.add(files('gdbstub.c', 'user.c')) +gdb_softmmu_ss.add(files('gdbstub.c', 'softmmu.c')) + +gdb_user_ss = gdb_user_ss.apply(config_host, strict: false) +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') + +libgdb_softmmu = static_library('gdb_softmmu', + gdb_softmmu_ss.sources() + genh, + name_suffix: 'fa') + +gdb_user = declare_dependency(link_whole: libgdb_user) +user_ss.add(gdb_user) +gdb_softmmu = declare_dependency(link_whole: libgdb_softmmu) +softmmu_ss.add(gdb_softmmu) # These have to built to the target ABI specific_ss.add(files('syscalls.c')) -softmmu_ss.add(files('softmmu.c')) -user_ss.add(files('user.c')) - # The user-target is specialised by the guest specific_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user-target.c'))