Message ID | 1434749378-8578-1-git-send-email-cchemparathy@ezchip.com (mailing list archive) |
---|---|
State | Rejected, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 8A089C94E; Fri, 19 Jun 2015 23:29:52 +0200 (CEST) Received: from sclab-apps-2.localdomain (sc-fw1.tilera.com [12.218.212.162]) by dpdk.org (Postfix) with ESMTP id 8D39FC934 for <dev@dpdk.org>; Fri, 19 Jun 2015 23:29:41 +0200 (CEST) X-CheckPoint: {558489C4-8-A3D4DA0C-C0000002} Received: by sclab-apps-2.localdomain (Postfix, from userid 1318) id 7288422048B; Fri, 19 Jun 2015 14:29:40 -0700 (PDT) From: Cyril Chemparathy <cchemparathy@ezchip.com> To: dev@dpdk.org Date: Fri, 19 Jun 2015 14:29:37 -0700 Message-Id: <1434749378-8578-1-git-send-email-cchemparathy@ezchip.com> X-Mailer: git-send-email 2.1.2 Subject: [dpdk-dev] [PATCH] mk: add support for gdb debug info generation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Cyril Chemparathy
June 19, 2015, 9:29 p.m. UTC
From: Cyril Chemparathy <cchemparathy@tilera.com> It is often useful to build with debug enabled, we add a config (CONFIG_RTE_TOOLCHAIN_DEBUG) to do so. Note: This patch does not include corresponding changes for ICC. The author pleads abject ignorance in this regard, and welcomes recommendations. :-) Change-Id: I499e591e1b7d71df751fd40d1fdcbe6975eeeb27 Signed-off-by: Cyril Chemparathy <cchemparathy@ezchip.com> --- mk/toolchain/gcc/rte.vars.mk | 5 +++++ 1 file changed, 5 insertions(+)
Comments
On 19/06/2015 22:29, Cyril Chemparathy wrote: > From: Cyril Chemparathy <cchemparathy@tilera.com> > > It is often useful to build with debug enabled, we add a config > (CONFIG_RTE_TOOLCHAIN_DEBUG) to do so. > > Note: This patch does not include corresponding changes for ICC. The > author pleads abject ignorance in this regard, and welcomes > recommendations. :-) > > Change-Id: I499e591e1b7d71df751fd40d1fdcbe6975eeeb27 > Signed-off-by: Cyril Chemparathy <cchemparathy@ezchip.com> > --- > mk/toolchain/gcc/rte.vars.mk | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk > index 0f51c66..22c4c1f 100644 > --- a/mk/toolchain/gcc/rte.vars.mk > +++ b/mk/toolchain/gcc/rte.vars.mk > @@ -71,6 +71,11 @@ ifeq (,$(findstring -O0,$(EXTRA_CFLAGS))) > endif > endif > > +ifeq ($(CONFIG_RTE_TOOLCHAIN_DEBUG),y) > +TOOLCHAIN_CFLAGS += -g -ggdb > +TOOLCHAIN_LDFLAGS += -g -ggdb > +endif > + > WERROR_FLAGS := -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes > WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith > WERROR_FLAGS += -Wcast-align -Wnested-externs -Wcast-qual I don't think you need to modify the makefiles and introduce a new compile time option for this. The same result can be easily achieved by setting EXTRA_CFLAGS in the command line. ie: $ make install T=x86_64-native-linuxapp-gcc EXTRA_CFLAGS='-g -ggdb' Sergio
On 2015-06-22 09:44, Gonzalez Monroy, Sergio wrote: > On 19/06/2015 22:29, Cyril Chemparathy wrote: >> From: Cyril Chemparathy <cchemparathy@tilera.com> >> >> It is often useful to build with debug enabled, we add a config >> (CONFIG_RTE_TOOLCHAIN_DEBUG) to do so. >> >> +ifeq ($(CONFIG_RTE_TOOLCHAIN_DEBUG),y) >> +TOOLCHAIN_CFLAGS += -g -ggdb >> +TOOLCHAIN_LDFLAGS += -g -ggdb >> +endif > I don't think you need to modify the makefiles and introduce a new > compile time option for this. > The same result can be easily achieved by setting EXTRA_CFLAGS in the > command line. ie: > $ make install T=x86_64-native-linuxapp-gcc EXTRA_CFLAGS='-g -ggdb' Why isn't -g standard though? The binaries should/will anyhow be stripped when used for production - but debugging information should be useful when analysing crashes. // Simon
On Mon, 22 Jun 2015 08:44:41 +0100 "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com> wrote: > I don't think you need to modify the makefiles and introduce a new > compile time option for this. > The same result can be easily achieved by setting EXTRA_CFLAGS in the > command line. ie: > $ make install T=x86_64-native-linuxapp-gcc EXTRA_CFLAGS='-g > -ggdb' Fair enough. Please ignore this patch then. Thanks!
On 22/06/2015 08:56, Simon Kågström wrote: > On 2015-06-22 09:44, Gonzalez Monroy, Sergio wrote: >> On 19/06/2015 22:29, Cyril Chemparathy wrote: >>> From: Cyril Chemparathy <cchemparathy@tilera.com> >>> >>> It is often useful to build with debug enabled, we add a config >>> (CONFIG_RTE_TOOLCHAIN_DEBUG) to do so. >>> >>> +ifeq ($(CONFIG_RTE_TOOLCHAIN_DEBUG),y) >>> +TOOLCHAIN_CFLAGS += -g -ggdb >>> +TOOLCHAIN_LDFLAGS += -g -ggdb >>> +endif >> I don't think you need to modify the makefiles and introduce a new >> compile time option for this. >> The same result can be easily achieved by setting EXTRA_CFLAGS in the >> command line. ie: >> $ make install T=x86_64-native-linuxapp-gcc EXTRA_CFLAGS='-g -ggdb' > Why isn't -g standard though? The binaries should/will anyhow be > stripped when used for production - but debugging information should be > useful when analysing crashes. I guess you could argue that, to always build with debug info then strip it down. You would need another flag to strip debug info for production, or leave it for debugging. In my opinion is not worth it, but it you feel strongly about it you can submit patches and let the community decide. Sergio > // Simon >
2015-06-23 08:39, Gonzalez Monroy, Sergio: > On 22/06/2015 08:56, Simon Kågström wrote: > > On 2015-06-22 09:44, Gonzalez Monroy, Sergio wrote: > >> On 19/06/2015 22:29, Cyril Chemparathy wrote: > >>> From: Cyril Chemparathy <cchemparathy@tilera.com> > >>> > >>> It is often useful to build with debug enabled, we add a config > >>> (CONFIG_RTE_TOOLCHAIN_DEBUG) to do so. > >>> > >>> +ifeq ($(CONFIG_RTE_TOOLCHAIN_DEBUG),y) > >>> +TOOLCHAIN_CFLAGS += -g -ggdb > >>> +TOOLCHAIN_LDFLAGS += -g -ggdb > >>> +endif > >> I don't think you need to modify the makefiles and introduce a new > >> compile time option for this. > >> The same result can be easily achieved by setting EXTRA_CFLAGS in the > >> command line. ie: > >> $ make install T=x86_64-native-linuxapp-gcc EXTRA_CFLAGS='-g -ggdb' > > Why isn't -g standard though? The binaries should/will anyhow be > > stripped when used for production - but debugging information should be > > useful when analysing crashes. > > I guess you could argue that, to always build with debug info then strip > it down. > You would need another flag to strip debug info for production, or leave > it for debugging. > > In my opinion is not worth it, but it you feel strongly about it you can > submit patches and > let the community decide. I think stripping is a packaging responsibility. It would be a good idea to always provide debugging symbols.
On 2015-06-23 09:47, Thomas Monjalon wrote: > 2015-06-23 08:39, Gonzalez Monroy, Sergio: >> I guess you could argue that, to always build with debug info then strip >> it down. >> You would need another flag to strip debug info for production, or leave >> it for debugging. >> >> In my opinion is not worth it, but it you feel strongly about it you can >> submit patches and >> let the community decide. > > I think stripping is a packaging responsibility. > It would be a good idea to always provide debugging symbols. Yes, I think this would be the best way too, and should be pretty much standard procedure. DPDK is anyhow just a library - stripping should be up to the application / packaging to do. // Simon
diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk index 0f51c66..22c4c1f 100644 --- a/mk/toolchain/gcc/rte.vars.mk +++ b/mk/toolchain/gcc/rte.vars.mk @@ -71,6 +71,11 @@ ifeq (,$(findstring -O0,$(EXTRA_CFLAGS))) endif endif +ifeq ($(CONFIG_RTE_TOOLCHAIN_DEBUG),y) +TOOLCHAIN_CFLAGS += -g -ggdb +TOOLCHAIN_LDFLAGS += -g -ggdb +endif + WERROR_FLAGS := -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith WERROR_FLAGS += -Wcast-align -Wnested-externs -Wcast-qual