config-internal.h: automatically set ECL_C_COMPATIBLE_VARIADIC_DISPATCH for apple/arm64

This commit is contained in:
Marius Gerbershagen 2021-01-29 19:46:01 +01:00
parent 19780e2033
commit d4e5a96c23
3 changed files with 11 additions and 2 deletions

View file

@ -98,7 +98,7 @@ Hint provided by Pascal J. Bourguignon.
#+END_SRC
3. Build and install the target library
#+BEGIN_SRC shell-script
export CFLAGS="$CFLAGS -DECL_C_COMPATIBLE_VARIADIC_DISPATCH -DGC_DISABLE_INCREMENTAL -DECL_RWLOCK"
export CFLAGS="$CFLAGS -DGC_DISABLE_INCREMENTAL -DECL_RWLOCK"
export CXXFLAGS="$CFLAGS"
./configure --host=aarch64-apple-darwin \
--prefix=`pwd`/ecl-iOS \

View file

@ -248,3 +248,12 @@
#else
#define ECL_DEFAULT_C_STACK_SIZE @ECL_DEFAULT_C_STACK_SIZE@
#endif
/* Do the fixed and optional arguments of a variadic function use a
* different calling convention?
* Hardcoded since there's no easy way to determine this from a
* configure check and currently ARM64 apple is the only platform
* known to do this. */
#if defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__))
#define ECL_C_COMPATIBLE_VARIADIC_DISPATCH
#endif

View file

@ -769,7 +769,7 @@ struct ecl_cfun { /* compiled function header */
cl_object block; /* descriptor of C code block for GC */
cl_objectfn entry; /* entry address */
#ifdef ECL_C_COMPATIBLE_VARIADIC_DISPATCH
/* Some architectures (i.e. ARM64 on iOS) use a different
/* Some architectures (i.e. ARM64 on iOS/Mac OS X) use a different
* calling convention for the fixed and variadic arguments of
* a variadic function. The only portable way to allow for
* function redefinitions during runtime in these