Bug#951714: ruby2.5: Please include small workaround to fix the build on sh4

John Paul Adrian Glaubitz <[email protected]>
Newsgroups gmane.linux.debian.ports.superh
Message-ID <158220897469.2484645.3045197768543411744.reportbug__49090.6366774411$1582209205$gmane$org@z6.physik.fu-berlin.de>
Source: ruby2.5
Severity: normal
User: [email protected]
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 - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
ruby-workaround-sh4.diff (text/plain, 633 B)
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.