All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
To: David Marchand <david.marchand@6wind.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH v2] mk: fix objects/library order when linking
Date: Fri, 4 Dec 2015 18:31:14 +0100	[thread overview]
Message-ID: <20151204173114.GH5048@6wind.com> (raw)
In-Reply-To: <1449249063-9792-1-git-send-email-david.marchand@6wind.com>

On Fri, Dec 04, 2015 at 06:11:03PM +0100, David Marchand wrote:
> The initial problem has been seen while building mlx4 pmd as a shared library
> on Ubuntu 14.04 (gcc 4.8.4-2ubuntu1~14.04).
> 
> Resulting .so will lack the DT_NEEDED entry for libibverbs:
> 
> marchand@ubuntu1404:~/dpdk$ ldd ./build/lib/librte_pmd_mlx4.so
> 	linux-vdso.so.1 =>  (0x00007fff87ebb000)
> 	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2ced21a000)
> 	/lib64/ld-linux-x86-64.so.2 (0x00007f2ced821000)
> 
> And trying to load it in testpmd triggers this error:
> 
> [...]
> EAL: librte_pmd_mlx4.so: undefined symbol: ibv_query_port
> [...]
> 
> After some strace, the problem comes from the --as-needed option passed to the
> linker.
> 
> It is safer to specify libraries we depend on after the objects we are linking
> into a shared library, especially when the linker is invoked with options like
> --as-needed.
> 
> Fixes: bef06a8a0655 ("mk: set library dependencies in shared object file")
> 
> Signed-off-by: David Marchand <david.marchand@6wind.com>
> ---
> 
> Changes since v1:
> - added some details in commitlog since Thomas does not like "safer"
>   argument :-)

Obvious issue that did not show up in our tests under Debian.

Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

-- 
Adrien Mazarguil
6WIND

  reply	other threads:[~2015-12-04 17:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-04 14:38 [PATCH] mk: fix objects/library order when linking David Marchand
2015-12-04 17:11 ` [PATCH v2] " David Marchand
2015-12-04 17:31   ` Adrien Mazarguil [this message]
2015-12-04 18:43     ` Thomas Monjalon

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=20151204173114.GH5048@6wind.com \
    --to=adrien.mazarguil@6wind.com \
    --cc=david.marchand@6wind.com \
    --cc=dev@dpdk.org \
    /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.