--- .gdbinit.orig 2024-06-11 16:54:24.000000000 -0700 +++ .gdbinit 2024-06-14 19:51:49.000000000 -0700 @@ -1,4 +1,5 @@ -set startup-with-shell off +# Move this to end, so failure on older gdbs doesn't blow the rest +# set startup-with-shell off define hook-run set $color_type = 0 @@ -1345,3 +1346,6 @@ define print_flags end source misc/gdb.py + +# Moved from beginning, since it fails on older gdbs +set startup-with-shell off --- ext/digest/md5/md5cc.h.orig 2024-06-11 16:54:24.000000000 -0700 +++ ext/digest/md5/md5cc.h 2024-06-14 19:51:49.000000000 -0700 @@ -17,3 +17,11 @@ static DEFINE_FINISH_FUNC_FROM_FINAL(MD5 #undef MD5_Finish #define MD5_Update rb_digest_MD5_update #define MD5_Finish rb_digest_MD5_finish + +/* + * Pre-10.6 defines are with args, which don't match the argless use in + * the function pointer inits. Thus, we redefine MD5_Init as well. + * This is a NOP on 10.6+. + */ +#undef MD5_Init +#define MD5_Init CC_MD5_Init --- ext/digest/sha1/sha1cc.h.orig 2024-06-11 16:54:24.000000000 -0700 +++ ext/digest/sha1/sha1cc.h 2024-06-14 19:51:49.000000000 -0700 @@ -12,3 +12,11 @@ static DEFINE_FINISH_FUNC_FROM_FINAL(SHA #undef SHA1_Finish #define SHA1_Update rb_digest_SHA1_update #define SHA1_Finish rb_digest_SHA1_finish + +/* + * Pre-10.6 defines are with args, which don't match the argless use in + * the function pointer inits. Thus, we redefine SHA1_Init as well. + * This is a NOP on 10.6+. + */ +#undef SHA1_Init +#define SHA1_Init CC_SHA1_Init --- ext/digest/sha2/sha2cc.h.orig 2024-06-11 16:54:24.000000000 -0700 +++ ext/digest/sha2/sha2cc.h 2024-06-14 19:51:49.000000000 -0700 @@ -1,6 +1,33 @@ #define COMMON_DIGEST_FOR_OPENSSL 1 #include +/* + * Prior to 10.5, OpenSSL-compatible definitions are missing for + * SHA2 macros, though the CC_ versions are present. + * Add the missing definitions we actually use here if needed. + * Note that the definitions are the argless 10.6+-style. + * The weird CTX mismatch is copied from the 10.6 header. + */ +#ifndef SHA256_DIGEST_LENGTH +#define SHA256_DIGEST_LENGTH CC_SHA256_DIGEST_LENGTH +#define SHA256_CTX CC_SHA256_CTX +#define SHA256_Update CC_SHA256_Update +#define SHA256_Final CC_SHA256_Final +#endif /* !defined SHA256_DIGEST_LENGTH */ + +#ifndef SHA384_DIGEST_LENGTH +#define SHA384_DIGEST_LENGTH CC_SHA384_DIGEST_LENGTH +#define SHA512_CTX CC_SHA512_CTX +#define SHA384_Update CC_SHA384_Update +#define SHA384_Final CC_SHA384_Final +#endif /* !defined SHA384_DIGEST_LENGTH */ + +#ifndef SHA512_DIGEST_LENGTH +#define SHA512_DIGEST_LENGTH CC_SHA512_DIGEST_LENGTH +#define SHA512_Update CC_SHA512_Update +#define SHA512_Final CC_SHA512_Final +#endif /* !defined SHA512_DIGEST_LENGTH */ + #define SHA256_BLOCK_LENGTH CC_SHA256_BLOCK_BYTES #define SHA384_BLOCK_LENGTH CC_SHA384_BLOCK_BYTES #define SHA512_BLOCK_LENGTH CC_SHA512_BLOCK_BYTES @@ -29,3 +56,15 @@ static DEFINE_FINISH_FUNC_FROM_FINAL(SHA #undef SHA512_Finish #define SHA512_Update rb_digest_SHA512_update #define SHA512_Finish rb_digest_SHA512_finish + +/* + * Pre-10.6 defines are with args, which don't match the argless use in + * the function pointer inits. Thus, we redefine SHA*_Init as well. + * This is a NOP on 10.6+. + */ +#undef SHA256_Init +#define SHA256_Init CC_SHA256_Init +#undef SHA384_Init +#define SHA384_Init CC_SHA384_Init +#undef SHA512_Init +#define SHA512_Init CC_SHA512_Init --- lib/bundler/gem_helper.rb.orig 2024-06-11 16:54:24.000000000 -0700 +++ lib/bundler/gem_helper.rb 2024-06-14 19:51:49.000000000 -0700 @@ -231,7 +231,7 @@ module Bundler end def gem_command - ENV["GEM_COMMAND"]&.shellsplit || ["gem"] + ENV["GEM_COMMAND"]&.shellsplit || ["gem3.3"] end end end --- signal.c.orig 2024-06-11 16:54:24.000000000 -0700 +++ signal.c 2024-06-14 19:51:49.000000000 -0700 @@ -803,7 +803,8 @@ check_stack_overflow(int sig, const uint const greg_t bp = mctx->gregs[REG_EBP]; # endif # elif defined __APPLE__ -# if __DARWIN_UNIX03 +# include +# if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 # define MCTX_SS_REG(reg) __ss.__##reg # else # define MCTX_SS_REG(reg) ss.reg --- vm_dump.c.orig 2024-06-11 16:54:24.000000000 -0700 +++ vm_dump.c 2024-06-14 19:51:49.000000000 -0700 @@ -490,7 +490,8 @@ rb_vmdebug_thread_dump_state(FILE *errou } #if defined __APPLE__ -# if __DARWIN_UNIX03 +# include +# if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 # define MCTX_SS_REG(reg) __ss.__##reg # else # define MCTX_SS_REG(reg) ss.reg @@ -502,7 +503,8 @@ rb_vmdebug_thread_dump_state(FILE *errou # ifdef HAVE_LIBUNWIND # undef backtrace # define backtrace unw_backtrace -# elif defined(__APPLE__) && defined(HAVE_LIBUNWIND_H) +# elif defined(__APPLE__) && defined(HAVE_LIBUNWIND_H) \ + && MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 # define UNW_LOCAL_ONLY # include # include