Source: ruby2.5
Severity: normal
User: debian-sup...@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 - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
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
 

Reply via email to