Disable warning softfloat. OpenBSD works fine. save/restore s0-s15 during memcpy call for structs update configure script. Works now on raspberry pi/All BSD Add eabi_mem.. functions in armeabi.c for OpenBSD Fix fp register in tccrun.c for OpenBSD
Unified · Split
| @@ -198,7 +198,8 @@ ST_FUNC void arm_init(struct TCCState *s) · 197 unmodified lines | |||
| 198 | 198 | ||
| 199 | float_abi = s->float_abi; | 199 | float_abi = s->float_abi; |
| 200 | #ifndef TCC_ARM_HARDFLOAT | 200 | #ifndef TCC_ARM_HARDFLOAT |
| 201 | # warning "soft float ABI currently not supported: default to softfp" | 201 | // XXX: Works on OpenBSD |
| 202 | // # warning "soft float ABI currently not supported: default to softfp" | ||
| 202 | #endif | 203 | #endif |
| 203 | } | 204 | } |
| 204 | #else | 205 | #else |
| @@ -1203,7 +1204,10 @@ again: · 998 unmodified lines | |||
| 1203 | o(0xE28D0000|(intr(r)<<12)|padding); /* add r, sp, padding */ | 1204 | o(0xE28D0000|(intr(r)<<12)|padding); /* add r, sp, padding */ |
| 1204 | vset(&vtop->type, r | VT_LVAL, 0); | 1205 | vset(&vtop->type, r | VT_LVAL, 0); |
| 1205 | vswap(); | 1206 | vswap(); |
| 1207 | /* XXX: optimize. Save all register because memcpy can use them */ | ||
| 1208 | o(0xED2D0A00|(0&1)<<22|(0>>1)<<12|16); /* vpush {s0-s15} */ | ||
| 1206 | vstore(); /* memcpy to current sp + potential padding */ | 1209 | vstore(); /* memcpy to current sp + potential padding */ |
| 1210 | o(0xECBD0A00|(0&1)<<22|(0>>1)<<12|16); /* vpop {s0-s15} */ | ||
| 1207 | 1211 | ||
| 1208 | /* Homogeneous float aggregate are loaded to VFP registers | 1212 | /* Homogeneous float aggregate are loaded to VFP registers |
| 1209 | immediately since there is no way of loading data in multiple | 1213 | immediately since there is no way of loading data in multiple |
| @@ -360,9 +360,11 @@ if test -z "$cross_prefix" ; then · 359 unmodified lines | |||
| 360 | if test "${triplet%eabihf}" != "$triplet" ; then | 360 | if test "${triplet%eabihf}" != "$triplet" ; then |
| 361 | confvars="$confvars arm_eabihf arm_vfp" | 361 | confvars="$confvars arm_eabihf arm_vfp" |
| 362 | elif test "${triplet%eabi}" != "$triplet" ; then | 362 | elif test "${triplet%eabi}" != "$triplet" ; then |
| 363 | confvars="$confvars arm_eabi" | 363 | confvars="$confvars arm_eabi arm_vfp" |
| 364 | elif test "$targetos" = "NetBSD"; then | 364 | elif test "${_triplet%eabihf}" != "$_triplet" ; then |
| 365 | confvars="$confvars arm_eabihf arm_vfp" | 365 | confvars="$confvars arm_eabihf arm_vfp" |
| 366 | elif test "${_triplet%eabi}" != "$_triplet" ; then | ||
| 367 | confvars="$confvars arm_eabi arm_vfp" | ||
| 366 | fi | 368 | fi |
| 367 | if grep -s -q "^Features.* \(vfp\|iwmmxt\) " /proc/cpuinfo ; then | 369 | if grep -s -q "^Features.* \(vfp\|iwmmxt\) " /proc/cpuinfo ; then |
| 368 | confvars="$confvars arm_vfp" | 370 | confvars="$confvars arm_vfp" |
| @@ -499,3 +499,39 @@ void __aeabi_uidivmod(unsigned num, unsigned den) · 498 unmodified lines | |||
| 499 | { | 499 | { |
| 500 | uidiv_t_return(aeabi_uidivmod(num, den)); | 500 | uidiv_t_return(aeabi_uidivmod(num, den)); |
| 501 | } | 501 | } |
| 502 | |||
| 503 | /* Some targets do not have all eabi calls (OpenBSD) */ | ||
| 504 | typedef __SIZE_TYPE__ size_t; | ||
| 505 | extern void *memcpy(void *dest, const void *src, size_t n); | ||
| 506 | extern void *memmove(void *dest, const void *src, size_t n); | ||
| 507 | extern void *memset(void *s, int c, size_t n); | ||
| 508 | |||
| 509 | void * | ||
| 510 | __aeabi_memcpy (void *dest, const void *src, size_t n) | ||
| 511 | { | ||
| 512 | return memcpy (dest, src, n); | ||
| 513 | } | ||
| 514 | |||
| 515 | void * | ||
| 516 | __aeabi_memmove (void *dest, const void *src, size_t n) | ||
| 517 | { | ||
| 518 | return memmove (dest, src, n); | ||
| 519 | } | ||
| 520 | |||
| 521 | void * | ||
| 522 | __aeabi_memmove4 (void *dest, const void *src, size_t n) | ||
| 523 | { | ||
| 524 | return memmove (dest, src, n); | ||
| 525 | } | ||
| 526 | |||
| 527 | void * | ||
| 528 | __aeabi_memmove8 (void *dest, const void *src, size_t n) | ||
| 529 | { | ||
| 530 | return memmove (dest, src, n); | ||
| 531 | } | ||
| 532 | |||
| 533 | void * | ||
| 534 | __aeabi_memset (void *s, size_t n, int c) | ||
| 535 | { | ||
| 536 | return memset (s, c, n); | ||
| 537 | } | ||
| @@ -665,7 +665,7 @@ static void rt_getcontext(ucontext_t *uc, rt_context *rc) · 664 unmodified lines | |||
| 665 | rc->fp = uc->uc_mcontext.__gregs[_REG_FP]; | 665 | rc->fp = uc->uc_mcontext.__gregs[_REG_FP]; |
| 666 | #elif defined(__arm__) && defined(__OpenBSD__) | 666 | #elif defined(__arm__) && defined(__OpenBSD__) |
| 667 | rc->ip = uc->sc_pc; | 667 | rc->ip = uc->sc_pc; |
| 668 | rc->fp = uc->sc_fpreg[29]; | 668 | rc->fp = uc->sc_r11; |
| 669 | #elif defined(__arm__) && defined(__FreeBSD__) | 669 | #elif defined(__arm__) && defined(__FreeBSD__) |
| 670 | rc->ip = uc->uc_mcontext.__gregs[_REG_PC]; | 670 | rc->ip = uc->uc_mcontext.__gregs[_REG_PC]; |
| 671 | rc->fp = uc->uc_mcontext.__gregs[_REG_FP]; | 671 | rc->fp = uc->uc_mcontext.__gregs[_REG_FP]; |