From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEoZU-0004C6-61 for qemu-devel@nongnu.org; Tue, 26 Apr 2011 16:09:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QEoZT-0000ub-1m for qemu-devel@nongnu.org; Tue, 26 Apr 2011 16:09:20 -0400 Received: from mail-vw0-f45.google.com ([209.85.212.45]:40259) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEoZS-0000uR-Ve for qemu-devel@nongnu.org; Tue, 26 Apr 2011 16:09:19 -0400 Received: by vws17 with SMTP id 17so856564vws.4 for ; Tue, 26 Apr 2011 13:09:18 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1303833400-13458-1-git-send-email-peter.maydell@linaro.org> References: <1303833400-13458-1-git-send-email-peter.maydell@linaro.org> From: Blue Swirl Date: Tue, 26 Apr 2011 23:08:58 +0300 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2] configure: Make epoll_create1 test work around SPARC glibc bug List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org, patches@linaro.org Thanks, applied. On Tue, Apr 26, 2011 at 6:56 PM, Peter Maydell w= rote: > Work around a SPARC glibc bug which caused the epoll_create1 configure > test to wrongly claim that the function was present. Some versions of > SPARC glibc provided the function in the library but didn't declare > it in the include file; the result is that gcc warns about an implicit > declaration but a link succeeds. So we reference the function as a > value rather than a function call to induce a compile time error > if the declaration was not present. > > Signed-off-by: Peter Maydell > --- > v1->v2: instead of compiling the test with -Werror, use the approach > suggested by Blue Swirl to force a compile-time failure if the > declaration is missing from the header file. > > =C2=A0configure | =C2=A0 10 +++++++++- > =C2=A01 files changed, 9 insertions(+), 1 deletions(-) > > diff --git a/configure b/configure > index de44bac..2bbbbf5 100755 > --- a/configure > +++ b/configure > @@ -2225,7 +2225,15 @@ cat > $TMPC << EOF > > =C2=A0int main(void) > =C2=A0{ > - =C2=A0 =C2=A0epoll_create1(0); > + =C2=A0 =C2=A0/* Note that we use epoll_create1 as a value, not as > + =C2=A0 =C2=A0 * a function being called. This is necessary so that on > + =C2=A0 =C2=A0 * old SPARC glibc versions where the function was present= in > + =C2=A0 =C2=A0 * the library but not declared in the header file we will > + =C2=A0 =C2=A0 * fail the configure check. (Otherwise we will get a comp= iler > + =C2=A0 =C2=A0 * warning but not an error, and will proceed to fail the > + =C2=A0 =C2=A0 * qemu compile where we compile with -Werror.) > + =C2=A0 =C2=A0 */ > + =C2=A0 =C2=A0epoll_create1; > =C2=A0 =C2=A0 return 0; > =C2=A0} > =C2=A0EOF > -- > 1.7.1 > >