An interpreter of object-oriented scripting language
Go to file
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
.gitignore Upgrade to Ruby 3.0.0. 2021-01-04 16:42:55 +01:00
libruby.stp Add TapSet for Ruby. 2013-02-22 14:17:04 +01:00
macros.ruby Add %{ruby_default_filter} macro. 2013-04-30 14:42:13 +02:00
macros.rubygems Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
operating_system.rb Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
ruby-2.1.0-always-use-i386.patch Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
ruby-2.1.0-custom-rubygems-location.patch Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
ruby-2.1.0-Enable-configuration-of-archlibdir.patch Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
ruby-2.3.0-ruby_version.patch Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
ruby-2.7.0-Initialize-ABRT-hook.patch Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
ruby-3.3.0-Disable-syntax-suggest-test-case.patch Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
ruby-3.3.0-Revert-Optimize-allocations-in-Hash-compare_by_identity.patch Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
ruby-3.4.0-fix-branch-protection-compilation-for-arm.patch Fix compiling coroutines with aarch64's branch protection. 2024-01-15 16:38:51 +01:00
ruby-3.4.0-ruby-net-http-Renew-test-certificates.patch Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
ruby-exercise.stp Add missing ruby-exercise.stp file. 2013-02-22 14:17:53 +01:00
ruby.rpmlintrc Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
ruby.spec Fix compiling coroutines with aarch64's branch protection. 2024-01-15 16:38:51 +01:00
rubygems.attr Add conflicts RPM generator. 2018-02-13 13:50:15 +01:00
rubygems.con Add conflicts RPM generator. 2018-02-13 13:50:15 +01:00
rubygems.prov Upgrade to Ruby 2.6.0. 2019-01-17 08:31:01 +01:00
rubygems.req Extract composition of dependecy strings into helper. 2019-01-24 10:38:43 +01:00
sources Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
test_abrt.rb Move the ABRT hook test into separate file. 2015-12-13 19:36:58 +01:00
test_openssl_fips.rb Fix OpenSSL.fips_mode and OpenSSL::PKey.read in OpenSSL 3 FIPS. 2023-09-22 12:54:53 +02:00
test_systemtap.rb Upgrade to Ruby 2.4.0. 2017-01-09 15:58:21 +01:00