DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: "Lu, Patrick" <patrick.lu@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] How to include pre-build object file (.o) in DPDK makefile?
Date: Fri, 16 Sep 2016 19:05:16 +0100	[thread overview]
Message-ID: <53596706-55c5-f234-f935-2cc3ac9af911@intel.com> (raw)
In-Reply-To: <EFC7DD9FAC418F4683FA895DBD8B35A30FA73F43@fmsmsx101.amr.corp.intel.com>

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

  reply	other threads:[~2016-09-16 18:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-16 17:04 Lu, Patrick
2016-09-16 18:05 ` Ferruh Yigit [this message]
2016-09-16 18:30   ` Lu, Patrick
2016-09-19 11:38     ` Neil Horman

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=53596706-55c5-f234-f935-2cc3ac9af911@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).