From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RE1Ya-0004L9-8u for qemu-devel@nongnu.org; Wed, 12 Oct 2011 12:21:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RE1YZ-0005kC-9t for qemu-devel@nongnu.org; Wed, 12 Oct 2011 12:21:24 -0400 Received: from mnementh.archaic.org.uk ([81.2.115.146]:37900) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RE1YZ-0005iu-3h for qemu-devel@nongnu.org; Wed, 12 Oct 2011 12:21:23 -0400 From: Peter Maydell Date: Wed, 12 Oct 2011 17:21:15 +0100 Message-Id: <1318436475-20691-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH] configure: Detect when glibc implements makecontext() to always fail List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , patches@linaro.org 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 --- 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 -- 1.7.4.1