Jarek Prokop 308b2c0ab2 Fix compiling coroutines with aarch64's branch protection.
Armv8.3+ capable CPUs might segfault with incorrect compilation options.
See related upstream report: https://bugs.ruby-lang.org/issues/20085

We have hit this on COPR which uses [0] c7g.xlarge AWS flavor for aarch64
architecture builds. This machine flavor seems to fall into the ARMv8.3+
range.

Fedora CFLAGS come with `-mbranch-protection=standard` which means that
both BTI and the PAC protections are used. The option is equivalent
to `-mbranch-protection=pac-ret+bti`.

However, since the upstream configure.ac automatically appends
`-mbranch-protection=pac-ret`, the BTI protection is not used
as the last used option seems to overwrite [1] the Fedora
default for this.

To resolve both of these issues, of BTI being skipped and the potential
segfaults a patch is applied.

To fix segfaults an upstream patch was applied [2].

To fix the issue of overridden option I have patched the
configure.ac file to check for the `=standard` first when searching for a usable
`-mbranch-protection` option.

The overriding of our options was reported upstream:
<https://bugs.ruby-lang.org/issues/20154>
In the same issue I provided the extension of compilation option as an
attachment, to showcase a workaround that fixes the situation in Fedora.

[0] <https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/Y4GPCGQAZT2LJ5CE7MTIEFKGAPP6O2DW/>
[1] <https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/QWLEBS4YQH73HJNNLKCCGIIOU3SSXAYK/>
[2] <02973b78f4>
2024-01-15 16:38:51 +01:00
2021-01-04 16:42:55 +01:00
2013-02-22 14:17:04 +01:00
2013-04-30 14:42:13 +02:00
2024-01-02 18:52:33 +01:00
2024-01-02 18:52:33 +01:00
2024-01-02 18:52:33 +01:00
2018-02-13 13:50:15 +01:00
2018-02-13 13:50:15 +01:00
2019-01-17 08:31:01 +01:00
2024-01-02 18:52:33 +01:00
2017-01-09 15:58:21 +01:00
Description
Languages
RPM Spec 60.1%
Diff 32.7%
Ruby 7.2%