From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DATE_IN_PAST_06_12, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6168BCA9EB6 for ; Wed, 23 Oct 2019 09:26:01 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 29C652084C for ; Wed, 23 Oct 2019 09:26:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 29C652084C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E72001BFFB; Wed, 23 Oct 2019 11:25:52 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id D60871BFEE for ; Wed, 23 Oct 2019 11:25:49 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Oct 2019 02:25:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,220,1569308400"; d="scan'208";a="397983767" Received: from silpixa00399838.ir.intel.com (HELO silpixa00399838.ger.corp.intel.com) ([10.237.223.140]) by fmsmga005.fm.intel.com with ESMTP; 23 Oct 2019 02:25:47 -0700 From: Kevin Laatz To: dev@dpdk.org Cc: bruce.richardson@intel.com, thomas@monjalon.net, ray.kinsella@intel.com Date: Wed, 23 Oct 2019 01:07:49 +0000 Message-Id: <20191023010754.65172-2-kevin.laatz@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191023010754.65172-1-kevin.laatz@intel.com> References: <20191023010754.65172-1-kevin.laatz@intel.com> Subject: [dpdk-dev] [RFC 1/6] 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 c5a3dda26..b77ccd6ef 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() -- 2.17.1