]> git.proxmox.com Git - qemu.git/commitdiff
fix build error on ARM due to wrong glibc check
authorJohn Spencer <maillist-qemu@barfooze.de>
Mon, 10 Dec 2012 06:59:44 +0000 (07:59 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 18 Dec 2012 16:21:13 +0000 (17:21 +0100)
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 <maillist-qemu@barfooze.de>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
user-exec.c

index 1185cb03c8c449bb5be6e3ed2b61c54aa5b363ec..5863b9f36243beb34243cc8fdf9d731389427633 100644 (file)
@@ -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;