qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] configure: Detect when glibc implements makecontext() to always fail
@ 2012-02-23 16:16 Peter Maydell
  2012-02-23 16:19 ` Peter Maydell
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Maydell @ 2012-02-23 16:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

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 <peter.maydell@linaro.org>
---
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 <ucontext.h>
-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

^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [Qemu-devel] [PATCH] configure: Detect when glibc implements makecontext() to always fail
@ 2011-10-12 16:21 Peter Maydell
  2011-10-13 14:26 ` Andreas Färber
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Maydell @ 2011-10-12 16:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Andreas Färber, patches

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 <peter.maydell@linaro.org>
---
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 <ucontext.h>
-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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-02-23 16:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-23 16:16 [Qemu-devel] [PATCH] configure: Detect when glibc implements makecontext() to always fail Peter Maydell
2012-02-23 16:19 ` Peter Maydell
  -- strict thread matches above, loose matches on Subject: below --
2011-10-12 16:21 Peter Maydell
2011-10-13 14:26 ` Andreas Färber
2011-10-13 22:23   ` Andreas Färber
2011-10-14 12:30     ` Peter Maydell
2011-10-14 12:47       ` Paolo Bonzini
2011-10-14 12:55         ` Paolo Bonzini
2011-10-14 13:01           ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).