[DRE-maint] Bug#951714: ruby2.5: Please include small workaround to fix the build on sh4

John Paul Adrian Glaubitz glaubitz at physik.fu-berlin.de
Thu Feb 20 14:29:34 GMT 2020


Source: ruby2.5
Severity: normal
User: debian-superh at lists.debian.org
Usertags: sh4

Hello!

Due to a compiler bug in gcc-9 and newer, ruby2.5 (and ruby2.7) currently
gets miscompiled and crashes with an 'Illegal Instruction' error [1].

The problem can be easily worked around by passing -fno-crossjumping through
CFLAGS to the compiler. Could you include the small attached workaround in
the next upload of ruby2.5 (and ruby2.7) to fix the build on sh4 until
the compiler bug has been fixed upstream?

diff -Nru old/ruby2.5-2.5.7/debian/rules new/ruby2.5-2.5.7/debian/rules
--- old/ruby2.5-2.5.7/debian/rules      2019-10-23 17:48:04.000000000 +0200
+++ new/ruby2.5-2.5.7/debian/rules      2020-02-20 15:17:13.910784900 +0100
@@ -55,6 +55,11 @@
 export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow
 configure_options += $(shell dpkg-buildflags --export=configure)
 
+# See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93808
+ifneq (,$(filter $(DEB_HOST_ARCH),sh3 sh4))
+export DEB_CFLAGS_MAINT_APPEND += -fno-crossjumping
+endif
+
 # Always build with /bin/bash, to get consistent rbconfig.rb (which embeds SHELL).
 export SHELL := /bin/bash

Thanks,
Adrian

> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93808

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz at debian.org
`. `'   Freie Universitaet Berlin - glaubitz at physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
-------------- next part --------------
diff -Nru old/ruby2.5-2.5.7/debian/rules new/ruby2.5-2.5.7/debian/rules
--- old/ruby2.5-2.5.7/debian/rules	2019-10-23 17:48:04.000000000 +0200
+++ new/ruby2.5-2.5.7/debian/rules	2020-02-20 15:17:13.910784900 +0100
@@ -55,6 +55,11 @@
 export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow
 configure_options += $(shell dpkg-buildflags --export=configure)
 
+# See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93808
+ifneq (,$(filter $(DEB_HOST_ARCH),sh3 sh4))
+export DEB_CFLAGS_MAINT_APPEND += -fno-crossjumping
+endif
+
 # Always build with /bin/bash, to get consistent rbconfig.rb (which embeds SHELL).
 export SHELL := /bin/bash
 


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