Turn on mbranch-protection=pac-ret only, JIT is broken with BTI enabled

WebKitGTK JIT crashes on aarch64 hardware with new ARMv8.5 BTI
extension, most commonly seen on M2 Macs running Fedora Asahi. This
breaks large parts of GNOME using WebKitGTK, notably GNOME Online
Accounts; GNOME Help; and other similar things.

This removes Asahi specific changes as this could occur on any aarch64
hardware with this feature and makes WebKitGTK pretty much unuseable
without this change.

We also reduced generated debuginfo for aarch64 here as the memory
requirements are pretty huge for -g, making aarch64 rpms unbuildable in
copr without this change.

Reference: https://bugs.webkit.org/show_bug.cgi?id=245697
Related: rhbz#213000
This commit is contained in:
Eric Curtin 2023-03-02 17:26:48 +00:00
parent 9031227061
commit fac6852e56

View File

@ -323,6 +323,14 @@ files for developing applications that use JavaScript engine from webkit2gtk-4.0
%global optflags %(echo %{optflags} | sed 's/-g /-g1 /')
%endif
# JIT is broken on ARM systems with new ARMv8.5 BTI extension at the moment
# Cf. https://bugzilla.redhat.com/show_bug.cgi?id=2130009
# Cf. https://bugs.webkit.org/show_bug.cgi?id=245697
# Disable BTI until this is fixed upstream.
%ifarch aarch64
%global optflags %(echo %{optflags} | sed 's/-mbranch-protection=standard /-mbranch-protection=pac-ret /')
%endif
%define _vpath_builddir %{_vendor}-%{_target_os}-build/webkitgtk-6.0
%cmake \
-GNinja \
@ -339,18 +347,6 @@ files for developing applications that use JavaScript engine from webkit2gtk-4.0
%ifarch aarch64
-DUSE_64KB_PAGE_BLOCK=ON \
%endif
%endif
%if "%{vendor}" == "Fedora Copr - group @asahi"
%dnl JIT is broken with BTI on Apple ARM systems at the moment
%dnl Cf. https://bugzilla.redhat.com/show_bug.cgi?id=2130009
%dnl Cf. https://bugs.webkit.org/show_bug.cgi?id=245697
%dnl Disable until this is fixed upstream.
%dnl Yes, this means performance is going to suck... :'(
%ifarch aarch64
-DENABLE_JIT=OFF \
-DENABLE_C_LOOP=ON \
-DENABLE_SAMPLING_PROFILER=OFF \
%endif
%endif
%{nil}
@ -370,18 +366,6 @@ files for developing applications that use JavaScript engine from webkit2gtk-4.0
%ifarch aarch64
-DUSE_64KB_PAGE_BLOCK=ON \
%endif
%endif
%if "%{vendor}" == "Fedora Copr - group @asahi"
%dnl JIT is broken with BTI on Apple ARM systems at the moment
%dnl Cf. https://bugzilla.redhat.com/show_bug.cgi?id=2130009
%dnl Cf. https://bugs.webkit.org/show_bug.cgi?id=245697
%dnl Disable until this is fixed upstream.
%dnl Yes, this means performance is going to suck... :'(
%ifarch aarch64
-DENABLE_JIT=OFF \
-DENABLE_C_LOOP=ON \
-DENABLE_SAMPLING_PROFILER=OFF \
%endif
%endif
%{nil}
@ -402,18 +386,6 @@ files for developing applications that use JavaScript engine from webkit2gtk-4.0
%ifarch aarch64
-DUSE_64KB_PAGE_BLOCK=ON \
%endif
%endif
%if "%{vendor}" == "Fedora Copr - group @asahi"
%dnl JIT is broken with BTI on Apple ARM systems at the moment
%dnl Cf. https://bugzilla.redhat.com/show_bug.cgi?id=2130009
%dnl Cf. https://bugs.webkit.org/show_bug.cgi?id=245697
%dnl Disable until this is fixed upstream.
%dnl Yes, this means performance is going to suck... :'(
%ifarch aarch64
-DENABLE_JIT=OFF \
-DENABLE_C_LOOP=ON \
-DENABLE_SAMPLING_PROFILER=OFF \
%endif
%endif
%{nil}