* [PATCH] Fix objdump output parser in "nsis.py"
@ 2025-04-12 18:08 Arthur Sengileyev
2025-04-12 18:19 ` [PATCH for-10.0] " Stefan Weil
0 siblings, 1 reply; 3+ messages in thread
From: Arthur Sengileyev @ 2025-04-12 18:08 UTC (permalink / raw)
To: qemu-devel, qemu-trivial
Cc: Cleber Rosa, John Snow, Stefan Weil, Arthur Sengileyev
In msys2 distribution objdump from gcc is using single tab character
prefix, but objdump from clang is using 4 white space characters instead.
The script will not identify any dll dependencies for a QEMU build
generated with clang. This in turn will fail the build, because there
will be no files inside dlldir and no setup file will be created.
Instead of checking for whitespace in prefix use lstrip to accommodate
for differences in outputs.
Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
---
scripts/nsis.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/nsis.py b/scripts/nsis.py
index af4e064819..8f469634eb 100644
--- a/scripts/nsis.py
+++ b/scripts/nsis.py
@@ -23,7 +23,7 @@ def find_deps(exe_or_dll, search_path, analyzed_deps):
output = subprocess.check_output(["objdump", "-p", exe_or_dll], text=True)
output = output.split("\n")
for line in output:
- if not line.startswith("\tDLL Name: "):
+ if not line.lstrip().startswith("DLL Name: "):
continue
dep = line.split("DLL Name: ")[1].strip()
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH for-10.0] Fix objdump output parser in "nsis.py"
2025-04-12 18:08 [PATCH] Fix objdump output parser in "nsis.py" Arthur Sengileyev
@ 2025-04-12 18:19 ` Stefan Weil
2025-04-14 14:43 ` Stefan Hajnoczi
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Weil @ 2025-04-12 18:19 UTC (permalink / raw)
To: Arthur Sengileyev, qemu-devel, QEMU Trivial, Stefan Hajnoczi
Cc: Cleber Rosa, John Snow
Am 12.04.25 um 20:08 schrieb Arthur Sengileyev:
> In msys2 distribution objdump from gcc is using single tab character
> prefix, but objdump from clang is using 4 white space characters instead.
> The script will not identify any dll dependencies for a QEMU build
> generated with clang. This in turn will fail the build, because there
> will be no files inside dlldir and no setup file will be created.
> Instead of checking for whitespace in prefix use lstrip to accommodate
> for differences in outputs.
>
> Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
> ---
> scripts/nsis.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/nsis.py b/scripts/nsis.py
> index af4e064819..8f469634eb 100644
> --- a/scripts/nsis.py
> +++ b/scripts/nsis.py
> @@ -23,7 +23,7 @@ def find_deps(exe_or_dll, search_path, analyzed_deps):
> output = subprocess.check_output(["objdump", "-p", exe_or_dll], text=True)
> output = output.split("\n")
> for line in output:
> - if not line.startswith("\tDLL Name: "):
> + if not line.lstrip().startswith("DLL Name: "):
> continue
>
> dep = line.split("DLL Name: ")[1].strip()
Thanks. I use nearly the same code `if not line.strip().startswith("DLL
Name: "):` in my builds for WoA.
@Stefan, can this trivial patch still be applied for 10.0?
I had planned to replace the whole code with objdump by platform
independent Python code, but that's a larger change, and I missed the
deadline.
Reviewed-by: Stefan Weil <sw@weilnetz.de>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH for-10.0] Fix objdump output parser in "nsis.py"
2025-04-12 18:19 ` [PATCH for-10.0] " Stefan Weil
@ 2025-04-14 14:43 ` Stefan Hajnoczi
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2025-04-14 14:43 UTC (permalink / raw)
To: Stefan Weil
Cc: Arthur Sengileyev, qemu-devel, QEMU Trivial, Cleber Rosa,
John Snow
[-- Attachment #1: Type: text/plain, Size: 1831 bytes --]
On Sat, Apr 12, 2025 at 08:19:50PM +0200, Stefan Weil wrote:
> Am 12.04.25 um 20:08 schrieb Arthur Sengileyev:
>
> > In msys2 distribution objdump from gcc is using single tab character
> > prefix, but objdump from clang is using 4 white space characters instead.
> > The script will not identify any dll dependencies for a QEMU build
> > generated with clang. This in turn will fail the build, because there
> > will be no files inside dlldir and no setup file will be created.
> > Instead of checking for whitespace in prefix use lstrip to accommodate
> > for differences in outputs.
> >
> > Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
> > ---
> > scripts/nsis.py | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/scripts/nsis.py b/scripts/nsis.py
> > index af4e064819..8f469634eb 100644
> > --- a/scripts/nsis.py
> > +++ b/scripts/nsis.py
> > @@ -23,7 +23,7 @@ def find_deps(exe_or_dll, search_path, analyzed_deps):
> > output = subprocess.check_output(["objdump", "-p", exe_or_dll], text=True)
> > output = output.split("\n")
> > for line in output:
> > - if not line.startswith("\tDLL Name: "):
> > + if not line.lstrip().startswith("DLL Name: "):
> > continue
> > dep = line.split("DLL Name: ")[1].strip()
>
>
> Thanks. I use nearly the same code `if not line.strip().startswith("DLL
> Name: "):` in my builds for WoA.
>
> @Stefan, can this trivial patch still be applied for 10.0?
Yes, it is included in Michael Tokarev's latest trivial patches pull
request.
> I had planned to replace the whole code with objdump by platform independent
> Python code, but that's a larger change, and I missed the deadline.
>
>
> Reviewed-by: Stefan Weil <sw@weilnetz.de>
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-14 14:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-12 18:08 [PATCH] Fix objdump output parser in "nsis.py" Arthur Sengileyev
2025-04-12 18:19 ` [PATCH for-10.0] " Stefan Weil
2025-04-14 14:43 ` Stefan Hajnoczi
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).