qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ninjatool: quote dollars in variables
@ 2020-08-26 19:01 Paolo Bonzini
  2020-08-26 19:34 ` Peter Maydell
  2020-08-27  7:33 ` Laurent Vivier
  0 siblings, 2 replies; 11+ messages in thread
From: Paolo Bonzini @ 2020-08-26 19:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier

Otherwise, dollars (such as in the special $ORIGIN rpath) are
eaten by Make.

Reported-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 scripts/ninjatool.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/ninjatool.py b/scripts/ninjatool.py
index cc77d51aa8..c33eafb5a0 100755
--- a/scripts/ninjatool.py
+++ b/scripts/ninjatool.py
@@ -834,7 +834,8 @@ class Ninja2Make(NinjaParserEventsWithVars):
         self.print()
         for targets in self.build_vars:
             for name, value in self.build_vars[targets].items():
-                self.print('%s: private .var.%s := %s' % (targets, name, value))
+                self.print('%s: private .var.%s := %s' %
+                           (targets, name, value.replace('$', '$$')))
             self.print()
         if not self.seen_default:
             default_targets = sorted(self.all_outs - self.all_ins, key=natural_sort_key)
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] ninjatool: quote dollars in variables
  2020-08-26 19:01 [PATCH] ninjatool: quote dollars in variables Paolo Bonzini
@ 2020-08-26 19:34 ` Peter Maydell
  2020-08-27  4:13   ` Paolo Bonzini
  2020-08-27  7:33 ` Laurent Vivier
  1 sibling, 1 reply; 11+ messages in thread
From: Peter Maydell @ 2020-08-26 19:34 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Laurent Vivier, QEMU Developers

On Wed, 26 Aug 2020 at 20:03, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> Otherwise, dollars (such as in the special $ORIGIN rpath) are
> eaten by Make.

Incidentally, why are we using rpath anyway? I'm pretty
sure the old build system didn't need it, and it's one of
those features I have mentally filed away under "liable
to confusing and non-portable weirdness"...

thanks
-- PMM


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] ninjatool: quote dollars in variables
  2020-08-26 19:34 ` Peter Maydell
@ 2020-08-27  4:13   ` Paolo Bonzini
  2020-08-27  5:29     ` Alexander Bulekov
  0 siblings, 1 reply; 11+ messages in thread
From: Paolo Bonzini @ 2020-08-27  4:13 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Laurent Vivier, QEMU Developers

[-- Attachment #1: Type: text/plain, Size: 690 bytes --]

Il mer 26 ago 2020, 21:34 Peter Maydell <peter.maydell@linaro.org> ha
scritto:

> On Wed, 26 Aug 2020 at 20:03, Paolo Bonzini <pbonzini@redhat.com> wrote:
> >
> > Otherwise, dollars (such as in the special $ORIGIN rpath) are
> > eaten by Make.
>
> Incidentally, why are we using rpath anyway? I'm pretty
> sure the old build system didn't need it, and it's one of
> those features I have mentally filed away under "liable
> to confusing and non-portable weirdness"...
>

It's only done in the build tree, to allow running against uninstalled
shared_library. Installed binaries have no rpath (distros don't want it
anyway). QEMU doesn't need it since it has no shared library yet.

Paolo

>

[-- Attachment #2: Type: text/html, Size: 1379 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] ninjatool: quote dollars in variables
  2020-08-27  4:13   ` Paolo Bonzini
@ 2020-08-27  5:29     ` Alexander Bulekov
  0 siblings, 0 replies; 11+ messages in thread
From: Alexander Bulekov @ 2020-08-27  5:29 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Laurent Vivier, Peter Maydell, QEMU Developers

On 200827 0613, Paolo Bonzini wrote:
> Il mer 26 ago 2020, 21:34 Peter Maydell <peter.maydell@linaro.org> ha
> scritto:
> 
> > On Wed, 26 Aug 2020 at 20:03, Paolo Bonzini <pbonzini@redhat.com> wrote:
> > >
> > > Otherwise, dollars (such as in the special $ORIGIN rpath) are
> > > eaten by Make.
> >
> > Incidentally, why are we using rpath anyway? I'm pretty
> > sure the old build system didn't need it, and it's one of
> > those features I have mentally filed away under "liable
> > to confusing and non-portable weirdness"...
> >
> 
> It's only done in the build tree, to allow running against uninstalled
> shared_library. Installed binaries have no rpath (distros don't want it
> anyway). QEMU doesn't need it since it has no shared library yet.
> 

Its an obscure example, but we use it in scripts/oss-fuzz/build.sh to
build a qemu-fuzz binary(qemu-system with some bells and whistles) that
is portable between containers and can be deployed on oss-fuzz. The
other option is to build a static binary, which AFAIK is not supported
for softmmu builds.

I guess this is a prime example of "confusing and non-portable
weirdness".
In defense, it wasn't our idea. The oss-fuzz documentation suggests it:
https://google.github.io/oss-fuzz/further-reading/fuzzer-environment/#runtime-dependencies

> Paolo
> 
> >


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] ninjatool: quote dollars in variables
  2020-08-26 19:01 [PATCH] ninjatool: quote dollars in variables Paolo Bonzini
  2020-08-26 19:34 ` Peter Maydell
@ 2020-08-27  7:33 ` Laurent Vivier
  2020-08-27  8:22   ` Paolo Bonzini
  1 sibling, 1 reply; 11+ messages in thread
From: Laurent Vivier @ 2020-08-27  7:33 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel; +Cc: Laurent Vivier

Le 26/08/2020 à 21:01, Paolo Bonzini a écrit :
> Otherwise, dollars (such as in the special $ORIGIN rpath) are
> eaten by Make.
> 
> Reported-by: Laurent Vivier <lvivier@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  scripts/ninjatool.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/ninjatool.py b/scripts/ninjatool.py
> index cc77d51aa8..c33eafb5a0 100755
> --- a/scripts/ninjatool.py
> +++ b/scripts/ninjatool.py
> @@ -834,7 +834,8 @@ class Ninja2Make(NinjaParserEventsWithVars):
>          self.print()
>          for targets in self.build_vars:
>              for name, value in self.build_vars[targets].items():
> -                self.print('%s: private .var.%s := %s' % (targets, name, value))
> +                self.print('%s: private .var.%s := %s' %
> +                           (targets, name, value.replace('$', '$$')))
>              self.print()
>          if not self.seen_default:
>              default_targets = sorted(self.all_outs - self.all_ins, key=natural_sort_key)
> 

This actually fixes the '-Wl,-rpath,$ORIGIN/', but doesn't fix the crash
with statically linked binaries.

Could we simply remove the the '-Wl,-rpath,$ORIGIN/' in the case of
"-static" build?

Thanks,
Laurent


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] ninjatool: quote dollars in variables
  2020-08-27  7:33 ` Laurent Vivier
@ 2020-08-27  8:22   ` Paolo Bonzini
  2020-08-27  9:10     ` Paolo Bonzini
  0 siblings, 1 reply; 11+ messages in thread
From: Paolo Bonzini @ 2020-08-27  8:22 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: Laurent Vivier, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 528 bytes --]

Il gio 27 ago 2020, 09:33 Laurent Vivier <laurent@vivier.eu> ha scritto:

> This actually fixes the '-Wl,-rpath,$ORIGIN/', but doesn't fix the crash
> with statically linked binaries.
>

I will try to reproduce when I am back; it works for Peter so there must be
something different in the setup.

In any case, if needed we can both momentarily hack around it in Makefiles,
and fix it for good in Meson.

Paolo


> Could we simply remove the the '-Wl,-rpath,$ORIGIN/' in the case of
> "-static" build?
>
> Thanks,
> Laurent
>
>

[-- Attachment #2: Type: text/html, Size: 1192 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] ninjatool: quote dollars in variables
  2020-08-27  8:22   ` Paolo Bonzini
@ 2020-08-27  9:10     ` Paolo Bonzini
  2020-08-27  9:14       ` Paolo Bonzini
  0 siblings, 1 reply; 11+ messages in thread
From: Paolo Bonzini @ 2020-08-27  9:10 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: Laurent Vivier, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 803 bytes --]

Found; https://github.com/mesonbuild/Meson/issues/5191.

(With the fix there's no rpath at all in the QEMU build process).

Let's ask for a backport to 0.55.2.

Paolo

Il gio 27 ago 2020, 10:22 Paolo Bonzini <pbonzini@redhat.com> ha scritto:

>
>
> Il gio 27 ago 2020, 09:33 Laurent Vivier <laurent@vivier.eu> ha scritto:
>
>> This actually fixes the '-Wl,-rpath,$ORIGIN/', but doesn't fix the crash
>> with statically linked binaries.
>>
>
> I will try to reproduce when I am back; it works for Peter so there must
> be something different in the setup.
>
> In any case, if needed we can both momentarily hack around it in
> Makefiles, and fix it for good in Meson.
>
> Paolo
>
>
>> Could we simply remove the the '-Wl,-rpath,$ORIGIN/' in the case of
>> "-static" build?
>>
>> Thanks,
>> Laurent
>>
>>

[-- Attachment #2: Type: text/html, Size: 1937 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] ninjatool: quote dollars in variables
  2020-08-27  9:10     ` Paolo Bonzini
@ 2020-08-27  9:14       ` Paolo Bonzini
  2020-08-27 10:07         ` Peter Maydell
  2020-08-28 18:57         ` Laurent Vivier
  0 siblings, 2 replies; 11+ messages in thread
From: Paolo Bonzini @ 2020-08-27  9:14 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: Laurent Vivier, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1065 bytes --]

... and actually it's fixed in 0.55.1. We can therefore just update the
submodule and declare 0.55.1 the minimum required version for QEMU.

Paolo

Il gio 27 ago 2020, 11:10 Paolo Bonzini <pbonzini@redhat.com> ha scritto:

> Found; https://github.com/mesonbuild/Meson/issues/5191.
>
> (With the fix there's no rpath at all in the QEMU build process).
>
> Let's ask for a backport to 0.55.2.
>
> Paolo
>
> Il gio 27 ago 2020, 10:22 Paolo Bonzini <pbonzini@redhat.com> ha scritto:
>
>>
>>
>> Il gio 27 ago 2020, 09:33 Laurent Vivier <laurent@vivier.eu> ha scritto:
>>
>>> This actually fixes the '-Wl,-rpath,$ORIGIN/', but doesn't fix the crash
>>> with statically linked binaries.
>>>
>>
>> I will try to reproduce when I am back; it works for Peter so there must
>> be something different in the setup.
>>
>> In any case, if needed we can both momentarily hack around it in
>> Makefiles, and fix it for good in Meson.
>>
>> Paolo
>>
>>
>>> Could we simply remove the the '-Wl,-rpath,$ORIGIN/' in the case of
>>> "-static" build?
>>>
>>> Thanks,
>>> Laurent
>>>
>>>

[-- Attachment #2: Type: text/html, Size: 2548 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] ninjatool: quote dollars in variables
  2020-08-27  9:14       ` Paolo Bonzini
@ 2020-08-27 10:07         ` Peter Maydell
  2020-08-27 12:02           ` Paolo Bonzini
  2020-08-28 18:57         ` Laurent Vivier
  1 sibling, 1 reply; 11+ messages in thread
From: Peter Maydell @ 2020-08-27 10:07 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Laurent Vivier, Laurent Vivier, qemu-devel

On Thu, 27 Aug 2020 at 10:20, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> ... and actually it's fixed in 0.55.1. We can therefore just update the submodule and declare 0.55.1 the minimum required version for QEMU.

Oh, I meant to ask -- if 0.56 is the one that gets rid of the
warnings about unstable-keyval backwards compatibility issues,
is there a reason our submodule version is 0.55 rather than 0.56 ?

thanks
-- PMM


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] ninjatool: quote dollars in variables
  2020-08-27 10:07         ` Peter Maydell
@ 2020-08-27 12:02           ` Paolo Bonzini
  0 siblings, 0 replies; 11+ messages in thread
From: Paolo Bonzini @ 2020-08-27 12:02 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Laurent Vivier, Laurent Vivier, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 616 bytes --]

Il gio 27 ago 2020, 12:08 Peter Maydell <peter.maydell@linaro.org> ha
scritto:

> On Thu, 27 Aug 2020 at 10:20, Paolo Bonzini <pbonzini@redhat.com> wrote:
> >
> > ... and actually it's fixed in 0.55.1. We can therefore just update the
> submodule and declare 0.55.1 the minimum required version for QEMU.
>
> Oh, I meant to ask -- if 0.56 is the one that gets rid of the
> warnings about unstable-keyval backwards compatibility issues,
> is there a reason our submodule version is 0.55 rather than 0.56 ?
>

Because 0.56 has not been released yet, it's what the master branch will be.

Paolo


> thanks
> -- PMM
>
>

[-- Attachment #2: Type: text/html, Size: 1309 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] ninjatool: quote dollars in variables
  2020-08-27  9:14       ` Paolo Bonzini
  2020-08-27 10:07         ` Peter Maydell
@ 2020-08-28 18:57         ` Laurent Vivier
  1 sibling, 0 replies; 11+ messages in thread
From: Laurent Vivier @ 2020-08-28 18:57 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Laurent Vivier, qemu-devel

Le 27/08/2020 à 11:14, Paolo Bonzini a écrit :
> ... and actually it's fixed in 0.55.1. We can therefore just update the
> submodule and declare 0.55.1 the minimum required version for QEMU.
> 

Updating the meson submodule to 0.55.1 has fixed the problem for me.

Thanks,
Laurent



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-08-28 19:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-26 19:01 [PATCH] ninjatool: quote dollars in variables Paolo Bonzini
2020-08-26 19:34 ` Peter Maydell
2020-08-27  4:13   ` Paolo Bonzini
2020-08-27  5:29     ` Alexander Bulekov
2020-08-27  7:33 ` Laurent Vivier
2020-08-27  8:22   ` Paolo Bonzini
2020-08-27  9:10     ` Paolo Bonzini
2020-08-27  9:14       ` Paolo Bonzini
2020-08-27 10:07         ` Peter Maydell
2020-08-27 12:02           ` Paolo Bonzini
2020-08-28 18:57         ` Laurent Vivier

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).