[dpdk-dev] How to include pre-build object file (.o) in DPDK makefile?

2016-09-19 Thread Neil Horman
On Fri, Sep 16, 2016 at 06:30:10PM +, Lu, Patrick wrote:
> -Original Message-
> From: Yigit, Ferruh 
> Sent: Friday, September 16, 2016 11:05 AM
> To: Lu, Patrick ; 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
>  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 0055fd1d 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
> 
> 


[dpdk-dev] How to include pre-build object file (.o) in DPDK makefile?

2016-09-16 Thread Ferruh Yigit
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
 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
0055fd1d T foo



[dpdk-dev] How to include pre-build object file (.o) in DPDK makefile?

2016-09-16 Thread Lu, Patrick
-Original Message-
From: Yigit, Ferruh 
Sent: Friday, September 16, 2016 11:05 AM
To: Lu, Patrick ; 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
 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 0055fd1d T foo

Perfect! This works for me.

Sincerely,

Patrick



[dpdk-dev] How to include pre-build object file (.o) in DPDK makefile?

2016-09-16 Thread Lu, Patrick
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/

Thanks,

Patrick