Skip to content

Commit

Permalink
ruby32: Fix build with gcc14.
Browse files Browse the repository at this point in the history
This backports the upstream commit 055613fd86, which fixes a
pointer-type mismatch in 32-bit builds, which gcc14 treats as an
error.

Although the intent is only to fix a build failure, the fix replaces
one function call with another, and hence requires a revbump.

TESTED:
Built successfully on OSX 10.4-10.5 ppc, 10.4-10.6 i386, 10.5-12.x
x86_64, and 11.x-14.x arm64.  Included all variants compatible with
available dependencies on the respective platforms (except ppc builds,
which were limited to default variants to save time).
  • Loading branch information
fhgwright committed Aug 12, 2024
1 parent 843831d commit 22095a2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lang/ruby32/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set ruby_patch 5
set ruby_ver_nodot [string map {. {}} ${ruby_ver}]
name ruby${ruby_ver_nodot}
version ${ruby_ver}.${ruby_patch}
revision 1
revision 2

categories lang ruby
maintainers {kimuraw @kimuraw} \
Expand Down Expand Up @@ -64,7 +64,7 @@ select.file ${filespath}/ruby${ruby_ver_nodot}
# patch-sources.diff: fixes for various issues.
# This includes the 'gem' versioning fix formerly handled via reinplace.
#
# This diff is from v3_2_5 vs. macports-3_2_5.
# This diff is from v3_2_5 vs. macports-3_2_5r2.
#
patchfiles-append patch-sources.diff

Expand Down
27 changes: 19 additions & 8 deletions lang/ruby32/files/patch-sources.diff
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- .gdbinit.orig 2024-07-26 04:54:27.000000000 -0700
+++ .gdbinit 2024-07-26 20:56:01.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
Expand All @@ -15,7 +15,7 @@
+# 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-07-26 20:56:01.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
Expand All @@ -29,7 +29,7 @@
+#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-07-26 20:56:01.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
Expand All @@ -43,7 +43,7 @@
+#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-07-26 20:56:01.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 <CommonCrypto/CommonDigest.h>
Expand Down Expand Up @@ -95,7 +95,7 @@
+#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-07-26 20:56:01.000000000 -0700
+++ lib/bundler/gem_helper.rb 2024-08-11 17:53:15.000000000 -0700
@@ -231,7 +231,7 @@ module Bundler
end

Expand All @@ -106,7 +106,7 @@
end
end
--- signal.c.orig 2024-07-26 04:54:27.000000000 -0700
+++ signal.c 2024-07-26 20:56:01.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
Expand All @@ -117,8 +117,19 @@
# 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-07-26 20:56:01.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|
Expand All @@ -131,7 +142,7 @@
(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-07-26 20:56:01.000000000 -0700
+++ vm_dump.c 2024-08-11 17:53:15.000000000 -0700
@@ -470,7 +470,8 @@ rb_vmdebug_thread_dump_state(VALUE self)
}

Expand Down

0 comments on commit 22095a2

Please sign in to comment.