diff --git a/ruby-2.7.1-disable-riscv64-clocks.patch b/ruby-2.7.1-disable-riscv64-clocks.patch new file mode 100644 index 0000000..88e925b --- /dev/null +++ b/ruby-2.7.1-disable-riscv64-clocks.patch @@ -0,0 +1,13 @@ +diff --git a/spec/ruby/core/process/fixtures/clocks.rb b/spec/ruby/core/process/fixtures/clocks.rb +index 7537cfa..c4c647a 100644 +--- a/spec/ruby/core/process/fixtures/clocks.rb ++++ b/spec/ruby/core/process/fixtures/clocks.rb +@@ -34,7 +34,7 @@ module ProcessSpecs + end + + # These clocks in practice on ARM on Linux do not seem to match their reported resolution. +- platform_is :armv7, :armv8, :aarch64 do ++ platform_is :armv7, :armv8, :aarch64, :riscv64 do + clocks = clocks.reject { |clock, value| + [:CLOCK_PROCESS_CPUTIME_ID, :CLOCK_THREAD_CPUTIME_ID, :CLOCK_MONOTONIC_RAW].include?(clock) + } diff --git a/ruby.spec b/ruby.spec index 10c1030..cd91a64 100644 --- a/ruby.spec +++ b/ruby.spec @@ -162,6 +162,11 @@ Patch22: ruby-2.6.0-config-support-include-directive.patch # Disable pthread assert on Linux RISC-V (riscv64) Patch30: abe2e7de4d1f2d5861d7c9ab9c7e778f2ee1dcd2.patch +# Same as for ARM. +# See: https://bugs.ruby-lang.org/issues/16007 +# https://github.com/ruby/ruby/commit/324dd9d01f0c97631a2588f63231bcb651844cca +Patch31: ruby-2.7.1-disable-riscv64-clocks.patch + Requires: %{name}-libs%{?_isa} = %{version}-%{release} Suggests: rubypick Recommends: ruby(rubygems) >= %{rubygems_version} @@ -574,6 +579,7 @@ rm -rf ext/fiddle/libffi* %ifarch riscv64 %patch30 -p1 +%patch31 -p1 %endif # Provide an example of usage of the tapset: