DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
To: dev@dpdk.org
Cc: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,
	XuemingX Zhang <xuemingx.zhang@intel.com>,
	Neil Horman <nhorman@tuxdriver.com>
Subject: [dpdk-dev] [PATCH] buildtools: fix archive extraction for LLVM 8
Date: Thu, 28 Jan 2021 22:05:15 +0300	[thread overview]
Message-ID: <20210128190515.7786-1-dmitry.kozliuk@gmail.com> (raw)

"llvm-ar xv lib.a" from LLVM 8 doesn't print extracted object file
names. The effect of "v" is not formally specified either.
Use "llvm-ar t" to get archive member names.

Reported-by: XuemingX Zhang <xuemingx.zhang@intel.com>

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
---
 buildtools/gen-pmdinfo-cfile.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/buildtools/gen-pmdinfo-cfile.py b/buildtools/gen-pmdinfo-cfile.py
index a4e080199..58fe3ad15 100644
--- a/buildtools/gen-pmdinfo-cfile.py
+++ b/buildtools/gen-pmdinfo-cfile.py
@@ -9,11 +9,12 @@
 
 _, tmp_root, ar, archive, output, *pmdinfogen = sys.argv
 with tempfile.TemporaryDirectory(dir=tmp_root) as temp:
-    proc = subprocess.run(
-        # Don't use "ar p", because its output is corrupted on Windows.
-        [ar, "xv", os.path.abspath(archive)], stdout=subprocess.PIPE, check=True, cwd=temp
+    run_ar = lambda command: subprocess.run(
+        [ar, command, os.path.abspath(archive)],
+        stdout=subprocess.PIPE, check=True, cwd=temp
     )
-    lines = proc.stdout.decode().splitlines()
-    names = [line[len("x - ") :] for line in lines]
+    # Don't use "ar p", because its output is corrupted on Windows.
+    run_ar("x")
+    names = run_ar("t").stdout.decode().splitlines()
     paths = [os.path.join(temp, name) for name in names]
     subprocess.run(pmdinfogen + paths + [output], check=True)
-- 
2.29.2


             reply	other threads:[~2021-01-28 19:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-28 19:05 Dmitry Kozlyuk [this message]
2021-01-28 22:02 ` 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=20210128190515.7786-1-dmitry.kozliuk@gmail.com \
    --to=dmitry.kozliuk@gmail.com \
    --cc=dev@dpdk.org \
    --cc=nhorman@tuxdriver.com \
    --cc=xuemingx.zhang@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).