From d93a6f052c055011684beedebd201c4473a4399f Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 6 Feb 2018 23:37:33 -0800 Subject: [PATCH] Patch binaryen for GCC 8 --- 0001-Fix-Wcatch-value-from-GCC-8.patch | 57 ++++++++++++++++++++++++++ rust.spec | 8 ++++ 2 files changed, 65 insertions(+) create mode 100644 0001-Fix-Wcatch-value-from-GCC-8.patch diff --git a/0001-Fix-Wcatch-value-from-GCC-8.patch b/0001-Fix-Wcatch-value-from-GCC-8.patch new file mode 100644 index 0000000..49d037b --- /dev/null +++ b/0001-Fix-Wcatch-value-from-GCC-8.patch @@ -0,0 +1,57 @@ +From 327c3d06258576cc9d9f2e5c0861abc72ebd10ef Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Fri, 2 Feb 2018 16:23:04 -0800 +Subject: [PATCH] Fix -Wcatch-value from GCC 8 + +These instances may simply be caught by reference instead. +--- + src/tools/asm2wasm.cpp | 2 +- + src/tools/s2wasm.cpp | 2 +- + src/wasm/wasm-s-parser.cpp | 4 ++-- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/tools/asm2wasm.cpp b/src/tools/asm2wasm.cpp +index 75a2c4d15e2e..6d14067d240f 100644 +--- a/src/tools/asm2wasm.cpp ++++ b/src/tools/asm2wasm.cpp +@@ -87,7 +87,7 @@ int main(int argc, const char *argv[]) { + [&trapMode](Options *o, const std::string &argument) { + try { + trapMode = trapModeFromString(argument); +- } catch (std::invalid_argument e) { ++ } catch (std::invalid_argument &e) { + std::cerr << "Error: " << e.what() << "\n"; + exit(EXIT_FAILURE); + } +diff --git a/src/tools/s2wasm.cpp b/src/tools/s2wasm.cpp +index 32af57dba5bf..c5e1d52b8d96 100644 +--- a/src/tools/s2wasm.cpp ++++ b/src/tools/s2wasm.cpp +@@ -92,7 +92,7 @@ int main(int argc, const char *argv[]) { + [&trapMode](Options *o, const std::string &argument) { + try { + trapMode = trapModeFromString(argument); +- } catch (std::invalid_argument e) { ++ } catch (std::invalid_argument &e) { + std::cerr << "Error: " << e.what() << "\n"; + exit(EXIT_FAILURE); + } +diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp +index 0de3edf3f6b4..78a150f8146c 100644 +--- a/src/wasm/wasm-s-parser.cpp ++++ b/src/wasm/wasm-s-parser.cpp +@@ -1408,9 +1408,9 @@ Name SExpressionWasmBuilder::getLabel(Element& s) { + uint64_t offset; + try { + offset = std::stoll(s.c_str(), nullptr, 0); +- } catch (std::invalid_argument) { ++ } catch (std::invalid_argument&) { + throw ParseException("invalid break offset"); +- } catch (std::out_of_range) { ++ } catch (std::out_of_range&) { + throw ParseException("out of range break offset"); + } + if (offset > nameMapper.labelStack.size()) throw ParseException("invalid label", s.line, s.col); +-- +2.14.3 + diff --git a/rust.spec b/rust.spec index fc0daea..982db8f 100644 --- a/rust.spec +++ b/rust.spec @@ -62,6 +62,9 @@ ExclusiveArch: %{rust_arches} %endif Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz +# https://github.com/WebAssembly/binaryen/pull/1400 +Patch1: 0001-Fix-Wcatch-value-from-GCC-8.patch + # Get the Rust triple for any arch. %{lua: function rust_triple(arch) local abi = "gnu" @@ -282,6 +285,10 @@ test -f '%{local_rust_root}/bin/rustc' %setup -q -n %{rustc_package} +pushd src/binaryen +%patch1 -p1 -b .catch-value +popd + # We're disabling jemalloc, but rust-src still wants it. # rm -rf src/jemalloc/ @@ -481,6 +488,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog * Tue Feb 06 2018 Josh Stone - 1.23.0-3 - Use full-bootstrap to work around a rebuild issue. +- Patch binaryen for GCC 8 * Thu Feb 01 2018 Igor Gnatenko - 1.23.0-2 - Switch to %%ldconfig_scriptlets