OpenBSD: improve partial support for x86_64 - WIP
This commit is contained in:
parent
cf8d9cf072
commit
4e12c2a6dc
3 changed files with 8 additions and 0 deletions
2
tcc.c
2
tcc.c
|
@ -171,6 +171,8 @@ static const char version[] =
|
||||||
" Darwin"
|
" Darwin"
|
||||||
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
" FreeBSD"
|
" FreeBSD"
|
||||||
|
#elif defined(__OpenBSD__)
|
||||||
|
" OpenBSD"
|
||||||
#else
|
#else
|
||||||
" Linux"
|
" Linux"
|
||||||
#endif
|
#endif
|
||||||
|
|
3
tcc.h
3
tcc.h
|
@ -45,6 +45,9 @@
|
||||||
/* XXX: need to define this to use them in non ISOC99 context */
|
/* XXX: need to define this to use them in non ISOC99 context */
|
||||||
extern float strtof (const char *__nptr, char **__endptr);
|
extern float strtof (const char *__nptr, char **__endptr);
|
||||||
extern long double strtold (const char *__nptr, char **__endptr);
|
extern long double strtold (const char *__nptr, char **__endptr);
|
||||||
|
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
|
||||||
|
extern char **environ;
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
3
tccrun.c
3
tccrun.c
|
@ -648,6 +648,9 @@ static void rt_getcontext(ucontext_t *uc, rt_context *rc)
|
||||||
# elif defined(__NetBSD__)
|
# elif defined(__NetBSD__)
|
||||||
rc->ip = uc->uc_mcontext.__gregs[_REG_RIP];
|
rc->ip = uc->uc_mcontext.__gregs[_REG_RIP];
|
||||||
rc->fp = uc->uc_mcontext.__gregs[_REG_RBP];
|
rc->fp = uc->uc_mcontext.__gregs[_REG_RBP];
|
||||||
|
# elif defined(__OpenBSD__)
|
||||||
|
rc->ip = uc->sc_rip;
|
||||||
|
rc->fp = uc->sc_rbp;
|
||||||
# else
|
# else
|
||||||
rc->ip = uc->uc_mcontext.gregs[REG_RIP];
|
rc->ip = uc->uc_mcontext.gregs[REG_RIP];
|
||||||
rc->fp = uc->uc_mcontext.gregs[REG_RBP];
|
rc->fp = uc->uc_mcontext.gregs[REG_RBP];
|
||||||
|
|
Loading…
Add table
Reference in a new issue