From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVNfi-0001mP-Cm for qemu-devel@nongnu.org; Tue, 10 Mar 2015 13:10:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVNfe-000435-QY for qemu-devel@nongnu.org; Tue, 10 Mar 2015 13:10:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41062) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVNfe-00042M-IP for qemu-devel@nongnu.org; Tue, 10 Mar 2015 13:10:18 -0400 Message-ID: <54FF2574.60604@redhat.com> Date: Tue, 10 Mar 2015 13:10:12 -0400 From: John Snow MIME-Version: 1.0 References: <1425990225-7539-1-git-send-email-stefanha@redhat.com> <1425990225-7539-2-git-send-email-stefanha@redhat.com> In-Reply-To: <1425990225-7539-2-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/2] configure: handle clang -nopie argument warning List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Kevin Wolf , Peter Maydell , Stefan Weil On 03/10/2015 08:23 AM, Stefan Hajnoczi wrote: > gcc 4.9.2 treats -nopie as an error: > > cc: error: unrecognized command line option =E2=80=98-nopie=E2=80=99 > > clang 3.5.0 treats -nopie as a warning: > > clang: warning: argument unused during compilation: '-nopie' > > The causes ./configure to fail with clang: > > ERROR: configure test passed without -Werror but failed with -Werror. > > Make the -nopie test use -Werror so that compile_prog works for both gc= c > and clang. > > Signed-off-by: Stefan Hajnoczi > --- > configure | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/configure b/configure > index 7ba4bcb..4f9f689 100755 > --- a/configure > +++ b/configure > @@ -1589,7 +1589,7 @@ EOF > fi > fi > > - if compile_prog "-fno-pie" "-nopie"; then > + if compile_prog "-Werror -fno-pie" "-nopie"; then > CFLAGS_NOPIE=3D"-fno-pie" > LDFLAGS_NOPIE=3D"-nopie" > fi > Oh, clang doesn't support -nopie but doesn't fail, so we have to force=20 it to in order to get proper configuration. Makes sense. Reviewed-by: John Snow