Skip to content

Commit c4f628c

Browse files
osyoyutianon
andauthored
Apply upstream patch to workaround arm64 crash
Ruby 3.3.0 has a bug that crashes many programs on arm64. https://bugs.ruby-lang.org/issues/20085 Workaround this bug by applying the upstream fix/backport in ruby/ruby#9385 . Co-authored-by: Tianon Gravi <[email protected]>
1 parent 4855bb0 commit c4f628c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Dockerfile.template

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,14 @@ RUN set -eux; \
253253
;; \
254254
esac; \
255255
{{ ) else "" end -}}
256-
{{ if .version | . == "3.3.0" then ( -}}
257-
# workaround crash on aarch64 Linux (e.g. Docker Desktop on macOS)
258-
# https://bugs.ruby-lang.org/issues/20085#note-5
259-
# https://github.com/ruby/ruby/pull/9371
260-
export ASFLAGS="${ASFLAGS:-} -mbranch-protection=pac-ret"; \
256+
{{ if .version == "3.3.0" then ( -}}
257+
# workaround crash on arm64
258+
# https://bugs.ruby-lang.org/issues/20085
259+
# https://github.com/ruby/ruby/pull/9385 <- https://github.com/ruby/ruby/pull/9371
260+
wget -O 'arm64-fix.patch' 'https://github.com/ruby/ruby/commit/7f97e3540ce448b501bcbee15afac5f94bb22dd9.patch?full_index=1'; \
261+
echo '86bc65415fd62cb2272a4df249f39fb79db15617ad05c540e05a22f02eae73b3 *arm64-fix.patch' | sha256sum --check --strict; \
262+
patch -p1 -i arm64-fix.patch; \
263+
rm arm64-fix.patch; \
261264
{{ ) else "" end -}}
262265
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
263266
./configure \

0 commit comments

Comments
 (0)