From patchwork Wed Oct 12 16:21:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 4648 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 7FECD23E0C for ; Wed, 12 Oct 2011 16:21:18 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id 718FDA18507 for ; Wed, 12 Oct 2011 16:21:18 +0000 (UTC) Received: by eyg5 with SMTP id 5so1213031eyg.11 for ; Wed, 12 Oct 2011 09:21:18 -0700 (PDT) Received: by 10.223.77.71 with SMTP id f7mr25839222fak.33.1318436478133; Wed, 12 Oct 2011 09:21:18 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.24.41 with SMTP id r9cs222143laf; Wed, 12 Oct 2011 09:21:17 -0700 (PDT) Received: by 10.216.193.212 with SMTP id k62mr2577822wen.113.1318436477384; Wed, 12 Oct 2011 09:21:17 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id fu18si480445wbb.83.2011.10.12.09.21.16 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Oct 2011 09:21:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1RE1YR-0005OA-1B; Wed, 12 Oct 2011 17:21:15 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [PATCH] configure: Detect when glibc implements makecontext() to always fail Date: Wed, 12 Oct 2011 17:21:15 +0100 Message-Id: <1318436475-20691-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 Improve the configure test for presence of ucontext functions by making linker warnings fatal; this allows us to detect when we are linked with a glibc which implements makecontext() to always return ENOSYS. Signed-off-by: Peter Maydell Tested-by: Andreas Färber --- Compiling on an Ubuntu Natty ARM host will hit this. (Anybody think we should clean up our configure tests so we can enable -Werror and -Wl,--fatal-warnings on all of them?) configure | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 9b4fe34..4d9d9e0 100755 --- a/configure +++ b/configure @@ -2549,9 +2549,12 @@ ucontext_coroutine=no if test "$darwin" != "yes"; then cat > $TMPC << EOF #include -int main(void) { makecontext(0, 0, 0); } +int main(void) { makecontext(0, 0, 0); return 0; } EOF - if compile_prog "" "" ; then + # Note that we enable fatal linker warnings to catch the + # glibc "makecontext is not implemented and will always fail" + # linker warning. + if compile_prog "-Wl,--fatal-warnings" "" ; then ucontext_coroutine=yes fi fi