Commit e12cdb1b authored by John Spencer's avatar John Spencer Committed by Stefan Hajnoczi
Browse files

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: default avatarJohn Spencer <maillist-qemu@barfooze.de>
Reviewed-by: default avatarStefan Weil <sw@weilnetz.de>
Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
parent 887eb299
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;