Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1012247: ruby3.1: Please build with --with-coroutine=ucontext on x32

21 views
Skip to first unread message

John Paul Adrian Glaubitz

unread,
Jun 2, 2022, 3:30:03 AM6/2/22
to
Source: ruby3.1
Version: 3.1.2-1
Severity: normal
Tags: patch

Hello!

ruby3.1 FTBFS on x32 because the configure misdetects x32 as amd64:

checking stack growing direction on x86_64... -1
checking native coroutine implementation for x86_64-linux-gnux32...
configure: error: '' is not supported as coroutine
make[1]: *** [debian/rules:91: override_dh_auto_configure] Error 1
make[1]: Leaving directory '/<<PKGBUILDDIR>>'

This can be fixed by building ruby3.1 on x32 with "--with-coroutine=ucontext".

Can you apply the attached patch?

--- old/ruby3.1-3.1.2/debian/rules 2022-04-22 14:43:42.000000000 +0200
+++ new/ruby3.1-3.1.2/debian/rules 2022-06-02 09:13:18.435655355 +0200
@@ -40,6 +40,10 @@
configure_options += CXX=$(DEB_HOST_GNU_TYPE)-g++
configure_options += LD=$(DEB_HOST_GNU_TYPE)-ld

+ifeq (x32 ,$(DEB_HOST_ARCH))
+configure_options += --with-coroutine=ucontext
+endif
+
ifneq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
# Cross-building. This is the same logic that debhelper's
# lib/Debian/Debhelper/Buildsystem/autoconf.pm uses.

Thanks,
Adrian

--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
ruby3.1-x32-ucontext.diff

Antonio Terceiro

unread,
Jun 2, 2022, 9:50:03 AM6/2/22
to
On Thu, Jun 02, 2022 at 09:17:43AM +0200, John Paul Adrian Glaubitz wrote:
> Source: ruby3.1
> Version: 3.1.2-1
> Severity: normal
> Tags: patch
>
> Hello!
>
> ruby3.1 FTBFS on x32 because the configure misdetects x32 as amd64:
>
> checking stack growing direction on x86_64... -1
> checking native coroutine implementation for x86_64-linux-gnux32...
> configure: error: '' is not supported as coroutine
> make[1]: *** [debian/rules:91: override_dh_auto_configure] Error 1
> make[1]: Leaving directory '/<<PKGBUILDDIR>>'
>
> This can be fixed by building ruby3.1 on x32 with "--with-coroutine=ucontext".
>
> Can you apply the attached patch?

I could, but ...

> --- old/ruby3.1-3.1.2/debian/rules 2022-04-22 14:43:42.000000000 +0200
> +++ new/ruby3.1-3.1.2/debian/rules 2022-06-02 09:13:18.435655355 +0200
> @@ -40,6 +40,10 @@
> configure_options += CXX=$(DEB_HOST_GNU_TYPE)-g++
> configure_options += LD=$(DEB_HOST_GNU_TYPE)-ld
>
> +ifeq (x32 ,$(DEB_HOST_ARCH))
> +configure_options += --with-coroutine=ucontext
> +endif
> +
> ifneq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
> # Cross-building. This is the same logic that debhelper's
> # lib/Debian/Debhelper/Buildsystem/autoconf.pm uses.

isn't this something that should be done in configure.ac instead (and
submitted upstream)? there's a big switch statement there to select the
type of coroutine.
signature.asc

John Paul Adrian Glaubitz

unread,
Jun 2, 2022, 10:10:03 AM6/2/22
to
Hi!

On 6/2/22 15:43, Antonio Terceiro wrote:
> isn't this something that should be done in configure.ac instead (and
> submitted upstream)? there's a big switch statement there to select the
> type of coroutine.

Sure, I can send a patch later. I just didn't have the time to dig through
the code to address the issue. Probably the match for "x86_64-*-*" needs
to be refined in configure.ac.

John Paul Adrian Glaubitz

unread,
Jun 2, 2022, 12:20:06 PM6/2/22
to
Hi Antonio!

On 6/2/22 15:58, John Paul Adrian Glaubitz wrote:
> On 6/2/22 15:43, Antonio Terceiro wrote:
>> isn't this something that should be done in configure.ac instead (and
>> submitted upstream)? there's a big switch statement there to select the
>> type of coroutine.
>
> Sure, I can send a patch later. I just didn't have the time to dig through
> the code to address the issue. Probably the match for "x86_64-*-*" needs
> to be refined in configure.ac.

x32 is actually covered by configure.ac, but there is a bug as the variable
is named rb_cv_coroutine instead of coroutine_type which is why the configure
script fails.

The following patch fixes the problem:

--- ruby3.1-3.1.2.orig/configure.ac
+++ ruby3.1-3.1.2/configure.ac
@@ -2525,7 +2525,7 @@ AS_CASE([$coroutine_type], [yes|''], [
coroutine_type=arm64
],
[x86_64-linux-gnux32], [
- rb_cv_coroutine=ucontext
+ coroutine_type=ucontext
],
[x*64-linux*], [
AS_CASE(["$ac_cv_sizeof_voidp"],

However, since upstream removed the x32 part [1], I don't know whether they would accept
such a change.

Adrian

> [1] https://github.com/ruby/ruby/blob/master/configure.ac#L2539

Antonio Terceiro

unread,
Jun 2, 2022, 8:00:04 PM6/2/22
to
It's not that upstream removed it, it's that it is added by a Debian
patch in the first place.
signature.asc
0 new messages