Re: [Qemu-devel] [PATCH] Quote extra_cflags in config-host.mak

2013-09-11 Thread Eric Blake
On 09/11/2013 08:53 AM, Paolo Bonzini wrote: > > printf "# Configured with:" >> $config_host_mak > printf " '%s'" "$0" "$@" >> $config_host_mak > > Something like > > for arg in "$0" "$@"; do >quoted_arg=$(echo "$i" | sed 's/[$\\"]/\\&/g') Won't work as written: mismatch between $arg vs. $i

Re: [Qemu-devel] [PATCH] Quote extra_cflags in config-host.mak

2013-09-11 Thread Gabriel Kerneis
On Wed, Sep 11, 2013 at 04:01:37PM +0100, Gabriel Kerneis wrote: > On Wed, Sep 11, 2013 at 04:53:35PM +0200, Paolo Bonzini wrote: > > Oh, then it's this line in configure that has to be changed to do proper > > quoting. > > > > printf "# Configured with:" >> $config_host_mak > > printf " '%s'" "$0

Re: [Qemu-devel] [PATCH] Quote extra_cflags in config-host.mak

2013-09-11 Thread Gabriel Kerneis
On Wed, Sep 11, 2013 at 04:16:28PM +0100, Gabriel Kerneis wrote: > > Yeah, what I'm missing now is why your patch works. > > That is indeed very mysterious :-) Okay, the answer is simple enough: it doesn't fix the issue at all. Long story short, I had a sed script to rewrite the faulty extra_cfla

Re: [Qemu-devel] [PATCH] Quote extra_cflags in config-host.mak

2013-09-11 Thread Paolo Bonzini
Il 11/09/2013 16:42, Gabriel Kerneis ha scritto: > On Wed, Sep 11, 2013 at 04:01:50PM +0200, Paolo Bonzini wrote: >>> ./configure --extra-cflags="-Dcoroutine_fn='__attribute__((coroutine_fn))'" >> >> Where does the shell read config-host.mak? Make does not need the quotes. > > I might have been c

Re: [Qemu-devel] [PATCH] Quote extra_cflags in config-host.mak

2013-09-11 Thread Gabriel Kerneis
On Wed, Sep 11, 2013 at 04:53:35PM +0200, Paolo Bonzini wrote: > Oh, then it's this line in configure that has to be changed to do proper > quoting. > > printf "# Configured with:" >> $config_host_mak > printf " '%s'" "$0" "$@" >> $config_host_mak No, this line has absolutely nothing to do with i

Re: [Qemu-devel] [PATCH] Quote extra_cflags in config-host.mak

2013-09-11 Thread Paolo Bonzini
Il 11/09/2013 17:23, Gabriel Kerneis ha scritto: > On Wed, Sep 11, 2013 at 04:16:28PM +0100, Gabriel Kerneis wrote: >>> > > Yeah, what I'm missing now is why your patch works. >> > >> > That is indeed very mysterious :-) > Okay, the answer is simple enough: it doesn't fix the issue at all. > Long

Re: [Qemu-devel] [PATCH] Quote extra_cflags in config-host.mak

2013-09-11 Thread Paolo Bonzini
Il 11/09/2013 17:01, Gabriel Kerneis ha scritto: > On Wed, Sep 11, 2013 at 04:53:35PM +0200, Paolo Bonzini wrote: >> Oh, then it's this line in configure that has to be changed to do proper >> quoting. >> >> printf "# Configured with:" >> $config_host_mak >> printf " '%s'" "$0" "$@" >> $config_host

Re: [Qemu-devel] [PATCH] Quote extra_cflags in config-host.mak

2013-09-11 Thread Gabriel Kerneis
On Wed, Sep 11, 2013 at 05:06:41PM +0200, Paolo Bonzini wrote: > > The line that has to be fixed is > > really the line starting with "extra_cflags=" in config-host.mak (well, > > at least in my experience - my patch does not touch the first line, at > > it still solves the issue). > > Yeah, what

Re: [Qemu-devel] [PATCH] Quote extra_cflags in config-host.mak

2013-09-11 Thread Gabriel Kerneis
On Wed, Sep 11, 2013 at 04:01:50PM +0200, Paolo Bonzini wrote: > > ./configure --extra-cflags="-Dcoroutine_fn='__attribute__((coroutine_fn))'" > > Where does the shell read config-host.mak? Make does not need the quotes. I might have been confused about the shell vs. make interpreting the string

Re: [Qemu-devel] [PATCH] Quote extra_cflags in config-host.mak

2013-09-11 Thread Paolo Bonzini
Il 11/09/2013 15:41, Gabriel Kerneis ha scritto: > The variable extra_cflags needs to be quoted in config-host.mak, > in particular because it might contain parentheses that would > otherwise be interpreted by the shell when reloading the file. > > For instance, if one wants to define some attribu

[Qemu-devel] [PATCH] Quote extra_cflags in config-host.mak

2013-09-11 Thread Gabriel Kerneis
The variable extra_cflags needs to be quoted in config-host.mak, in particular because it might contain parentheses that would otherwise be interpreted by the shell when reloading the file. For instance, if one wants to define some attribute with configure: ./configure --extra-cflags="-Dcoroutine