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 2A4CF8DB2 for ; Fri, 16 Sep 2016 20:05:18 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP; 16 Sep 2016 11:05:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,345,1470726000"; d="scan'208";a="762072129" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.97]) ([10.237.220.97]) by FMSMGA003.fm.intel.com with ESMTP; 16 Sep 2016 11:05:16 -0700 To: "Lu, Patrick" , "dev@dpdk.org" References: From: Ferruh Yigit Message-ID: <53596706-55c5-f234-f935-2cc3ac9af911@intel.com> Date: Fri, 16 Sep 2016 19:05:16 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit 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: Fri, 16 Sep 2016 18:05:19 -0000 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