Am 12.10.2011 18:21, schrieb Peter Maydell:
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.mayd...@linaro.org>
Tested-by: Andreas Färber <afaer...@suse.de>
---
Compiling on an Ubuntu Natty ARM host will hit this.
Works on Ubuntu Maverick ARM host as well.
(Anybody think we should clean up our configure tests so we can
enable -Werror and -Wl,--fatal-warnings on all of them?)
In theory that would be nice. I noticed for example that a missing
glib2-devel package is not caught by configure, on openSUSE.
As a start for cleaning up...
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; }
...we could give a good example by adopting regular multi-line Coding
Style, like accept4() and others.
Andreas
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
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746, AG Nürnberg