[DRE-maint] Bug#954293: ruby2.7: FTBFS on x32: misdetected as i386 or amd64

Thorsten Glaser tg at mirbsd.de
Thu Mar 19 19:54:12 GMT 2020


Source: ruby2.7
Version: 2.7.0-4
Severity: important
Tags: ftbfs upstream
Justification: fails to build from source on non-release arch

[…]
gcc -I. -I.ext/include/x86_64-linux-gnux32 -I./include -I. -I./enc/unicode/12.1.0 -DSYMBOL_PREFIX= -o coroutine/x
86/Context.o -c coroutine/x86/Context.S
coroutine/x86/Context.S: Assembler messages:
coroutine/x86/Context.S:17: Error: invalid instruction suffix for `push'
[…]

The problem lies in the top-level configure.ac:

 2303 AC_ARG_WITH(coroutine,
 2304     AS_HELP_STRING([--with-coroutine=IMPLEMENTATION], [specify the coroutine implementation to use]),
 2305     [rb_cv_coroutine=$withval])
 2306 AS_CASE([$rb_cv_coroutine], [yes|''], [
 2307     AC_MSG_CHECKING(native coroutine implementation for ${target_cpu}-${target_os})
 2308     AS_CASE(["$target_cpu-$target_os"],
[…]
 2312         [x*64-linux*], [
 2313             AS_CASE(["$ac_cv_sizeof_voidp"],
 2314                 [8], [ rb_cv_coroutine=amd64 ],
 2315                 [4], [ rb_cv_coroutine=x86 ],
 2316                 [*], [ rb_cv_coroutine= ]
 2317             )

This basically assumes there are only two x86 architectures.

For x32, the amd64 code might serve as start but won’t work as-is.
I don’t see right now everything that would need to be patched, as
it’s very sparsely commented, so I’d suggest using the generic im‐
plementation, probably ucontext.

This can be achieved by adding a *BEFORE* line 2312:

	[x86_64-linux-gnux32], [
		rb_cv_coroutine=ucontext
	],

Please apply as patch, so we can test this on the buildd, and
forward it upstream when it works.

This is kinda important because libselinux build-depends on this.

https://buildd.debian.org/status/fetch.php?pkg=ruby2.7&arch=x32&ver=2.7.0-4&stamp=1582112521&raw=0
has the complete log of the failed build.


More information about the Pkg-ruby-extras-maintainers mailing list