--- .gdbinit.orig 2024-07-26 04:54:27.000000000 -0700 +++ .gdbinit 2024-08-11 17:53:15.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 @@ -1348,3 +1349,6 @@ define print_flags printf "RUBY_FL_USER17 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER17 ? "1" : "0" printf "RUBY_FL_USER18 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER18 ? "1" : "0" end + +# Moved from beginning, since it fails on older gdbs +set startup-with-shell off --- ext/digest/md5/md5cc.h.orig 2024-07-26 04:54:27.000000000 -0700 +++ ext/digest/md5/md5cc.h 2024-08-11 17:53:15.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-07-26 04:54:27.000000000 -0700 +++ ext/digest/sha1/sha1cc.h 2024-08-11 17:53:15.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-07-26 04:54:27.000000000 -0700 +++ ext/digest/sha2/sha2cc.h 2024-08-11 17:53:15.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-07-26 04:54:27.000000000 -0700 +++ lib/bundler/gem_helper.rb 2024-08-11 17:53:15.000000000 -0700 @@ -231,7 +231,7 @@ module Bundler end def gem_command - ENV["GEM_COMMAND"]&.shellsplit || ["gem"] + ENV["GEM_COMMAND"]&.shellsplit || ["gem3.2"] end end end --- signal.c.orig 2024-07-26 04:54:27.000000000 -0700 +++ signal.c 2024-08-11 17:53:15.000000000 -0700 @@ -841,7 +841,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 --- time.c.orig 2024-07-26 04:54:27.000000000 -0700 +++ time.c 2024-08-11 17:53:15.000000000 -0700 @@ -2322,7 +2322,7 @@ zone_timelocal(VALUE zone, VALUE time) struct time_object *tobj = DATA_PTR(time); wideval_t t, s; - split_second(tobj->timew, &t, &s); + wdivmod(tobj->timew, WINT2FIXWV(TIME_SCALE), &t, &s); tm = tm_from_time(rb_cTimeTM, time); utc = rb_check_funcall(zone, id_local_to_utc, 1, &tm); if (UNDEF_P(utc)) return 0; --- tool/transform_mjit_header.rb.orig 2024-07-26 04:54:27.000000000 -0700 +++ tool/transform_mjit_header.rb 2024-08-11 17:53:15.000000000 -0700 @@ -181,7 +181,9 @@ module MJITHeader def self.conflicting_types?(code, cc, cflags) with_code(code) do |path| cmd = "#{cc} #{cflags} #{path}" - out = IO.popen(cmd, err: [:child, :out], &:read) + # As per gcc docs, set LC_ALL=C to avoid curly quotes in messages + cmd_env = {"LC_ALL" => "C"} + out = IO.popen(cmd_env, cmd, err: [:child, :out], &:read) !$?.success? && (out.match?(/error: conflicting types for '[^']+'/) || out.match?(/error: redefinition of parameter '[^']+'/)) --- vm_dump.c.orig 2024-07-26 04:54:27.000000000 -0700 +++ vm_dump.c 2024-08-11 17:53:15.000000000 -0700 @@ -470,7 +470,8 @@ rb_vmdebug_thread_dump_state(VALUE self) } #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 @@ -482,7 +483,8 @@ rb_vmdebug_thread_dump_state(VALUE self) # 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