Bug#952482: webkit2gtk: Please pass -mlra and -fno-move-loop-invariants on sh4

John Paul Adrian Glaubitz <[email protected]>
Newsgroups gmane.linux.debian.ports.superh
Message-ID <158258228312.3514016.1265081005541549723.reportbug__29480.1043624588$1582582524$gmane$org@z6.physik.fu-berlin.de>
Source: webkit2gtk
Version: 2.26.4-1
Severity: normal
Tags: patch
User: [email protected]
Usertags: sh4

Hi!

In order for webkit2gtk to build on sh4, it's necessary to enable the
new register allocator on sh4 (LRA), see [1, 2].

Also, there is a regression in gcc-9 and gcc-10 that needs one optimization
to be disabled as otherwise the compiler will crash with an internal
compiler error (ICE) [3].

Please apply the attached patch for the next upload.

Thanks,
Adrian

> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55212
> [2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93876
> [3] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93877

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
sh4-compiler-flags.patch (text/plain, 679 B)
--- webkit2gtk-2.26.4/debian/rules.orig	2020-02-14 14:55:40.000000000 +0100
+++ webkit2gtk-2.26.4/debian/rules	2020-02-24 23:06:26.482766937 +0100
@@ -37,6 +37,14 @@
 	EXTRA_CMAKE_ARGUMENTS += -DUSE_LD_GOLD=OFF
 endif
 
+# Enable the new register allocator on SH and
+# disable one particular optimization flag
+# See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93876
+# and: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93877
+ifneq (,$(filter $(DEB_HOST_ARCH),sh3 sh4))
+        CPPFLAGS += -mlra -fno-move-loop-invariants
+endif
+
 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
 	EXTRA_CMAKE_ARGUMENTS += -DUSE_SYSTEM_MALLOC=ON
 	CPPFLAGS += -DRELEASE_WITHOUT_OPTIMIZATIONS
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.