Fix alloca and arm problems

alloca is only defined for i386 and x86_64
arm has __aeabi_ prefixes for mem... calls
This commit is contained in:
herman ten brugge 2020-07-06 20:10:56 +02:00
parent 40671f76e4
commit fc05da3c0b
2 changed files with 9 additions and 0 deletions

View File

@ -1919,8 +1919,10 @@ ST_FUNC void gbound_args(int nb_args)
gfunc_call(1);
func_bound_add_epilog = 1;
}
#if defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64
if (v == TOK_alloca)
func_bound_add_epilog = 1;
#endif
}
}

View File

@ -3706,6 +3706,13 @@ static void tcc_predefs(CString *cstr)
"__MAYBE_REDIR(void,free,(void*))\n"
#if defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64
"__BOTH(void*,alloca,(__SIZE_TYPE__))\n"
#endif
#if defined(TCC_TARGET_ARM) && defined(TCC_ARM_EABI)
"__BOUND(void*,__aeabi_memcpy,(void*,const void*,__SIZE_TYPE__))\n"
"__BOUND(void*,__aeabi_memmove,(void*,const void*,__SIZE_TYPE__))\n"
"__BOUND(void*,__aeabi_memmove4,(void*,const void*,__SIZE_TYPE__))\n"
"__BOUND(void*,__aeabi_memmove8,(void*,const void*,__SIZE_TYPE__))\n"
"__BOUND(void*,__aeabi_memset,(void*,int,__SIZE_TYPE__))\n"
#endif
"__BUILTIN(void,abort,(void))\n"
"__BOUND(int,longjmp,())\n"