All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Olivier Matz <olivier.matz@6wind.com>
Cc: Robin Jarry <rjarry@redhat.com>,
	dev@dpdk.org, Ferruh Yigit <ferruh.yigit@amd.com>,
	Bruce Richardson <bruce.richardson@intel.com>
Subject: Re: [PATCH v7] usertools: rewrite pmdinfo
Date: Wed, 12 Oct 2022 18:16:52 +0200	[thread overview]
Message-ID: <25917113.6Emhk5qWAg@thomas> (raw)
In-Reply-To: <Y0baaCw7s30cYBL0@platinum>

12/10/2022 17:16, Olivier Matz:
> On Tue, Oct 11, 2022 at 12:44:56AM +0200, Thomas Monjalon wrote:
> As discussed off-list with Robin, it appears that "ldd" is not available
> on buildroot-based images. See:
> http://lists.busybox.net/pipermail/buildroot/2013-July/074927.html
> 
> The link is quite old but it seems it's still true today if we don't
> build the toolchain.
> 
> Robin suggested this patch:
> 
> --- a/usertools/dpdk-pmdinfo.py
> +++ b/usertools/dpdk-pmdinfo.py
> @@ -290,8 +290,10 @@ def get_needed_libs(path: Path) -> Iterator[Path]:
>      """
>      Extract the dynamic library dependencies from an ELF executable.
>      """
> +    env = os.environ.copy()
> +    env["LD_TRACE_LOADED_OBJECTS"] = "1"
>      with subprocess.Popen(
> -        ["ldd", str(path)], stdout=subprocess.PIPE, stderr=subprocess.PIPE
> +        [str(path)], stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env
>      ) as proc:
>          out, err = proc.communicate()
>          if proc.returncode != 0:
> 
> One subtle difference is that the patched version won't work on
> non-executable files, but I don't think it can happen in real-life.
> 
> An alternative for us is to provide a simple "ldd" shell script in our
> buildroot-based images.
> 
> I don't have a strong opinion, I'll tend to say that the patch is a
> better option. Any comment?

What about implementing both?
If ldd is available, use it,
otherwise use LD_TRACE_LOADED_OBJECTS variable.



  reply	other threads:[~2022-10-12 16:17 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-13 10:58 [PATCH] usertools: rewrite pmdinfo Robin Jarry
2022-09-13 11:29 ` Ferruh Yigit
2022-09-13 11:49   ` Robin Jarry
2022-09-13 13:50     ` Ferruh Yigit
2022-09-13 13:59       ` Robin Jarry
2022-09-13 14:17         ` Ferruh Yigit
2022-09-13 14:17 ` Bruce Richardson
2022-09-13 19:42 ` [PATCH v2] " Robin Jarry
2022-09-13 20:54   ` Ferruh Yigit
2022-09-13 21:22     ` Robin Jarry
2022-09-14 11:46       ` Ferruh Yigit
2022-09-15  9:18         ` Robin Jarry
2022-09-20  9:08 ` [PATCH v3] " Robin Jarry
2022-09-20 10:10   ` Ferruh Yigit
2022-09-20 10:12     ` Robin Jarry
2022-09-20 10:42 ` [PATCH v4] " Robin Jarry
2022-09-20 14:08   ` Olivier Matz
2022-09-20 17:48   ` Ferruh Yigit
2022-09-20 17:50     ` Ferruh Yigit
2022-09-21  7:27       ` Thomas Monjalon
2022-09-21  8:02         ` Ferruh Yigit
2022-09-20 19:15     ` Robin Jarry
2022-09-21  7:58       ` Ferruh Yigit
2022-09-21  9:57         ` Ferruh Yigit
2022-09-22 11:58 ` [PATCH v5] " Robin Jarry
2022-09-22 12:03   ` Bruce Richardson
2022-09-22 15:12   ` Ferruh Yigit
2022-09-26 11:55   ` Olivier Matz
2022-09-26 12:52   ` Robin Jarry
2022-09-26 13:44 ` [PATCH v6] " Robin Jarry
2022-09-26 15:17   ` Bruce Richardson
2022-09-28  6:51     ` Robin Jarry
2022-09-28 10:53       ` Bruce Richardson
2022-09-28 11:12         ` Robin Jarry
2022-10-04 19:29 ` [PATCH v7] " Robin Jarry
2022-10-10 22:44   ` Thomas Monjalon
2022-10-12 15:16     ` Olivier Matz
2022-10-12 16:16       ` Thomas Monjalon [this message]
2022-10-12 16:30         ` Robin Jarry
2022-10-12 16:44           ` Thomas Monjalon
2022-10-12 16:48             ` Robin Jarry
2022-10-12 20:40               ` 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=25917113.6Emhk5qWAg@thomas \
    --to=thomas@monjalon.net \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=olivier.matz@6wind.com \
    --cc=rjarry@redhat.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.