diff --git a/lib/alloca86_64-bt.S b/lib/alloca86_64-bt.S index e1bac5f4..34ab0e77 100644 --- a/lib/alloca86_64-bt.S +++ b/lib/alloca86_64-bt.S @@ -1,6 +1,11 @@ /* ---------------------------------------------- */ /* alloca86_64.S */ +#ifdef __APPLE__ +#define __bound_alloca ___bound_alloca +#define __bound_alloca_nr ___bound_alloca_nr +#endif + .globl __bound_alloca __bound_alloca: diff --git a/libtcc.c b/libtcc.c index 8f95ace1..4fef0a09 100644 --- a/libtcc.c +++ b/libtcc.c @@ -56,6 +56,9 @@ #ifdef TCC_TARGET_PE #include "tccpe.c" #endif +#ifdef TCC_TARGET_MACHO +#include "tccmacho.c" +#endif #endif /* ONE_SOURCE */ #include "tcc.h" @@ -944,6 +947,7 @@ LIBTCCAPI TCCState *tcc_new(void) tcc_define_symbol(s, "__APPLE__", "1"); tcc_define_symbol(s, "__GNUC__", "4"); /* darwin emits warning on GCC<4 */ tcc_define_symbol(s, "__APPLE_CC__", "1"); /* for */ + tcc_define_symbol(s, "__builtin_alloca", "alloca"); /* as we claim GNUC */ /* avoids usage of GCC/clang specific builtins in libc-headerfiles: */ tcc_define_symbol(s, "__FINITE_MATH_ONLY__", "1");