All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: "Lu, Patrick" <patrick.lu@intel.com>
Cc: "Yigit, Ferruh" <ferruh.yigit@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: How to include pre-build object file (.o) in DPDK makefile?
Date: Mon, 19 Sep 2016 07:38:12 -0400	[thread overview]
Message-ID: <20160919113812.GA30452@hmsreliant.think-freely.org> (raw)
In-Reply-To: <EFC7DD9FAC418F4683FA895DBD8B35A30FA7423B@fmsmsx101.amr.corp.intel.com>

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 <patrick.lu@intel.com>; 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
> 
> 

      reply	other threads:[~2016-09-19 11:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-16 17:04 How to include pre-build object file (.o) in DPDK makefile? Lu, Patrick
2016-09-16 18:05 ` Ferruh Yigit
2016-09-16 18:30   ` Lu, Patrick
2016-09-19 11:38     ` Neil Horman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160919113812.GA30452@hmsreliant.think-freely.org \
    --to=nhorman@tuxdriver.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=patrick.lu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.