Skip to content

WIP: Fixes for s390x (64-bit big endian)

Simon McVittie requested to merge wip/s390x into debian/master

Untested backports from https://bugzilla.mozilla.org/show_bug.cgi?id=1488552.

This is as far as I've got with trying to backport patches for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=909536. Many tests still fail, and one still segfaults. Looking at the pattern of errors, I think typed arrays are broken: this might be one bug, or it might be many bugs.

This is way beyond my JS or s390x knowledge, so I'm stopping here. Anyone who likes s390x is welcome to take over.

Please do not assume that my patches are correct. They will definitely need testing on mips or powerpc (32-bit BE) and would probably benefit from testing on ppc64 (64-bit BE, like s390x). I would strongly recommend the first upload of this stuff being to experimental.

# Error: Assertion failed: got 0, expected NaN
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script non262/extensions/clone-transferables.js
# Error: Assertion failed: got 1024, expected Infinity
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script non262/extensions/sharedtypedarray.js
# Segfaults
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script non262/extensions/clone-errors.js
# Expected value '0', Actual value '4'
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script non262/extensions/typedarray.js
# expected exception TypeError, no exception thrown - ArrayBuffer is detached in ToInteger(start)
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script non262/TypedArray/slice-detached.js
# Assertion failed: got 3, expected 0
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script non262/TypedArray/Tconstructor-romTypedArray-byteLength.js
# attempting to construct out-of-bounds TypedArray on ArrayBuffer
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script non262/TypedArray/set-same-buffer-ifferent-source-target-types.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script non262/TypedArray/subarray.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script non262/TypedArray/sort_byteoffset.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArray/prototypeset/typedarray-arg-set-values-same-buffer-same-type-sab.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/buffer-arg-defined-length.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/buffer-arg-defined-length-and-offset-sab.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/buffer-arg-defined-length-and-offset.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/buffer-arg-defined-length-sab.js
# Assertion failed: got (void 0), expected 1
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script non262/TypedArray/iterator-next-with-detached.js
# Assertion failed: got 0, expected 8
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script non262/TypedArray/indexOf-and-lastIndexOf.js
# Assertion failed: got 8, expected 0
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script non262/ArrayBuffer/CloneArrayBuffer.js
# [1] is the byte offset pos Expected SameValue(«8», «0») to be true (Testing wii  ith Float64Array.)
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor-invocation.js
# Expected true but got false (Testing with Float32Array.)
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArray/prototype/copyWithin/bit-precision.js
# src is SAB-backed, offset: N, result: 1,2,3,4 (Testing with Int8Array.)
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-same-type-sab.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-other-type-sab.js
# Expected SameValue(«336», «0») to be true (Testing with Float64Array.)
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArray/prototype/byteLength/return-bytelength.js
# RangeError: invalid or out-of-range index
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/Atomics/wait/was-woken.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/Atomics/wait/no-spurious-wakeup.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/Atomics/wait/did-timeout.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/Atomics/wait/nan-timeout.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/Atomics/wake/wake-one.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/Atomics/wake/wake-zero.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/Atomics/wake/wake-two.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/Atomics/wake/wake-nan.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/Atomics/wake/wake-negative.js
# Timed out after 600s
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/Atomics/wait/negative-timeout.js
# Expected a RangeError to be thrown but no exception was thrown at all
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/buffer-arg-toindex-byteoffset-sab.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/buffer-arg-excessive-offset-throws.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/buffer-arg-excessive-length-throws.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/buffer-arg-bufferbyteoffset-throws-from-modulo-element-size.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/buffer-arg-toindex-byteoffset.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/buffer-arg-excessive-offset-throws-sab.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/buffer-arg-bufferbyteoffset-throws-from-modulo-element-size-sab.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/buffer-arg-byteoffset-throws-from-modulo-element-size.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/buffer-arg-byteoffset-throws-from-modulo-element-size-sab.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/buffer-arg-excessive-length-throws-sab.js
# Expected SameValue(«0», «N») to be true
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/buffer-arg-defined-offset-sab.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/buffer-arg-returns-new-instance-sab.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/buffer-arg-returns-new-instance.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/buffer-arg-defined-offset.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/Float64Array/BYTES_PER_ELEMENT.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/Float64Array/prototype/BYTES_PER_ELEMENT.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/Uint16Array/BYTES_PER_ELEMENT.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/Uint16Array/prototype/BYTES_PER_ELEMENT.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/Uint8Array/prototype/BYTES_PER_ELEMENT.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/Uint8Array/BYTES_PER_ELEMENT.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/Int32Array/BYTES_PER_ELEMENT.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/Int32Array/prototype/BYTES_PER_ELEMENT.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/Float32Array/BYTES_PER_ELEMENT.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/Float32Array/prototype/BYTES_PER_ELEMENT.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/Int16Array/BYTES_PER_ELEMENT.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/Int16Array/prototype/BYTES_PER_ELEMENT.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/Int8Array/BYTES_PER_ELEMENT.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/Int8Array/prototype/BYTES_PER_ELEMENT.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/Uint8ClampedArray/BYTES_PER_ELEMENT.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/Uint8ClampedArray/prototype/BYTES_PER_ELEMENT.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/Uint32Array/BYTES_PER_ELEMENT.js
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/Uint32Array/prototype/BYTES_PER_ELEMENT.js
# RangeError: invalid array length
fails-if(xulRuntime.debian.DEB_HOST_ARCH_CPU.match(/^s390x$/)) script test262/built-ins/TypedArrays/internals/Get/indexed-value-sab.js

Merge request reports

Loading