From: John Spencer Date: Mon, 10 Dec 2012 06:59:44 +0000 (+0100) Subject: fix build error on ARM due to wrong glibc check X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e12cdb1b4055530c61fe99683d256c42e9e62ac8;p=qemu.git fix build error on ARM due to wrong glibc check the test for glibc < 2 "succeeds" wrongly for any non-glibc C library, and breaks the build on musl libc. we must first test if __GLIBC__ is defined at all, before using it unconditionally. Signed-off-by: John Spencer Reviewed-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- diff --git a/user-exec.c b/user-exec.c index 1185cb03c8..5863b9f362 100644 --- a/user-exec.c +++ b/user-exec.c @@ -436,7 +436,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, unsigned long pc; int is_write; -#if (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3)) +#if defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3)) pc = uc->uc_mcontext.gregs[R15]; #else pc = uc->uc_mcontext.arm_pc;