From patchwork Fri Nov 29 17:10:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Laatz X-Patchwork-Id: 63392 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7167EA04E0; Fri, 29 Nov 2019 18:10:51 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6427E2B9C; Fri, 29 Nov 2019 18:10:43 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id AB339235 for ; Fri, 29 Nov 2019 18:10:40 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Nov 2019 09:10:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,257,1571727600"; d="scan'208";a="409684844" Received: from silpixa00399838.ir.intel.com (HELO silpixa00399838.ger.corp.intel.com) ([10.237.222.120]) by fmsmga005.fm.intel.com with ESMTP; 29 Nov 2019 09:10:38 -0800 From: Kevin Laatz To: dev@dpdk.org Cc: david.marchand@redhat.com, thomas@monjalon.net, bruce.richardson@intel.com, ray.kinsella@intel.com Date: Fri, 29 Nov 2019 17:10:18 +0000 Message-Id: <20191129171024.56165-2-kevin.laatz@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191129171024.56165-1-kevin.laatz@intel.com> References: <20191023010754.65172-1-kevin.laatz@intel.com> <20191129171024.56165-1-kevin.laatz@intel.com> Subject: [dpdk-dev] [PATCH v2 1/7] build: enable debug info by default in meson builds X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Bruce Richardson We can turn on debug info by default in meson builds, since it has no performance penalty. This is done by changing the default build type from "release" to "debugoptimized". Since the latter using O2, we can using extra cflags to override that back to O3, which will make little real difference for actual debugging. For real debug builds, the user can still do "meson --buildtype=debug ..." and to remove the debug info "meson --buildtype=release ..." can be used. These are all standard meson options. The advantage of having debug builds by default using meson settings is that we can then add checks for ABI compatibility into each build, and disable them if we detect that the user has turned off the debug info. Signed-off-by: Bruce Richardson --- meson.build | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index b7ae9c8d9..3b7a2e7de 100644 --- a/meson.build +++ b/meson.build @@ -7,10 +7,16 @@ project('DPDK', 'C', version: run_command(find_program('cat', 'more'), files('VERSION')).stdout().strip(), license: 'BSD', - default_options: ['buildtype=release', 'default_library=static'], + default_options: ['buildtype=debugoptimized', + 'default_library=static'], meson_version: '>= 0.47.1' ) +# for default "debugoptimized" builds override optimization level 2 with 3 +if get_option('buildtype') == 'debugoptimized' + add_project_arguments('-O3', language: 'c') +endif + # set up some global vars for compiler, platform, configuration, etc. cc = meson.get_compiler('c') dpdk_conf = configuration_data()