Start support of OpenBSD, tcc compiler can be produced from source tree
This commit is contained in:
parent
18a5d8188a
commit
36759ddacf
2 changed files with 7 additions and 1 deletions
4
tcc.h
4
tcc.h
|
@ -39,7 +39,9 @@
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
# include <sys/time.h>
|
# include <sys/time.h>
|
||||||
# include <sys/ucontext.h>
|
# ifndef __OpenBSD__
|
||||||
|
# include <sys/ucontext.h>
|
||||||
|
# endif
|
||||||
# include <sys/mman.h>
|
# include <sys/mman.h>
|
||||||
# ifndef CONFIG_TCC_STATIC
|
# ifndef CONFIG_TCC_STATIC
|
||||||
# include <dlfcn.h>
|
# include <dlfcn.h>
|
||||||
|
|
4
tccrun.c
4
tccrun.c
|
@ -496,6 +496,8 @@ static int rt_get_caller_pc(addr_t *paddr, ucontext_t *uc, int level)
|
||||||
*paddr = uc->uc_mcontext.eip;
|
*paddr = uc->uc_mcontext.eip;
|
||||||
#elif defined(__NetBSD__)
|
#elif defined(__NetBSD__)
|
||||||
*paddr = uc->uc_mcontext.__gregs[_REG_EIP];
|
*paddr = uc->uc_mcontext.__gregs[_REG_EIP];
|
||||||
|
#elif defined(__OpenBSD__)
|
||||||
|
*paddr = uc->sc_eip;
|
||||||
#else
|
#else
|
||||||
*paddr = uc->uc_mcontext.gregs[REG_EIP];
|
*paddr = uc->uc_mcontext.gregs[REG_EIP];
|
||||||
#endif
|
#endif
|
||||||
|
@ -509,6 +511,8 @@ static int rt_get_caller_pc(addr_t *paddr, ucontext_t *uc, int level)
|
||||||
fp = uc->uc_mcontext.ebp;
|
fp = uc->uc_mcontext.ebp;
|
||||||
#elif defined(__NetBSD__)
|
#elif defined(__NetBSD__)
|
||||||
fp = uc->uc_mcontext.__gregs[_REG_EBP];
|
fp = uc->uc_mcontext.__gregs[_REG_EBP];
|
||||||
|
#elif defined(__OpenBSD__)
|
||||||
|
*paddr = uc->sc_ebp;
|
||||||
#else
|
#else
|
||||||
fp = uc->uc_mcontext.gregs[REG_EBP];
|
fp = uc->uc_mcontext.gregs[REG_EBP];
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue