From patchwork Tue Mar 4 22:24:39 2025 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: 870154 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:178f:b0:38f:210b:807b with SMTP id e15csp495766wrg; Tue, 4 Mar 2025 14:35:59 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWvpBHAxM42inFW2OxHOA5/YCscfh0Qda8G0n4Dx3Rs1mad4vBhgvZWB+AuNaMrzpdmEBgPbA==@linaro.org X-Google-Smtp-Source: AGHT+IHX9sLFdfEnWTC9X2tQGiRzAGAI2hhk/Q+YI0rTRr8hxQxwMNtdpNokonQo5eSCVpb3utyP X-Received: by 2002:a05:6214:2243:b0:6e8:8934:337b with SMTP id 6a1803df08f44-6e8e6cdaec2mr19442346d6.14.1741127759782; Tue, 04 Mar 2025 14:35:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741127759; cv=none; d=google.com; s=arc-20240605; b=Fze2S3B3TZWLyyLMXilrsWjiHaXyWWr8dnTRWQpjkirCGHoRb/zJUZbi9eMb/qi2y7 l4AekvcU6iWasoqRTylBtUvZTbTzb5v0+UMeLCqosW5deI7Rdc3gF3WxhH8ddDK19AAO D5tdAYYH5U/nQGmvuMFG8jGTNPrTE0yJiUPiNH5Uv2rSYVS6wkAUhoKIYKfstnfiByu2 FcnOCl5la2yQi9zVjsRvKqidxkBdrfgkDSm8CXqomNp/dmIQNHZO/5MAigHjWuVxMsWj mvNBR5ijAp5TBRhHJRR0uM/4BRSg8KAMNQS4mFsPwQNcO5R9rCYqfwN4HESVXOvYW8bG 7qUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=9JeQtbLiYtOLbCRF+mM5h0mscE6W4z+gp/D6Lf7IWuI=; fh=6Bzz00MUAZSz1sM9FDoE/jB6E9D8TQzH70NWpntkZX8=; b=XywaEinl1QqdYfLi0ZRJ5BA7P8WfPAp7LScNW4mLCdhQDF+Mre4wo2oj+LX5maV1Ed dn8yKw9XKZEzF+q6VHhBrgzKMEzOY2rb6bScpTC9XBNK2fO6chovGo6CJeTGyBcz+Zpz KnoJYxiSVkZ+K8+g2BRbJEmBFqmhX/uQweIOAZ7teuT7n+0NYay3hqb8FEpo2Im8crB3 2/8gSo/3eISbHw31tczSjp8ciQc17GXDjIi6+8zWFErJXEIiyeZyrm/5wGKwmpaJsGGi +QcaZ1i0i5KXfXmWNMhhLOZYcfE+698Md2M9MlUpRmf0pf5uRvqf8iASh3zyX4bCl//X JIKw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PnR7vJqE; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c3c0c739d8si444227385a.359.2025.03.04.14.35.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Mar 2025 14:35:59 -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=PnR7vJqE; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tparE-0000pN-0X; Tue, 04 Mar 2025 17:35:24 -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 1tpaqk-0000Wo-Th for qemu-devel@nongnu.org; Tue, 04 Mar 2025 17:34:55 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tpaqi-0001O5-0C for qemu-devel@nongnu.org; Tue, 04 Mar 2025 17:34:54 -0500 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-ac0b6e8d96cso383500566b.0 for ; Tue, 04 Mar 2025 14:34:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741127690; x=1741732490; darn=nongnu.org; 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=9JeQtbLiYtOLbCRF+mM5h0mscE6W4z+gp/D6Lf7IWuI=; b=PnR7vJqEUUL4GwcFYUhtFBQfk+/FUQHtIrlaFAKjUnehWUu2j+apjBW4a0zPhJ4flJ 3/vcqo3N0oxMVU+vIqQ9FQAPDH/qHt82egPR6ibLc/X4+1B8S3n8HCF90+LG6Zm9xpms j/R94aA+YWgaL2wApzHpcVY0m/TqB8lUBOGrs4fKa1etH47oUpPlr0HEvkfEklbJzKbj pI5Vk0UkdytL7DUU7qZ5B6hxNj129z8EOWg5z4g+HWxuEludqvhaLkp5zt2vZ+fBr3um IKkNNMf06LfggVjwETHLbLXd4UuWcdH9Ndz7lU2bb1sfvBgxrg1DKlyzqtJvzu7mg93c QbOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741127690; x=1741732490; 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=9JeQtbLiYtOLbCRF+mM5h0mscE6W4z+gp/D6Lf7IWuI=; b=TRb6DbfO0vPyUcKZBvsL+w35s0Ip1pyxxVZu3jCcl4nDjz9oGsYxGJGGBQQt1uYAXD VdEc5fvI7xM/3/JE2SGZ9B5QS7Pc54wmScSCxIMwMgQqfY3DQcnZ32q+vxBQ/3c+cxBn qluLTg0E1oOiLXpMBUBuUnWNts0CwhcHZX8tj4uI8ZeXpo/BvzSUZkK3Q7AS06dGHtUm jXzSGhJPNkDUhEndvXlStDAnuWBBOomJr1rIX+l2qlqNMs1UGIycb/8wI6iZ4uaveNC9 REtEcRWnwUyK5XGTvFomXMnW6Yt5f0QEMJ0MmQv9QCHFPmmHW7oLhBjXFfPbI7Pzj8k7 4egg== X-Gm-Message-State: AOJu0Ywvdu0cDMMQ3rIdhwQECVnJ2Y8LHhdq061x+YfWWDlku7ubCNij CVsJGC58vW0lQ33mGFzEo1PZkncswbowytVJCpjbupMQ67dYzfHhRr64pICdvjc= X-Gm-Gg: ASbGncsSZOjOON1Qo4AB3C+yjWrxWODgghgkIsG//KAo9UCCP9xEo4HhUAwkasuQEcI fHVzpuz/xjOveTMdBhAqU2atfbx9DWB3EbzmTSNTXsK4K8fd9ujs1MFh7HrEZ3u70e9D/hDW6bM A1nZVzBiHkc2aLjwZHSXXCtrsmHWsyjBpgZH/FiHZdFUccWrwI5oBewbY19DLCadtAfAo5PQyWH D8TqpSEvwH8db/vFMgTiFhYg0IuwTGuFPaEHKvc4/UecZlgKptU34d2tHrAV9zS1G/jVMGiyOqn to/qzCRgI6VQFf7/3evMyyyyJtDwxXiz5Cy0z+mNhAolCMA= X-Received: by 2002:a17:907:94c8:b0:abf:44bd:8326 with SMTP id a640c23a62f3a-ac20d8bce29mr83331366b.17.1741127689992; Tue, 04 Mar 2025 14:34:49 -0800 (PST) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-abf40a603b7sm785796566b.170.2025.03.04.14.34.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Mar 2025 14:34:49 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id A13C062604; Tue, 4 Mar 2025 22:24:42 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Li-Wen Hsu , Peter Maydell , Laurent Vivier , qemu-arm@nongnu.org, Alexandre Iooss , Paolo Bonzini , Richard Henderson , Riku Voipio , Warner Losh , Brian Cain , Mahmoud Mandour , Kyle Evans , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Ed Maste , Pierrick Bouvier , =?utf-8?q?Marc-Andr=C3=A9_L?= =?utf-8?q?ureau?= , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth Subject: [PATCH v2 32/32] meson.build: default to -gsplit-dwarf for debug info Date: Tue, 4 Mar 2025 22:24:39 +0000 Message-Id: <20250304222439.2035603-33-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250304222439.2035603-1-alex.bennee@linaro.org> References: <20250304222439.2035603-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62d.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, 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.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 This option is supported by both gcc (since 4.7) and clang (since 7.0). Not only does this make the linkers job easier by reducing the amount of ELF it needs to parse it also reduces the total build size quite considerably. In my case a default build went from 5.8G to 3.9G. The --disable-split-debug option allows distros to keep all the info together for ease of packaging. Signed-off-by: Alex Bennée --- v1 - add --disable/enable-split-debug - move to option_cflags --- meson.build | 7 +++++-- meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 8d0abe7f12..36ffe1b730 100644 --- a/meson.build +++ b/meson.build @@ -363,7 +363,7 @@ endforeach qemu_common_flags = [ '-D_GNU_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', - '-fno-strict-aliasing', '-fno-common', '-fwrapv' ] + '-fno-strict-aliasing', '-fno-common', '-fwrapv'] qemu_cflags = [] qemu_ldflags = [] @@ -4589,7 +4589,10 @@ if have_rust summary_info += {'bindgen': bindgen.full_path()} summary_info += {'bindgen version': bindgen.version()} endif -option_cflags = (get_option('debug') ? ['-g'] : []) +option_cflags = [] +if get_option('debug') + option_cflags += [get_option('split_debug') ? ['-gsplit-dwarf'] : ['-g']] +endif if get_option('optimization') != 'plain' option_cflags += ['-O' + get_option('optimization')] endif diff --git a/meson_options.txt b/meson_options.txt index 59d973bca0..3432123fee 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -362,6 +362,8 @@ option('debug_mutex', type: 'boolean', value: false, description: 'mutex debugging support') option('debug_stack_usage', type: 'boolean', value: false, description: 'measure coroutine stack usage') +option('split_debug', type: 'boolean', value: true, + description: 'split debug info from object files') option('qom_cast_debug', type: 'boolean', value: true, description: 'cast debugging support') option('slirp_smbd', type : 'feature', value : 'auto', diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index 3e8e00852b..aca6e68830 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -504,6 +504,8 @@ _meson_option_parse() { --disable-strict-rust-lints) printf "%s" -Dstrict_rust_lints=false ;; --enable-strip) printf "%s" -Dstrip=true ;; --disable-strip) printf "%s" -Dstrip=false ;; + --enable-split-debug) printf "%s" -Dsplit_debug=true ;; + --disable-split-debug) printf "%s" -Dsplit_debug=false ;; --sysconfdir=*) quote_sh "-Dsysconfdir=$2" ;; --enable-tcg) printf "%s" -Dtcg=enabled ;; --disable-tcg) printf "%s" -Dtcg=disabled ;;