From f486b19f56081583f4f861f9ebd4da54e4388867 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Fri, 22 May 2020 06:29:18 +0200 Subject: [PATCH] macos: bound_alloca symbol adjust so that tests/boundtest.c links as well. --- lib/alloca86_64-bt.S | 5 +++++ libtcc.c | 4 ++++ 2 files changed, 9 insertions(+) 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"); -- 2.11.4.GIT