Files
ports/lang/ruby34/files/patch-configure.ac
T
Piotr Kubaj b6686e6f88 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
2026-06-11 13:51:21 +02:00

47 lines
1.6 KiB
Plaintext

--- configure.ac.orig 2026-03-11 09:51:47 UTC
+++ configure.ac
@@ -1409,7 +1409,7 @@ AC_CHECK_HEADERS(stdatomic.h)
AC_CHECK_HEADERS(stdckdint.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)
@@ -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"
- DLDFLAGS="$DLDFLAGS "'-Wl,-soname,$@'
+ DLDFLAGS="$DLDFLAGS "'-Wl,-E'
], [
test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED='$(LD) -Bshareable'
])
@@ -3609,6 +3612,7 @@ AS_CASE("$enable_shared", [yes], [
[freebsd*|dragonfly*], [
LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT).$(MAJOR)$(MINOR)'
LIBRUBY_SONAME='$(LIBRUBY_SO)'
+ RUBY_APPEND_OPTIONS(LIBRUBY_DLDFLAGS, ['-Wl,-soname,${LIBRUBY_SO}'])
AS_IF([test "$rb_cv_binary_elf" != "yes" ], [
LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)"
LIBRUBY_ALIASES=''
@@ -4442,6 +4446,7 @@ AS_IF([test "${universal_binary-no}" = yes ], [
arch="${target_cpu}-mingw-ucrt"
], [
arch="${target_cpu}-${target_os}"
+ AS_CASE(["$target_cpu-$target_os"], [x86_64-freebsd*],[arch=amd64-${target_os}])
])
AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "$arch")