From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id 46CC0374F for ; Mon, 19 Sep 2016 13:38:33 +0200 (CEST) Received: from cpe-2606-a000-111b-40ed-7aac-c0ff-fec2-933b.dyn6.twc.com ([2606:a000:111b:40ed:7aac:c0ff:fec2:933b] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1blwtx-00079N-EX; Mon, 19 Sep 2016 07:38:31 -0400 Date: Mon, 19 Sep 2016 07:38:12 -0400 From: Neil Horman To: "Lu, Patrick" Cc: "Yigit, Ferruh" , "dev@dpdk.org" Message-ID: <20160919113812.GA30452@hmsreliant.think-freely.org> References: <53596706-55c5-f234-f935-2cc3ac9af911@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.0 (2016-08-17) X-Spam-Score: -2.9 (--) X-Spam-Status: No Subject: Re: [dpdk-dev] How to include pre-build object file (.o) in DPDK makefile? 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: Mon, 19 Sep 2016 11:38:33 -0000 On Fri, Sep 16, 2016 at 06:30:10PM +0000, Lu, Patrick wrote: > -----Original Message----- > From: Yigit, Ferruh > Sent: Friday, September 16, 2016 11:05 AM > To: Lu, Patrick ; dev@dpdk.org > Subject: Re: [dpdk-dev] How to include pre-build object file (.o) in DPDK makefile? > > On 9/16/2016 6:04 PM, Lu, Patrick wrote: > > Hi, > > > > I'm trying to include some hand written assembly (compiled by yasm) in my DPDK program. I couldn't find any example linking the DPDK C code with pre-compiled .o file. I've searched the mk/ and found OBJS-y seems the right variable to include .o file, but when generating the final executable, OBJS-y contains only main.o (generating from main.c). > > > > I've tried to put my .o file in both source directory as well as > > build/ > > > > Possible to use EXTRA_LDLIBS to provide the object file name, and put object file into build folder. > > Following example worked for me: > > $ nm foo.o > 0000000000000000 T foo > > $ cp foo.o examples/skeleton/build/ > > $ make -C examples/skeleton EXTRA_LDLIBS="foo.o" > make: Entering directory '.../examples/skeleton' > CC basicfwd.o > LD basicfwd > INSTALL-APP basicfwd > INSTALL-MAP basicfwd.map > make: Leaving directory '.../examples/skeleton' > > $ nm examples/skeleton/build/basicfwd | grep foo 000000000055fd1d T foo > > Perfect! This works for me. > Just out of curiosity, why not just specify the source file in SRCS-y for your target binary? rte.pre-compile.mk has an assembly target for .S->.o transitions. Neil > Sincerely, > > Patrick > >