Bug#887462: qtwebkit-opensource-src: Please reduce optimization level on sh3/sh4 to -O1
Source: qtwebkit-opensource-src
Version: 5.212.0~alpha2-6
Severity: normal
Tags: patch
User: debian-superh@lists.debian.org
Usertags: sh3 sh4
Hi!
Due to an upstream bug in gcc [1], both webkit2gtk and qtwebkit-opensource-src
fail to build from source on sh4 (and consequently sh3):
../Source/JavaScriptCore/heap/ConservativeRoots.cpp: In member function 'void JSC::ConservativeRoots::add(void*, void*, JSC::JITStubRoutineSet&, JSC::CodeBlockSet&)':
../Source/JavaScriptCore/heap/ConservativeRoots.cpp:145:1: error: unable to find a register to spill in class 'R0_REGS'
}
^
../Source/JavaScriptCore/heap/ConservativeRoots.cpp:145:1: error: this is the insn:
(insn 23 122 28 2 (parallel [
(set (subreg:SI (reg:QI 182) 0)
(unspec_volatile:SI [
(mem/v:QI (reg/f:SI 4 r4 [orig:162 _1 ] [162]) [-1 S1 A8])
(reg:QI 184)
(reg:QI 186)
] UNSPECV_CMPXCHG_1))
(set (mem/v:QI (reg/f:SI 4 r4 [orig:162 _1 ] [162]) [-1 S1 A8])
(unspec_volatile:QI [
(const_int 0 [0])
] UNSPECV_CMPXCHG_2))
(set (reg:SI 147 t)
(unspec_volatile:SI [
(const_int 0 [0])
] UNSPECV_CMPXCHG_3))
(clobber (scratch:SI))
(clobber (reg:SI 0 r0))
(clobber (reg:SI 1 r1))
]) "/usr/include/c++/7/bits/atomic_base.h":434 403 {atomic_compare_and_swapqi_soft_gusa}
(expr_list:REG_DEAD (reg:QI 186)
(expr_list:REG_DEAD (reg:QI 184)
(expr_list:REG_UNUSED (reg:QI 182)
(expr_list:REG_UNUSED (reg:SI 1 r1)
(expr_list:REG_UNUSED (reg:SI 0 r0)
(nil)))))))
../Source/JavaScriptCore/heap/ConservativeRoots.cpp:145: confused by earlier errors, bailing out
This error can be worked around by reducing the optimization level to -O1
which is what the attached patch is enabling in the debian/rules file.
Could you integrate this change into qtwebkit-opensource-src for the next
upload?
Thanks,
Adrian
> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81426
> [2] https://buildd.debian.org/status/fetch.php?pkg=qtwebkit-opensource-src&arch=sh4&ver=5.212.0%7Ealpha2-6&stamp=1515522880&raw=0
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - glaubitz@debian.org
`. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
--- old/qtwebkit-opensource-src-5.212.0~alpha2/debian/rules 2018-01-09 16:38:23.000000000 +0100
+++ new/qtwebkit-opensource-src-5.212.0~alpha2/debian/rules 2018-01-16 17:30:08.481774799 +0100
@@ -20,6 +20,11 @@
export DEB_CXXFLAGS_MAINT_APPEND = -mfp32
endif
+# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81426
+ifneq (,$(filter $(DEB_HOST_ARCH_CPU),sh3 sh4))
+ export DEB_CXXFLAGS_MAINT_APPEND = -O1
+endif
+
# Disable gold linker on all architectures except x32
ifneq ($(DEB_HOST_ARCH),x32)
EXTRA_CMAKE_ARGUMENTS += -DUSE_LD_GOLD=OFF
Reply to: