--- fuse/lib/fuse_lowlevel.c 2018-12-14 22:34:44.000000000 +0800 +++ fuse/lib/fuse_lowlevel.c 2026-02-22 06:49:51.000000000 +0800 @@ -22,6 +22,10 @@ #include "fuse_lowlevel_compat.h" #ifdef __APPLE__ # include "fuse_darwin_private.h" +# include +# if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 +# define DARWIN_POSIX_MEMALIGN_COMPAT +# endif #endif #include @@ -41,6 +45,40 @@ #define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7) #endif +#ifdef DARWIN_POSIX_MEMALIGN_COMPAT + +int posix_memalign(void** pp, size_t alignment, size_t bytes) { + /* if alignment is 0 or not a power of 2 return bad value */ + if (alignment < sizeof( void *) || // excludes 0 == alignment + 0 != (alignment & (alignment - 1))) { // relies on sizeof(void *) being a power of two. + return EINVAL; + } + + void* mem = 0; + + if (alignment <= 16) { + /* MacOSX always returns memory aligned on a 16 byte alignment + */ + mem = malloc(bytes); + + } else { + /* if the caller wants a larger alignment than 16 + * we give them a page-aligned allotment. This is not as efficient + * as an optimized aligned memory implementation, but much + * simpler, effective, and requires no changes to the rest of + * the underlying memory management system. + */ + mem = valloc(bytes); + } + + if (mem == 0) + return ENOMEM; + else { + *pp = mem; + return 0; + } +} +#endif /* DARWIN_POSIX_MEMALIGN_COMPAT */ #define PARAM(inarg) (((char *)(inarg)) + sizeof(*(inarg))) #define OFFSET_MAX 0x7fffffffffffffffLL --- build.d/targets/library.sh 2018-12-18 13:34:11.000000000 +0800 +++ build.d/targets/library.sh 2026-02-22 07:10:50.000000000 +0800 @@ -85,15 +85,6 @@ /usr/bin/xcrun dsymutil -o "${debug_directory}/${executable_name}.dSYM" "${executable_path}" 1>&3 2>&4 common_die_on_error "Failed to link debug information: '${executable_path}'" - # Strip library - - /usr/bin/xcrun strip -S -x "${executable_path}" 1>&3 2>&4 - common_die_on_error "Failed to strip executable: '${executable_path}'" - - # Sign library - - build_target_codesign "${executable_path}" - common_die_on_error "Failed to sign executable: '${executable_path}'" done < <(/usr/bin/find lib -name lib*.dylib -type f -print0) popd > /dev/null 2>&1 --- build.d/targets/macfuse_library.sh 2018-12-18 13:34:11.000000000 +0800 +++ build.d/targets/macfuse_library.sh 2026-02-22 07:11:05.000000000 +0800 @@ -85,15 +85,6 @@ /usr/bin/xcrun dsymutil -o "${debug_directory}/${executable_name}.dSYM" "${executable_path}" 1>&3 2>&4 common_die_on_error "Failed to link debug information: '${executable_path}'" - # Strip library - - /usr/bin/xcrun strip -S -x "${executable_path}" 1>&3 2>&4 - common_die_on_error "Failed to strip executable: '${executable_path}'" - - # Sign library - - build_target_codesign "${executable_path}" - common_die_on_error "Failed to sign executable: '${executable_path}'" done < <(/usr/bin/find lib -name lib*.dylib -type f -print0) popd > /dev/null 2>&1