From f760f3abe0775916efb356fce04788d75f23b857 Mon Sep 17 00:00:00 2001 From: barrystyle Date: Tue, 6 Dec 2022 01:51:48 +0800 Subject: [PATCH 1/8] patch boost for ifdef pthread --- depends/packages/boost.mk | 2 ++ depends/patches/boost/commit-74fb0a2.patch | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 depends/patches/boost/commit-74fb0a2.patch diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index 98f25db9b9..6ca40fe435 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -4,6 +4,7 @@ $(package)_download_path=https://boostorg.jfrog.io/artifactory/main/release/$(su $(package)_file_name=boost_$($(package)_version).tar.bz2 $(package)_sha256_hash=d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee $(package)_dependencies=native_b2 +$(package)_patches=commit-74fb0a2.patch define $(package)_set_vars $(package)_config_opts_release=variant=release @@ -29,6 +30,7 @@ $(package)_cxxflags_android=-fPIC endef define $(package)_preprocess_cmds + patch -p2 -i $($(package)_patch_dir)/commit-74fb0a2.patch && \ echo "using $($(package)_toolset_$(host_os)) : : $($(package)_cxx) : \"$($(package)_cflags)\" \"$($(package)_cxxflags)\" \"$($(package)_cppflags)\" \"$($(package)_ldflags)\" \"$($(package)_ar)\" \"$(host_STRIP)\" \"$(host_RANLIB)\" \"$(host_WINDRES)\" : ;" > user-config.jam endef diff --git a/depends/patches/boost/commit-74fb0a2.patch b/depends/patches/boost/commit-74fb0a2.patch new file mode 100644 index 0000000000..a2f706c6d0 --- /dev/null +++ b/depends/patches/boost/commit-74fb0a2.patch @@ -0,0 +1,19 @@ +From 74fb0a26099bc51d717f5f154b37231ce7df3e98 Mon Sep 17 00:00:00 2001 +From: Rob Boehne +Date: Wed, 20 Nov 2019 11:25:20 -0600 +Subject: Revert change to elide a warning that caused Solaris builds to fail. + + +diff --git a/include/boost/thread/pthread/thread_data.hpp b/include/boost/thread/pthread/thread_data.hpp +index aefbeb43..bc9b1367 100644 +--- a/include/boost/thread/pthread/thread_data.hpp ++++ b/include/boost/thread/pthread/thread_data.hpp +@@ -57,7 +57,7 @@ namespace boost + #else + std::size_t page_size = ::sysconf( _SC_PAGESIZE); + #endif +-#if PTHREAD_STACK_MIN > 0 ++#ifdef PTHREAD_STACK_MIN + if (size Date: Tue, 6 Dec 2022 01:52:16 +0800 Subject: [PATCH 2/8] update path with working url for qt --- depends/packages/qt.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 31e60fcd6a..be7bda7a4f 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -1,6 +1,6 @@ PACKAGE=qt $(package)_version=5.12.11 -$(package)_download_path=https://download.qt.io/official_releases/qt/5.12/$($(package)_version)/submodules +$(package)_download_path=https://master.qt.io/archive/qt/5.12/$($(package)_version)/submodules $(package)_suffix=everywhere-src-$($(package)_version).tar.xz $(package)_file_name=qtbase-$($(package)_suffix) $(package)_sha256_hash=1c1b4e33137ca77881074c140d54c3c9747e845a31338cfe8680f171f0bc3a39 From d2e39c0a33bb716456a7e6fd24e3e96a3897b3d7 Mon Sep 17 00:00:00 2001 From: barrystyle Date: Tue, 6 Dec 2022 01:58:04 +0800 Subject: [PATCH 3/8] revert libzmq 4.3.4 -> 4.3.1 (introduced on c8197cd) --- depends/packages/zeromq.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/depends/packages/zeromq.mk b/depends/packages/zeromq.mk index d0497c6962..3b7f3690a4 100644 --- a/depends/packages/zeromq.mk +++ b/depends/packages/zeromq.mk @@ -1,8 +1,8 @@ package=zeromq -$(package)_version=4.3.4 +$(package)_version=4.3.1 $(package)_download_path=https://github.com/zeromq/libzmq/releases/download/v$($(package)_version)/ $(package)_file_name=$(package)-$($(package)_version).tar.gz -$(package)_sha256_hash=c593001a89f5a85dd2ddf564805deb860e02471171b3f204944857336295c3e5 +$(package)_sha256_hash=bcbabe1e2c7d0eec4ed612e10b94b112dd5f06fcefa994a0c79a45d835cd21eb $(package)_patches=remove_libstd_link.patch define $(package)_set_vars From 9aa1b3e0e23fa7d0502249fe918f546fc74491e5 Mon Sep 17 00:00:00 2001 From: barrystyle Date: Tue, 6 Dec 2022 02:17:33 +0800 Subject: [PATCH 4/8] patch qt with bitcoin pr#22186 --- depends/packages/qt.mk | 3 +- depends/patches/qt/fix_limits_header.patch | 44 ++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 depends/patches/qt/fix_limits_header.patch diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index be7bda7a4f..c8bf974e9f 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -11,7 +11,7 @@ $(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_no_printer.patch no $(package)_patches+= fix_android_qmake_conf.patch fix_android_jni_static.patch dont_hardcode_pwd.patch $(package)_patches+= drop_lrelease_dependency.patch no_sdk_version_check.patch $(package)_patches+= fix_lib_paths.patch fix_android_pch.patch -$(package)_patches+= qtbase-moc-ignore-gcc-macro.patch +$(package)_patches+= qtbase-moc-ignore-gcc-macro.patch fix_limits_header.patch $(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) $(package)_qttranslations_sha256_hash=577b0668a777eb2b451c61e8d026d79285371597ce9df06b6dee6c814164b7c3 @@ -230,6 +230,7 @@ define $(package)_preprocess_cmds patch -p1 -i $($(package)_patch_dir)/no_sdk_version_check.patch && \ patch -p1 -i $($(package)_patch_dir)/fix_lib_paths.patch && \ patch -p1 -i $($(package)_patch_dir)/qtbase-moc-ignore-gcc-macro.patch && \ + patch -p1 -i $($(package)_patch_dir)/fix_limits_header.patch && \ sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \ mkdir -p qtbase/mkspecs/macx-clang-linux &&\ cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\ diff --git a/depends/patches/qt/fix_limits_header.patch b/depends/patches/qt/fix_limits_header.patch new file mode 100644 index 0000000000..e4313770e5 --- /dev/null +++ b/depends/patches/qt/fix_limits_header.patch @@ -0,0 +1,44 @@ +Fix compiling with GCC 11 + +See: https://bugreports.qt.io/browse/QTBUG-90395. + +Upstream commits: + - Qt 5.15 -- unavailable as open source + - Qt 6.0: b2af6332ea37e45ab230a7a5d2d278f86d961b83 + - Qt 6.1: 9c56d4da2ff631a8c1c30475bd792f6c86bda53c + +--- old/qtbase/src/corelib/global/qendian.h ++++ new/qtbase/src/corelib/global/qendian.h +@@ -44,6 +44,8 @@ + #include + #include + ++#include ++ + // include stdlib.h and hope that it defines __GLIBC__ for glibc-based systems + #include + #include + +--- old/qtbase/src/corelib/tools/qbytearraymatcher.h ++++ new/qtbase/src/corelib/tools/qbytearraymatcher.h +@@ -42,6 +42,8 @@ + + #include + ++#include ++ + QT_BEGIN_NAMESPACE + + + +--- old/qtbase/src/tools/moc/generator.cpp ++++ new/qtbase/src/tools/moc/generator.cpp +@@ -40,6 +40,8 @@ + #include + #include + ++#include ++ + #include + #include + From 9433d3dabaa9590f89409dd3ddcdebbbeb0b4fd5 Mon Sep 17 00:00:00 2001 From: barrystyle Date: Tue, 6 Dec 2022 01:58:56 +0800 Subject: [PATCH 5/8] add trial workflow for x86_64-w64-mingw32 --- .github/workflows/ravencoin-cross.yml | 56 +++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/ravencoin-cross.yml diff --git a/.github/workflows/ravencoin-cross.yml b/.github/workflows/ravencoin-cross.yml new file mode 100644 index 0000000000..91b678e978 --- /dev/null +++ b/.github/workflows/ravencoin-cross.yml @@ -0,0 +1,56 @@ +name: 'build ravencoin (x86_64-w64-mingw32)' + +on: [push] + +jobs: + build: + runs-on: ubuntu-22.04 + strategy: + matrix: + os: [x86_64-w64-mingw32] + + steps: + - uses: actions/checkout@v2 + + - name: Cache apt depencenies + uses: actions/cache@v2 + id: cache-apt + with: + path: "~/apt-cache" + key: apt-cache + + - name: Cache depends + id: cache-dependencies + uses: actions/cache@v2 + with: + path: depends/${{ matrix.os }} + key: ${{ matrix.os }}-${{ hashFiles('depends/packages/*.mk') }} + + - name: Install dependencies + env: + CACHE_HIT: ${{steps.cache-apt.outputs.cache-hit}} + DEPS: build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git ca-certificates ccache g++-mingw-w64-x86-64 + run: | + if [[ "$CACHE_HIT" == 'true' ]]; then + sudo cp --force --recursive ~/apt-cache/* / + else + sudo apt-get update && sudo apt-get install -yq $DEPS + mkdir -p ~/apt-cache + for dep in $DEPS; do + dpkg -L $dep | while IFS= read -r f; do if test -f $f; then echo $f; fi; done | xargs cp --parents --target-directory ~/apt-cache/ + done + fi + + - name: Build depends + if: steps.cache-dependencies.outputs.cache-hit != 'true' && steps.cache-apt.outputs.cache-hit != 'true' + run: cd depends/ && make -j4 HOST=${{matrix.os}} + + - name: Refresh automake configs + run: ./autogen.sh + + - name: Configure automake + run: ./configure --prefix=`pwd`/depends/${{ matrix.os }} + + - name: Build codebase + run: make -j4 + From eb7a25a4872b88bb61cd7db983da63570b2bebfa Mon Sep 17 00:00:00 2001 From: barrystyle Date: Tue, 6 Dec 2022 03:05:00 +0800 Subject: [PATCH 6/8] force posix --- .github/workflows/ravencoin-cross.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ravencoin-cross.yml b/.github/workflows/ravencoin-cross.yml index 91b678e978..e5c3f0ce6a 100644 --- a/.github/workflows/ravencoin-cross.yml +++ b/.github/workflows/ravencoin-cross.yml @@ -40,6 +40,7 @@ jobs: dpkg -L $dep | while IFS= read -r f; do if test -f $f; then echo $f; fi; done | xargs cp --parents --target-directory ~/apt-cache/ done fi + sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix - name: Build depends if: steps.cache-dependencies.outputs.cache-hit != 'true' && steps.cache-apt.outputs.cache-hit != 'true' From 4c605b696551314c85cfa3d916da717fd9cbda74 Mon Sep 17 00:00:00 2001 From: barrystyle Date: Sat, 24 Dec 2022 18:25:39 +0800 Subject: [PATCH 7/8] port veil changes using std::mutex instead of c-style pthread --- configure.ac | 26 ++++++++++++++++++++++-- src/Makefile.am | 14 +++++++------ src/crypto/ethash/lib/ethash/managed.cpp | 11 +++++----- src/crypto/ethash/lib/keccak/keccak.c | 2 -- 4 files changed, 37 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index a7970563cb..98d36176b6 100644 --- a/configure.ac +++ b/configure.ac @@ -313,9 +313,9 @@ AC_ARG_WITH([tx], AC_ARG_WITH([libs], [AS_HELP_STRING([--with-libs], - [build libraries (default=yes)])], + [build libraries (default=no)])], [build_raven_libs=$withval], - [build_raven_libs=yes]) + [build_raven_libs=no]) AC_ARG_WITH([daemon], [AS_HELP_STRING([--with-daemon], @@ -673,6 +673,28 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([ ] ) +TEMP_LDFLAGS="$LDFLAGS" +LDFLAGS="$TEMP_LDFLAGS $PTHREAD_CFLAGS" +AC_MSG_CHECKING([for thread_local support]) +AC_LINK_IFELSE([AC_LANG_SOURCE([ + #include + static thread_local int foo = 0; + static void run_thread() { foo++;} + int main(){ + for(int i = 0; i < 10; i++) { std::thread(run_thread).detach();} + return foo; + } + ])], + [ + AC_DEFINE(HAVE_THREAD_LOCAL,1,[Define if thread_local is supported.]) + AC_MSG_RESULT(yes) + ], + [ + AC_MSG_RESULT(no) + ] +) +LDFLAGS="$TEMP_LDFLAGS" + # Check for different ways of gathering OS randomness AC_MSG_CHECKING(for Linux getrandom syscall) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include diff --git a/src/Makefile.am b/src/Makefile.am index a44cc99c66..8d749300db 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,9 +5,11 @@ DIST_SUBDIRS = secp256k1 univalue -AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) $(HARDENED_LDFLAGS) -AM_CXXFLAGS = $(HARDENED_CXXFLAGS) $(ERROR_CXXFLAGS) -AM_CPPFLAGS = $(HARDENED_CPPFLAGS) +AM_LDFLAGS = $(LIBTOOL_LDFLAGS) $(HARDENED_LDFLAGS) $(GPROF_LDFLAGS) $(SANITIZER_LDFLAGS) +AM_CXXFLAGS = $(DEBUG_CXXFLAGS) $(HARDENED_CXXFLAGS) $(WARN_CXXFLAGS) $(NOWARN_CXXFLAGS) $(ERROR_CXXFLAGS) $(GPROF_CXXFLAGS) $(SANITIZER_CXXFLAGS) +AM_CPPFLAGS = $(DEBUG_CPPFLAGS) $(HARDENED_CPPFLAGS) +AM_LIBTOOLFLAGS = --preserve-dup-deps +PTHREAD_FLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) EXTRA_LIBRARIES = if EMBEDDED_UNIVALUE @@ -479,7 +481,7 @@ nodist_libraven_util_a_SOURCES = $(srcdir)/obj/build.h ravend_SOURCES = ravend.cpp ravend_CPPFLAGS = $(AM_CPPFLAGS) $(RAVEN_INCLUDES) ravend_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -ravend_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) +ravend_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) if TARGET_WINDOWS ravend_SOURCES += ravend-res.rc @@ -505,7 +507,7 @@ ravend_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC raven_cli_SOURCES = raven-cli.cpp raven_cli_CPPFLAGS = $(AM_CPPFLAGS) $(RAVEN_INCLUDES) $(EVENT_CFLAGS) raven_cli_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -raven_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) +raven_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) if TARGET_WINDOWS raven_cli_SOURCES += raven-cli-res.rc @@ -524,7 +526,7 @@ raven_cli_LDADD += $(BOOST_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(EVENT_LIBS) raven_tx_SOURCES = raven-tx.cpp raven_tx_CPPFLAGS = $(AM_CPPFLAGS) $(RAVEN_INCLUDES) raven_tx_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -raven_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) +raven_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) if TARGET_WINDOWS raven_tx_SOURCES += raven-tx-res.rc diff --git a/src/crypto/ethash/lib/ethash/managed.cpp b/src/crypto/ethash/lib/ethash/managed.cpp index 3bc277df68..740cd4119b 100644 --- a/src/crypto/ethash/lib/ethash/managed.cpp +++ b/src/crypto/ethash/lib/ethash/managed.cpp @@ -3,9 +3,9 @@ // Licensed under the Apache License, Version 2.0. #include "crypto/ethash/lib/ethash/ethash-internal.hpp" -#include "sync.h" #include +#include #if !defined(__has_cpp_attribute) #define __has_cpp_attribute(x) 0 @@ -23,12 +23,11 @@ using namespace ethash; namespace { - -CCriticalSection shared_context_cs; +std::mutex shared_context_mutex; std::shared_ptr shared_context; thread_local std::shared_ptr thread_local_context; -CCriticalSection shared_context_full_cs; +std::mutex shared_context_full_mutex; std::shared_ptr shared_context_full; thread_local std::shared_ptr thread_local_context_full; @@ -45,7 +44,7 @@ void update_local_context(int epoch_number) thread_local_context.reset(); // Local context invalid, check the shared context. - LOCK(shared_context_cs); + std::lock_guard lock{shared_context_mutex}; if (!shared_context || shared_context->epoch_number != epoch_number) { @@ -66,7 +65,7 @@ void update_local_context_full(int epoch_number) thread_local_context_full.reset(); // Local context invalid, check the shared context. - LOCK(shared_context_full_cs); + std::lock_guard lock{shared_context_full_mutex}; if (!shared_context_full || shared_context_full->epoch_number != epoch_number) { diff --git a/src/crypto/ethash/lib/keccak/keccak.c b/src/crypto/ethash/lib/keccak/keccak.c index f31632a81b..e455c0a126 100644 --- a/src/crypto/ethash/lib/keccak/keccak.c +++ b/src/crypto/ethash/lib/keccak/keccak.c @@ -19,8 +19,6 @@ #define __BYTE_ORDER __LITTLE_ENDIAN #elif __APPLE__ #include -#elif __FreeBSD__ -#include #else #include #endif From e48d932ec70267a62ec3541bdaf4fe022c149f0e Mon Sep 17 00:00:00 2001 From: hans-schmidt <43421934+hans-schmidt@users.noreply.github.com> Date: Sat, 11 Mar 2023 18:02:22 -0600 Subject: [PATCH 8/8] Remove problem pr1224 (#1226) * Revert "port veil changes using std::mutex instead of c-style pthread" This reverts commit 4c605b696551314c85cfa3d916da717fd9cbda74. * Revert "force posix" This reverts commit eb7a25a4872b88bb61cd7db983da63570b2bebfa. * Revert "add trial workflow for x86_64-w64-mingw32" This reverts commit 9433d3dabaa9590f89409dd3ddcdebbbeb0b4fd5. * Revert "patch qt with bitcoin pr#22186" This reverts commit 9aa1b3e0e23fa7d0502249fe918f546fc74491e5. * Revert "revert libzmq 4.3.4 -> 4.3.1 (introduced on c8197cd)" This reverts commit d2e39c0a33bb716456a7e6fd24e3e96a3897b3d7. * Revert "update path with working url for qt" This reverts commit dbb4b9fb9adc5788271ef3f1a580752ae6d84045. * Revert "patch boost for ifdef pthread" This reverts commit f760f3abe0775916efb356fce04788d75f23b857. * Update URL for qt-5.12.11 --- .github/workflows/ravencoin-cross.yml | 57 ---------------------- configure.ac | 26 +--------- depends/packages/boost.mk | 2 - depends/packages/qt.mk | 6 +-- depends/packages/zeromq.mk | 4 +- depends/patches/boost/commit-74fb0a2.patch | 19 -------- depends/patches/qt/fix_limits_header.patch | 44 ----------------- src/Makefile.am | 14 +++--- src/crypto/ethash/lib/ethash/managed.cpp | 11 +++-- src/crypto/ethash/lib/keccak/keccak.c | 2 + 10 files changed, 21 insertions(+), 164 deletions(-) delete mode 100644 .github/workflows/ravencoin-cross.yml delete mode 100644 depends/patches/boost/commit-74fb0a2.patch delete mode 100644 depends/patches/qt/fix_limits_header.patch diff --git a/.github/workflows/ravencoin-cross.yml b/.github/workflows/ravencoin-cross.yml deleted file mode 100644 index e5c3f0ce6a..0000000000 --- a/.github/workflows/ravencoin-cross.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: 'build ravencoin (x86_64-w64-mingw32)' - -on: [push] - -jobs: - build: - runs-on: ubuntu-22.04 - strategy: - matrix: - os: [x86_64-w64-mingw32] - - steps: - - uses: actions/checkout@v2 - - - name: Cache apt depencenies - uses: actions/cache@v2 - id: cache-apt - with: - path: "~/apt-cache" - key: apt-cache - - - name: Cache depends - id: cache-dependencies - uses: actions/cache@v2 - with: - path: depends/${{ matrix.os }} - key: ${{ matrix.os }}-${{ hashFiles('depends/packages/*.mk') }} - - - name: Install dependencies - env: - CACHE_HIT: ${{steps.cache-apt.outputs.cache-hit}} - DEPS: build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git ca-certificates ccache g++-mingw-w64-x86-64 - run: | - if [[ "$CACHE_HIT" == 'true' ]]; then - sudo cp --force --recursive ~/apt-cache/* / - else - sudo apt-get update && sudo apt-get install -yq $DEPS - mkdir -p ~/apt-cache - for dep in $DEPS; do - dpkg -L $dep | while IFS= read -r f; do if test -f $f; then echo $f; fi; done | xargs cp --parents --target-directory ~/apt-cache/ - done - fi - sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix - - - name: Build depends - if: steps.cache-dependencies.outputs.cache-hit != 'true' && steps.cache-apt.outputs.cache-hit != 'true' - run: cd depends/ && make -j4 HOST=${{matrix.os}} - - - name: Refresh automake configs - run: ./autogen.sh - - - name: Configure automake - run: ./configure --prefix=`pwd`/depends/${{ matrix.os }} - - - name: Build codebase - run: make -j4 - diff --git a/configure.ac b/configure.ac index 98d36176b6..a7970563cb 100644 --- a/configure.ac +++ b/configure.ac @@ -313,9 +313,9 @@ AC_ARG_WITH([tx], AC_ARG_WITH([libs], [AS_HELP_STRING([--with-libs], - [build libraries (default=no)])], + [build libraries (default=yes)])], [build_raven_libs=$withval], - [build_raven_libs=no]) + [build_raven_libs=yes]) AC_ARG_WITH([daemon], [AS_HELP_STRING([--with-daemon], @@ -673,28 +673,6 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([ ] ) -TEMP_LDFLAGS="$LDFLAGS" -LDFLAGS="$TEMP_LDFLAGS $PTHREAD_CFLAGS" -AC_MSG_CHECKING([for thread_local support]) -AC_LINK_IFELSE([AC_LANG_SOURCE([ - #include - static thread_local int foo = 0; - static void run_thread() { foo++;} - int main(){ - for(int i = 0; i < 10; i++) { std::thread(run_thread).detach();} - return foo; - } - ])], - [ - AC_DEFINE(HAVE_THREAD_LOCAL,1,[Define if thread_local is supported.]) - AC_MSG_RESULT(yes) - ], - [ - AC_MSG_RESULT(no) - ] -) -LDFLAGS="$TEMP_LDFLAGS" - # Check for different ways of gathering OS randomness AC_MSG_CHECKING(for Linux getrandom syscall) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index 6ca40fe435..98f25db9b9 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -4,7 +4,6 @@ $(package)_download_path=https://boostorg.jfrog.io/artifactory/main/release/$(su $(package)_file_name=boost_$($(package)_version).tar.bz2 $(package)_sha256_hash=d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee $(package)_dependencies=native_b2 -$(package)_patches=commit-74fb0a2.patch define $(package)_set_vars $(package)_config_opts_release=variant=release @@ -30,7 +29,6 @@ $(package)_cxxflags_android=-fPIC endef define $(package)_preprocess_cmds - patch -p2 -i $($(package)_patch_dir)/commit-74fb0a2.patch && \ echo "using $($(package)_toolset_$(host_os)) : : $($(package)_cxx) : \"$($(package)_cflags)\" \"$($(package)_cxxflags)\" \"$($(package)_cppflags)\" \"$($(package)_ldflags)\" \"$($(package)_ar)\" \"$(host_STRIP)\" \"$(host_RANLIB)\" \"$(host_WINDRES)\" : ;" > user-config.jam endef diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index c8bf974e9f..12dd7e657e 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -1,6 +1,7 @@ PACKAGE=qt $(package)_version=5.12.11 -$(package)_download_path=https://master.qt.io/archive/qt/5.12/$($(package)_version)/submodules +#$(package)_download_path=https://download.qt.io/official_releases/qt/5.12/$($(package)_version)/submodules +$(package)_download_path=https://download.qt.io/archive/qt/5.12/$($(package)_version)/submodules $(package)_suffix=everywhere-src-$($(package)_version).tar.xz $(package)_file_name=qtbase-$($(package)_suffix) $(package)_sha256_hash=1c1b4e33137ca77881074c140d54c3c9747e845a31338cfe8680f171f0bc3a39 @@ -11,7 +12,7 @@ $(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_no_printer.patch no $(package)_patches+= fix_android_qmake_conf.patch fix_android_jni_static.patch dont_hardcode_pwd.patch $(package)_patches+= drop_lrelease_dependency.patch no_sdk_version_check.patch $(package)_patches+= fix_lib_paths.patch fix_android_pch.patch -$(package)_patches+= qtbase-moc-ignore-gcc-macro.patch fix_limits_header.patch +$(package)_patches+= qtbase-moc-ignore-gcc-macro.patch $(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) $(package)_qttranslations_sha256_hash=577b0668a777eb2b451c61e8d026d79285371597ce9df06b6dee6c814164b7c3 @@ -230,7 +231,6 @@ define $(package)_preprocess_cmds patch -p1 -i $($(package)_patch_dir)/no_sdk_version_check.patch && \ patch -p1 -i $($(package)_patch_dir)/fix_lib_paths.patch && \ patch -p1 -i $($(package)_patch_dir)/qtbase-moc-ignore-gcc-macro.patch && \ - patch -p1 -i $($(package)_patch_dir)/fix_limits_header.patch && \ sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \ mkdir -p qtbase/mkspecs/macx-clang-linux &&\ cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\ diff --git a/depends/packages/zeromq.mk b/depends/packages/zeromq.mk index 3b7f3690a4..d0497c6962 100644 --- a/depends/packages/zeromq.mk +++ b/depends/packages/zeromq.mk @@ -1,8 +1,8 @@ package=zeromq -$(package)_version=4.3.1 +$(package)_version=4.3.4 $(package)_download_path=https://github.com/zeromq/libzmq/releases/download/v$($(package)_version)/ $(package)_file_name=$(package)-$($(package)_version).tar.gz -$(package)_sha256_hash=bcbabe1e2c7d0eec4ed612e10b94b112dd5f06fcefa994a0c79a45d835cd21eb +$(package)_sha256_hash=c593001a89f5a85dd2ddf564805deb860e02471171b3f204944857336295c3e5 $(package)_patches=remove_libstd_link.patch define $(package)_set_vars diff --git a/depends/patches/boost/commit-74fb0a2.patch b/depends/patches/boost/commit-74fb0a2.patch deleted file mode 100644 index a2f706c6d0..0000000000 --- a/depends/patches/boost/commit-74fb0a2.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 74fb0a26099bc51d717f5f154b37231ce7df3e98 Mon Sep 17 00:00:00 2001 -From: Rob Boehne -Date: Wed, 20 Nov 2019 11:25:20 -0600 -Subject: Revert change to elide a warning that caused Solaris builds to fail. - - -diff --git a/include/boost/thread/pthread/thread_data.hpp b/include/boost/thread/pthread/thread_data.hpp -index aefbeb43..bc9b1367 100644 ---- a/include/boost/thread/pthread/thread_data.hpp -+++ b/include/boost/thread/pthread/thread_data.hpp -@@ -57,7 +57,7 @@ namespace boost - #else - std::size_t page_size = ::sysconf( _SC_PAGESIZE); - #endif --#if PTHREAD_STACK_MIN > 0 -+#ifdef PTHREAD_STACK_MIN - if (size - #include - -+#include -+ - // include stdlib.h and hope that it defines __GLIBC__ for glibc-based systems - #include - #include - ---- old/qtbase/src/corelib/tools/qbytearraymatcher.h -+++ new/qtbase/src/corelib/tools/qbytearraymatcher.h -@@ -42,6 +42,8 @@ - - #include - -+#include -+ - QT_BEGIN_NAMESPACE - - - ---- old/qtbase/src/tools/moc/generator.cpp -+++ new/qtbase/src/tools/moc/generator.cpp -@@ -40,6 +40,8 @@ - #include - #include - -+#include -+ - #include - #include - diff --git a/src/Makefile.am b/src/Makefile.am index 8d749300db..a44cc99c66 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,11 +5,9 @@ DIST_SUBDIRS = secp256k1 univalue -AM_LDFLAGS = $(LIBTOOL_LDFLAGS) $(HARDENED_LDFLAGS) $(GPROF_LDFLAGS) $(SANITIZER_LDFLAGS) -AM_CXXFLAGS = $(DEBUG_CXXFLAGS) $(HARDENED_CXXFLAGS) $(WARN_CXXFLAGS) $(NOWARN_CXXFLAGS) $(ERROR_CXXFLAGS) $(GPROF_CXXFLAGS) $(SANITIZER_CXXFLAGS) -AM_CPPFLAGS = $(DEBUG_CPPFLAGS) $(HARDENED_CPPFLAGS) -AM_LIBTOOLFLAGS = --preserve-dup-deps -PTHREAD_FLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) +AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) $(HARDENED_LDFLAGS) +AM_CXXFLAGS = $(HARDENED_CXXFLAGS) $(ERROR_CXXFLAGS) +AM_CPPFLAGS = $(HARDENED_CPPFLAGS) EXTRA_LIBRARIES = if EMBEDDED_UNIVALUE @@ -481,7 +479,7 @@ nodist_libraven_util_a_SOURCES = $(srcdir)/obj/build.h ravend_SOURCES = ravend.cpp ravend_CPPFLAGS = $(AM_CPPFLAGS) $(RAVEN_INCLUDES) ravend_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -ravend_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) +ravend_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) if TARGET_WINDOWS ravend_SOURCES += ravend-res.rc @@ -507,7 +505,7 @@ ravend_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC raven_cli_SOURCES = raven-cli.cpp raven_cli_CPPFLAGS = $(AM_CPPFLAGS) $(RAVEN_INCLUDES) $(EVENT_CFLAGS) raven_cli_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -raven_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) +raven_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) if TARGET_WINDOWS raven_cli_SOURCES += raven-cli-res.rc @@ -526,7 +524,7 @@ raven_cli_LDADD += $(BOOST_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(EVENT_LIBS) raven_tx_SOURCES = raven-tx.cpp raven_tx_CPPFLAGS = $(AM_CPPFLAGS) $(RAVEN_INCLUDES) raven_tx_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -raven_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) +raven_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) if TARGET_WINDOWS raven_tx_SOURCES += raven-tx-res.rc diff --git a/src/crypto/ethash/lib/ethash/managed.cpp b/src/crypto/ethash/lib/ethash/managed.cpp index 740cd4119b..3bc277df68 100644 --- a/src/crypto/ethash/lib/ethash/managed.cpp +++ b/src/crypto/ethash/lib/ethash/managed.cpp @@ -3,9 +3,9 @@ // Licensed under the Apache License, Version 2.0. #include "crypto/ethash/lib/ethash/ethash-internal.hpp" +#include "sync.h" #include -#include #if !defined(__has_cpp_attribute) #define __has_cpp_attribute(x) 0 @@ -23,11 +23,12 @@ using namespace ethash; namespace { -std::mutex shared_context_mutex; + +CCriticalSection shared_context_cs; std::shared_ptr shared_context; thread_local std::shared_ptr thread_local_context; -std::mutex shared_context_full_mutex; +CCriticalSection shared_context_full_cs; std::shared_ptr shared_context_full; thread_local std::shared_ptr thread_local_context_full; @@ -44,7 +45,7 @@ void update_local_context(int epoch_number) thread_local_context.reset(); // Local context invalid, check the shared context. - std::lock_guard lock{shared_context_mutex}; + LOCK(shared_context_cs); if (!shared_context || shared_context->epoch_number != epoch_number) { @@ -65,7 +66,7 @@ void update_local_context_full(int epoch_number) thread_local_context_full.reset(); // Local context invalid, check the shared context. - std::lock_guard lock{shared_context_full_mutex}; + LOCK(shared_context_full_cs); if (!shared_context_full || shared_context_full->epoch_number != epoch_number) { diff --git a/src/crypto/ethash/lib/keccak/keccak.c b/src/crypto/ethash/lib/keccak/keccak.c index e455c0a126..f31632a81b 100644 --- a/src/crypto/ethash/lib/keccak/keccak.c +++ b/src/crypto/ethash/lib/keccak/keccak.c @@ -19,6 +19,8 @@ #define __BYTE_ORDER __LITTLE_ENDIAN #elif __APPLE__ #include +#elif __FreeBSD__ +#include #else #include #endif