From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 61B515A32 for ; Wed, 13 May 2015 16:43:44 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 13 May 2015 07:43:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,421,1427785200"; d="scan'208";a="493113276" Received: from orsmsx104.amr.corp.intel.com ([10.22.225.131]) by FMSMGA003.fm.intel.com with ESMTP; 13 May 2015 07:43:42 -0700 Received: from orsmsx155.amr.corp.intel.com (10.22.240.21) by ORSMSX104.amr.corp.intel.com (10.22.225.131) with Microsoft SMTP Server (TLS) id 14.3.224.2; Wed, 13 May 2015 07:43:42 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by ORSMSX155.amr.corp.intel.com (10.22.240.21) with Microsoft SMTP Server (TLS) id 14.3.224.2; Wed, 13 May 2015 07:43:42 -0700 Received: from fmsmsx113.amr.corp.intel.com ([169.254.13.51]) by fmsmsx120.amr.corp.intel.com ([169.254.15.92]) with mapi id 14.03.0224.002; Wed, 13 May 2015 07:43:41 -0700 From: "Wiles, Keith" To: Olivier MATZ , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v8 1/2] mk:Simplify the ifdefs in rte.app.mk Thread-Index: AQHQjYs0jmIzPd/5n0GFkZB2ucTpFQ== Date: Wed, 13 May 2015 14:43:41 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.254.90.134] Content-Type: text/plain; charset="us-ascii" Content-ID: <736EF27E50E59E4B880905A01DE4747D@intel.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v8 1/2] mk:Simplify the ifdefs in rte.app.mk X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2015 14:43:45 -0000 On 5/13/15, 9:28 AM, "Olivier MATZ" wrote: > >On 05/13/2015 04:04 PM, Wiles, Keith wrote: >> >> >> On 5/13/15, 8:56 AM, "Olivier MATZ" wrote: >> >>> Hi Keith, >>> >>> On 05/13/2015 03:17 PM, Wiles, Keith wrote: >>>>>> >>>>>> endif # ifeq ($(NO_AUTOLIBS),) >>>>>> >>>>>> -LDLIBS +=3D $(CPU_LDLIBS) >>>>>> +LDLIBS +=3D $(_LDLIBS-y) $(EXTRA_LDLIBS) >>>>>> >>>>> >>>>> As discussed in the previous mail, all things that are about >>>>> EXTRA_LDLIBS should be moved in the second patch. Therefore, >>>>> the title of the second patch should not be "update doc...", but >>>>> something like "mk: introduce EXTRA_LDLIBS...". >>>>> >>>>> By the way, I missed that before, but it seems that your >>>>> patch removes CPU_LDLIBS, I don't think it's correct. >>>> >>>> I found no reference to CPU_LDLIBS in the docs or code other then then >>>> one >>>> line. We now have EXTRA_LDLIBS for the command line, right? >>> >>> Yes, but your patch says "simplify the ifdef". Removing >>> a variable (even if it is not used) in this patch is not >>> a good idea. >>> >>> Now, the CPU_CFLAGS, CPU_LDFLAGS, CPU_LDLIBS can be defined internally >>> by the rte.vars.mk in mk/arch/ or mk/machine/ directories. >> >> No docs for CPU_LDLIBS or reference to that variable, which means it >>does >> not exist, right? >> If it was used or documented then I would agree. Having magic variables >>is >> not a good idea. I will add the CPU_LDLIBS in to the line, but someone >> will have to document that variable. > >First, this variable is internal to DPDK framework. It is not Not referenced in the code any place except the one line and not referenced in the docs, which means no one used that variable. By definition this is some magic variable that someone could use only because he knew about that variable. As I stated before, I will add that variable back, but it must be documented, correct? Look at the code a number of CPU_XXXX flags are commented about in the code. machine/power8/rte.vars.mk:39:# - can define CPU_CFLAGS variable (overridden by cmdline value) that machine/power8/rte.vars.mk:41:# - can define CPU_LDFLAGS variable (overridden by cmdline value) that machine/power8/rte.vars.mk:43:# - can define CPU_ASFLAGS variable (overridden by cmdline value) that machine/power8/rte.vars.mk:53:# CPU_CFLAGS =3D machine/power8/rte.vars.mk:54:# CPU_LDFLAGS =3D machine/power8/rte.vars.mk:55:# CPU_ASFLAGS =3D machine/wsm/rte.vars.mk:40:# - can define CPU_CFLAGS variable (overriden by cmdline value) that machine/wsm/rte.vars.mk:42:# - can define CPU_LDFLAGS variable (overriden by cmdline value) that machine/wsm/rte.vars.mk:44:# - can define CPU_ASFLAGS variable (overriden by cmdline value) that machine/wsm/rte.vars.mk:54:# CPU_CFLAGS =3D machine/wsm/rte.vars.mk:55:# CPU_LDFLAGS =3D machine/wsm/rte.vars.mk:56:# CPU_ASFLAGS =3D machine/native/rte.vars.mk:40:# - can define CPU_CFLAGS variable (overriden by cmdline value) that machine/native/rte.vars.mk:42:# - can define CPU_LDFLAGS variable (overriden by cmdline value) that machine/native/rte.vars.mk:44:# - can define CPU_ASFLAGS variable (overriden by cmdline value) that machine/native/rte.vars.mk:54:# CPU_CFLAGS =3D machine/native/rte.vars.mk:55:# CPU_LDFLAGS =3D machine/native/rte.vars.mk:56:# CPU_ASFLAGS =3D machine/native/rte.vars.mk:66: CPU_SSE42_SUPPORT =3D $(shell grep SSE4\.2 /var/run/dmesg.boot 2>/dev/null) machine/native/rte.vars.mk:67: ifneq ($(CPU_SSE42_SUPPORT),) machine/atm/rte.vars.mk:40:# - can define CPU_CFLAGS variable (overriden by cmdline value) that machine/atm/rte.vars.mk:42:# - can define CPU_LDFLAGS variable (overriden by cmdline value) that machine/atm/rte.vars.mk:44:# - can define CPU_ASFLAGS variable (overriden by cmdline value) that machine/atm/rte.vars.mk:54:# CPU_CFLAGS =3D machine/atm/rte.vars.mk:55:# CPU_LDFLAGS =3D machine/atm/rte.vars.mk:56:# CPU_ASFLAGS =3D machine/hsw/rte.vars.mk:40:# - can define CPU_CFLAGS variable (overriden by cmdline value) that machine/hsw/rte.vars.mk:42:# - can define CPU_LDFLAGS variable (overriden by cmdline value) that machine/hsw/rte.vars.mk:44:# - can define CPU_ASFLAGS variable (overriden by cmdline value) that machine/hsw/rte.vars.mk:54:# CPU_CFLAGS =3D machine/hsw/rte.vars.mk:55:# CPU_LDFLAGS =3D machine/hsw/rte.vars.mk:56:# CPU_ASFLAGS =3D machine/ivb/rte.vars.mk:40:# - can define CPU_CFLAGS variable (overriden by cmdline value) that machine/ivb/rte.vars.mk:42:# - can define CPU_LDFLAGS variable (overriden by cmdline value) that machine/ivb/rte.vars.mk:44:# - can define CPU_ASFLAGS variable (overriden by cmdline value) that machine/ivb/rte.vars.mk:54:# CPU_CFLAGS =3D machine/ivb/rte.vars.mk:55:# CPU_LDFLAGS =3D machine/ivb/rte.vars.mk:56:# CPU_ASFLAGS =3D machine/snb/rte.vars.mk:40:# - can define CPU_CFLAGS variable (overriden by cmdline value) that machine/snb/rte.vars.mk:42:# - can define CPU_LDFLAGS variable (overriden by cmdline value) that machine/snb/rte.vars.mk:44:# - can define CPU_ASFLAGS variable (overriden by cmdline value) that machine/snb/rte.vars.mk:54:# CPU_CFLAGS =3D machine/snb/rte.vars.mk:55:# CPU_LDFLAGS =3D machine/snb/rte.vars.mk:56:# CPU_ASFLAGS =3D machine/nhm/rte.vars.mk:40:# - can define CPU_CFLAGS variable (overriden by cmdline value) that machine/nhm/rte.vars.mk:42:# - can define CPU_LDFLAGS variable (overriden by cmdline value) that machine/nhm/rte.vars.mk:44:# - can define CPU_ASFLAGS variable (overriden by cmdline value) that machine/nhm/rte.vars.mk:54:# CPU_CFLAGS =3D machine/nhm/rte.vars.mk:55:# CPU_LDFLAGS =3D machine/nhm/rte.vars.mk:56:# CPU_ASFLAGS =3D machine/default/rte.vars.mk:40:# - can define CPU_CFLAGS variable (overriden by cmdline value) that machine/default/rte.vars.mk:42:# - can define CPU_LDFLAGS variable (overriden by cmdline value) that machine/default/rte.vars.mk:44:# - can define CPU_ASFLAGS variable (overriden by cmdline value) that machine/default/rte.vars.mk:54:# CPU_CFLAGS =3D machine/default/rte.vars.mk:55:# CPU_LDFLAGS =3D machine/default/rte.vars.mk:56:# CPU_ASFLAGS =3D rte.lib.mk:43:CPU_LDFLAGS +=3D --version-script=3D$(SRCDIR)/$(EXPORT_MAP) rte.lib.mk:67:LD :=3D $(CC) $(CPU_CFLAGS) rte.lib.mk:68:_CPU_LDFLAGS :=3D $(call linkerprefix,$(CPU_LDFLAGS)) rte.lib.mk:70:_CPU_LDFLAGS :=3D $(CPU_LDFLAGS) rte.lib.mk:82:O_TO_S =3D $(LD) $(_CPU_LDFLAGS) -shared $(OBJS-y) -Wl,-soname,$(LIB) -o $(LIB) rte.app.mk:144:LDLIBS +=3D $(_LDLIBS-y) $(CPU_LDLIBS) $(EXTRA_LDLIBS) arch/x86_64/rte.vars.mk:39:# - define CPU_CFLAGS variable (overriden by cmdline or previous arch/x86_64/rte.vars.mk:41:# - define CPU_LDFLAGS variable (overriden by cmdline or previous arch/x86_64/rte.vars.mk:43:# - define CPU_ASFLAGS variable (overriden by cmdline or previous arch/x86_64/rte.vars.mk:55:CPU_CFLAGS ?=3D -m64 arch/x86_64/rte.vars.mk:56:CPU_LDFLAGS ?=3D arch/x86_64/rte.vars.mk:57:CPU_ASFLAGS ?=3D -felf64 arch/x86_64/rte.vars.mk:59:export ARCH CROSS CPU_CFLAGS CPU_LDFLAGS CPU_ASFLAGS arch/i686/rte.vars.mk:39:# - define CPU_CFLAGS variable (overriden by cmdline or previous arch/i686/rte.vars.mk:41:# - define CPU_LDFLAGS variable (overriden by cmdline or previous arch/i686/rte.vars.mk:43:# - define CPU_ASFLAGS variable (overriden by cmdline or previous arch/i686/rte.vars.mk:55:CPU_CFLAGS ?=3D -m32 arch/i686/rte.vars.mk:56:CPU_LDFLAGS ?=3D -melf_i386 arch/i686/rte.vars.mk:57:CPU_ASFLAGS ?=3D -felf arch/i686/rte.vars.mk:59:export ARCH CROSS CPU_CFLAGS CPU_LDFLAGS CPU_ASFLAGS arch/x86_x32/rte.vars.mk:39:# - define CPU_CFLAGS variable (overridden by cmdline or previous arch/x86_x32/rte.vars.mk:41:# - define CPU_LDFLAGS variable (overridden by cmdline or previous arch/x86_x32/rte.vars.mk:43:# - define CPU_ASFLAGS variable (overridden by cmdline or previous arch/x86_x32/rte.vars.mk:54:CPU_CFLAGS ?=3D -mx32 arch/x86_x32/rte.vars.mk:55:CPU_LDFLAGS ?=3D -melf32_x86_64 arch/x86_x32/rte.vars.mk:56:#CPU_ASFLAGS ?=3D -felf64 arch/x86_x32/rte.vars.mk:59:ifneq ($(shell echo | $(CC) $(CPU_CFLAGS) -E - 2>/dev/null 1>/dev/null && echo 0), 0) arch/x86_x32/rte.vars.mk:63:export ARCH CROSS CPU_CFLAGS CPU_LDFLAGS CPU_ASFLAGS arch/ppc_64/rte.vars.mk:35:CPU_CFLAGS ?=3D -m64 -DRTE_CACHE_LINE_SIZE=3D12= 8 arch/ppc_64/rte.vars.mk:36:CPU_LDFLAGS ?=3D arch/ppc_64/rte.vars.mk:37:CPU_ASFLAGS ?=3D -felf64 arch/ppc_64/rte.vars.mk:39:export ARCH CROSS CPU_CFLAGS CPU_LDFLAGS CPU_ASFLAGS target/generic/rte.vars.mk:46:# - can define CPU_CFLAGS variable (overriden by cmdline value) that target/generic/rte.vars.mk:48:# - can define CPU_LDFLAGS variable (overriden by cmdline value) that target/generic/rte.vars.mk:50:# - can define CPU_ASFLAGS variable (overriden by cmdline value) that target/generic/rte.vars.mk:64:# - define CPU_CFLAGS variable (overriden by cmdline or previous target/generic/rte.vars.mk:66:# - define CPU_LDFLAGS variable (overriden by cmdline or previous target/generic/rte.vars.mk:68:# - define CPU_ASFLAGS variable (overriden by cmdline or previous target/generic/rte.vars.mk:110:CFLAGS :=3D $(CPU_CFLAGS) $(EXECENV_CFLAGS) $(TOOLCHAIN_CFLAGS) $(MACHINE_CFLAGS) target/generic/rte.vars.mk:114:LDFLAGS :=3D $(CPU_LDFLAGS) $(EXECENV_LDFLAGS) $(TOOLCHAIN_LDFLAGS) $(MACHINE_LDFLAGS) target/generic/rte.vars.mk:118:ASFLAGS :=3D $(CPU_ASFLAGS) $(EXECENV_ASFLAGS) $(TOOLCHAIN_ASFLAGS) $(MACHINE_ASFLAGS) rte.sharelib.mk:52:LD :=3D $(CC) $(CPU_CFLAGS) rte.sharelib.mk:53:O_TO_S =3D $(LD) $(call linkerprefix,$(CPU_LDFLAGS)) \ rte.sharelib.mk:56:O_TO_S =3D $(LD) $(CPU_LDFLAGS) \ >documented, because the goal of the documentation is not to >document all internal variables. In one word, it's not a magic >variable at all, it is simply a variable. > >Now, the heart of the matter is that your patch silently remove >this line. This is not acceptable and that's why I'm commenting >on it. The goal of patch splitting and proper title is to separate >features, and win time when searching in the git log for the cause >of a problem. > >This is the same problem with EXTRA_LDLIBS. How can you justify >having 2 patches: >- "simplify the ifdef" that also adds the EXTRA_LDLIBS > then >- "update the documentation for EXTRA_LDLIBS" > >Regards, >Olivier > > > >>> >>> Regards, >>> Olivier >>> >> >