From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49937) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RV9on-0002aM-Hv for qemu-devel@nongnu.org; Mon, 28 Nov 2011 17:36:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RV9oe-0004cZ-76 for qemu-devel@nongnu.org; Mon, 28 Nov 2011 17:36:57 -0500 Received: from mail-iy0-f173.google.com ([209.85.210.173]:64822) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RV9oe-0004Y7-3t for qemu-devel@nongnu.org; Mon, 28 Nov 2011 17:36:48 -0500 Received: by mail-iy0-f173.google.com with SMTP id k32so10875872iak.4 for ; Mon, 28 Nov 2011 14:36:42 -0800 (PST) Message-ID: <4ED40CF7.8050606@codemonkey.ws> Date: Mon, 28 Nov 2011 16:36:39 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1322040265-14530-1-git-send-email-avi@redhat.com> In-Reply-To: <1322040265-14530-1-git-send-email-avi@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 1.0] configure: tighten pie toolchain support test for tls variables List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Paolo Bonzini , Brad , qemu-devel@nongnu.org, Gerd Hoffmann On 11/23/2011 03:24 AM, Avi Kivity wrote: > Some toolchains don't support pie properly when tls variables are > in use. Disallow pie when such toolchains are detected. > > Signed-off-by: Avi Kivity Applied. Thanks. Regards, Anthony Liguori > --- > > v3: only check __thread on Linux, where we require it, and where the > toolchain fails > > v2: give tls_var a type; avoids invisible warning > > configure | 12 +++++++++++- > 1 files changed, 11 insertions(+), 1 deletions(-) > > diff --git a/configure b/configure > index 75e1f10..1a2c55f 100755 > --- a/configure > +++ b/configure > @@ -1120,7 +1120,17 @@ fi > > if test "$pie" != "no" ; then > cat> $TMPC<< EOF > -int main(void) { return 0; } > + > +#ifdef __linux__ > +# define THREAD __thread > +#else > +# define THREAD > +#endif > + > +static THREAD int tls_var; > + > +int main(void) { return tls_var; } > + > EOF > if compile_prog "-fPIE -DPIE" "-pie"; then > QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS"