From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id 1B30F2986 for ; Fri, 6 May 2016 16:32:56 +0200 (CEST) Received: by mail-wm0-f41.google.com with SMTP id a17so81170290wme.0 for ; Fri, 06 May 2016 07:32:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=egvayhVIa4YIZmIONnjB9tIy94GQXeKAlUvERnGr3PY=; b=04DG5inotoU7+YW8eUa6GBzTUv+7JHYZIC8ikH22HIwwpv362u3ul48Y8e4oeKZcDL dgjczDvmzrRDL4IuqND/F2zw2o4rkI/h9OLDs/S/gXXbP894P5dbYn2702c+jZs1IniY y4SbnVy1aRw8G5cW5GPOdcFY1D/+Mco0S0gheLTmMQvpy6bStGhNwWt6Q3i7OzR9ID/a e0xnlJ8ABbNxG/Ls0N7u18EQrCN/U2qczKgNoou8qbSWXKMsA9quo1xtIr3NnOSOQsZE A0l5s1ynZmbfBT/Hk4arE23FNGmBhtHfgJ8+1q7uSudSK/Sj1OjDFKDyY5nOku6qXM56 NYfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding; bh=egvayhVIa4YIZmIONnjB9tIy94GQXeKAlUvERnGr3PY=; b=KOvm94XV2O+ShE7BNS3DK5j1NRh61vpc5KX+7fC977WqTthx3Zt1hxKISkkmtrRlVM pzEnCHTRAv9R096legyQ6Kj+FJ52Ng7Lk+DNqI3Ddc5bOn/B5mpsueoj7qfqnNzL73EJ MixeZpcigmw02uAxhfR0VxPtpUk8PEMs04/sgaeocrSakf6WlpCVn3h3/AsS48vT00QE nc6J0t18r+9HuYyHWVNvpRht+wNnvLnsj4i+Yn2inj+vd1mN5hSusNTdcRHPT53MvNY5 jh+aCMWOZ/U4TlcFD2CNeNvB0Vmp1FL8YmyT4wI+HoDQhhG6fdTVeMgpDx9cuk8/tKf1 rbWA== X-Gm-Message-State: AOPr4FUKEuANj19gYmHSfTI6FQdPpg5JZghe6hi8j68KFxFU3IAUVTqgrKHI4Dsp6fJUAViJ X-Received: by 10.28.46.19 with SMTP id u19mr9758627wmu.98.1462545175883; Fri, 06 May 2016 07:32:55 -0700 (PDT) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id n66sm8731749wmf.6.2016.05.06.07.32.54 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 06 May 2016 07:32:54 -0700 (PDT) From: Thomas Monjalon To: Jan Viktorin Cc: dev@dpdk.org, Bruce Richardson , David Marchand Date: Fri, 06 May 2016 16:32:53 +0200 Message-ID: <2406220.vlQ29PEzMg@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1462531720-26217-3-git-send-email-viktorin@rehivetech.com> References: <1462531720-26217-1-git-send-email-viktorin@rehivetech.com> <1462531720-26217-3-git-send-email-viktorin@rehivetech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v1 02/10] app/test: support resources externally linked 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: Fri, 06 May 2016 14:32:56 -0000 It looks a lot too much tricky to be integrated without code comments ;) Please make a documentation effort. 2016-05-06 12:48, Jan Viktorin: > --- a/app/test/Makefile > +++ b/app/test/Makefile > @@ -33,6 +33,37 @@ include $(RTE_SDK)/mk/rte.vars.mk > > ifeq ($(CONFIG_RTE_APP_TEST),y) A comment is needed here to explain the intent of the following code. > +ifeq ($(RTE_ARCH),arm) > +RTE_OBJCOPY_O = elf32-littlearm > +RTE_OBJCOPY_B = arm > +else ifeq ($(RTE_ARCH),arm64) > +RTE_OBJCOPY_O = elf64-littleaarch64 > +RTE_OBJCOPY_B = aarch64 > +else ifeq ($(RTE_ARCH),i686) > +RTE_OBJCOPY_O = elf32-i386 > +RTE_OBJCOPY_B = i386 > +else ifeq ($(RTE_ARCH),x86_64) > +RTE_OBJCOPY_O = elf64-x86-64 > +RTE_OBJCOPY_B = i386:x86-64 > +else ifeq ($(RTE_ARCH),x86_x32) > +RTE_OBJCOPY_O = elf32-x86-64 > +RTE_OBJCOPY_B = i386:x86-64 > +else > +$(error Unrecognized RTE_ARCH: $(RTE_ARCH)) > +endif RTE_OBJCOPY_O could be renamed RTE_OBJCOPY_TARGET. RTE_OBJCOPY_B could be renamed RTE_OBJCOPY_ARCH. These definitions could be done in mk/arch/ > + > +define resource When defining a makefile macro, the arguments must be documented on the previous line. Otherwise, nobody (including you) will be able to read it without parsing the code below. It is not a simple resource, so the name must avoid the confusion. Why not linked_resource? > +SRCS-y += $(1).res.o > +$(1).res.o: $(2) > + $(OBJCOPY) -I binary -B $(RTE_OBJCOPY_B) -O $(RTE_OBJCOPY_O) \ > + --rename-section \ > + .data=.rodata,alloc,load,data,contents,readonly \ > + --redefine-sym _binary__dev_stdin_start=beg_$(1) \ > + --redefine-sym _binary__dev_stdin_end=end_$(1) \ > + --redefine-sym _binary__dev_stdin_size=siz_$(1) \ > + /dev/stdin $$@ < $$< > +endef [...] > +#define REGISTER_LINKED_RESOURCE(_n) \ > +extern const char beg_ ##_n; \ > +extern const char end_ ##_n; \ > +REGISTER_RESOURCE(_n, &beg_ ##_n, &end_ ##_n); \ Please explain the begin/end trick. Thanks