From 5d1e96a78586d5d0572398bf49b08c5d34af92bd Mon Sep 17 00:00:00 2001 From: Zephyr Lykos Date: Fri, 11 Oct 2024 13:51:16 +0800 Subject: [PATCH] ctest: fix building on apple silicone --- misc/tests/ctest.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/misc/tests/ctest.h b/misc/tests/ctest.h index 64858682..58020add 100644 --- a/misc/tests/ctest.h +++ b/misc/tests/ctest.h @@ -92,7 +92,11 @@ struct ctest { #define CTEST_IMPL_TEARDOWN_TPNAME(sname, tname) CTEST_IMPL_NAME(sname##_##tname##_teardown_ptr) #ifdef __APPLE__ +#ifdef __arm64__ +#define CTEST_IMPL_SECTION __attribute__ ((used, section ("__DATA, .ctest"), aligned(8))) +#else #define CTEST_IMPL_SECTION __attribute__ ((used, section ("__DATA, .ctest"), aligned(1))) +#endif #elif !defined _MSC_VER #define CTEST_IMPL_SECTION __attribute__ ((used, section (".ctest"), aligned(1))) #else