git: b6686e6f886f - main - lang/ruby*: fix coroutines on armv7
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 11 Jun 2026 11:52:04 UTC
The branch main has been updated by fuz:
URL: https://cgit.FreeBSD.org/ports/commit/?id=b6686e6f886f55b93c73d323d868bc3fdf7f1eac
commit b6686e6f886f55b93c73d323d868bc3fdf7f1eac
Author: Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2026-06-10 22:18:01 +0000
Commit: Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2026-06-11 11:51:21 +0000
lang/ruby*: fix coroutines on armv7
Two ports, devel/rubygem-glib2 and graphics/rubygem-cairo, have been
broken on armv7 for a long time. Recently, pkubaj fixed a problem with
Ruby's coroutine code on ppc64* (see 3bb0a9335) affecting the very same
ports. This naturally raises the question if the armv7 problems are
related.
Turns out that due to an oversight, we use the generic ucontext.h-based
coroutine code on armv7. Switching to the assembly-based code fixes
the ports! Further digging suggests that there may be a problem in the
freebsd32 support for these calls on aarch64 causing the observed
issues. We will investigate those separately.
Tested by: fuz
Approved by: portmgr (build fix blanket)
MFH: 2026Q2
---
lang/ruby33/Makefile | 1 +
lang/ruby33/files/patch-configure.ac | 24 +++++++++++++++++-------
lang/ruby34/Makefile | 2 +-
lang/ruby34/files/patch-configure.ac | 20 +++++++++++++++-----
lang/ruby40/Makefile | 1 +
lang/ruby40/files/patch-configure.ac | 20 +++++++++++++++-----
6 files changed, 50 insertions(+), 18 deletions(-)
diff --git a/lang/ruby33/Makefile b/lang/ruby33/Makefile
index 7d16bb778252..2e0371df2d1a 100644
--- a/lang/ruby33/Makefile
+++ b/lang/ruby33/Makefile
@@ -1,5 +1,6 @@
PORTNAME= ruby
PORTVERSION= ${RUBY_DISTVERSION}
+PORTREVISION= 1
PORTEPOCH= ${RUBY_PORTEPOCH}
CATEGORIES= lang ruby
MASTER_SITES= RUBY/${MASTER_SITE_SUBDIR_RUBY}
diff --git a/lang/ruby33/files/patch-configure.ac b/lang/ruby33/files/patch-configure.ac
index b83eddb09e5c..1e195de7f3dd 100644
--- a/lang/ruby33/files/patch-configure.ac
+++ b/lang/ruby33/files/patch-configure.ac
@@ -1,15 +1,25 @@
---- configure.ac.orig 2023-11-12 04:51:16 UTC
+--- configure.ac.orig 2026-03-26 00:05:04 UTC
+++ configure.ac
-@@ -1356,7 +1356,7 @@ AC_CHECK_HEADERS(ucontext.h)
- AC_CHECK_HEADERS(utime.h)
- AC_CHECK_HEADERS(sys/epoll.h)
+@@ -1359,7 +1359,7 @@ AC_CHECK_HEADERS(stdatomic.h)
+ AC_CHECK_HEADERS(sys/event.h)
+ AC_CHECK_HEADERS(stdatomic.h)
-AS_CASE("$target_cpu", [x64|x86_64|i[3-6]86*], [
+AS_CASE("$target_cpu", [amd64|x64|x86_64|i[3-6]86*], [
AC_CHECK_HEADERS(x86intrin.h)
])
RUBY_UNIVERSAL_CHECK_HEADER([x86_64, i386], x86intrin.h)
-@@ -3101,7 +3101,7 @@ AC_SUBST(EXTOBJS)
+@@ -2699,6 +2699,9 @@ AS_CASE([$coroutine_type], [yes|''], [
+ [i386-freebsd*], [
+ coroutine_type=x86
+ ],
++ [arm*-freebsd*], [
++ coroutine_type=arm32
++ ],
+ [aarch64-freebsd*], [
+ coroutine_type=arm64
+ ],
+@@ -3112,7 +3115,7 @@ AC_SUBST(EXTOBJS)
: ${LDSHARED='$(CC) -shared'}
AS_IF([test "$rb_cv_binary_elf" = yes], [
LDFLAGS="$LDFLAGS -rdynamic"
@@ -18,7 +28,7 @@
], [
test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED='$(LD) -Bshareable'
])
-@@ -3559,6 +3559,7 @@ AS_CASE("$enable_shared", [yes], [
+@@ -3570,6 +3573,7 @@ AS_CASE("$enable_shared", [yes], [
[freebsd*|dragonfly*], [
LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT).$(MAJOR)$(MINOR)'
LIBRUBY_SONAME='$(LIBRUBY_SO)'
@@ -26,7 +36,7 @@
AS_IF([test "$rb_cv_binary_elf" != "yes" ], [
LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)"
LIBRUBY_ALIASES=''
-@@ -4391,6 +4392,7 @@ AS_IF([test "${universal_binary-no}" = yes ], [
+@@ -4397,6 +4401,7 @@ AS_IF([test "${universal_binary-no}" = yes ], [
arch="${target_cpu}-mingw-ucrt"
], [
arch="${target_cpu}-${target_os}"
diff --git a/lang/ruby34/Makefile b/lang/ruby34/Makefile
index 7000b55ca647..46b8a39efad5 100644
--- a/lang/ruby34/Makefile
+++ b/lang/ruby34/Makefile
@@ -1,6 +1,6 @@
PORTNAME= ruby
PORTVERSION= ${RUBY_DISTVERSION}
-PORTREVISION= 1
+PORTREVISION= 2
PORTEPOCH= ${RUBY_PORTEPOCH}
CATEGORIES= lang ruby
MASTER_SITES= RUBY/${MASTER_SITE_SUBDIR_RUBY}
diff --git a/lang/ruby34/files/patch-configure.ac b/lang/ruby34/files/patch-configure.ac
index 2e3c608f9449..8d1d1cfeb097 100644
--- a/lang/ruby34/files/patch-configure.ac
+++ b/lang/ruby34/files/patch-configure.ac
@@ -1,6 +1,6 @@
---- configure.ac.orig 2024-12-12 01:10:13 UTC
+--- configure.ac.orig 2026-03-11 09:51:47 UTC
+++ configure.ac
-@@ -1411,7 +1411,7 @@ AC_CHECK_HEADERS(stdatomic.h)
+@@ -1409,7 +1409,7 @@ AC_CHECK_HEADERS(stdatomic.h)
AC_CHECK_HEADERS(stdckdint.h)
AC_CHECK_HEADERS(stdatomic.h)
@@ -9,7 +9,17 @@
AC_CHECK_HEADERS(x86intrin.h)
])
RUBY_UNIVERSAL_CHECK_HEADER([x86_64, i386], x86intrin.h)
-@@ -3149,7 +3149,7 @@ AC_SUBST(EXTOBJS)
+@@ -2728,6 +2728,9 @@ AS_CASE([$coroutine_type], [yes|''], [
+ [i386-freebsd*], [
+ coroutine_type=x86
+ ],
++ [arm*-freebsd*], [
++ coroutine_type=arm32
++ ],
+ [aarch64-freebsd*], [
+ coroutine_type=arm64
+ ],
+@@ -3147,7 +3150,7 @@ AC_SUBST(EXTOBJS)
: ${LDSHARED='$(CC) -shared'}
AS_IF([test "$rb_cv_binary_elf" = yes], [
LDFLAGS="$LDFLAGS -rdynamic"
@@ -18,7 +28,7 @@
], [
test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED='$(LD) -Bshareable'
])
-@@ -3611,6 +3611,7 @@ AS_CASE("$enable_shared", [yes], [
+@@ -3609,6 +3612,7 @@ AS_CASE("$enable_shared", [yes], [
[freebsd*|dragonfly*], [
LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT).$(MAJOR)$(MINOR)'
LIBRUBY_SONAME='$(LIBRUBY_SO)'
@@ -26,7 +36,7 @@
AS_IF([test "$rb_cv_binary_elf" != "yes" ], [
LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)"
LIBRUBY_ALIASES=''
-@@ -4443,6 +4444,7 @@ AS_IF([test "${universal_binary-no}" = yes ], [
+@@ -4442,6 +4446,7 @@ AS_IF([test "${universal_binary-no}" = yes ], [
arch="${target_cpu}-mingw-ucrt"
], [
arch="${target_cpu}-${target_os}"
diff --git a/lang/ruby40/Makefile b/lang/ruby40/Makefile
index d91cdbfd4882..b9496684e786 100644
--- a/lang/ruby40/Makefile
+++ b/lang/ruby40/Makefile
@@ -1,5 +1,6 @@
PORTNAME= ruby
PORTVERSION= ${RUBY_DISTVERSION}
+PORTREVISION= 1
PORTEPOCH= ${RUBY_PORTEPOCH}
CATEGORIES= lang ruby
MASTER_SITES= RUBY/${MASTER_SITE_SUBDIR_RUBY}
diff --git a/lang/ruby40/files/patch-configure.ac b/lang/ruby40/files/patch-configure.ac
index 2e3c608f9449..e48af2c4f55d 100644
--- a/lang/ruby40/files/patch-configure.ac
+++ b/lang/ruby40/files/patch-configure.ac
@@ -1,6 +1,6 @@
---- configure.ac.orig 2024-12-12 01:10:13 UTC
+--- configure.ac.orig 2026-05-19 23:22:54 UTC
+++ configure.ac
-@@ -1411,7 +1411,7 @@ AC_CHECK_HEADERS(stdatomic.h)
+@@ -1444,7 +1444,7 @@ AC_CHECK_HEADERS(stdatomic.h)
AC_CHECK_HEADERS(stdckdint.h)
AC_CHECK_HEADERS(stdatomic.h)
@@ -9,7 +9,17 @@
AC_CHECK_HEADERS(x86intrin.h)
])
RUBY_UNIVERSAL_CHECK_HEADER([x86_64, i386], x86intrin.h)
-@@ -3149,7 +3149,7 @@ AC_SUBST(EXTOBJS)
+@@ -2761,6 +2761,9 @@ AS_CASE([$coroutine_type], [yes|''], [
+ [i386-freebsd*], [
+ coroutine_type=x86
+ ],
++ [arm*-freebsd*], [
++ coroutine_type=arm32
++ ],
+ [aarch64-freebsd*], [
+ coroutine_type=arm64
+ ],
+@@ -3183,7 +3186,7 @@ AC_SUBST(EXTOBJS)
: ${LDSHARED='$(CC) -shared'}
AS_IF([test "$rb_cv_binary_elf" = yes], [
LDFLAGS="$LDFLAGS -rdynamic"
@@ -18,7 +28,7 @@
], [
test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED='$(LD) -Bshareable'
])
-@@ -3611,6 +3611,7 @@ AS_CASE("$enable_shared", [yes], [
+@@ -3644,6 +3647,7 @@ AS_CASE("$enable_shared", [yes], [
[freebsd*|dragonfly*], [
LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT).$(MAJOR)$(MINOR)'
LIBRUBY_SONAME='$(LIBRUBY_SO)'
@@ -26,7 +36,7 @@
AS_IF([test "$rb_cv_binary_elf" != "yes" ], [
LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)"
LIBRUBY_ALIASES=''
-@@ -4443,6 +4444,7 @@ AS_IF([test "${universal_binary-no}" = yes ], [
+@@ -4546,6 +4550,7 @@ AS_IF([test "${universal_binary-no}" = yes ], [
arch="${target_cpu}-mingw-ucrt"
], [
arch="${target_cpu}-${target_os}"