Merge ~lucaskanashiro/ubuntu/+source/ruby2.5:bionic-arm64-optimization into ubuntu/+source/ruby2.5:ubuntu/bionic-devel

Proposed by Lucas Kanashiro
Status: Merged
Approved by: Lucas Kanashiro
Approved revision: 87b6ba6b1cab4536a638916fb19bd165cf735fd6
Merge reported by: Lucas Kanashiro
Merged at revision: 87b6ba6b1cab4536a638916fb19bd165cf735fd6
Proposed branch: ~lucaskanashiro/ubuntu/+source/ruby2.5:bionic-arm64-optimization
Merge into: ubuntu/+source/ruby2.5:ubuntu/bionic-devel
Diff against target: 397 lines (+331/-1)
8 files modified
debian/changelog (+19/-0)
debian/control (+1/-0)
debian/patches/0029-Backport-upstream-patch-to-fix-Kiritimati-TZ-test-1-.patch (+58/-0)
debian/patches/0030-Backport-upstream-patch-to-fix-Kiritimati-TZ-test-2-.patch (+46/-0)
debian/patches/arm64-optimizations.patch (+179/-0)
debian/patches/series (+3/-0)
debian/tests/bundled-gems (+24/-1)
debian/tests/control (+1/-0)
Reviewer Review Type Date Requested Status
Bryce Harrington (community) Approve
Canonical Server Pending
git-ubuntu developers Pending
Review via email: mp+393470@code.launchpad.net

Description of the change

Apply upstream patch to optimize performance on arm64 in Bionic.

Upstream patch: https://github.com/ruby/ruby/commit/511b55bcefc81c03
LP bug: https://bugs.launchpad.net/ubuntu/+source/ruby2.7/+bug/1901074

I was not able to build this package from the git-ubuntu branch, there is some mismatch with the upstream tarball in the archive. So I am submitting the changes here using the git-ubuntu repo to facilitate the review but I built the package pulling the source package from LP (the changes are the same I am proposing here).

Moreover, I needed to add some extra changes to fix a FTBFS and also DEP-8 tests. I was kind of surprised that autopkgtest never passed for ruby2.5.

PPA: https://launchpad.net/~lucaskanashiro/+archive/ubuntu/ruby2.7-arm64-optimization/+packages

Autopkgtest is still happy:

autopkgtest [17:57:34]: @@@@@@@@@@@@@@@@@@@@ summary
run-all PASS
bundled-gems PASS
builtin-extensions PASS
rubyconfig PASS

To post a comment you must log in.
Revision history for this message
Bryce Harrington (bryce) wrote :
Download full text (4.7 KiB)

### Branch Review ###

* Changelog:
  - [-] old content and logical tag match as expected
  - [√] changelog entry correct version and targeted codename
  - [√] changelog entries correct
  - [√] update-maintainer has been run

* Actual changes:
  - [-] no upstream changes to consider
  - [-] no further upstream version to consider
  - [√] debian changes look safe

* Old Delta:
  - [-] dropped changes are ok to be dropped
  - [-] nothing else to drop
  - [-] changes forwarded upstream/debian (if appropriate)

* New Delta:
  - [-] no new patches added
  - [√] patches match what was proposed upstream
  - [√] patches correctly included in debian/patches/series
  - [x] patches have correct DEP3 metadata
    + Need bug links, see below

* Build/Test:
  - [√] build is ok
  - [√] verified PPA package installs/uninstalls
  - [x] autopkgtest against the PPA package passes
    + see below
  - [-] sanity checks test fine

I didn't attempt to build locally from git-ubuntu, but the PPA seems to have built fine. I did try running the autopkgtest locally using the ppa, but it fails on the run-all test:

autopkgtest [22:24:33]: test rubyconfig: -----------------------]
autopkgtest [22:24:33]: test rubyconfig: - - - - - - - - - - results - - - - - - - - - -
rubyconfig PASS
autopkgtest [22:24:33]: @@@@@@@@@@@@@@@@@@@@ summary
run-all FAIL non-zero exit status 1
bundled-gems PASS
builtin-extensions PASS
rubyconfig PASS

Here's the specific test case output:

FAIL test/rubygems/test_gem_util.rb
-----------------------------------

[/var/lib/gems/2.5.0/specifications/bundler-1.16.1.gemspec] isn't a Gem::Specification (NilClass instead).
[/var/lib/gems/2.5.0/specifications/bundler-audit-1.0.0.gemspec] isn't a Gem::Specification (NilClass instead).
Run options: -v --excludes-dir=test/excludes/ --excludes-dir=debian/tests/excludes/any/ --excludes-dir=debian/tests/excludes/amd64/ --name=!/memory_leak/

# Running tests:

[1/5] TestGemUtil#test_silent_system = 0.05 s
[2/5] TestGemUtil#test_class_popen = 0.04 s
[3/5] TestGemUtil#test_traverse_parents = 0.00 s
[4/5] TestGemUtil#test_traverse_parents_does_not_crash_on_permissions_error = 0.01 s
[5/5] TestGemUtil#test_linked_list_find = 0.00 s

  1) Failure:
TestGemUtil#test_traverse_parents_does_not_crash_on_permissions_error [/tmp/autopkgtest.XIAQZ1/autopkgtest_tmp/test/rubygems/test_gem_util.rb:43]:
--- expected
+++ actual
@@ -1 +1 @@
-"/tmp/test_rubygems_103177/d"
+"/tmp/test_rubygems_103177/d/e/f"

Finished tests in 0.105744s, 47.2839 tests/s, 94.5678 assertions/s.
5 tests, 10 assertions, 1 failures, 0 errors, 0 skips

The DEP3 for the added patches miss their upstream bug links. The arm patch doesn't appear to have an actual bug report afaict but there is a PR with a bit of context:

https://github.com/ruby/ruby/pull/3393
https://bugs.ruby-lang.org/issues/14655

Inline below are some refactoring and typo fixing suggestions.

### SRU Text Review ###

Some suggestions to help improve the SRU text to help it pass.

The timezone patch doesn't appear to have a ubuntu bug. I gather this is added strictly just to fix test suite failure, which is great, and as such might not ...

Read more...

review: Needs Fixing
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks for the review Bryce! I believe I addressed all your comments, it is up for review again. I uploaded a new version to the PPA with the all the improvements.

Regarding the autopkgtest failure I was not able to reproduce it, I ran it locally multiple times with different backends and all of them passed:

autopkgtest [18:38:52]: @@@@@@@@@@@@@@@@@@@@ summary
run-all PASS
bundled-gems PASS
builtin-extensions PASS
rubyconfig PASS

I tested with the commands below:

$ autopkgtest -U -s ruby2.5_2.5.1-1ubuntu1.7~ppa4_amd64.changes -- lxd ubuntu-daily:bionic
$ autopkgtest -U -s ruby2.5_2.5.1-1ubuntu1.7~ppa4_amd64.changes -- qemu @autopkgtest-bionic.cfg
$ cat autopkgtest-bionic.cfg
--ram-size=2046
/home/lucas/autopkgtest/autopkgtest-bionic-amd64.img

Here you can find the log of one of my executions: https://paste.ubuntu.com/p/H2fHr4y7Yb/

Revision history for this message
Bryce Harrington (bryce) wrote :

Looks good, +1.

review: Approve
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks for the review Bryce! Uploaded:

$ git push pkg upload/2.5.1-1ubuntu1.7
Enumerating objects: 43, done.
Counting objects: 100% (43/43), done.
Delta compression using up to 32 threads
Compressing objects: 100% (32/32), done.
Writing objects: 100% (33/33), 8.03 KiB | 4.01 MiB/s, done.
Total 33 (delta 21), reused 2 (delta 1)
To ssh://git.launchpad.net/ubuntu/+source/ruby2.5
 * [new tag] upload/2.5.1-1ubuntu1.7 -> upload/2.5.1-1ubuntu1.7

$ dput ubuntu ../ruby2.5_2.5.1-1ubuntu1.7_source.changes
Checking signature on .changes
gpg: ../ruby2.5_2.5.1-1ubuntu1.7_source.changes: Valid signature from F823A2729883C97C
Checking signature on .dsc
gpg: ../ruby2.5_2.5.1-1ubuntu1.7.dsc: Valid signature from F823A2729883C97C
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading ruby2.5_2.5.1-1ubuntu1.7.dsc: done.
  Uploading ruby2.5_2.5.1-1ubuntu1.7.debian.tar.xz: done.
  Uploading ruby2.5_2.5.1-1ubuntu1.7_source.changes: done.
Successfully uploaded packages.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index 08fcc18..c1b4e7f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,22 @@
1ruby2.5 (2.5.1-1ubuntu1.7) bionic; urgency=medium
2
3 * d/p/arm64-optimizations.patch: enable arm64 optimizations that exist
4 for power/x86. It includes enabling unaligned memory access, gc and
5 vm_exec.c optimizations (LP: #1901074).
6 * Fix FTBFS, many tests were failing during the build (LP: #1903902).
7 - Add missing b-d on tzdata.
8 * Fix DEP-8 tests (LP: #1903905).
9 - Backport patches to fix Kiritimati TZ tests:
10 + 0029-Backport-upstream-patch-to-fix-Kiritimati-TZ-test-1-.patch
11 + 0030-Backport-upstream-patch-to-fix-Kiritimati-TZ-test-2-.patch
12 - d/t/control: add restriction to allow-stderr. The rubyconfig test calls
13 dpkg-architecture which is returning a warning in Bionic.
14 - d/t/bundled-gems: skip gems which do not match upstream expectations.
15 Some gems listed as bundled by upstream are not satisfied by the Ubuntu
16 Bionic archive.
17
18 -- Lucas Kanashiro <lucas.kanashiro@canonical.com> Thu, 05 Nov 2020 10:30:22 -0300
19
1ruby2.5 (2.5.1-1ubuntu1.6) bionic-security; urgency=medium20ruby2.5 (2.5.1-1ubuntu1.6) bionic-security; urgency=medium
221
3 * SECURITY UPDATE: NULL injection vulnerability22 * SECURITY UPDATE: NULL injection vulnerability
diff --git a/debian/control b/debian/control
index 50986d7..2a2cbe8 100644
--- a/debian/control
+++ b/debian/control
@@ -24,6 +24,7 @@ Build-Depends: bison,
24 procps,24 procps,
25 rubygems-integration (>= 1.6),25 rubygems-integration (>= 1.6),
26 systemtap-sdt-dev [linux-any],26 systemtap-sdt-dev [linux-any],
27 tzdata,
27 zlib1g-dev28 zlib1g-dev
28Standards-Version: 4.1.229Standards-Version: 4.1.2
29Homepage: http://www.ruby-lang.org/30Homepage: http://www.ruby-lang.org/
diff --git a/debian/patches/0029-Backport-upstream-patch-to-fix-Kiritimati-TZ-test-1-.patch b/debian/patches/0029-Backport-upstream-patch-to-fix-Kiritimati-TZ-test-1-.patch
30new file mode 10064431new file mode 100644
index 0000000..374cc5e
--- /dev/null
+++ b/debian/patches/0029-Backport-upstream-patch-to-fix-Kiritimati-TZ-test-1-.patch
@@ -0,0 +1,58 @@
1From: Lucas Kanashiro <lucas.kanashiro@canonical.com>
2Date: Thu, 5 Nov 2020 17:17:25 -0300
3Subject: Backport upstream patch to fix Kiritimati TZ test [1/2]
4
5Original commit message:
6
7test_time_tz.rb: Kiritimati tzdata fix
8
9* test/ruby/test_time_tz.rb (TestTimeTZ#test_pacific_kiritimati):
10 fix the expected data at the skip of New Year's Eve 1994.
11 [Bug #14655]
12
13git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
14
15Origin: upstream, https://github.com/ruby/ruby/commit/2965c2d4df7
16Bug-Upstream: https://bugs.ruby-lang.org/issues/14655
17Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/ruby2.5/+bug/1903905
18Reviewed-By: Lucas Kanashiro <lucas.kanashiro@canonical.com>
19Last-Updated: 2020-11-04
20---
21 test/ruby/test_time_tz.rb | 17 ++++++++++++++---
22 1 file changed, 14 insertions(+), 3 deletions(-)
23
24diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb
25index 52d8bf8..ff3169e 100644
26--- a/test/ruby/test_time_tz.rb
27+++ b/test/ruby/test_time_tz.rb
28@@ -91,6 +91,9 @@ def group_by(e, &block)
29 end
30 end
31 }
32+ CORRECT_KIRITIMATI_SKIP_1994 = with_tz("Pacific/Kiritimati") {
33+ Time.local(1994, 12, 31, 0, 0, 0).year == 1995
34+ }
35
36 def time_to_s(t)
37 t.to_s
38@@ -180,9 +183,17 @@ def test_europe_lisbon
39
40 def test_pacific_kiritimati
41 with_tz(tz="Pacific/Kiritimati") {
42- assert_time_constructor(tz, "1994-12-31 23:59:59 -1000", :local, [1994,12,31,23,59,59])
43- assert_time_constructor(tz, "1995-01-02 00:00:00 +1400", :local, [1995,1,1,0,0,0])
44- assert_time_constructor(tz, "1995-01-02 23:59:59 +1400", :local, [1995,1,1,23,59,59])
45+ assert_time_constructor(tz, "1994-12-30 00:00:00 -1000", :local, [1994,12,30,0,0,0])
46+ assert_time_constructor(tz, "1994-12-30 23:59:59 -1000", :local, [1994,12,30,23,59,59])
47+ if CORRECT_KIRITIMATI_SKIP_1994
48+ assert_time_constructor(tz, "1995-01-01 00:00:00 +1400", :local, [1994,12,31,0,0,0])
49+ assert_time_constructor(tz, "1995-01-01 23:59:59 +1400", :local, [1994,12,31,23,59,59])
50+ assert_time_constructor(tz, "1995-01-01 00:00:00 +1400", :local, [1995,1,1,0,0,0])
51+ else
52+ assert_time_constructor(tz, "1994-12-31 23:59:59 -1000", :local, [1994,12,31,23,59,59])
53+ assert_time_constructor(tz, "1995-01-02 00:00:00 +1400", :local, [1995,1,1,0,0,0])
54+ assert_time_constructor(tz, "1995-01-02 23:59:59 +1400", :local, [1995,1,1,23,59,59])
55+ end
56 assert_time_constructor(tz, "1995-01-02 00:00:00 +1400", :local, [1995,1,2,0,0,0])
57 }
58 end
diff --git a/debian/patches/0030-Backport-upstream-patch-to-fix-Kiritimati-TZ-test-2-.patch b/debian/patches/0030-Backport-upstream-patch-to-fix-Kiritimati-TZ-test-2-.patch
0new file mode 10064459new file mode 100644
index 0000000..a6c0b90
--- /dev/null
+++ b/debian/patches/0030-Backport-upstream-patch-to-fix-Kiritimati-TZ-test-2-.patch
@@ -0,0 +1,46 @@
1From: Lucas Kanashiro <lucas.kanashiro@canonical.com>
2Date: Thu, 5 Nov 2020 17:21:47 -0300
3Subject: Backport upstream patch to fix Kiritimati TZ test [2/2]
4
5Original commit message:
6
7test_time_tz.rb: Kiritimati tzdata fix
8
9* test/ruby/test_time_tz.rb (gen_zdump_test): fix the expected
10 data at the Kiritimati's skip of New Year's Eve 1994.
11 [Bug #14655]
12
13git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
14
15Origin: upstream, https://github.com/ruby/ruby/commit/584b5929f9b7
16Bug-Upstream: https://bugs.ruby-lang.org/issues/14655
17Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/ruby2.5/+bug/1903905
18Reviewed-By: Lucas Kanashiro <lucas.kanashiro@canonical.com>
19Last-Updated: 2020-11-05
20---
21 test/ruby/test_time_tz.rb | 9 +++++++++
22 1 file changed, 9 insertions(+)
23
24diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb
25index ff3169e..dad8e67 100644
26--- a/test/ruby/test_time_tz.rb
27+++ b/test/ruby/test_time_tz.rb
28@@ -381,9 +381,18 @@ def self.gen_zdump_test(data)
29 Europe/London Sun Aug 10 01:00:00 1947 UTC = Sun Aug 10 02:00:00 1947 BST isdst=1 gmtoff=3600
30 Europe/London Sun Nov 2 01:59:59 1947 UTC = Sun Nov 2 02:59:59 1947 BST isdst=1 gmtoff=3600
31 Europe/London Sun Nov 2 02:00:00 1947 UTC = Sun Nov 2 02:00:00 1947 GMT isdst=0 gmtoff=0
32+End
33+ if CORRECT_KIRITIMATI_SKIP_1994
34+ gen_zdump_test <<'End'
35+Pacific/Kiritimati Sat Dec 31 09:59:59 1994 UTC = Fri Dec 30 23:59:59 1994 LINT isdst=0 gmtoff=-36000
36+Pacific/Kiritimati Sat Dec 31 10:00:00 1994 UTC = Sun Jan 1 00:00:00 1995 LINT isdst=0 gmtoff=50400
37+End
38+ else
39+ gen_zdump_test <<'End'
40 Pacific/Kiritimati Sun Jan 1 09:59:59 1995 UTC = Sat Dec 31 23:59:59 1994 LINT isdst=0 gmtoff=-36000
41 Pacific/Kiritimati Sun Jan 1 10:00:00 1995 UTC = Mon Jan 2 00:00:00 1995 LINT isdst=0 gmtoff=50400
42 End
43+ end
44 gen_zdump_test <<'End' if has_right_tz
45 right/America/Los_Angeles Fri Jun 30 23:59:60 1972 UTC = Fri Jun 30 16:59:60 1972 PDT isdst=1 gmtoff=-25200
46 right/America/Los_Angeles Wed Dec 31 23:59:60 2008 UTC = Wed Dec 31 15:59:60 2008 PST isdst=0 gmtoff=-28800
diff --git a/debian/patches/arm64-optimizations.patch b/debian/patches/arm64-optimizations.patch
0new file mode 10064447new file mode 100644
index 0000000..1e98b50
--- /dev/null
+++ b/debian/patches/arm64-optimizations.patch
@@ -0,0 +1,179 @@
1From: Lucas Kanashiro <lucas.kanashiro@canonical.com>
2Date: Thu, 5 Nov 2020 10:27:17 -0300
3Subject: Backport some arm64 optimizations
4
5Original commit message:
6
7From 511b55bcefc81c036294dc9a544d14bd342acd3b Mon Sep 17 00:00:00 2001
8From: AGSaidi <AGSaidi@users.noreply.github.com>
9Date: Thu, 13 Aug 2020 12:15:54 -0500
10Subject: [PATCH] Enable arm64 optimizations that exist for power/x86 (#3393)
11
12* Enable unaligned accesses on arm64
13
1464-bit Arm platforms support unaligned accesses.
15
16Running the string benchmarks this change improves performance
17by an average of 1.04x, min .96x, max 1.21x, median 1.01x
18
19* arm64 enable gc optimizations
20
21Similar to x86 and powerpc optimizations.
22
23| |compare-ruby|built-ruby|
24|:------|-----------:|---------:|
25|hash1 | 0.225| 0.237|
26| | -| 1.05x|
27|hash2 | 0.110| 0.110|
28| | 1.00x| -|
29
30* vm_exec.c: improve performance for arm64
31
32| |compare-ruby|built-ruby|
33|:------------------------------|-----------:|---------:|
34|vm_array | 26.501M| 27.959M|
35| | -| 1.06x|
36|vm_attr_ivar | 21.606M| 31.429M|
37| | -| 1.45x|
38|vm_attr_ivar_set | 21.178M| 26.113M|
39| | -| 1.23x|
40|vm_backtrace | 6.621| 6.668|
41| | -| 1.01x|
42|vm_bigarray | 26.205M| 29.958M|
43| | -| 1.14x|
44|vm_bighash | 504.155k| 479.306k|
45| | 1.05x| -|
46|vm_block | 16.692M| 21.315M|
47| | -| 1.28x|
48|block_handler_type_iseq | 5.083| 7.004|
49| | -| 1.38x|
50
51Origin: upstream, https://github.com/ruby/ruby/commit/511b55bcefc81c03
52Bug-Upstream: https://github.com/ruby/ruby/pull/3393
53Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/ruby2.7/+bug/1901074
54Reviewed-By: Lucas Kanashiro <lucas.kanashiro@canonical.com>
55Last-Updated: 2020-11-05
56---
57 gc.c | 12 ++++++++++++
58 gc.h | 2 ++
59 include/ruby/defines.h | 2 +-
60 regint.h | 2 +-
61 siphash.c | 2 +-
62 st.c | 2 +-
63 vm_exec.c | 8 ++++++++
64 7 files changed, 26 insertions(+), 4 deletions(-)
65
66diff --git a/gc.c b/gc.c
67index f031861..8cf2fbb 100644
68--- a/gc.c
69+++ b/gc.c
70@@ -975,6 +975,18 @@ tick(void)
71 return val;
72 }
73
74+#elif defined(__aarch64__) && defined(__GNUC__)
75+typedef unsigned long tick_t;
76+#define PRItick "lu"
77+
78+static __inline__ tick_t
79+tick(void)
80+{
81+ unsigned long val;
82+ __asm__ __volatile__ ("mrs %0, cntvct_el0", : "=r" (val));
83+ return val;
84+}
85+
86 #elif defined(_WIN32) && defined(_MSC_VER)
87 #include <intrin.h>
88 typedef unsigned __int64 tick_t;
89diff --git a/gc.h b/gc.h
90index 2c91e06..0f8a56f 100644
91--- a/gc.h
92+++ b/gc.h
93@@ -6,6 +6,8 @@
94 #define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("movq\t%%rsp, %0" : "=r" (*(p)))
95 #elif defined(__i386) && defined(__GNUC__)
96 #define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("movl\t%%esp, %0" : "=r" (*(p)))
97+#elif defined(__aarch64__) && defined(__GNUC__)
98+#define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("mov\t%0, sp" : "=r" (*(p)))
99 #else
100 NOINLINE(void rb_gc_set_stack_end(VALUE **stack_end_p));
101 #define SET_MACHINE_STACK_END(p) rb_gc_set_stack_end(p)
102diff --git a/include/ruby/defines.h b/include/ruby/defines.h
103index 9940c93..fff794e 100644
104--- a/include/ruby/defines.h
105+++ b/include/ruby/defines.h
106@@ -358,7 +358,7 @@ void rb_ia64_flushrs(void);
107 #ifndef UNALIGNED_WORD_ACCESS
108 # if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
109 defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || \
110- defined(__powerpc64__) || \
111+ defined(__powerpc64__) || defined(__aarch64__) || \
112 defined(__mc68020__)
113 # define UNALIGNED_WORD_ACCESS 1
114 # else
115diff --git a/regint.h b/regint.h
116index a2f5bbb..0740429 100644
117--- a/regint.h
118+++ b/regint.h
119@@ -52,7 +52,7 @@
120 #ifndef UNALIGNED_WORD_ACCESS
121 # if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
122 defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || \
123- defined(__powerpc64__) || \
124+ defined(__powerpc64__) || defined(__aarch64__) || \
125 defined(__mc68020__)
126 # define UNALIGNED_WORD_ACCESS 1
127 # else
128diff --git a/siphash.c b/siphash.c
129index 153d2c6..ddf8ee2 100644
130--- a/siphash.c
131+++ b/siphash.c
132@@ -30,7 +30,7 @@
133 #ifndef UNALIGNED_WORD_ACCESS
134 # if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
135 defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || \
136- defined(__powerpc64__) || \
137+ defined(__powerpc64__) || defined(__aarch64__) || \
138 defined(__mc68020__)
139 # define UNALIGNED_WORD_ACCESS 1
140 # endif
141diff --git a/st.c b/st.c
142index 9740e02..93635e6 100644
143--- a/st.c
144+++ b/st.c
145@@ -1744,7 +1744,7 @@ st_values_check(st_table *tab, st_data_t *values, st_index_t size,
146 #ifndef UNALIGNED_WORD_ACCESS
147 # if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
148 defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || \
149- defined(__powerpc64__) || \
150+ defined(__powerpc64__) || defined(__aarch64__) || \
151 defined(__mc68020__)
152 # define UNALIGNED_WORD_ACCESS 1
153 # endif
154diff --git a/vm_exec.c b/vm_exec.c
155index 87e9714..65bbca2 100644
156--- a/vm_exec.c
157+++ b/vm_exec.c
158@@ -27,6 +27,9 @@ static void vm_analysis_insn(int insn);
159 #elif defined(__GNUC__) && defined(__powerpc64__)
160 #define DECL_SC_REG(type, r, reg) register type reg_##r __asm__("r" reg)
161
162+#elif defined(__GNUC__) && defined(__aarch64__)
163+#define DECL_SC_REG(type, r, reg) register type reg_##r __asm__("x" reg)
164+
165 #else
166 #define DECL_SC_REG(type, r, reg) register type reg_##r
167 #endif
168@@ -74,6 +77,11 @@ vm_exec_core(rb_execution_context_t *ec, VALUE initial)
169 DECL_SC_REG(rb_control_frame_t *, cfp, "15");
170 #define USE_MACHINE_REGS 1
171
172+#elif defined(__GNUC__) && defined(__aarch64__)
173+ DECL_SC_REG(const VALUE *, pc, "19");
174+ DECL_SC_REG(rb_control_frame_t *, cfp, "20");
175+#define USE_MACHINE_REGS 1
176+
177 #else
178 register rb_control_frame_t *reg_cfp;
179 const VALUE *reg_pc;
diff --git a/debian/patches/series b/debian/patches/series
index 488ec39..44beaf8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -25,3 +25,6 @@ CVE-2019-15845.patch
25CVE-2019-16201.patch25CVE-2019-16201.patch
26CVE-2019-16254.patch26CVE-2019-16254.patch
27CVE-2019-16255.patch27CVE-2019-16255.patch
28arm64-optimizations.patch
290029-Backport-upstream-patch-to-fix-Kiritimati-TZ-test-1-.patch
300030-Backport-upstream-patch-to-fix-Kiritimati-TZ-test-2-.patch
diff --git a/debian/tests/bundled-gems b/debian/tests/bundled-gems
index 5767c70..4ee2d21 100755
--- a/debian/tests/bundled-gems
+++ b/debian/tests/bundled-gems
@@ -1,9 +1,32 @@
1#!/bin/sh1#!/bin/bash
22
3set -e3set -e
44
5bionic_meets_gem_requirement() {
6 local gem="$1"
7 # The gems listed below do not match what ruby upstream expects.
8 # * power_assert: upstream expects version >= 1.1.1. Bionic has version 0.3.0-1
9 # but actually it contains 0.2.7, look at the gemspec:
10 # /usr/share/rubygems-integration/all/specifications/power_assert-0.2.7.gemspec
11 # * test-unit: upstream expects version >= 3.2.7. Bionic has version 3.2.5-1.
12 # * xmlrpc: upstream expects version >= 0.3.0. This package is not available in
13 # Bionic, just from Focal onwards.
14 # Also see LP #1903905.
15 local gems_not_expected_to_work=(power_assert test-unit xmlrpc)
16
17 for gem_skipped in "${gems_not_expected_to_work[@]}"; do
18 if [[ "${gem}" == "${gem_skipped}" ]]; then
19 echo "${gem} in Bionic does not match what ruby upstream expects for this version."
20 return 1
21 fi
22 done
23 return 0
24}
25
5rc=026rc=0
6while read gem version repository; do27while read gem version repository; do
28 bionic_meets_gem_requirement "${gem}" || continue
29
7 if ruby2.5 -e "gem '${gem}', '>= ${version}'"; then30 if ruby2.5 -e "gem '${gem}', '>= ${version}'"; then
8 echo "${gem} (>= ${version}) OK"31 echo "${gem} (>= ${version}) OK"
9 else32 else
diff --git a/debian/tests/control b/debian/tests/control
index d5c2ee0..2b0bab8 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,3 @@
1Tests: run-all bundled-gems builtin-extensions rubyconfig1Tests: run-all bundled-gems builtin-extensions rubyconfig
2Depends: @2Depends: @
3Restrictions: allow-stderr

Subscribers

People subscribed via source and target branches