Compare commits

...

10 Commits

Author SHA1 Message Date
3e5b20e2a9
Disable clocks on riscv64
https://bugs.ruby-lang.org/issues/16007
324dd9d01f

1)
Process.clock_getres matches the clock in practice for Process::CLOCK_PROCESS_CPUTIME_ID FAILED
Expected 10000 == 10000
to be falsy but was true
/builddir/build/BUILD/ruby-2.7.1/spec/ruby/core/process/clock_getres_spec.rb:27:in `block (4 levels) in <top (required)>'
/builddir/build/BUILD/ruby-2.7.1/spec/ruby/core/process/clock_getres_spec.rb:4:in `<top (required)>'
2)
Process.clock_getres matches the clock in practice for Process::CLOCK_THREAD_CPUTIME_ID FAILED
Expected 10000 == 10000
to be falsy but was true
/builddir/build/BUILD/ruby-2.7.1/spec/ruby/core/process/clock_getres_spec.rb:27:in `block (4 levels) in <top (required)>'
/builddir/build/BUILD/ruby-2.7.1/spec/ruby/core/process/clock_getres_spec.rb:4:in `<top (required)>'
Finished in 2010.323383 seconds
3746 files, 30427 examples, 111183 expectations, 2 failures, 0 errors, 3 tagged
make: *** [uncommon.mk:823: yes-test-spec] Error 1

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2020-05-02 22:24:17 +03:00
120ff99bc9
Disable more tests on riscv64
These tests time out on QEMU VM:

  1) Error:
Racc::TestRaccCommand#test_cast:
Timeout::Error: execution of assert_ruby_status expired timeout (10 sec)
pid 127860 killed by SIGTERM (signal 15)
|
    /builddir/build/BUILD/ruby-2.7.1/test/racc/helper.rb:108:in `ruby'
    /builddir/build/BUILD/ruby-2.7.1/test/racc/helper.rb:104:in `racc'
    /builddir/build/BUILD/ruby-2.7.1/test/racc/helper.rb:57:in `assert_compile'
    /builddir/build/BUILD/ruby-2.7.1/test/racc/test_racc_command.rb:269:in `test_cast'
  2) Error:
Racc::TestRaccCommand#test_riml:
Timeout::Error: execution of assert_ruby_status expired timeout (10 sec)
pid 127914 killed by SIGTERM (signal 15)
|
    /builddir/build/BUILD/ruby-2.7.1/test/racc/helper.rb:108:in `ruby'
    /builddir/build/BUILD/ruby-2.7.1/test/racc/helper.rb:104:in `racc'
    /builddir/build/BUILD/ruby-2.7.1/test/racc/helper.rb:57:in `assert_compile'
    /builddir/build/BUILD/ruby-2.7.1/test/racc/test_racc_command.rb:245:in `test_riml'
  3) Error:
TestBugReporter#test_bug_reporter_add:
Timeout::Error: execution of assert_in_out_err expired timeout (30 sec)
pid 128134 killed by SIGKILL (signal 9)
|
| -:1: [BUG] Segmentation fault at 0x000003db0001f486
| ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [riscv64-linux]
|
| -- Control frame information -----------------------------------------------
| c:0003 p:---- s:0012 e:000011 CFUNC  :kill
| c:0002 p:0021 s:0006 e:000005 EVAL   -:1 [FINISH]
| c:0001 p:0000 s:0003 E:001570 (none) [FINISH]
|
| -- Ruby level backtrace information ----------------------------------------
| -:1:in `<main>'
| -:1:in `kill'
|
| -- C level backtrace information -------------------------------------------

    /builddir/build/BUILD/ruby-2.7.1/test/-ext-/bug_reporter/test_bug_reporter.rb:22:in `test_bug_reporter_add'
  4) Error:
TestFiber#test_many_fibers_with_threads:
Timeout::Error: execution of assert_normal_exit expired timeout (60 sec)
pid 128358 killed by SIGKILL (signal 9)
|
    /builddir/build/BUILD/ruby-2.7.1/test/ruby/test_fiber.rb:53:in `test_many_fibers_with_threads'
  5) Error:
TestRubyOptions#test_segv_test:
Timeout::Error: execution of assert_in_out_err expired timeout (10 sec)
pid 134299 killed by SIGKILL (signal 9)
|
| -e:1: [BUG] Segmentation fault at 0x000003db00020c9b
| ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [riscv64-linux]
|
| -- Control frame information -----------------------------------------------
| c:0003 p:---- s:0012 e:000011 CFUNC  :kill
| c:0002 p:0015 s:0006 e:000005 EVAL   -e:1 [FINISH]
| c:0001 p:0000 s:0003 E:002170 (none) [FINISH]
|
| -- Ruby level backtrace information ----------------------------------------
| -e:1:in `<main>'
| -e:1:in `kill'
|

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2020-05-02 15:33:34 +03:00
03cb588be8
Disable failing tests on riscv64
[21014/21023] YAMLStoreTest#test_writing_inside_readonly_transaction_raises_error = 0.00 s
[21015/21023] YAMLStoreTest#test_yaml_store_files_are_accessed_as_binary_files = 2.52 s
  1) Failure:
TestJIT#test_compile_insn_once [/builddir/build/BUILD/ruby-2.7.1/test/ruby/test_jit.rb:495]:
Expected 1 times of JIT success, but succeeded 0 times.
script:
"""
p proc { /#{true}/o =~ "true" && $~.to_a }.call
"""
stderr:
"""
gcc: internal compiler error: Segmentation fault signal terminated program cc1
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Successful MJIT finish
"""
.
<1> expected but was
<0>.
  2) Error:
TestBugReporter#test_bug_reporter_add:
Timeout::Error: execution of assert_in_out_err expired timeout (10 sec)
pid 69062 killed by SIGKILL (signal 9)
|
| -:1: [BUG] Segmentation fault at 0x000003db00010dc6
| ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [riscv64-linux]
|
| -- Control frame information -----------------------------------------------
| c:0003 p:---- s:0012 e:000011 CFUNC  :kill
| c:0002 p:0021 s:0006 e:000005 EVAL   -:1 [FINISH]
| c:0001 p:0000 s:0003 E:001c20 (none) [FINISH]
|
| -- Ruby level backtrace information ----------------------------------------
| -:1:in `<main>'
| -:1:in `kill'
|
| -- C level backtrace information -------------------------------------------
| Unknown extended opcode: 5 in /builddir/build/BUILD/ruby-2.7.1/ruby
| Unknown extended opcode: 5 in /builddir/build/BUILD/ruby-2.7.1/ruby
| Unknown extended opcode: 5 in /builddir/build/BUILD/ruby-2.7.1/ruby
| Unknown extended opcode: 5 in /builddir/build/BUILD/ruby-2.7.1/ruby
| Unknown extended opcode: 5 in /builddir/build/BUILD/ruby-2.7.1/ruby

[..]

    /builddir/build/BUILD/ruby-2.7.1/test/-ext-/bug_reporter/test_bug_reporter.rb:22:in `test_bug_reporter_add'
  3) Error:
TestRubyOptions#test_segv_loaded_features:
Timeout::Error: execution of assert_in_out_err expired timeout (10 sec)
pid 74892 killed by SIGABRT (signal 6) (core dumped)
|
| -e:1: [BUG] Segmentation fault at 0x000003db0001248c
| ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [riscv64-linux]
|
| -- Control frame information -----------------------------------------------
| c:0003 p:---- s:0012 e:000011 CFUNC  :kill
| c:0002 p:0016 s:0006 e:000005 BLOCK  -e:1 [FINISH]
| c:0001 p:0000 s:0003 E:000ee0 (none) [FINISH]
|
| -- Ruby level backtrace information ----------------------------------------
| -e:1:in `block in <main>'
| -e:1:in `kill'
|
| -- C level backtrace information -------------------------------------------
| Unknown extended opcode: 5 in /builddir/build/BUILD/ruby-2.7.1/ruby

[..]

    /builddir/build/BUILD/ruby-2.7.1/test/ruby/test_rubyoptions.rb:725:in `assert_segv'
    /builddir/build/BUILD/ruby-2.7.1/test/ruby/test_rubyoptions.rb:735:in `test_segv_loaded_features'
  4) Error:
TestRubyOptions#test_segv_setproctitle:
Timeout::Error: execution of assert_in_out_err expired timeout (10 sec)
pid 74904 killed by SIGABRT (signal 6) (core dumped)
|
| -e:1: [BUG] Segmentation fault at 0x000003db00012498
| ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [riscv64-linux]
|
| -- Control frame information -----------------------------------------------
| c:0003 p:---- s:0012 e:000011 CFUNC  :kill
| c:0002 p:0029 s:0006 e:000005 EVAL   -e:1 [FINISH]
| c:0001 p:0000 s:0003 E:002640 (none) [FINISH]
|
| -- Ruby level backtrace information ----------------------------------------
| -e:1:in `<main>'
| -e:1:in `kill'
|
| -- C level backtrace information -------------------------------------------
| Unknown extended opcode: 5 in /builddir/build/BUILD/ruby-2.7.1/ruby

[..]
    /builddir/build/BUILD/ruby-2.7.1/test/ruby/test_rubyoptions.rb:725:in `assert_segv'
    /builddir/build/BUILD/ruby-2.7.1/test/ruby/test_rubyoptions.rb:729:in `test_segv_test'
Finished tests in 4584.001316s, 4.5844 tests/s, 593.8157 assertions/s.
21015 tests, 2722052 assertions, 1 failures, 4 errors, 61 skips
ruby -v: ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [riscv64-linux]
RPM build errors:
make: *** [uncommon.mk:783: yes-test-all] Error 5

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2020-04-20 15:39:12 +03:00
98349071bc
Fix atomic detection for RISC-V (riscv64)
See:
abe2e7de4d
https://bugs.ruby-lang.org/issues/16800
https://bugs.ruby-lang.org/issues/16774

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2020-04-20 11:00:53 +03:00
f297a7ee61
Merge remote-tracking branch 'up/master' into master-riscv64
Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2020-04-20 10:58:19 +03:00
4a959b9846
Disable pthread assert for riscv
Let's see how far this can go in testing.

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2020-01-17 19:56:49 +02:00
4916a7212e
Merge commit '04b63f48ea89ff10fcffafe2ff3815dfa0e16e99' into master-riscv64
Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2020-01-17 19:35:32 +02:00
60baed04d5
Disable pthread on RISC-V (riscv64)
Until we can understand the build failure related to pthread thread
model it's better we disable it:

BUILDSTDERR: rb_mjiminiruby: thread_pthread.c:1995: rb_sigwait_fd_put: Assertion `old == th' failed.
BUILDSTDERR: make: *** [uncommon.mk:233: .ext/include/riscv64-linux/rb_mjit_min_header-2.6.3.h] Aborted (core dumped)

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2019-07-23 17:04:04 +03:00
d2b1e688a4
Merge remote-tracking branch 'up/master' into master-riscv64
Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2019-07-23 16:40:15 +03:00
0645d264b1
Rebuild for gdbm
Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
2018-07-24 09:35:33 +02:00
3 changed files with 81 additions and 2 deletions

View File

@ -0,0 +1,37 @@
From abe2e7de4d1f2d5861d7c9ab9c7e778f2ee1dcd2 Mon Sep 17 00:00:00 2001
From: Andreas Schwab <schwab@suse.de>
Date: Fri, 10 Apr 2020 15:34:52 +0200
Subject: [PATCH] Don't require sub-word atomics
On some architectures (like RISC-V) sub-word atomics are only available
when linking against -latomic, but the configure script doesn't do that,
causing the atomic checks to fail and the resulting ruby binary is
non-functional. Ruby does not use sub-word atomic operations, rb_atomic_t
is defined to unsigned int, so use unsigned int when checking for atomic
operations.
---
configure.ac | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 7c12b9e5fb94..ba86deffbebb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1498,7 +1498,7 @@ AS_IF([test "$GCC" = yes], [
])
AC_CACHE_CHECK([for __atomic builtins], [rb_cv_gcc_atomic_builtins], [
- AC_TRY_LINK([unsigned char atomic_var;],
+ AC_TRY_LINK([unsigned int atomic_var;],
[
__atomic_exchange_n(&atomic_var, 0, __ATOMIC_SEQ_CST);
__atomic_exchange_n(&atomic_var, 1, __ATOMIC_SEQ_CST);
@@ -1513,7 +1513,7 @@ AS_IF([test "$GCC" = yes], [
])
AC_CACHE_CHECK([for __sync builtins], [rb_cv_gcc_sync_builtins], [
- AC_TRY_LINK([unsigned char atomic_var;],
+ AC_TRY_LINK([unsigned int atomic_var;],
[
__sync_lock_test_and_set(&atomic_var, 0);
__sync_lock_test_and_set(&atomic_var, 1);

View File

@ -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)
}

View File

@ -23,7 +23,7 @@
%global release 130
%{!?release_string:%define release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}}
%{!?release_string:%define release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}.0.riscv64%{?dist}}
# The RubyGems library has to stay out of Ruby directory tree, since the
# RubyGems should be share by all Ruby implementations.
@ -159,6 +159,14 @@ Patch13: ruby-2.8.0-remove-unneeded-gem-require-for-ipaddr.patch
# https://github.com/ruby/openssl/pull/216
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}
@ -569,6 +577,11 @@ rm -rf ext/fiddle/libffi*
%patch13 -p1
%patch22 -p1
%ifarch riscv64
%patch30 -p1
%patch31 -p1
%endif
# Provide an example of usage of the tapset:
cp -a %{SOURCE3} .
@ -853,10 +866,23 @@ MSPECOPTS="$MSPECOPTS -P 'File.lchmod raises a NotImplementedError when called'"
# Increase timeout for TestBugReporter#test_bug_reporter_add test, which fails
# quite often.
# https://bugs.ruby-lang.org/issues/16492
%ifarch s390x
%ifarch s390x riscv64
sed -i '/assert_in_out_err/ s/)/, timeout: 30)/' test/-ext-/bug_reporter/test_bug_reporter.rb
%endif
%ifarch riscv64
# TestRubyOptions#test_segv_setproctitle: execution of assert_in_out_err expired timeout (10 sec)
# TestRubyOptions#test_segv_loaded_features: execution of assert_in_out_err expired timeout (10 sec)
# TestJIT#test_compile_insn_once: gcc: internal compiler error: Segmentation fault signal terminated program cc1
# The following timeout on QEMU:
# Racc::TestRaccCommand#test_cast: execution of assert_ruby_status expired timeout (10 sec)
# Racc::TestRaccCommand#test_riml: execution of assert_ruby_status expired timeout (10 sec)
# TestBugReporter#test_bug_reporter_add: execution of assert_in_out_err expired timeout (30 sec)
# TestFiber#test_many_fibers_with_threads: execution of assert_normal_exit expired timeout (60 sec)
# TestRubyOptions#test_segv_test: execution of assert_in_out_err expired timeout (10 sec)
DISABLE_TESTS="$DISABLE_TESTS -n !/test_segv_\(setproctitle\|loaded_features\)/ -n !/test_compile_insn_once/ -n !/test_cast/ -n !/test_riml/ -n !/test_bug_reporter_add/ -n !/test_many_fibers_with_threads/ -n !/test_segv_test/"
%endif
make check TESTS="-v $DISABLE_TESTS" MSPECOPT="-fs $MSPECOPTS"
%files
@ -1270,6 +1296,9 @@ make check TESTS="-v $DISABLE_TESTS" MSPECOPT="-fs $MSPECOPTS"
%changelog
* Mon Apr 20 2020 David Abdurachmanov <david.abdurachmanov@sifive.com> - 2.7.1-130.0.riscv64
- Disable pthread assert on RISC-V (riscv64)
* Wed Apr 08 2020 Vít Ondruch <vondruch@redhat.com> - 2.7.1-130
- Bundle did_you_mean into StdLib.
Resolves: rhbz#1817178