From 0a4bf3d53aa74f77675d8ba0879fae5aa6cb5d39 Mon Sep 17 00:00:00 2001 From: Dominik 'Rathann' Mierzejewski Date: Wed, 17 Apr 2019 17:09:04 +0200 Subject: [PATCH 1/7] use python2 on EPEL7 --- wabt-python.patch | 12 ------------ wabt.spec | 15 ++++----------- 2 files changed, 4 insertions(+), 23 deletions(-) delete mode 100644 wabt-python.patch diff --git a/wabt-python.patch b/wabt-python.patch deleted file mode 100644 index a256113..0000000 --- a/wabt-python.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up wabt-1.0.10/CMakeLists.txt.orig wabt-1.0.10/CMakeLists.txt ---- wabt-1.0.10/CMakeLists.txt.orig 2019-03-15 12:53:00.645283108 +0100 -+++ wabt-1.0.10/CMakeLists.txt 2019-03-15 12:55:50.734311159 +0100 -@@ -425,7 +425,7 @@ if (NOT EMSCRIPTEN) - endif () - - # test running -- find_package(PythonInterp 2.7 REQUIRED) -+ find_package(Python COMPONENTS Interpreter REQUIRED) - set(RUN_TESTS_PY ${WABT_SOURCE_DIR}/test/run-tests.py) - add_custom_target(run-tests - COMMAND ${CMAKE_BINARY_DIR}/wabt-unittests diff --git a/wabt.spec b/wabt.spec index f5c644e..2026e9a 100644 --- a/wabt.spec +++ b/wabt.spec @@ -13,8 +13,6 @@ Source1: https://github.com/WebAssembly/testsuite/archive/%{ts_commit}/%{name}-t Patch0: wabt-cmake.patch # Build against system gtest Patch1: wabt-gtest.patch -# Fix python detection -Patch2: wabt-python.patch # https://github.com/WebAssembly/wabt/pull/1046 Patch100: 0001-Canonicalize-NaNs-in-the-interpreter-1046.patch License: ASL 2.0 @@ -22,9 +20,7 @@ BuildRequires: cmake BuildRequires: gcc-c++ %if %{with check} BuildRequires: gtest-devel -BuildRequires: python3-ply -BuildRequires: re2c >= 0.16 -BuildRequires: %{_bindir}/pathfix.py +BuildRequires: python-ply %endif %description @@ -38,16 +34,11 @@ higher-level compiler target; instead they aim for full fidelity and compliance with the spec (e.g. 1:1 round-trips with no changes to instructions). %prep -%setup -q -%patch0 -p1 -%patch2 -p1 +%autosetup -p1 %if %{with check} -%patch1 -p1 -%patch100 -p1 rmdir third_party/testsuite tar xzf %{S:1} -C third_party mv third_party/testsuite{-%{ts_commit},} -pathfix.py -i "%{__python3} -Es" -p test/run-tests.py pushd test # https://github.com/WebAssembly/wabt/issues/1044 # https://github.com/WebAssembly/wabt/issues/1045 @@ -67,6 +58,8 @@ rm \ popd %ifarch ppc64 rm spec/{conversions.txt,nontrapping-float-to-int-conversions/conversions.txt} +%endif +%ifarch ppc64 ppc64le rm wasm2c/spec/f{32,64}.txt %endif popd From 8b7ef2d4b0670b4cf5c9a2d47d7d6c053deaf93c Mon Sep 17 00:00:00 2001 From: Dominik 'Rathann' Mierzejewski Date: Thu, 12 Sep 2019 10:42:24 +0200 Subject: [PATCH 2/7] update to 1.0.11 - drop obsolete patches --- .gitignore | 2 + ...icalize-NaNs-in-the-interpreter-1046.patch | 307 ------------------ sources | 4 +- wabt.spec | 12 +- 4 files changed, 11 insertions(+), 314 deletions(-) delete mode 100644 0001-Canonicalize-NaNs-in-the-interpreter-1046.patch diff --git a/.gitignore b/.gitignore index d24bcd3..cf8d56f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /wabt-1.0.10.tar.gz /wabt-testsuite-89cc463.tar.gz +/wabt-1.0.11.tar.gz +/wabt-testsuite-2a2099d.tar.gz diff --git a/0001-Canonicalize-NaNs-in-the-interpreter-1046.patch b/0001-Canonicalize-NaNs-in-the-interpreter-1046.patch deleted file mode 100644 index 80e0f9d..0000000 --- a/0001-Canonicalize-NaNs-in-the-interpreter-1046.patch +++ /dev/null @@ -1,307 +0,0 @@ -From 6f743c4dc3bc69601fe54ba938d083ebc4cbe587 Mon Sep 17 00:00:00 2001 -From: Ben Smith -Date: Mon, 18 Mar 2019 15:05:26 -0700 -Subject: [PATCH] Canonicalize NaNs in the interpreter (#1046) - -Even though we store f32 and f64 values as their representation, we -still use the underlying system's implementations for float operations. -These have non-deterministic behavior w.r.t. NaNs. - -This change canoncalizes all NaNs where it is allowed. This excludes -`fxx.abs`, `fxx.neg`, `fxx.copysign` and `fxx.reinterpret*`, which -always work on the floating-point representation directly, and the -`fxx.convert*` instructions, which cannot be NaN because the input is an -integer. ---- - src/interp/interp.cc | 102 ++++++++++++++++++------------------ - test/interp/simd-binary.txt | 20 +++---- - test/interp/simd-unary.txt | 4 +- - 3 files changed, 62 insertions(+), 64 deletions(-) - -diff --git a/src/interp/interp.cc b/src/interp/interp.cc -index 822f003d..f6490695 100644 ---- a/src/interp/interp.cc -+++ b/src/interp/interp.cc -@@ -445,7 +445,6 @@ struct FloatTraits { - static const uint32_t kNegZero = 0x80000000U; - static const uint32_t kQuietNan = 0x7fc00000U; - static const uint32_t kQuietNegNan = 0xffc00000U; -- static const uint32_t kQuietNanBit = 0x00400000U; - static const int kSigBits = 23; - static const uint32_t kSigMask = 0x7fffff; - static const uint32_t kSignMask = 0x80000000U; -@@ -463,6 +462,10 @@ struct FloatTraits { - static bool IsArithmeticNan(uint32_t bits) { - return (bits & kQuietNan) == kQuietNan; - } -+ -+ static uint32_t CanonicalizeNan(uint32_t bits) { -+ return WABT_UNLIKELY(IsNan(bits)) ? kQuietNan : bits; -+ } - }; - - bool IsCanonicalNan(uint32_t bits) { -@@ -531,7 +534,6 @@ struct FloatTraits { - static const uint64_t kNegZero = 0x8000000000000000ULL; - static const uint64_t kQuietNan = 0x7ff8000000000000ULL; - static const uint64_t kQuietNegNan = 0xfff8000000000000ULL; -- static const uint64_t kQuietNanBit = 0x0008000000000000ULL; - static const int kSigBits = 52; - static const uint64_t kSigMask = 0xfffffffffffffULL; - static const uint64_t kSignMask = 0x8000000000000000ULL; -@@ -549,6 +551,10 @@ struct FloatTraits { - static bool IsArithmeticNan(uint64_t bits) { - return (bits & kQuietNan) == kQuietNan; - } -+ -+ static uint64_t CanonicalizeNan(uint64_t bits) { -+ return WABT_UNLIKELY(IsNan(bits)) ? kQuietNan : bits; -+ } - }; - - bool IsCanonicalNan(uint64_t bits) { -@@ -698,6 +704,21 @@ template<> uint32_t GetValue(Value v) { return v.f32_bits; } - template<> uint64_t GetValue(Value v) { return v.f64_bits; } - template<> v128 GetValue(Value v) { return v.v128_bits; } - -+template -+ValueTypeRep CanonicalizeNan(ValueTypeRep rep) { -+ return rep; -+} -+ -+template <> -+ValueTypeRep CanonicalizeNan(ValueTypeRep rep) { -+ return FloatTraits::CanonicalizeNan(rep); -+} -+ -+template <> -+ValueTypeRep CanonicalizeNan(ValueTypeRep rep) { -+ return FloatTraits::CanonicalizeNan(rep); -+} -+ - #define TRAP(type) return Result::Trap##type - #define TRAP_UNLESS(cond, type) TRAP_IF(!(cond), type) - #define TRAP_IF(cond, type) \ -@@ -1005,7 +1026,7 @@ Result Thread::BinopTrap(BinopTrapFunc func) { - // {i,f}{32,64}.add - template - ValueTypeRep Add(ValueTypeRep lhs_rep, ValueTypeRep rhs_rep) { -- return ToRep(FromRep(lhs_rep) + FromRep(rhs_rep)); -+ return CanonicalizeNan(ToRep(FromRep(lhs_rep) + FromRep(rhs_rep))); - } - - template -@@ -1063,13 +1084,13 @@ int32_t SimdIsLaneTrue(ValueTypeRep value, int32_t true_cond) { - // {i,f}{32,64}.sub - template - ValueTypeRep Sub(ValueTypeRep lhs_rep, ValueTypeRep rhs_rep) { -- return ToRep(FromRep(lhs_rep) - FromRep(rhs_rep)); -+ return CanonicalizeNan(ToRep(FromRep(lhs_rep) - FromRep(rhs_rep))); - } - - // {i,f}{32,64}.mul - template - ValueTypeRep Mul(ValueTypeRep lhs_rep, ValueTypeRep rhs_rep) { -- return ToRep(FromRep(lhs_rep) * FromRep(rhs_rep)); -+ return CanonicalizeNan(ToRep(FromRep(lhs_rep) * FromRep(rhs_rep))); - } - - // i{32,64}.{div,rem}_s are special-cased because they trap when dividing the -@@ -1140,16 +1161,15 @@ ValueTypeRep FloatDiv(ValueTypeRep lhs_rep, ValueTypeRep rhs_rep) { - typedef FloatTraits Traits; - ValueTypeRep result; - if (WABT_UNLIKELY(Traits::IsZero(rhs_rep))) { -- if (Traits::IsNan(lhs_rep)) { -- result = lhs_rep | Traits::kQuietNan; -- } else if (Traits::IsZero(lhs_rep)) { -+ if (Traits::IsNan(lhs_rep) || Traits::IsZero(lhs_rep)) { - result = Traits::kQuietNan; - } else { - auto sign = (lhs_rep & Traits::kSignMask) ^ (rhs_rep & Traits::kSignMask); - result = sign | Traits::kInf; - } - } else { -- result = ToRep(FromRep(lhs_rep) / FromRep(rhs_rep)); -+ result = -+ CanonicalizeNan(ToRep(FromRep(lhs_rep) / FromRep(rhs_rep))); - } - return result; - } -@@ -1245,51 +1265,31 @@ ValueTypeRep FloatNeg(ValueTypeRep v_rep) { - // f{32,64}.ceil - template - ValueTypeRep FloatCeil(ValueTypeRep v_rep) { -- auto result = ToRep(std::ceil(FromRep(v_rep))); -- if (WABT_UNLIKELY(FloatTraits::IsNan(result))) { -- result |= FloatTraits::kQuietNanBit; -- } -- return result; -+ return CanonicalizeNan(ToRep(std::ceil(FromRep(v_rep)))); - } - - // f{32,64}.floor - template - ValueTypeRep FloatFloor(ValueTypeRep v_rep) { -- auto result = ToRep(std::floor(FromRep(v_rep))); -- if (WABT_UNLIKELY(FloatTraits::IsNan(result))) { -- result |= FloatTraits::kQuietNanBit; -- } -- return result; -+ return CanonicalizeNan(ToRep(std::floor(FromRep(v_rep)))); - } - - // f{32,64}.trunc - template - ValueTypeRep FloatTrunc(ValueTypeRep v_rep) { -- auto result = ToRep(std::trunc(FromRep(v_rep))); -- if (WABT_UNLIKELY(FloatTraits::IsNan(result))) { -- result |= FloatTraits::kQuietNanBit; -- } -- return result; -+ return CanonicalizeNan(ToRep(std::trunc(FromRep(v_rep)))); - } - - // f{32,64}.nearest - template - ValueTypeRep FloatNearest(ValueTypeRep v_rep) { -- auto result = ToRep(std::nearbyint(FromRep(v_rep))); -- if (WABT_UNLIKELY(FloatTraits::IsNan(result))) { -- result |= FloatTraits::kQuietNanBit; -- } -- return result; -+ return CanonicalizeNan(ToRep(std::nearbyint(FromRep(v_rep)))); - } - - // f{32,64}.sqrt - template - ValueTypeRep FloatSqrt(ValueTypeRep v_rep) { -- auto result = ToRep(std::sqrt(FromRep(v_rep))); -- if (WABT_UNLIKELY(FloatTraits::IsNan(result))) { -- result |= FloatTraits::kQuietNanBit; -- } -- return result; -+ return CanonicalizeNan(ToRep(std::sqrt(FromRep(v_rep)))); - } - - // f{32,64}.min -@@ -1297,10 +1297,8 @@ template - ValueTypeRep FloatMin(ValueTypeRep lhs_rep, ValueTypeRep rhs_rep) { - typedef FloatTraits Traits; - -- if (WABT_UNLIKELY(Traits::IsNan(lhs_rep))) { -- return lhs_rep | Traits::kQuietNanBit; -- } else if (WABT_UNLIKELY(Traits::IsNan(rhs_rep))) { -- return rhs_rep | Traits::kQuietNanBit; -+ if (WABT_UNLIKELY(Traits::IsNan(lhs_rep) || Traits::IsNan(rhs_rep))) { -+ return Traits::kQuietNan; - } else if (WABT_UNLIKELY(Traits::IsZero(lhs_rep) && - Traits::IsZero(rhs_rep))) { - // min(0.0, -0.0) == -0.0, but std::min won't produce the correct result. -@@ -1317,10 +1315,8 @@ template - ValueTypeRep FloatMax(ValueTypeRep lhs_rep, ValueTypeRep rhs_rep) { - typedef FloatTraits Traits; - -- if (WABT_UNLIKELY(Traits::IsNan(lhs_rep))) { -- return lhs_rep | Traits::kQuietNanBit; -- } else if (WABT_UNLIKELY(Traits::IsNan(rhs_rep))) { -- return rhs_rep | Traits::kQuietNanBit; -+ if (WABT_UNLIKELY(Traits::IsNan(lhs_rep) || Traits::IsNan(rhs_rep))) { -+ return Traits::kQuietNan; - } else if (WABT_UNLIKELY(Traits::IsZero(lhs_rep) && - Traits::IsZero(rhs_rep))) { - // min(0.0, -0.0) == -0.0, but std::min won't produce the correct result. -@@ -2393,7 +2389,6 @@ Result Thread::Run(int num_instructions) { - - case Opcode::F32DemoteF64: { - typedef FloatTraits F32Traits; -- typedef FloatTraits F64Traits; - - uint64_t value = PopRep(); - if (WABT_LIKELY((IsConversionInRange(value)))) { -@@ -2402,15 +2397,12 @@ Result Thread::Run(int num_instructions) { - CHECK_TRAP(PushRep(F32Traits::kMax)); - } else if (IsInRangeF64DemoteF32RoundToNegF32Max(value)) { - CHECK_TRAP(PushRep(F32Traits::kNegMax)); -+ } else if (FloatTraits::IsNan(value)) { -+ CHECK_TRAP(PushRep(F32Traits::kQuietNan)); - } else { -+ // Infinity. - uint32_t sign = (value >> 32) & F32Traits::kSignMask; -- uint32_t tag = 0; -- if (F64Traits::IsNan(value)) { -- tag = F32Traits::kQuietNanBit | -- ((value >> (F64Traits::kSigBits - F32Traits::kSigBits)) & -- F32Traits::kSigMask); -- } -- CHECK_TRAP(PushRep(sign | F32Traits::kInf | tag)); -+ CHECK_TRAP(PushRep(sign | F32Traits::kInf)); - } - break; - } -@@ -2436,9 +2428,15 @@ Result Thread::Run(int num_instructions) { - Push(wabt_convert_uint64_to_double(Pop()))); - break; - -- case Opcode::F64PromoteF32: -- CHECK_TRAP(Push(Pop())); -+ case Opcode::F64PromoteF32: { -+ uint32_t value = PopRep(); -+ if (WABT_UNLIKELY(FloatTraits::IsNan(value))) { -+ CHECK_TRAP(PushRep(FloatTraits::kQuietNan)); -+ } else { -+ CHECK_TRAP(Push(Bitcast(value))); -+ } - break; -+ } - - case Opcode::F64ReinterpretI64: - CHECK_TRAP(PushRep(Pop())); -diff --git a/test/interp/simd-binary.txt b/test/interp/simd-binary.txt -index e3c446ec..1efd76fb 100644 ---- a/test/interp/simd-binary.txt -+++ b/test/interp/simd-binary.txt -@@ -374,16 +374,16 @@ i16x8_sub_saturate_unsigned_0() => v128:0x00fdfffe 0x0000fffd 0x00000000 0x00000 - v128_and_0() => v128:0x00020001 0x00040002 0x00000003 0x00000004 - v128_or_0() => v128:0x00ff0001 0x00fe0002 0x44000003 0x55000004 - v128_xor_0() => v128:0x00fd0000 0x00fa0000 0x44000000 0x55000000 --f32x4_min_0() => v128:0x80000000 0xffc00000 0x449a5000 0xbf800000 --f64x2_min_0() => v128:0x00000000 0xc0934a00 0x00000000 0xfff80000 --f32x4_max_0() => v128:0x00000000 0xffc00000 0x449a5000 0x3f800000 --f64x2_max_0() => v128:0x00000000 0x00000000 0x00000000 0xfff80000 --f32x4_add_0() => v128:0x00000000 0xffc00000 0x449a7000 0xc49a2000 --f64x2_add_0() => v128:0x00000000 0xc0934400 0x00000000 0xfff80000 --f32x4_sub_0() => v128:0x80000000 0xffc00000 0x449a3000 0xc49a8000 --f64x2_sub_0() => v128:0x00000000 0x40935000 0x00000000 0xfff80000 --f32x4_div_0() => v128:0x7fc00000 0xffc00000 0x3fc00000 0xc0000000 -+f32x4_min_0() => v128:0x80000000 0x7fc00000 0x449a5000 0xbf800000 -+f64x2_min_0() => v128:0x00000000 0xc0934a00 0x00000000 0x7ff80000 -+f32x4_max_0() => v128:0x00000000 0x7fc00000 0x449a5000 0x3f800000 -+f64x2_max_0() => v128:0x00000000 0x00000000 0x00000000 0x7ff80000 -+f32x4_add_0() => v128:0x00000000 0x7fc00000 0x449a7000 0xc49a2000 -+f64x2_add_0() => v128:0x00000000 0xc0934400 0x00000000 0x7ff80000 -+f32x4_sub_0() => v128:0x80000000 0x7fc00000 0x449a3000 0xc49a8000 -+f64x2_sub_0() => v128:0x00000000 0x40935000 0x00000000 0x7ff80000 -+f32x4_div_0() => v128:0x7fc00000 0x7fc00000 0x3fc00000 0xc0000000 - f64x2_div_0() => v128:0x00000000 0x3ff80000 0x00000000 0xc0000000 --f32x4_mul_0() => v128:0x80000000 0xffc00000 0x3fc00000 0xc0900000 -+f32x4_mul_0() => v128:0x80000000 0x7fc00000 0x3fc00000 0xc0900000 - f64x2_mul_0() => v128:0x00000000 0x3ff80000 0x00000000 0xc0120000 - ;;; STDOUT ;;) -diff --git a/test/interp/simd-unary.txt b/test/interp/simd-unary.txt -index 6b4e95ec..c599d63e 100644 ---- a/test/interp/simd-unary.txt -+++ b/test/interp/simd-unary.txt -@@ -277,8 +277,8 @@ f64x2_neg_1() => v128:0x00000000 0x40934a00 0x00000000 0xbff00000 - f32x4_abs_0() => v128:0x00000000 0x7fc00000 0x449a5000 0x3f800000 - f64x2_abs_0() => v128:0x00000000 0x00000000 0x00000000 0x7ff80000 - f64x2_abs_1() => v128:0x00000000 0x40934a00 0x00000000 0x3ff00000 --f32x4_sqrt_0() => v128:0xffc00000 0xffc00000 0x40000000 0x40400000 --f64x2_sqrt_0() => v128:0x00000000 0xfff80000 0x00000000 0xfff80000 -+f32x4_sqrt_0() => v128:0x7fc00000 0x7fc00000 0x40000000 0x40400000 -+f64x2_sqrt_0() => v128:0x00000000 0x7ff80000 0x00000000 0x7ff80000 - f64x2_sqrt_1() => v128:0x00000000 0x40000000 0x00000000 0x40080000 - f32x4_convert_i32x4_s_0() => v128:0x3f800000 0xbf800000 0x00000000 0x40400000 - f32x4_convert_i32x4_u_0() => v128:0x3f800000 0x40000000 0x00000000 0x40400000 --- -2.20.1 - diff --git a/sources b/sources index 56c1abf..5b53f18 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (wabt-1.0.10.tar.gz) = c992b2ded97b04936c88cc4b6ef84ebd1270e7c85b912f62bbda4b65bf44256a3e0275b8bcf2f8137e4bcafc8bc0521ca60ed8d7a7c2894bfff65cceb71edebf -SHA512 (wabt-testsuite-89cc463.tar.gz) = f37d42f49b852d9975ec0eaab85219a499d6df2f156896c7280365fcb8ee383db1b3cf790b4f69741d542b1104c445e8c9cae3613b7446f0df8f51dee9203a2e +SHA512 (wabt-1.0.11.tar.gz) = e0cd1afb914cb0115090ef935de68f16dccc7f8c0dd62ace519a5e00a44ad7167db33ee6902da378c125e94d31c3530bec9943e4f8098d2df6a3a4290d425833 +SHA512 (wabt-testsuite-2a2099d.tar.gz) = 04c678404d0a0b966edd137b124dbd378907068471156c6a75b3119c04e23aefb76785d2c11f58dcbc6cb7a6cf082c613f11804e4abca21a7f5c24e5e12a41e0 diff --git a/wabt.spec b/wabt.spec index 2026e9a..1348399 100644 --- a/wabt.spec +++ b/wabt.spec @@ -1,11 +1,11 @@ %bcond_without check -%global ts_commit 89cc463fa1251449d7974086a34ef0dc100b1582 +%global ts_commit 2a2099d52103215962707fbe9f44cd51fd146636 %global ts_shortcommit %(c=%{ts_commit}; echo ${c:0:7}) Summary: The WebAssembly Binary Toolkit Name: wabt -Version: 1.0.10 -Release: 2%{?dist} +Version: 1.0.11 +Release: 1%{?dist} URL: https://github.com/WebAssembly/wabt Source0: https://github.com/WebAssembly/wabt/archive/%{version}/%{name}-%{version}.tar.gz Source1: https://github.com/WebAssembly/testsuite/archive/%{ts_commit}/%{name}-testsuite-%{ts_shortcommit}.tar.gz @@ -13,8 +13,6 @@ Source1: https://github.com/WebAssembly/testsuite/archive/%{ts_commit}/%{name}-t Patch0: wabt-cmake.patch # Build against system gtest Patch1: wabt-gtest.patch -# https://github.com/WebAssembly/wabt/pull/1046 -Patch100: 0001-Canonicalize-NaNs-in-the-interpreter-1046.patch License: ASL 2.0 BuildRequires: cmake BuildRequires: gcc-c++ @@ -111,6 +109,10 @@ test/run-tests.py -v --timeout=20 %{?_smp_mflags} %{_mandir}/man1/wat2wasm.1* %changelog +* Thu Sep 12 2019 Dominik Mierzejewski 1.0.11-1 +- update to 1.0.11 +- drop obsolete patches + * Mon Apr 15 2019 Dominik Mierzejewski 1.0.10-2 - backport some fixes for test failures from upstream git - run tests in parallel and double timeout to prevent failures on armv7hl From 92113e9a862bdc2c5dfdd4cb1ec10604d6921cc6 Mon Sep 17 00:00:00 2001 From: Dominik 'Rathann' Mierzejewski Date: Fri, 20 Aug 2021 14:06:41 +0200 Subject: [PATCH 3/7] use _cmake3_in_source_build macro on EPEL --- wabt.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wabt.spec b/wabt.spec index 3723c4a..0aab46b 100644 --- a/wabt.spec +++ b/wabt.spec @@ -1,4 +1,4 @@ -%undefine __cmake_in_source_build +%undefine __cmake3_in_source_build %bcond_without check %global commit 21279a861fa3dbac9af9d2bab16c741df17a86af %global shortcommit %(c=%{commit}; echo ${c:0:7}) @@ -100,6 +100,7 @@ test/run-tests.py -v --bindir %{_vpath_builddir} --timeout=80 %{?_smp_mflags} * Fri Aug 20 2021 Dominik Mierzejewski 1.0.24-1 - update to 1.0.24 (#1993479) - enable skipped tests on s390x (fixed upstream) +- use _cmake3_in_source_build macro on EPEL * Fri May 14 2021 Dominik Mierzejewski 1.0.23-1 - update to 1.0.23 (#1934466) From 9fdd3c452bcb355bc29f0db5323776cc7e695fa0 Mon Sep 17 00:00:00 2001 From: Dominik 'Rathann' Mierzejewski Date: Fri, 20 Aug 2021 14:10:30 +0200 Subject: [PATCH 4/7] use bundled gtest (EPEL7 one is too old) --- .gitignore | 1 + sources | 1 + wabt.spec | 11 ++++++++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 797a8f7..d45d290 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ /wabt-testsuite-9994915.tar.gz /wabt-1.0.24.tar.gz /wabt-testsuite-01efde8.tar.gz +/googletest-703bd9c.tar.gz diff --git a/sources b/sources index 7becfb5..3771df8 100644 --- a/sources +++ b/sources @@ -1,3 +1,4 @@ SHA512 (wabt-1.0.24.tar.gz) = 6257702f06baace7eded7fd4890cbf23e533f20ee6c40de82a7a4cd32fe931a49efd3cbfc1355c4da49e6fbd3b62b1cf05edf1699313840d4825a2165a3928a8 SHA512 (wabt-testsuite-01efde8.tar.gz) = 549c2e13ebbd7d87013426d8cdeaa0a6177928307b688e1b90026e79683f7964f09dfb47294b34ba9190d0f3acb279f6d0a924e1f1a9112fc9d89637b8cb9efd SHA512 (wabt-wasm-c-api-d9a8009.tar.gz) = b6ee7d2d83a3ca7b3cb3ee110282f7d32eada1d9020cadd3fdec58f40478879fd9ac9fada526021d8f6e8a26e1df7353df313d4149be2ffe4aea3a28f856fd89 +SHA512 (googletest-703bd9c.tar.gz) = 0b7b9f50efc117de5a6ebfb59006f2bd9da307e546f2cbb8e14e247bfa11b1048b8a361f3aa04f9df78e72e6a43d9051eae4c112fb45b6fd29992ac00e0612e6 diff --git a/wabt.spec b/wabt.spec index 0aab46b..9848417 100644 --- a/wabt.spec +++ b/wabt.spec @@ -6,6 +6,8 @@ %global ts_shortcommit %(c=%{ts_commit}; echo ${c:0:7}) %global wc_commit d9a80099d496b5cdba6f3fe8fc77586e0e505ddc %global wc_shortcommit %(c=%{wc_commit}; echo ${c:0:7}) +%global gt_commit 703bd9caab50b139428cea1aaff9974ebee5742e +%global gt_shortcommit %(c=%{gt_commit}; echo ${c:0:7}) Summary: The WebAssembly Binary Toolkit Name: wabt @@ -15,11 +17,11 @@ URL: https://github.com/WebAssembly/wabt Source0: https://github.com/WebAssembly/wabt/archive/%{version}/%{name}-%{version}.tar.gz Source1: https://github.com/WebAssembly/testsuite/archive/%{ts_commit}/%{name}-testsuite-%{ts_shortcommit}.tar.gz Source2: https://github.com/WebAssembly/wasm-c-api/archive/%{wc_commit}/%{name}-wasm-c-api-%{wc_shortcommit}.tar.gz +Source3: https://github.com/google/googletest/archive/%{gt_commit}/googletest-%{gt_shortcommit}.tar.gz License: ASL 2.0 BuildRequires: cmake3 BuildRequires: gcc-c++ %if %{with check} -BuildRequires: gtest-devel BuildRequires: python%{python3_pkgversion}-ply %endif # wasm.h from https://github.com/WebAssembly/wasm-c-api/ is used for build @@ -38,11 +40,13 @@ with the spec (e.g. 1:1 round-trips with no changes to instructions). %prep %setup -q %if %{with check} -rmdir third_party/{testsuite,wasm-c-api} +rmdir third_party/{gtest,testsuite,wasm-c-api} tar xzf %{S:1} -C third_party mv third_party/testsuite{-%{ts_commit},} tar xzf %{S:2} -C third_party mv third_party/wasm-c-api{-%{wc_commit},} +tar xzf %{S:3} -C third_party +mv third_party/{googletest-%{gt_commit},gtest} pushd test # https://github.com/WebAssembly/wabt/issues/1045 %ifarch ppc64le @@ -54,7 +58,7 @@ popd %endif %build -%cmake3 -DUSE_SYSTEM_GTEST=ON +%cmake3 -DUSE_SYSTEM_GTEST=OFF %cmake3_build %install @@ -101,6 +105,7 @@ test/run-tests.py -v --bindir %{_vpath_builddir} --timeout=80 %{?_smp_mflags} - update to 1.0.24 (#1993479) - enable skipped tests on s390x (fixed upstream) - use _cmake3_in_source_build macro on EPEL +- use bundled gtest * Fri May 14 2021 Dominik Mierzejewski 1.0.23-1 - update to 1.0.23 (#1934466) From 322307d1c9a8e7da5ab7a5a91af77c9a00693da6 Mon Sep 17 00:00:00 2001 From: Dominik 'Rathann' Mierzejewski Date: Fri, 20 Aug 2021 14:17:35 +0200 Subject: [PATCH 5/7] use gcc from devtoolset-10 Upstream issue: https://github.com/WebAssembly/wabt/issues/1703 --- wabt.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wabt.spec b/wabt.spec index 9848417..8e444b2 100644 --- a/wabt.spec +++ b/wabt.spec @@ -20,7 +20,8 @@ Source2: https://github.com/WebAssembly/wasm-c-api/archive/%{wc_commit}/%{name}- Source3: https://github.com/google/googletest/archive/%{gt_commit}/googletest-%{gt_shortcommit}.tar.gz License: ASL 2.0 BuildRequires: cmake3 -BuildRequires: gcc-c++ +# https://github.com/WebAssembly/wabt/issues/1703 +BuildRequires: devtoolset-10-gcc-c++ %if %{with check} BuildRequires: python%{python3_pkgversion}-ply %endif @@ -58,6 +59,7 @@ popd %endif %build +. /opt/rh/devtoolset-10/enable %cmake3 -DUSE_SYSTEM_GTEST=OFF %cmake3_build @@ -106,6 +108,7 @@ test/run-tests.py -v --bindir %{_vpath_builddir} --timeout=80 %{?_smp_mflags} - enable skipped tests on s390x (fixed upstream) - use _cmake3_in_source_build macro on EPEL - use bundled gtest +- use gcc from devtoolset-10 * Fri May 14 2021 Dominik Mierzejewski 1.0.23-1 - update to 1.0.23 (#1934466) From 75053205d38ae0c58dfd98fd05e37a8cfb79f01e Mon Sep 17 00:00:00 2001 From: Dominik 'Rathann' Mierzejewski Date: Fri, 20 Aug 2021 14:47:13 +0200 Subject: [PATCH 6/7] fix test/wasm2c/spec/names.txt test with python-3.6 Upstream issue https://github.com/WebAssembly/wabt/issues/1704 . --- wabt-testsuite.patch | 12 ++++++++++++ wabt.spec | 4 ++++ 2 files changed, 16 insertions(+) create mode 100644 wabt-testsuite.patch diff --git a/wabt-testsuite.patch b/wabt-testsuite.patch new file mode 100644 index 0000000..d687723 --- /dev/null +++ b/wabt-testsuite.patch @@ -0,0 +1,12 @@ +diff -up wabt-1.0.24/test/run-spec-wasm2c.py.utf8 wabt-1.0.24/test/run-spec-wasm2c.py +--- wabt-1.0.24/test/run-spec-wasm2c.py.utf8 2021-08-11 22:00:51.000000000 +0200 ++++ wabt-1.0.24/test/run-spec-wasm2c.py 2021-08-20 13:47:48.766113890 +0200 +@@ -390,7 +390,7 @@ def main(args): + + cc = utils.Executable(options.cc, *options.cflags) + +- with open(json_file_path) as json_file: ++ with open(json_file_path, encoding="utf-8") as json_file: + spec_json = json.load(json_file) + + prefix = '' diff --git a/wabt.spec b/wabt.spec index 8e444b2..3e80928 100644 --- a/wabt.spec +++ b/wabt.spec @@ -18,6 +18,8 @@ Source0: https://github.com/WebAssembly/wabt/archive/%{version}/%{name}-%{versio Source1: https://github.com/WebAssembly/testsuite/archive/%{ts_commit}/%{name}-testsuite-%{ts_shortcommit}.tar.gz Source2: https://github.com/WebAssembly/wasm-c-api/archive/%{wc_commit}/%{name}-wasm-c-api-%{wc_shortcommit}.tar.gz Source3: https://github.com/google/googletest/archive/%{gt_commit}/googletest-%{gt_shortcommit}.tar.gz +# https://github.com/WebAssembly/wabt/issues/1704 +Patch0: %{name}-testsuite.patch License: ASL 2.0 BuildRequires: cmake3 # https://github.com/WebAssembly/wabt/issues/1703 @@ -41,6 +43,7 @@ with the spec (e.g. 1:1 round-trips with no changes to instructions). %prep %setup -q %if %{with check} +%patch0 -p1 -b .utf8 rmdir third_party/{gtest,testsuite,wasm-c-api} tar xzf %{S:1} -C third_party mv third_party/testsuite{-%{ts_commit},} @@ -109,6 +112,7 @@ test/run-tests.py -v --bindir %{_vpath_builddir} --timeout=80 %{?_smp_mflags} - use _cmake3_in_source_build macro on EPEL - use bundled gtest - use gcc from devtoolset-10 +- fix test/wasm2c/spec/names.txt test with python-3.6 * Fri May 14 2021 Dominik Mierzejewski 1.0.23-1 - update to 1.0.23 (#1934466) From 0451c957ecfde65a1a186880fb74e1fb0cd24911 Mon Sep 17 00:00:00 2001 From: Dominik 'Rathann' Mierzejewski Date: Fri, 20 Aug 2021 15:36:22 +0200 Subject: [PATCH 7/7] skip two still failing tests on ppc64le Upstream issue https://github.com/WebAssembly/wabt/issues/1045 --- wabt.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wabt.spec b/wabt.spec index 3e80928..f8f571b 100644 --- a/wabt.spec +++ b/wabt.spec @@ -57,6 +57,8 @@ pushd test rm spec/conversions.txt rm spec/simd/simd_conversions.txt rm wasm2c/spec/conversions.txt +rm wasm2c/spec/f32.txt +rm wasm2c/spec/f64.txt %endif popd %endif