From patchwork Mon Dec 10 06:59:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2/4] fix build error on ARM due to wrong glibc check Date: Sun, 09 Dec 2012 20:59:44 -0000 From: John Spencer X-Patchwork-Id: 204824 Message-Id: <1355122786-29243-2-git-send-email-maillist-qemu@barfooze.de> To: qemu-trivial@nongnu.org Cc: qemu-devel@nongnu.org, John Spencer 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 --- user-exec.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/user-exec.c b/user-exec.c index ef9b172..cccc145 100644 --- a/user-exec.c +++ b/user-exec.c @@ -442,7 +442,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;