[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] ninjatool: quote dollars in variables
From: |
Laurent Vivier |
Subject: |
Re: [PATCH] ninjatool: quote dollars in variables |
Date: |
Thu, 27 Aug 2020 09:33:44 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
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