-----Original Message-----
From: Yigit, Ferruh 
Sent: Friday, September 16, 2016 11:05 AM
To: Lu, Patrick <patrick.lu at intel.com>; dev at 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.

Sincerely,

Patrick

Reply via email to