From bc9e6ed8529f8b1d953f27953ebc980536464ef4 Mon Sep 17 00:00:00 2001 From: umarcor Date: Fri, 18 Jun 2021 13:17:50 +0200 Subject: [PATCH] verilator: update to 4.204 --- .../0001-Fix-V3Hash-when-building-m32.patch | 64 +++++++++++++++++++ mingw-w64-verilator/PKGBUILD | 13 +++- 2 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 mingw-w64-verilator/0001-Fix-V3Hash-when-building-m32.patch diff --git a/mingw-w64-verilator/0001-Fix-V3Hash-when-building-m32.patch b/mingw-w64-verilator/0001-Fix-V3Hash-when-building-m32.patch new file mode 100644 index 0000000000000..26b633487b7f8 --- /dev/null +++ b/mingw-w64-verilator/0001-Fix-V3Hash-when-building-m32.patch @@ -0,0 +1,64 @@ +From 0c4d88baccd3d253479ac94f444b0f3c621807a2 Mon Sep 17 00:00:00 2001 +From: Geza Lore +Date: Sun, 13 Jun 2021 20:04:26 +0100 +Subject: [PATCH] Fix V3Hash when building -m32 + +--- + src/V3Hash.h | 24 +++++++++++------------- + 1 file changed, 11 insertions(+), 13 deletions(-) + +diff --git a/src/V3Hash.h b/src/V3Hash.h +index b28b3bf1..06223567 100644 +--- a/src/V3Hash.h ++++ b/src/V3Hash.h +@@ -26,6 +26,10 @@ + class V3Hash final { + uint32_t m_value; // The 32-bit hash value. + ++ inline static uint32_t combine(uint32_t a, uint32_t b) { ++ return a ^ (b + 0x9e3779b9 + (a << 6) + (a >> 2)); ++ } ++ + public: + // CONSTRUCTORS + V3Hash() +@@ -34,8 +38,10 @@ public: + : m_value{val} {} + explicit V3Hash(int32_t val) + : m_value{static_cast(val)} {} +- explicit V3Hash(size_t val) +- : m_value{static_cast(val)} {} ++ explicit V3Hash(uint64_t val) ++ : m_value{combine(static_cast(val), static_cast(val >> 32))} {} ++ explicit V3Hash(int64_t val) ++ : m_value{combine(static_cast(val), static_cast(val >> 32))} {} + explicit V3Hash(const std::string& val); + + // METHODS +@@ -48,20 +54,12 @@ public: + bool operator<(const V3Hash& rh) const { return m_value < rh.m_value; } + + // '+' combines hashes +- V3Hash operator+(const V3Hash& that) const { +- return V3Hash(m_value ^ (that.m_value + 0x9e3779b9 + (m_value << 6) + (m_value >> 2))); ++ template V3Hash operator+(T that) const { ++ return V3Hash(combine(m_value, V3Hash(that).m_value)); + } +- V3Hash operator+(uint32_t value) const { return *this + V3Hash(value); } +- V3Hash operator+(int32_t value) const { return *this + V3Hash(value); } +- V3Hash operator+(size_t value) const { return *this + V3Hash(value); } +- V3Hash operator+(const std::string& value) const { return *this + V3Hash(value); } + + // '+=' combines in place +- V3Hash& operator+=(const V3Hash& that) { return *this = *this + that; } +- V3Hash& operator+=(uint32_t value) { return *this += V3Hash(value); } +- V3Hash& operator+=(int32_t value) { return *this += V3Hash(value); } +- V3Hash& operator+=(size_t value) { return *this += V3Hash(value); } +- V3Hash& operator+=(const std::string& that) { return *this += V3Hash(that); } ++ template V3Hash& operator+=(T that) { return *this = *this + that; } + }; + + std::ostream& operator<<(std::ostream& os, const V3Hash& rhs); +-- +2.32.0 + diff --git a/mingw-w64-verilator/PKGBUILD b/mingw-w64-verilator/PKGBUILD index 8f97042872ec3..7ec2d30ce8f03 100644 --- a/mingw-w64-verilator/PKGBUILD +++ b/mingw-w64-verilator/PKGBUILD @@ -3,7 +3,7 @@ _realname=verilator pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" -pkgver=4.202 +pkgver=4.204 pkgrel=1 pkgdesc="The fastest free Verilog HDL simulator (mingw-w64)" arch=('any') @@ -14,13 +14,20 @@ groups=("${MINGW_PACKAGE_PREFIX}-eda") makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "flex") depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs") -source=("${_realname}::https://codeload.github.com/${_realname}/${_realname}/tar.gz/v${pkgver}") -sha256sums=('a60c02f299ddb5bb8e963dc7d81983c55c293d97718685c1cd4b66638a33d98e') +source=( + "${_realname}::https://codeload.github.com/${_realname}/${_realname}/tar.gz/v${pkgver}" + '0001-Fix-V3Hash-when-building-m32.patch' +) +sha256sums=( + 'dbad9bd3cac34e63bbd945fff9a59eaabe31dae1e1c93c847d0f894db9919498' + '9c2a039f72d14896e9def846f4f274ce98cde52ee34cd3adad2c715b8e93c000' +) prepare() { [[ -d "${srcdir}/build-${MINGW_CHOST}" ]] && rm -rf "${srcdir}/build-${MINGW_CHOST}" cp -rf "${srcdir}/${_realname}-${pkgver}" "${srcdir}/build-${MINGW_CHOST}" cd "${srcdir}/build-${MINGW_CHOST}" + patch -p1 < ${srcdir}/0001-Fix-V3Hash-when-building-m32.patch sh autoconf }