--- auxil/spicy/3rdparty/fiber/CMakeLists.txt 2025-08-19 02:02:17.000000000 +0800 +++ auxil/spicy/3rdparty/fiber/CMakeLists.txt 2025-08-20 10:50:33.000000000 +0800 @@ -84,6 +84,10 @@ set(asm_sources src/fiber_asm_riscv_elf.S) elseif(CMU_OS_POSIX AND CMU_ARCH_PPC AND FIBER_BITS_64 AND CMU_LITTLE_ENDIAN) set(asm_sources src/fiber_asm_ppc64le_elf2.S) +#elseif(CMU_OS_POSIX AND CMU_ARCH_PPC AND FIBER_BITS_64) +# set(asm_sources src/fiber_asm_ppc64_mach.S) +elseif(CMU_OS_POSIX AND CMU_ARCH_PPC AND FIBER_BITS_32) + set(asm_sources src/fiber_asm_ppc_mach.S) endif() if(CMU_COMP_MSVC) --- auxil/spicy/3rdparty/fiber/src/fiber.c 2025-08-19 02:02:17.000000000 +0800 +++ auxil/spicy/3rdparty/fiber/src/fiber.c 2025-08-20 12:54:46.000000000 +0800 @@ -8,10 +8,16 @@ #include #include +#ifdef __APPLE__ +#include +#endif + #if HU_OS_POSIX_P # include # include -# if HU_C_11_P +# if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED < 101300 +# define USE_POSIX_MEMALIGN 1 /* No aligned_alloc on macOS < 10.13 */ +# elif HU_C_11_P # define ALIGNED_ALLOC aligned_alloc # elif HU_OS_BSD_P || defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L # define USE_POSIX_MEMALIGN 1 --- auxil/spicy/3rdparty/fiber/include/fiber/fiber_mach.h 2025-08-19 02:02:17.000000000 +0800 +++ auxil/spicy/3rdparty/fiber/include/fiber/fiber_mach.h 2025-08-20 12:46:29.000000000 +0800 @@ -119,6 +119,19 @@ double *f[18]; /* f14 - f31 */ \ double *v[12 * 2 + 1] /* v20 - v31, adjusted to be 16 byte aligned */ +#elif HU_ARCH_PPC_P && HU_BITS_32_P +# define FIBER_TARGET_PPC_MACH 1 +# define FIBER_DEFAULT_STACK_ALIGNMENT 16 +# define FIBER_ARCH_REGS \ + uint32_t cr; \ + uint32_t vrsave; \ + void *lr; /* r0 */ \ + void *sp; /* r1 */ \ + void *r[19]; /* r13 - r31 */ \ + uint32_t __pad; /* align f[] to 8 bytes */ \ + double f[18]; /* f14 - f31, 8 bytes each */ \ + double v[12 * 2 + 2] /* v20 - v31 + slack for 4-aligned struct base */ + #else # error "fiber: system/architecture target not supported" #endif