From e12cdb1b4055530c61fe99683d256c42e9e62ac8 Mon Sep 17 00:00:00 2001 From: John Spencer Date: Mon, 10 Dec 2012 07:59:44 +0100 Subject: [PATCH] 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 --- user-exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user-exec.c b/user-exec.c index 1185cb0..5863b9f 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; -- 2.7.4