From patchwork Tue Apr 26 15:56:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 92935 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1E8971007D5 for ; Wed, 27 Apr 2011 01:57:01 +1000 (EST) Received: from localhost ([::1]:59269 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEkdF-00039y-BY for incoming@patchwork.ozlabs.org; Tue, 26 Apr 2011 11:56:57 -0400 Received: from eggs.gnu.org ([140.186.70.92]:49819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEkd8-00039t-Tp for qemu-devel@nongnu.org; Tue, 26 Apr 2011 11:56:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QEkd8-0003HN-69 for qemu-devel@nongnu.org; Tue, 26 Apr 2011 11:56:50 -0400 Received: from mnementh.archaic.org.uk ([81.2.115.146]:40713) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEkd7-0003HA-NX for qemu-devel@nongnu.org; Tue, 26 Apr 2011 11:56:50 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1QEkcy-0003VV-DE; Tue, 26 Apr 2011 16:56:40 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Tue, 26 Apr 2011 16:56:40 +0100 Message-Id: <1303833400-13458-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Cc: Blue Swirl , patches@linaro.org Subject: [Qemu-devel] [PATCH v2] configure: Make epoll_create1 test work around SPARC glibc bug X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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. configure | 10 +++++++++- 1 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 int main(void) { - epoll_create1(0); + /* Note that we use epoll_create1 as a value, not as + * a function being called. This is necessary so that on + * old SPARC glibc versions where the function was present in + * the library but not declared in the header file we will + * fail the configure check. (Otherwise we will get a compiler + * warning but not an error, and will proceed to fail the + * qemu compile where we compile with -Werror.) + */ + epoll_create1; return 0; } EOF