From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 1A71E1B33E for ; Tue, 7 Nov 2017 01:15:42 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP; 06 Nov 2017 16:15:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,355,1505804400"; d="scan'208";a="1215029045" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga001.fm.intel.com with ESMTP; 06 Nov 2017 16:15:41 -0800 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 6 Nov 2017 16:15:41 -0800 Received: from bgsmsx105.gar.corp.intel.com (10.223.43.197) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 6 Nov 2017 16:15:40 -0800 Received: from bgsmsx101.gar.corp.intel.com ([169.254.1.245]) by BGSMSX105.gar.corp.intel.com ([169.254.3.4]) with mapi id 14.03.0319.002; Tue, 7 Nov 2017 05:45:38 +0530 From: "Varghese, Vipin" To: Thomas Monjalon , "Hunt, David" CC: "dev@dpdk.org" , "Richardson, Bruce" , "Patel, Amol" Thread-Topic: [dpdk-dev] [PATCH v1] mk: allow use of toolchain cflags Thread-Index: AQHTVIfRBEEKVGoE0UCVbG2kecYzraMHgUAAgACDt1A= Date: Tue, 7 Nov 2017 00:15:37 +0000 Message-ID: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D168836@BGSMSX101.gar.corp.intel.com> References: <1509702003-70630-1-git-send-email-david.hunt@intel.com> <2369574.SFH6e9u1pT@xps> In-Reply-To: <2369574.SFH6e9u1pT@xps> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMWQ1NGFiM2UtZTYzMi00Y2FiLWFkYWEtNzY1NTliYTMyYjU2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJyWWxYVnNIaXg5aWVwdys2V2x1ZG9cL3NBdFUxUFdyb3d6dzAyWlFBTDFIQnNvXC82eHF6Tll4OGFvQUpaSmRvNUMifQ== dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.223.10.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 07 Nov 2017 15:31:50 +0100 Subject: Re: [dpdk-dev] [PATCH v1] mk: allow use of toolchain cflags 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: , X-List-Received-Date: Tue, 07 Nov 2017 00:15:43 -0000 Hi Thomas, Please find my answers below=20 Why do you want to use export from the shell environment? Answer> One scenario that generic scripts or makefiles are used to build DP= DK and Customer components. While building for "make debug" mode; we requir= e DPDK libraries to be built with compiler specific additives. Hence there = are requirements of having them exported (especially in DPDK shared library= mode) is in practice. The standard way of overriding a variable with make, is to specify a value = on the make command line. Answer> Please find my observations while using non modified DPDK versions CMD:=20 1) cd $RTE_SDK/$RTE_TARGET 2) make clean; make TOOLCHAIN_CFLAGS=3D"-ggdb -fno-omit-frame-pointer" Checking for user flags: # grep -nr "fno-omit-frame-pointer" lib/ | wc -l 66 # grep -nr "fno-omit-frame-pointer" app/ Binary file app/dpdk-procinfo matches Binary file app/testpmd matches Binary file app/dpdk-test-eventdev matches Binary file app/dpdk-test-crypto-perf matches Binary file app/dpdk-pdump matches # grep -nr "fno-omit-frame-pointer" kmod/ # ldd x86_64-native-linuxapp-gcc/app/* | grep rte_eal librte_eal.so.5.1 =3D> /home/saesrv02/Downloads/dpdksrc/dpdk-17.08= /x86_64-native-linuxapp-gcc/lib/librte_eal.so.5.1 (0x00007f9a7badc000) librte_eal.so.5.1 =3D> /home/saesrv02/Downloads/dpdksrc/dpdk-17.08= /x86_64-native-linuxapp-gcc/lib/librte_eal.so.5.1 (0x00007fb2fb318000) librte_eal.so.5.1 =3D> /home/saesrv02/Downloads/dpdksrc/dpdk-17.08= /x86_64-native-linuxapp-gcc/lib/librte_eal.so.5.1 (0x00007f865530f000) librte_eal.so.5.1 =3D> /home/saesrv02/Downloads/dpdksrc/dpdk-17.08= /x86_64-native-linuxapp-gcc/lib/librte_eal.so.5.1 (0x00007f83c7c4c000) librte_eal.so.5.1 =3D> /home/saesrv02/Downloads/dpdksrc/dpdk-17.08= /x86_64-native-linuxapp-gcc/lib/librte_eal.so.5.1 (0x00007f1003c10000) If you really want to take environment value into account, you can just com= ment this assignment or use ?=3D operator. Answer> I also tried adding variable into ".config" - "CONFIG_RTE_TOOLCHAIN= _GCC_DEBUG=3Dy", then manually editing "mk/toolchain/gcc/rte.vars.mk" as "i= feq ($(CONFIG_RTE_TOOLCHAIN_GCC_DEBUG),y) TOOLCHAIN_CFLAGS ?=3D ". But this requires to edit or sed the file for each new combinatio= n. Hence dropped this approach. Note that you can also use EXTRA_CFLAGS. Answer> As per the mailing list http://dpdk.org/ml/archives/dev/2015-August= /022592.html, passing EXTRA_CFLAGS will solve the issue. But this affect mo= dules, libraries and application grep -nr EXTRA_CFLAGS * --include=3D*.mk internal/rte.compile-pre.mk:78: $(CFLAGS_$(@)) $(HOST_EXTRA_CPPFLAGS) $(HOS= T_EXTRA_CFLAGS) -o $@ -c $< internal/rte.compile-pre.mk:83: $(CFLAGS_$(@)) $(EXTRA_CPPFLAGS) $(EXTRA_CF= LAGS) -o $@ -c $< rte.app.mk:245:O_TO_EXE =3D $(CC) -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $(OBJS-y)= $(call linkerprefix, \ rte.bsdmodule.mk:34:override EXTRA_CFLAGS =3D $(MODULE_CFLAGS) $(EXTRA_KERN= EL_CFLAGS) rte.cpuflags.mk:36:AUTO_CPUFLAGS :=3D $(shell $(CC) $(MACHINE_CFLAGS) $(WER= ROR_FLAGS) $(EXTRA_CFLAGS) -dM -E - < /dev/null) rte.lib.mk:80:LD :=3D $(CC) $(CPU_CFLAGS) $(EXTRA_CFLAGS) rte.module.mk:34:override EXTRA_CFLAGS =3D $(MODULE_CFLAGS) $(EXTRA_KERNEL_= CFLAGS) toolchain/gcc/rte.vars.mk:69:ifeq (,$(findstring -O0,$(EXTRA_CFLAGS))) toolchain/gcc/rte.vars.mk:70: $(warning "EXTRA_CFLAGS doesn't contains -O0,= coverage will be inaccurate with optimizations enabled") I would be in favor of removing these variables. We have too many variables. Answer> Ok, at least we should have right variables to allow build componen= ts with right settings. Thanks Vipin Varghese -----Original Message----- From: Thomas Monjalon [mailto:thomas@monjalon.net]=20 Sent: Tuesday, November 7, 2017 2:38 AM To: Hunt, David ; Varghese, Vipin Cc: dev@dpdk.org; Richardson, Bruce Subject: Re: [dpdk-dev] [PATCH v1] mk: allow use of toolchain cflags 03/11/2017 10:40, David Hunt: > From: Vipin Varghese >=20 > with 'export TOOLCHAIN_CFLAGS' the values are not inherited throuhout=20 > make system. The change appends the user defined cflags. Why do you want to use export from the shell environment? The standard way of overriding a variable with make, is to specify a value = on the make command line. [...] > -TOOLCHAIN_ASFLAGS =3D > -TOOLCHAIN_CFLAGS =3D > -TOOLCHAIN_LDFLAGS =3D > +TOOLCHAIN_ASFLAGS +=3D > +TOOLCHAIN_CFLAGS +=3D > +TOOLCHAIN_LDFLAGS +=3D There is nothing to append here. It is here only for documentation purpose. If you really want to take environment value into account, you can just com= ment this assignment or use ?=3D operator. Note that you can also use EXTRA_CFLAGS. I would be in favor of removing these variables. We have too many variables.