diff --git a/makefile b/makefile index 7a6800760e..7e1ed6de37 100755 --- a/makefile +++ b/makefile @@ -318,7 +318,11 @@ ifeq ($(platform),qnx) build-cflags = $(common-cflags) -fPIC -fvisibility=hidden -I$(src) build-lflags = $(common-lflags) else - prefix = i486-pc-nto-qnx6.5.0- + ifeq ($(arch),i386) + prefix = i486-pc-nto-qnx6.5.0- + else + prefix = arm-unknown-nto-qnx6.5.0- + endif endif cxx = $(prefix)g++ cc = $(prefix)gcc diff --git a/src/arm.h b/src/arm.h index 42fc44e8bf..9008ac489e 100644 --- a/src/arm.h +++ b/src/arm.h @@ -44,7 +44,12 @@ THREAD_STATE_THREAD(context->uc_mcontext->FIELD(ss)) # define LINK_REGISTER(context) \ THREAD_STATE_LINK(context->uc_mcontext->FIELD(ss)) -#else // not __APPLE__ +#elif (defined __QNX__) +# define IP_REGISTER(context) (context->uc_mcontext.cpu.gpr[ARM_REG_PC]) +# define STACK_REGISTER(context) (context->uc_mcontext.cpu.gpr[ARM_REG_SP]) +# define THREAD_REGISTER(context) (context->uc_mcontext.cpu.gpr[ARM_REG_IP]) +# define LINK_REGISTER(context) (context->uc_mcontext.cpu.gpr[ARM_REG_LR]) +#else # define IP_REGISTER(context) (context->uc_mcontext.arm_pc) # define STACK_REGISTER(context) (context->uc_mcontext.arm_sp) # define THREAD_REGISTER(context) (context->uc_mcontext.arm_ip)