Go to file
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
.gitignore
libruby.stp
macros.ruby
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.1. 2024-04-24 12:31:33 +02:00
ruby-2.1.0-custom-rubygems-location.patch Upgrade to Ruby 3.3.1. 2024-04-24 12:31:33 +02:00
ruby-2.1.0-Enable-configuration-of-archlibdir.patch Upgrade to Ruby 3.3.1. 2024-04-24 12:31:33 +02:00
ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch Upgrade to Ruby 3.3.1. 2024-04-24 12:31:33 +02:00
ruby-2.3.0-ruby_version.patch Upgrade to Ruby 3.3.1. 2024-04-24 12:31:33 +02: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.1. 2024-04-24 12:31:33 +02:00
ruby-3.4.0-fix-branch-protection-compilation-for-arm.patch Upgrade to Ruby 3.3.1. 2024-04-24 12:31:33 +02:00
ruby-3.4.0-Fix-pointer-incompatiblity.patch Fix patch to apply cleanly. 2024-04-24 17:35:38 +02:00
ruby-exercise.stp
ruby.rpmlintrc Upgrade to Ruby 3.3.0. 2024-01-02 18:52:33 +01:00
ruby.spec Make sure fortification flags are applied 2024-06-05 16:29:24 +02:00
rubygems.attr
rubygems.con
rubygems.prov
rubygems.req
sources Upgrade to Ruby 3.3.1. 2024-04-24 12:31:33 +02:00
test_abrt.rb
test_openssl_fips.rb
test_systemtap.rb