Commit graph

690 commits

Author SHA1 Message Date
Jarek Prokop
c670682a97 Upgrade to Ruby 4.0.0.
* Define different expected archives macros for development.

When revision was defined, there was also timestamp appended.
That does not seem necessary for preview tarballs from upstream.

Instead split it into their own separate conditionals.

* irb and rdoc are now a bundled gem
Don't ship the %ruby_libdir parts and the symlinking for irb and rdoc.
The rdoc rubygems plugin should now be correctly present. Remove the
additional source.

* Multiple gems are now bundled gems.
Add them to ruby-bundled-gems subpackage instead of their own separate
packages.

* Split the rdoc support for ruby version directory from
  ruby-2.3.0-ruby_version.patch.
After Ruby moved RDoc to bundled gems from default gems, the directory
in which RDoc is in the upstream tarball is not in the upstream source,
necessitating a patch split for the Ruby version patch.
It cannot be fully re-created including the rdoc part in a single patch
with upstream ruby/ruby github.

Instead the part is created from ruby/rdoc github.

Add bundled provides for rubygem-json + the source into comments.
Source is as described in upstream commits and in the LEGAL file
upstream. Add the respective licenses for the subpackage.

RDoc includes a new doc generator that is under the MIT license,
update the license to reflect it.

Resolves: rhbz#2425358
2026-01-07 18:01:48 +01:00
Vít Ondruch
4034e3e02c Update to Ruby 3.4.8.
Resolves: rhbz#2422963
Resolves: rhbz#2412227
2025-12-17 12:44:52 +01:00
Jun Aruga
9dc850b911 Fix REXML denial of service.
Upgrade to rexml gem 3.4.4.
https://www.ruby-lang.org/en/news/2025/09/18/dos-rexml-cve-2025-58767/

Resolves: CVE-2025-58767
2025-10-23 18:24:32 +01:00
Jun Aruga
6b81f1b80f Upgrade to Ruby 3.4.7.
- Fix URI Credential Leakage Bypass previous fixes.

Resolves: rhbz#2402422
Resolves: CVE-2025-61594
2025-10-23 17:29:51 +01:00
Jarek Prokop
aa9dd7be5f Enable parallel 'make check'.
Use a build condition to turn the parallelization on and off when
needed. The output is slightly different from the previous approach.
The way results are collected and displayed remains the same.

This allows us to scale down build time on multiple cores better.

Chose to introduce a bcond explicitly for tests for debugging purposes.
Running tests in parallel could hide issues that would show if
everything was done in a single test-unit process.
Limiting the number of cores available to RPM via a macro would also
hinder parallelization of the compilation, which might not be desired
in the case of only wanting to serializing the tests.

Table from the associated ticket:
The time represents total seconds that a full RPM build inside mock
took from start to finish.

PARALLEL TESTS
------------------------------------------------------------------------
Cores        |   Runs |    Avg (s) |    Min (s) |    Max (s) | Speedup
------------------------------------------------------------------------
2_core       |      5 |     3196.0 |     3175.0 |     3218.0 |   1.00x
4_core       |      5 |     3166.6 |     2949.0 |     3598.0 |   1.01x
8_core       |      5 |     1129.2 |     1090.0 |     1257.0 |   2.83x
16_core      |      5 |      807.4 |      794.0 |      820.0 |   3.96x

SEQUENTIAL TESTS
------------------------------------------------------------------------
Cores        |   Runs |    Avg (s) |    Min (s) |    Max (s) | Speedup
------------------------------------------------------------------------
2_core       |      5 |     3749.6 |     3728.0 |     3772.0 |   1.00x
4_core       |      5 |     3368.8 |     3128.0 |     3539.0 |   1.11x
8_core       |      5 |     1810.6 |     1764.0 |     1912.0 |   2.07x
16_core      |      5 |     1612.8 |     1571.0 |     1646.0 |   2.32x

PARALLEL vs SEQUENTIAL COMPARISON
-------------------------------------------------------------------------
Cores        |  Sequential Avg |    Parallel Avg |   Difference
-------------------------------------------------------------------------
2_core       |       3749.6 s |         3196.0 s |      +17.3%
4_core       |       3368.8 s |         3166.6 s |       +6.4%
8_core       |       1810.6 s |         1129.2 s |      +60.3%
16_core      |       1612.8 s |          807.4 s |      +99.8%

Resolves: rhbz#2401230
2025-10-15 15:38:03 +02:00
Vít Ondruch
97eeae3d75 Update IETF license information after legal review
https://gitlab.com/fedora/legal/fedora-license-data/-/issues/506
2025-10-06 09:55:45 +02:00
Vít Ondruch
f50637ef39 Add missing bundled tsort provide. 2025-10-06 09:55:45 +02:00
Jarek Prokop
84309be01e Rebase versions of bundled libraries.
Add `## BUNDLED_GEMS_VERSIONS` and the symmetric
`## BUNDLED_GEMS_VERSIONS_END` for a script from ferut
'bundled_lib_versions.rb'. These tags are used to easily tell the
beginning and end of the section we can and want to edit by the
automation.

Remove duplicate syslog entry.

Move out default gemified libraries out into their place
into either the bundled gems section or the default gems section.
Reducing special cases helps lower complexity and length of the script.

In this case, there does not seem a big case to have these gems
specially handled in this section.

Properly sort sections alphabetically using the ruby's `Array#sort`
method.
2025-08-18 17:45:03 +02:00
Jarek Prokop
563fb688b3 Upgrade to Ruby 3.4.5.
Resolves: rhbz#2380246
2025-08-18 17:23:34 +02:00
Fedora Release Engineering
1aeb02030c Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-25 12:11:35 +00:00
Jarek Prokop
43d2363c1e Upgrade to ruby 3.4.4.
Resolves: rhbz#2359563
2025-06-13 12:41:51 +02:00
Jun Aruga
e7395a7d22 Fix the tests using SHA-1 Probabilistic Signature Scheme (PSS) parameters.
Fedora OpenSSL 3.5 on rawhide stopped accepting SHA-1 PSS[1] parameters.
This is different from the SHA-1 signatures which Fedora OpenSSL stopped
accepting since Fedora 41.[2]

This commit fixes the following test failures related to the SHA-1 PSS
parameters with Fedora OpenSSL 3.5.
Note these failures are the downstream Fedora OpenSSL RPM specific.

```
184) Error:
OpenSSL::TestPKeyRSA#test_sign_verify_options:
OpenSSL::PKey::PKeyError: EVP_PKEY_CTX_ctrl_str(ctx, "rsa_mgf1_md", "SHA1"): digest not allowed (digest=SHA1)
    /builddir/build/BUILD/ruby-3.4.2-build/ruby-3.4.2/test/openssl/test_pkey_rsa.rb:113:in 'Hash#each'
    /builddir/build/BUILD/ruby-3.4.2-build/ruby-3.4.2/test/openssl/test_pkey_rsa.rb:113:in 'OpenSSL::PKey::PKey#sign'
    /builddir/build/BUILD/ruby-3.4.2-build/ruby-3.4.2/test/openssl/test_pkey_rsa.rb:113:in 'OpenSSL::TestPKeyRSA#test_sign_verify_options'
185) Error:
OpenSSL::TestPKeyRSA#test_sign_verify_pss:
OpenSSL::PKey::RSAError: digest not allowed (digest=SHA1)
    /builddir/build/BUILD/ruby-3.4.2-build/ruby-3.4.2/test/openssl/test_pkey_rsa.rb:191:in 'OpenSSL::PKey::RSA#sign_pss'
    /builddir/build/BUILD/ruby-3.4.2-build/ruby-3.4.2/test/openssl/test_pkey_rsa.rb:191:in 'OpenSSL::TestPKeyRSA#test_sign_verify_pss'
Finished tests in 1152.595208s, 27.9812 tests/s, 5697.0278 assertions/s.
32251 tests, 6566367 assertions, 0 failures, 2 errors, 183 skips
```

According to a maintainer of the rpms/openssl, Dmitry Belyavskiy
<dbelyavs@redhat.com>, the following patch is disabling SHA-1 PSS parameters.
5f41d6a8f5/f/0018-RH-Allow-disabling-of-SHA1-signatures.patch

Resolves: rhbz#2358256
2025-04-08 18:36:18 +02:00
Vít Ondruch
a38fdce3da Upgrade to Ruby 3.4.2.
Resolves: rhbz#2345875
2025-02-19 12:28:44 +01:00
Björn Esser
da900b8789
Add explicit BR: libxcrypt-devel
Signed-off-by: Björn Esser <besser82@fedoraproject.org>
2025-02-01 19:57:15 +01:00
Jarek Prokop
3541190791 Stop including <cstdbool> C++ header, it is deprecated since C++17.
The header is useless in C++ and it is throwing a warning when it is
being included since GCC 15. libdnf5 uses -Werror which turns the
warning into an error making it fail to build.

Delete the include in ruby sources to allow such libraries to build
again with Ruby.

https://bugs.ruby-lang.org/issues/21024
https://github.com/ruby/ruby/pull/12628

Resolves: rhbz#2336567
2025-01-24 15:38:06 +01:00
Fedora Release Engineering
7262ed4066 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-18 22:53:00 +00:00
Vít Ondruch
e3690ac430 Revert "Temporary disable FIPS OpenSSL test cases."
This reverts commit 5f10b7c93e.

Related: rhbz#2335414
2025-01-08 17:23:17 +01:00
Vít Ondruch
5f10b7c93e Temporary disable FIPS OpenSSL test cases.
These seems to be cause by OpenSSL being broken by change in debugedit:

https://bugzilla.redhat.com/show_bug.cgi?id=2335414
2025-01-07 12:44:03 +01:00
Vít Ondruch
74a9a07c69 Fix gem install to generate documentation 2025-01-07 12:43:07 +01:00
Vít Ondruch
7b420c76e8 Upgrade to Ruby 3.4.1.
Resolves: rhbz#2334047
2025-01-07 12:43:03 +01:00
Vít Ondruch
4ccd95e387 Include ruby-{default,bundled}-gems in ruby by default.
When installing `ruby` package, Users are expecting to have those
available, because that is what upstream does.
2025-01-07 10:14:37 +01:00
Jun Aruga
da4a9f4b88 Fix Ruby OpenSSL to respect crypto-policies TLS minimal version.
This issue was identified at the ticket RHEL-21019.
https://issues.redhat.com/browse/RHEL-21019
2024-12-16 17:16:12 +01:00
David Abdurachmanov
186be743be Add riscv64 information for checksec 2024-11-22 12:24:21 +08:00
Vít Ondruch
19423ee8d9 Fix version in changelog 2024-11-19 17:46:34 +01:00
Vít Ondruch
f241947e6c Upgrade to Ruby 3.3.6. 2024-11-12 00:33:53 +01:00
Vít Ondruch
8daf7ccb72 Fix Bundler --local option
Resolves: rhbz#2311898
2024-09-13 16:33:48 +02:00
Vít Ondruch
b7e197fb88 Upgrade to Ruby 3.3.5.
Resolves: rhbz#2309364
2024-09-03 15:19:20 +02:00
Mikolaj Izdebski
6bed1e3bd5 Generate RPM dependencies with RPM 4.20 API
Use new RPM 4.20 API to generate RPM dependencies instead of relying
on rpm-local-generator-support.

See: https://rpm-software-management.github.io/rpm/manual/dependency_generators.html#using-file-attributes-in-their-own-package
2024-08-22 15:34:03 +00:00
Jarek Prokop
2e6762df8d Test RPM dependency generators for rubygems.
Add tests for RPM dependency generators that execute during build.
The tests make use of methods available in tools present in the
upstream ruby tar archive to find and set up the ruby executable.
This is then used to execute the dependency generator script with
a given test input passed into the subprocess and collect the output
given out by the generator for testing.

Skip "test_generator_on_gem_with_multiple_conflict_constraints" for
now. rubygems.req is currently only capable of filtering out a single
conflict requirement that is specified on a given dependency.

Execute it in the %check section before the long-running
Ruby test suite starts. If testing the generators fails it means there
is the possibility of generating bogus requires,
which is a valuable information to get sooner rather than later.
2024-08-22 13:06:15 +00:00
Vít Ondruch
f11fa48d8f Revert "Remove systemtap-sdt-dtrace dependency including dtrace command."
This reverts commit 0d81c8b95a. As it
turns out, both requires are needed after \[[1]\].

[1]: https://src.fedoraproject.org/rpms/systemtap/pull-request/30
2024-08-21 10:05:37 +02:00
Vít Ondruch
bd711c9036 Use newly introduced Ruby-pty license identifier 2024-08-08 14:21:53 +00:00
Jun Aruga
0d81c8b95a Remove systemtap-sdt-dtrace dependency including dtrace command.
This commit is an improvement for the past commit
<d03ac3403a>.
According to the following part at the commit[1] on systemtap rawhide,
systemtap-sdt-devel RPM requires systemtap-sdt-dtrace RPM including the
`dtrace` command. We can remove the systemtap-sdt-dtrace build dependency.

```
%package sdt-devel
...
Requires: systemtap-sdt-dtrace = %{version}-%{release}
```

[1] https://src.fedoraproject.org/rpms/systemtap/c/93948388bc54cd7a4efb1806d9787291d26b33d6?branch=rawhide
2024-08-01 10:49:29 +02:00
Lumir Balhar
d03ac3403a Add systemtap-sdt-devel to build Ruby with systemtap sdt header files.
Add systemtap-sdt-devel as BuildRequires to build Ruby with systemtap sdt header
files.

The commit[1] on systemtap rawhide by the change[2] on
systemtap-5.2~pre17206355g1a07290a-2.fc41 or later versions caused the
following error in the `test_systemtap.rb`.

Because the `readelf -S "#{LIBRUBY_SO}"` in the `test_systemtap.rb` failed to
find the systemtap section headers in the `libruby.so` file.

We relied on the `BuildRequires: %{_bindir}/dtrace` BuildRequires to bring in
all required files for systemtap support. However, after the change[1] that the
systemtap package was split, now we need to require systemtap sdt header files
on top of the dtrace executable to build Ruby with systemtap support to fix the
error.

```
+ make -C redhat-linux-build runruby TESTRUN_SCRIPT=/builddir/build/SOURCES/test_systemtap.rb
make: Entering directory '/builddir/build/BUILD/ruby-3.3.4-build/ruby-3.3.4/redhat-linux-build'
RUBY_ON_BUG='gdb -x /builddir/build/BUILD/ruby-3.3.4-build/ruby-3.3.4/.gdbinit -p' ./miniruby -I/builddir/build/BUILD/ruby-3.3.4-build/ruby-3.3.4/lib -I. -I.ext/common  /builddir/build/BUILD/ruby-3.3.4-build/ruby-3.3.4/tool/runruby.rb --extout=.ext  -- --disable-gems  /builddir/build/SOURCES/test_systemtap.rb
ERROR: SystemTap (DTrace) headers were not detected in resulting library.
```

Co-authored-by: Lumír Balhar <lbalhar@redhat.com>

[1] https://src.fedoraproject.org/rpms/systemtap/c/93948388bc54cd7a4efb1806d9787291d26b33d6?branch=rawhide
[2] https://fedoraproject.org/wiki/Changes/Separate_dtrace_package
2024-07-30 11:32:46 +02:00
Fedora Release Engineering
55661b64e9 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-19 18:58:13 +00:00
Vít Ondruch
ca13a51589 Upgrade to Ruby 3.3.4.
Resolves: rhbz#2292052
2024-07-10 11:17:20 +02:00
Vít Ondruch
7724c2d703 Make sure hardening configuration flags are correctly applied.
Previously, upstream flags were overriding our configuration flags,
therefore we had two workarounds in place. This commit replaces these
workarounds by upstream solution. While it should not result in any
functional changes, it is be better to have this patch in place to make
easier to spot when it is not needed anymore.
2024-06-18 12:56:21 +02:00
Vít Ondruch
42b0e43e5a Fix generators for RPM 4.20 compatibility
RPM 4.20 introduce per-build directory. However, this also brings some
issues where `%{_builddir}` might have different value in different
context, leading to issues such as:

~~~
Processing files: ruby-default-gems-3.3.1-8.fc41.noarch
make: *** /builddir/build/BUILD/ruby-3.3.1/redhat-linux-build: No such file or directory.  Stop.
~~~

Therefore the generators are not executed properly. Use `%define`
instead of `%global`, because those are laze evaluated and actually
suggested by RPM upstream:

https://github.com/rpm-software-management/rpm/issues/3151
2024-06-07 12:25:48 +02:00
Vít Ondruch
c913e4326c Drop patch which was needed for alexandria
It seems it build just fine now.
2024-06-06 19:13:11 +02:00
Vít Ondruch
93638d9e58 Upgrade to Ruby 3.3.2.
Resolves: rhbz#2284020
2024-06-06 16:07:59 +02:00
Vít Ondruch
677893973e Make sure fortification flags are applied
This is example of current build options:

~~~
gcc -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fPIC -m64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT -I. -I.ext/include/x86_64-linux -I/builddir/build/BUILD/ruby-3.3.1-build/ruby-3.3.1/include -I/builddir/build/BUILD/ruby-3.3.1-build/ruby-3.3.1 -I/builddir/build/BUILD/ruby-3.3.1-build/ruby-3.3.1/prism -I/builddir/build/BUILD/ruby-3.3.1-build/ruby-3.3.1/enc/unicode/15.0.0      -o dmyext.o -c /builddir/build/BUILD/ruby-3.3.1-build/ruby-3.3.1/dmyext.c
~~~

Please note that there are included Fedora options:

~~~
-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3
~~~

as well as upstream options:

~~~
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
~~~

The problem is that the configure script cannot properly detect
`_FORTIFY_SOURCE=3` and instead of replacing that option, it includes
new definition \[[1]\]. This happens since Fedora started to use
`_FORTIFY_SOURCE=3` option. To mitigate this issue, upstream
fortification was disabled (this might or might not stay disabled
"forever").

These are the build options with this change applied for comparison:

~~~
gcc -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fPIC -m64 -fstack-protector-strong -fno-strict-overflow -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT -I. -I.ext/include/x86_64-linux -I/builddir/build/BUILD/ruby-3.3.1-build/ruby-3.3.1/include -I/builddir/build/BUILD/ruby-3.3.1-build/ruby-3.3.1 -I/builddir/build/BUILD/ruby-3.3.1-build/ruby-3.3.1/prism -I/builddir/build/BUILD/ruby-3.3.1-build/ruby-3.3.1/enc/unicode/15.0.0      -o dmyext.o -c /builddir/build/BUILD/ruby-3.3.1-build/ruby-3.3.1/dmyext.c
~~~

[1]: https://bugs.ruby-lang.org/issues/20520
2024-06-05 16:29:24 +02:00
Vít Ondruch
d9051618e3 Adjust the test to updated checksec output.
`checksec` output since v2.7.0 become more nuanced. Previously, the
`FORTIFY` could become just `Yes` / `No`. Now it can have also `Partial`
state, which better describe our situation.

Currently if e.g. `Fortifiable=28` and `Fortified=11`, that means that the
fortification is just partial and another 17 functions could be
fortified.

Also, check the numbers specifically, because this seems to be the
interesting information. Unfortunatelly, the results differ between
platforms.

Last but not least, use `sed` to analyze the output, because this allows to
always display the processed text. The trick comes from \[[1]\].

On top of this, use XML formatted output, which provides more context to
reader.

[1]: https://unix.stackexchange.com/questions/366/convince-grep-to-output-all-lines-not-just-those-with-matches

Resolves: rhbz#2282953
2024-06-05 09:45:17 +02:00
Vít Ondruch
c649282efb Upgrade to Ruby 3.3.1. 2024-04-24 12:31:33 +02:00
Vít Ondruch
4ff7de7007 License review and clarification 2024-04-12 17:28:42 +02:00
Vít Ondruch
5da6a15c57 Ruby bundled NKF, add appropriate bundled provide and test 2024-04-12 17:26:16 +02:00
Vít Ondruch
a34f33bc50 Fix FTBFS caused by OpenSSL 3.2.1 update. 2024-03-06 15:14:30 +01:00
Vít Ondruch
3008410463 Merge #169 Use gem macros for rubygem-rbs subpackage. 2024-01-26 15:04:52 +00:00
Vít Ondruch
ac77c2a354 Use gem macros for rubygem-rbs subpackage.
This were apparenlyt overlooked previously.
2024-01-26 14:16:50 +01:00
Jarek Prokop
aa7e8debee Revert adding AI_ADDRCONFIG flag to getaddrinfo(3) calls.
It is causing problems when network is in certain, valid, configuration.
The point of it is to workaround a glibc bug that is not present for us.
https://bugs.ruby-lang.org/issues/20208

To reproduce, have IPv6 enabled localhost but only IPv4
interfaces (such as eth0, name and count of them may vary based on system)
to disable public interfaces via sysctl:
`$ sysctl "net.ipv6.conf.<interface>.disable_ipv6=1"`
Where <interface> is NOT lo but can be eth0 or other.

Confirm with command `$ ip addr` command that only `lo`
interface has IPv6 address.

and run the following with Ruby 3.3:
~~~
$ ruby -rnet/http -e 'http = Net::HTTP.new("localhost", 8080); http.local_host = Addrinfo.tcp("localhost", 8080).ip_address; p http.get("/")'
~~~
The error is then related to EAFNOSUPPORT:
```
Errno::EAFNOSUPPORT: Failed to open TCP connection to localhost:37337 (Address family not supported by protocol - bind(2) for "::1" port 45395)
```

running above Ruby command with `strace` suggest that
there is an attempt to bind with AF_INET6
using an AF_INET socket, however, only if the reproducer above
attempts to set the `http.local_host` with Addrinfo.

From upstream issue #20208:
"This is calling getaddrinfo to resolve "localhost" for us to use
it as the local side of the connection. Because Ruby does not know
what you intend to do with this IP address, it does not make the request
with AI_ADDRCONFIG. Thus, you get an IPv6 result returned,
since there is an IPv6 addres for localhost!"
2024-01-26 13:54:20 +01:00
Fedora Release Engineering
066e0a3d6d Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-22 12:17:40 +00:00
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