qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] configure: Check whether makecontext() is a glibc stub function
@ 2012-02-23 16:20 Peter Maydell
  2012-02-24 19:47 ` Anthony Liguori
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Maydell @ 2012-02-23 16:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

On some systems (notably ARM Linux) glibc provides implementations
of makecontext(), getcontext() and friends which are stubs which
always return failure. Make the configure test for makecontext()
also check for the presence of the __stub_makecontext macro which
indicates the presence of these stubs, so we can avoid trying to use
them and fall back to a different coroutine implementation instead.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
I think this fixes the last of the bugs which meant we had to declare
ARM hosts as officially unsupported in QEMU 1.0...

 configure |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 037f7f7..9fbf88a 100755
--- a/configure
+++ b/configure
@@ -2712,11 +2712,15 @@ fi
 
 ##########################################
 # check if we have makecontext
+# (and that it's not a glibc stub which always returns -1)
 
 ucontext_coroutine=no
 if test "$darwin" != "yes"; then
   cat > $TMPC << EOF
 #include <ucontext.h>
+#ifdef __stub_makecontext
+#error Ignoring glibc stub makecontext which will always fail
+#endif
 int main(void) { makecontext(0, 0, 0); return 0; }
 EOF
   if compile_prog "" "" ; then
-- 
1.7.1

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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-23 16:20 [Qemu-devel] [PATCH] configure: Check whether makecontext() is a glibc stub function Peter Maydell
2012-02-24 19:47 ` Anthony Liguori

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).