diff options
Diffstat (limited to 'contrib')
34 files changed, 101 insertions, 520 deletions
diff --git a/contrib/brew/Brewfile b/contrib/brew/Brewfile index c74e7b2a2..c2fae0ffc 100644 --- a/contrib/brew/Brewfile +++ b/contrib/brew/Brewfile @@ -31,4 +31,5 @@ brew "doxygen" brew "graphviz" brew "libunwind-headers" brew "xz" -brew "protobuf" +brew "protobuf@21", link: true +brew "libusb" diff --git a/contrib/depends/Makefile b/contrib/depends/Makefile index 4b60ee054..ce74de184 100644 --- a/contrib/depends/Makefile +++ b/contrib/depends/Makefile @@ -68,21 +68,6 @@ $(host_arch)_$(host_os)_prefix=$(BASEDIR)/$(host) $(host_arch)_$(host_os)_host=$(host) host_prefix=$($(host_arch)_$(host_os)_prefix) build_prefix=$(host_prefix)/native -ifeq ($(host_os),mingw32) -host_cmake=Windows -endif -ifeq ($(host_os),linux) -host_cmake=Linux -endif -ifeq ($(host_os),freebsd) -host_cmake=FreeBSD -endif -ifeq ($(host_os),darwin) -host_cmake=Darwin -endif -ifeq ($(host_os),android) -host_cmake=Android -endif AT_$(V):= AT_:=@ @@ -151,7 +136,7 @@ $(host_prefix)/share/toolchain.cmake : toolchain.cmake.in $(host_prefix)/.stamp_ -e 's|@debug@|$(DEBUG)|' \ -e 's|@release_type@|$(release_type)|' \ -e 's|@build_tests@|$(build_tests)|' \ - -e 's|@depends@|$(host_cmake)|' \ + -e 's|@cmake_system_name@|$($(host_os)_cmake_system)|' \ -e 's|@prefix@|$($(host_arch)_$(host_os)_prefix)|'\ -e 's|@arch@|$(host_arch)|'\ $< > $@ @@ -185,7 +170,7 @@ install: check-packages $(host_prefix)/share/toolchain.cmake download-one: check-sources $(all_sources) download-osx: - @$(MAKE) -s HOST=x86_64-apple-darwin11 download-one + @$(MAKE) -s HOST=x86_64-apple-darwin download-one download-linux: @$(MAKE) -s HOST=x86_64-unknown-linux-gnu download-one download-win: diff --git a/contrib/depends/README.md b/contrib/depends/README.md index 2f1d8424a..d19baaf8a 100644 --- a/contrib/depends/README.md +++ b/contrib/depends/README.md @@ -32,7 +32,7 @@ Common `host-platform-triplets` for cross compilation are: - `i686-w64-mingw32` for Win32 - `x86_64-w64-mingw32` for Win64 -- `x86_64-apple-darwin11` for MacOSX x86_64 +- `x86_64-apple-darwin` for MacOSX x86_64 - `arm-linux-gnueabihf` for Linux ARM 32 bit - `aarch64-linux-gnu` for Linux ARM 64 bit - `riscv64-linux-gnu` for Linux RISCV 64 bit diff --git a/contrib/depends/hosts/android.mk b/contrib/depends/hosts/android.mk index d6f8b99dd..b08126e86 100644 --- a/contrib/depends/hosts/android.mk +++ b/contrib/depends/hosts/android.mk @@ -20,3 +20,4 @@ android_debug_CXXFLAGS=$(android_debug_CFLAGS) android_native_toolchain=android_ndk +android_cmake_system=Android diff --git a/contrib/depends/hosts/darwin.mk b/contrib/depends/hosts/darwin.mk index 79d449054..9a96e2601 100644 --- a/contrib/depends/hosts/darwin.mk +++ b/contrib/depends/hosts/darwin.mk @@ -1,12 +1,12 @@ -OSX_MIN_VERSION=10.8 +OSX_MIN_VERSION=10.13 LD64_VERSION=609 ifeq (aarch64, $(host_arch)) CC_target=arm64-apple-$(host_os) else CC_target=$(host) endif -darwin_CC=clang -target $(CC_target) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(host_prefix)/native/SDK/ -mlinker-version=$(LD64_VERSION) -B$(host_prefix)/native/bin/$(host)- -darwin_CXX=clang++ -target $(CC_target) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(host_prefix)/native/SDK/ -mlinker-version=$(LD64_VERSION) -stdlib=libc++ -B$(host_prefix)/native/bin/$(host)- +darwin_CC=clang -target $(CC_target) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(host_prefix)/native/SDK/ -iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks -mlinker-version=$(LD64_VERSION) -B$(host_prefix)/native/bin/$(host)- +darwin_CXX=clang++ -target $(CC_target) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(host_prefix)/native/SDK/ -iwithsysroot/usr/include/c++/v1 -iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks -mlinker-version=$(LD64_VERSION) -stdlib=libc++ -B$(host_prefix)/native/bin/$(host)- darwin_CFLAGS=-pipe darwin_CXXFLAGS=$(darwin_CFLAGS) @@ -19,3 +19,5 @@ darwin_debug_CFLAGS=-O1 darwin_debug_CXXFLAGS=$(darwin_debug_CFLAGS) darwin_native_toolchain=native_cctools darwin_sdk + +darwin_cmake_system=Darwin diff --git a/contrib/depends/hosts/freebsd.mk b/contrib/depends/hosts/freebsd.mk index 2e3b5933e..d3c6c6149 100644 --- a/contrib/depends/hosts/freebsd.mk +++ b/contrib/depends/hosts/freebsd.mk @@ -16,3 +16,4 @@ freebsd_debug_CXXFLAGS=$(freebsd_debug_CFLAGS) freebsd_native_toolchain=freebsd_base +freebsd_cmake_system=FreeBSD diff --git a/contrib/depends/hosts/linux.mk b/contrib/depends/hosts/linux.mk index 912fdb03c..0f9379f4a 100644 --- a/contrib/depends/hosts/linux.mk +++ b/contrib/depends/hosts/linux.mk @@ -30,3 +30,5 @@ i686_linux_CXX=$(default_host_CXX) -m32 x86_64_linux_CC=$(default_host_CC) -m64 x86_64_linux_CXX=$(default_host_CXX) -m64 endif + +linux_cmake_system=Linux diff --git a/contrib/depends/hosts/mingw32.mk b/contrib/depends/hosts/mingw32.mk index ccc4c5082..58a9a929d 100644 --- a/contrib/depends/hosts/mingw32.mk +++ b/contrib/depends/hosts/mingw32.mk @@ -9,3 +9,5 @@ mingw32_debug_CFLAGS=-O1 mingw32_debug_CXXFLAGS=$(mingw32_debug_CFLAGS) mingw32_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC + +mingw32_cmake_system=Windows diff --git a/contrib/depends/packages/boost.mk b/contrib/depends/packages/boost.mk index fd06c5393..d81bca973 100644 --- a/contrib/depends/packages/boost.mk +++ b/contrib/depends/packages/boost.mk @@ -3,7 +3,6 @@ $(package)_version=1_64_0 $(package)_download_path=https://downloads.sourceforge.net/project/boost/boost/1.64.0/ $(package)_file_name=$(package)_$($(package)_version).tar.bz2 $(package)_sha256_hash=7bcc5caace97baa948931d712ea5f37038dbb1c5d89b43ad4def4ed7cb683332 -$(package)_dependencies=libiconv $(package)_patches=fix_aroptions.patch fix_arm_arch.patch define $(package)_set_vars @@ -22,7 +21,8 @@ $(package)_toolset_$(host_os)=gcc $(package)_archiver_$(host_os)=$($(package)_ar) $(package)_toolset_darwin=darwin $(package)_archiver_darwin=$($(package)_libtool) -$(package)_config_libraries=chrono,filesystem,program_options,system,thread,test,date_time,regex,serialization,locale +$(package)_config_libraries_$(host_os)="chrono,filesystem,program_options,system,thread,test,date_time,regex,serialization" +$(package)_config_libraries_mingw32="chrono,filesystem,program_options,system,thread,test,date_time,regex,serialization,locale" $(package)_cxxflags=-std=c++11 $(package)_cxxflags_linux=-fPIC $(package)_cxxflags_freebsd=-fPIC @@ -35,7 +35,7 @@ define $(package)_preprocess_cmds endef define $(package)_config_cmds - ./bootstrap.sh --without-icu --with-libraries=$(boost_config_libraries) + ./bootstrap.sh --without-icu --with-libraries=$(boost_config_libraries_$(host_os)) endef define $(package)_build_cmds diff --git a/contrib/depends/packages/darwin_sdk.mk b/contrib/depends/packages/darwin_sdk.mk index d639c422e..3355dcf3a 100644 --- a/contrib/depends/packages/darwin_sdk.mk +++ b/contrib/depends/packages/darwin_sdk.mk @@ -1,8 +1,8 @@ package=darwin_sdk -$(package)_version=11.1 -$(package)_download_path=https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/ -$(package)_file_name=MacOSX$($(package)_version).sdk.tar.xz -$(package)_sha256_hash=68797baaacb52f56f713400de306a58a7ca00b05c3dc6d58f0a8283bcac721f8 +$(package)_version=12.2 +$(package)_download_path=https://bitcoincore.org/depends-sources/sdks +$(package)_file_name=Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz +$(package)_sha256_hash=df75d30ecafc429e905134333aeae56ac65fac67cb4182622398fd717df77619 define $(package)_stage_cmds mkdir -p $($(package)_staging_dir)/$(host_prefix)/native/SDK &&\ diff --git a/contrib/depends/packages/libiconv.mk b/contrib/depends/packages/libiconv.mk deleted file mode 100644 index eac8b4331..000000000 --- a/contrib/depends/packages/libiconv.mk +++ /dev/null @@ -1,35 +0,0 @@ -package=libiconv -$(package)_version=1.15 -$(package)_download_path=https://ftp.gnu.org/gnu/libiconv -$(package)_file_name=libiconv-$($(package)_version).tar.gz -$(package)_sha256_hash=ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178 -$(package)_patches=fix-whitespace.patch - -define $(package)_set_vars - $(package)_config_opts=--disable-nls - $(package)_config_opts=--enable-static - $(package)_config_opts=--disable-shared - $(package)_config_opts_linux=--with-pic - $(package)_config_opts_freebsd=--with-pic -endef - -define $(package)_preprocess_cmds - cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub build-aux/ &&\ - patch -p1 < $($(package)_patch_dir)/fix-whitespace.patch -endef - -define $(package)_config_cmds - $($(package)_autoconf) AR_FLAGS=$($(package)_arflags) -endef - -define $(package)_build_cmds - $(MAKE) -endef - -define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) install -endef - -define $(package)_postprocess_cmds - rm lib/*.la -endef diff --git a/contrib/depends/packages/libusb.mk b/contrib/depends/packages/libusb.mk index c1d9fe6a9..fb6646685 100644 --- a/contrib/depends/packages/libusb.mk +++ b/contrib/depends/packages/libusb.mk @@ -3,8 +3,10 @@ $(package)_version=1.0.26 $(package)_download_path=https://github.com/libusb/libusb/releases/download/v$($(package)_version) $(package)_file_name=$(package)-$($(package)_version).tar.bz2 $(package)_sha256_hash=12ce7a61fc9854d1d2a1ffe095f7b5fac19ddba095c259e6067a46500381b5a5 +$(package)_patches=fix_osx_avail.patch define $(package)_preprocess_cmds + patch -p1 < $($(package)_patch_dir)/fix_osx_avail.patch &&\ autoreconf -i endef @@ -13,6 +15,7 @@ define $(package)_set_vars $(package)_config_opts_linux=--with-pic --disable-udev $(package)_config_opts_mingw32=--disable-udev $(package)_config_opts_darwin=--disable-udev + $(package)_config_opts_freebsd=--with-pic --disable-udev endef ifneq ($(host_os),darwin) diff --git a/contrib/depends/packages/native_clang.mk b/contrib/depends/packages/native_clang.mk index 115f8f389..4ff21ada0 100644 --- a/contrib/depends/packages/native_clang.mk +++ b/contrib/depends/packages/native_clang.mk @@ -24,6 +24,5 @@ define $(package)_stage_cmds cp lib/libLTO.so $($(package)_staging_prefix_dir)/lib/ && \ cp -rf lib/clang/$($(package)_version)/include/* $($(package)_staging_prefix_dir)/lib/clang/$($(package)_version)/include/ && \ cp bin/dsymutil $($(package)_staging_prefix_dir)/bin/$(host)-dsymutil && \ - if `test -d include/c++/`; then cp -rf include/c++/ $($(package)_staging_prefix_dir)/include/; fi && \ if `test -d lib/c++/`; then cp -rf lib/c++/ $($(package)_staging_prefix_dir)/lib/; fi endef diff --git a/contrib/depends/packages/native_protobuf.mk b/contrib/depends/packages/native_protobuf.mk index 35f648b9a..2dc11b23c 100644 --- a/contrib/depends/packages/native_protobuf.mk +++ b/contrib/depends/packages/native_protobuf.mk @@ -1,8 +1,9 @@ package=protobuf3 -$(package)_version=3.6.1 +$(package)_version=21.12 +$(package)_version_protobuf_cpp=3.21.12 $(package)_download_path=https://github.com/protocolbuffers/protobuf/releases/download/v$($(package)_version)/ -$(package)_file_name=protobuf-cpp-$($(package)_version).tar.gz -$(package)_sha256_hash=b3732e471a9bb7950f090fd0457ebd2536a9ba0891b7f3785919c654fe2a2529 +$(package)_file_name=protobuf-cpp-$($(package)_version_protobuf_cpp).tar.gz +$(package)_sha256_hash=4eab9b524aa5913c6fffb20b2a8abf5ef7f95a80bc0701f3a6dbb4c607f73460 $(package)_cxxflags=-std=c++11 define $(package)_set_vars diff --git a/contrib/depends/packages/openssl.mk b/contrib/depends/packages/openssl.mk index bdfb031ed..b35cf5e97 100644 --- a/contrib/depends/packages/openssl.mk +++ b/contrib/depends/packages/openssl.mk @@ -1,8 +1,8 @@ package=openssl -$(package)_version=3.0.9 +$(package)_version=3.0.11 $(package)_download_path=https://www.openssl.org/source $(package)_file_name=$(package)-$($(package)_version).tar.gz -$(package)_sha256_hash=eb1ab04781474360f77c318ab89d8c5a03abc38e63d65a603cabbf1b00a1dc90 +$(package)_sha256_hash=b3425d3bb4a2218d0697eb41f7fc0cdede016ed19ca49d168b78e8d947887f55 define $(package)_set_vars $(package)_config_env=AR="$($(package)_ar)" ARFLAGS=$($(package)_arflags) RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)" diff --git a/contrib/depends/packages/packages.mk b/contrib/depends/packages/packages.mk index ea4a0effd..6bc5a6fa1 100644 --- a/contrib/depends/packages/packages.mk +++ b/contrib/depends/packages/packages.mk @@ -1,4 +1,4 @@ -packages:=boost openssl zeromq libiconv expat unbound +packages:=boost openssl zeromq expat unbound # ccache is useless in gitian builds ifneq ($(GITIAN),1) @@ -8,15 +8,15 @@ endif hardware_packages := hidapi protobuf libusb hardware_native_packages := native_protobuf -android_native_packages = android_ndk -android_packages = ncurses readline sodium +android_native_packages = android_ndk $(hardware_native_packages) +android_packages = ncurses readline sodium protobuf darwin_native_packages = $(hardware_native_packages) darwin_packages = ncurses readline sodium $(hardware_packages) # not really native... -freebsd_native_packages = freebsd_base -freebsd_packages = ncurses readline sodium +freebsd_native_packages = freebsd_base $(hardware_native_packages) +freebsd_packages = ncurses readline sodium protobuf libusb linux_packages = eudev ncurses readline sodium $(hardware_packages) linux_native_packages = $(hardware_native_packages) @@ -25,10 +25,6 @@ ifeq ($(build_tests),ON) packages += gtest endif -ifneq ($(host_arch),riscv64) -linux_packages += unwind -endif - mingw32_packages = sodium $(hardware_packages) mingw32_native_packages = $(hardware_native_packages) diff --git a/contrib/depends/packages/protobuf.mk b/contrib/depends/packages/protobuf.mk index ddec1eb59..780357c90 100644 --- a/contrib/depends/packages/protobuf.mk +++ b/contrib/depends/packages/protobuf.mk @@ -1,21 +1,17 @@ package=protobuf $(package)_version=$(native_$(package)_version) +$(package)_version_protobuf_cpp=$(native_$(package)_version_protobuf_cpp) $(package)_download_path=$(native_$(package)_download_path) $(package)_file_name=$(native_$(package)_file_name) $(package)_sha256_hash=$(native_$(package)_sha256_hash) $(package)_dependencies=native_$(package) $(package)_cxxflags=-std=c++11 -$(package)_patches=visibility.patch define $(package)_set_vars $(package)_config_opts=--disable-shared --with-protoc=$(build_prefix)/bin/protoc $(package)_config_opts_linux=--with-pic endef -define $(package)_preprocess_cmds - patch -p0 < $($(package)_patch_dir)/visibility.patch -endef - define $(package)_config_cmds $($(package)_autoconf) AR_FLAGS=$($(package)_arflags) endef diff --git a/contrib/depends/packages/zeromq.mk b/contrib/depends/packages/zeromq.mk index 20f2d4bd9..669d06d83 100644 --- a/contrib/depends/packages/zeromq.mk +++ b/contrib/depends/packages/zeromq.mk @@ -1,9 +1,8 @@ package=zeromq -$(package)_version=4.3.4 +$(package)_version=4.3.5 $(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)_patches=06aba27b04c5822cb88a69677382a0f053367143.patch +$(package)_sha256_hash=6653ef5910f17954861fe72332e68b03ca6e4d9c7160eb3a8de5a5a913bfab43 define $(package)_set_vars $(package)_config_opts=--without-documentation --disable-shared --without-libsodium --disable-curve @@ -12,10 +11,6 @@ define $(package)_set_vars $(package)_cxxflags=-std=c++11 endef -define $(package)_preprocess_cmds - patch -p1 < $($(package)_patch_dir)/06aba27b04c5822cb88a69677382a0f053367143.patch -endef - define $(package)_config_cmds $($(package)_autoconf) AR_FLAGS=$($(package)_arflags) endef diff --git a/contrib/depends/patches/libiconv/fix-whitespace.patch b/contrib/depends/patches/libiconv/fix-whitespace.patch deleted file mode 100644 index 531364b45..000000000 --- a/contrib/depends/patches/libiconv/fix-whitespace.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/preload/configure b/preload/configure -index aab5c77..e20b8f0 100755 ---- a/preload/configure -+++ b/preload/configure -@@ -588,7 +588,7 @@ MAKEFLAGS= - PACKAGE_NAME='libiconv' - PACKAGE_TARNAME='libiconv' - PACKAGE_VERSION='0' --PACKAGE_STRING='libiconv 0' -+PACKAGE_STRING='libiconv0' - PACKAGE_BUGREPORT='' - PACKAGE_URL='' - diff --git a/contrib/depends/patches/libusb/fix_osx_avail.patch b/contrib/depends/patches/libusb/fix_osx_avail.patch new file mode 100644 index 000000000..2474993f5 --- /dev/null +++ b/contrib/depends/patches/libusb/fix_osx_avail.patch @@ -0,0 +1,12 @@ +--- a/libusb/os/darwin_usb.h 2023-03-19 12:07:53 ++++ b/libusb/os/darwin_usb.h 2023-03-19 12:07:47 +@@ -165,7 +165,8 @@ + #define __has_builtin(x) 0 // Compatibility with non-clang compilers. + #endif + #if __has_builtin(__builtin_available) +- #define HAS_CAPTURE_DEVICE() __builtin_available(macOS 10.10, *) ++// #define HAS_CAPTURE_DEVICE() __builtin_available(macOS 10.10, *) ++ #define HAS_CAPTURE_DEVICE() 0 + #else + #define HAS_CAPTURE_DEVICE() 0 + #endif diff --git a/contrib/depends/patches/protobuf/visibility.patch b/contrib/depends/patches/protobuf/visibility.patch deleted file mode 100644 index e66d5961f..000000000 --- a/contrib/depends/patches/protobuf/visibility.patch +++ /dev/null @@ -1,159 +0,0 @@ ---- src/google/protobuf/descriptor.cc.O 2018-07-30 22:16:10.000000000 +0000 -+++ src/google/protobuf/descriptor.cc 2022-05-06 13:38:14.827309092 +0000 -@@ -32,6 +32,9 @@ - // Based on original Protocol Buffers design by - // Sanjay Ghemawat, Jeff Dean, and others. - -+#if defined(__APPLE__) && defined(__arm64__) -+#pragma GCC visibility push(hidden) -+#endif - #include <algorithm> - #include <functional> - #include <google/protobuf/stubs/hash.h> -@@ -7274,3 +7277,6 @@ - - } // namespace protobuf - } // namespace google -+#if defined(__APPLE__) && defined(__arm64__) -+#pragma GCC visibility pop -+#endif ---- src/google/protobuf/extension_set.cc.O 2018-07-23 20:56:42.000000000 +0000 -+++ src/google/protobuf/extension_set.cc 2022-05-06 14:48:55.369877050 +0000 -@@ -32,6 +32,9 @@ - // Based on original Protocol Buffers design by - // Sanjay Ghemawat, Jeff Dean, and others. - -+#if defined(__APPLE__) && defined(__arm64__) -+#pragma GCC visibility push(hidden) -+#endif - #include <google/protobuf/stubs/hash.h> - #include <tuple> - #include <utility> -@@ -1914,3 +1917,6 @@ - } // namespace internal - } // namespace protobuf - } // namespace google -+#if defined(__APPLE__) && defined(__arm64__) -+#pragma GCC visibility pop -+#endif ---- src/google/protobuf/extension_set_heavy.cc.O 2018-07-30 22:16:10.000000000 +0000 -+++ src/google/protobuf/extension_set_heavy.cc 2022-05-06 14:14:27.847320946 +0000 -@@ -35,6 +35,10 @@ - // Contains methods defined in extension_set.h which cannot be part of the - // lite library because they use descriptors or reflection. - -+#if defined(__APPLE__) && defined(__arm64__) -+#pragma GCC visibility push(hidden) -+#endif -+ - #include <google/protobuf/stubs/casts.h> - #include <google/protobuf/descriptor.pb.h> - #include <google/protobuf/io/coded_stream.h> -@@ -814,3 +818,6 @@ - } // namespace internal - } // namespace protobuf - } // namespace google -+#if defined(__APPLE__) && defined(__arm64__) -+#pragma GCC visibility pop -+#endif ---- src/google/protobuf/generated_message_reflection.cc.O 2018-07-23 20:56:42.000000000 +0000 -+++ src/google/protobuf/generated_message_reflection.cc 2022-05-06 13:38:49.655540772 +0000 -@@ -32,6 +32,9 @@ - // Based on original Protocol Buffers design by - // Sanjay Ghemawat, Jeff Dean, and others. - -+#if defined(__APPLE__) && defined(__arm64__) -+#pragma GCC visibility push(hidden) -+#endif - #include <algorithm> - #include <set> - -@@ -2420,3 +2423,6 @@ - } // namespace internal - } // namespace protobuf - } // namespace google -+#if defined(__APPLE__) && defined(__arm64__) -+#pragma GCC visibility pop -+#endif ---- src/google/protobuf/map_field.cc.O 2018-07-23 20:56:42.000000000 +0000 -+++ src/google/protobuf/map_field.cc 2022-05-06 13:34:44.913905697 +0000 -@@ -28,6 +28,10 @@ - // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -+#if defined(__APPLE__) && defined(__arm64__) -+#pragma GCC visibility push(hidden) -+#endif -+ - #include <google/protobuf/map_field.h> - #include <google/protobuf/map_field_inl.h> - -@@ -462,3 +466,6 @@ - } // namespace internal - } // namespace protobuf - } // namespace google -+#if defined(__APPLE__) && defined(__arm64__) -+#pragma GCC visibility pop -+#endif ---- src/google/protobuf/text_format.cc.O 2018-07-30 22:16:11.000000000 +0000 -+++ src/google/protobuf/text_format.cc 2022-05-06 13:34:58.881999517 +0000 -@@ -32,6 +32,10 @@ - // Based on original Protocol Buffers design by - // Sanjay Ghemawat, Jeff Dean, and others. - -+#if defined(__APPLE__) && defined(__arm64__) -+#pragma GCC visibility push(hidden) -+#endif -+ - #include <algorithm> - #include <float.h> - #include <math.h> -@@ -2258,3 +2262,6 @@ - - } // namespace protobuf - } // namespace google -+#if defined(__APPLE__) && defined(__arm64__) -+#pragma GCC visibility pop -+#endif ---- src/google/protobuf/wire_format.cc.O 2018-07-23 20:56:42.000000000 +0000 -+++ src/google/protobuf/wire_format.cc 2022-05-06 13:06:23.294219228 +0000 -@@ -32,6 +32,10 @@ - // Based on original Protocol Buffers design by - // Sanjay Ghemawat, Jeff Dean, and others. - -+#if defined(__APPLE__) && defined(__arm64__) -+#pragma GCC visibility push(hidden) -+#endif -+ - #include <stack> - #include <string> - #include <vector> -@@ -1445,3 +1449,7 @@ - } // namespace internal - } // namespace protobuf - } // namespace google -+ -+#if defined(__APPLE__) && defined(__arm64__) -+#pragma GCC visibility pop -+#endif ---- src/google/protobuf/stubs/status.cc.O 2018-07-23 20:56:42.000000000 +0000 -+++ src/google/protobuf/stubs/status.cc 2022-05-06 15:18:53.393208814 +0000 -@@ -27,6 +27,11 @@ - // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+ -+#if defined(__APPLE__) && defined(__arm64__) -+#pragma GCC visibility push(hidden) -+#endif -+ - #include <google/protobuf/stubs/status.h> - - #include <ostream> -@@ -132,3 +137,6 @@ - } // namespace util - } // namespace protobuf - } // namespace google -+#if defined(__APPLE__) && defined(__arm64__) -+#pragma GCC visibility pop -+#endif diff --git a/contrib/depends/patches/zeromq/06aba27b04c5822cb88a69677382a0f053367143.patch b/contrib/depends/patches/zeromq/06aba27b04c5822cb88a69677382a0f053367143.patch deleted file mode 100644 index 53e18a452..000000000 --- a/contrib/depends/patches/zeromq/06aba27b04c5822cb88a69677382a0f053367143.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 06aba27b04c5822cb88a69677382a0f053367143 Mon Sep 17 00:00:00 2001 -From: sabotagebeats <27985126+sabotagebeats@users.noreply.github.com> -Date: Thu, 22 Jul 2021 21:53:19 -0700 -Subject: [PATCH] fix: building libzmq fails with error src/clock.cpp:131:16: - error: unused variable 'nsecs_per_usec' - ---- - src/clock.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/clock.cpp b/src/clock.cpp -index 93da90a8e..63c0100a5 100644 ---- a/src/clock.cpp -+++ b/src/clock.cpp -@@ -195,6 +195,7 @@ uint64_t zmq::clock_t::now_us () - - #else - -+ LIBZMQ_UNUSED (nsecs_per_usec); - // Use POSIX gettimeofday function to get precise time. - struct timeval tv; - int rc = gettimeofday (&tv, NULL); diff --git a/contrib/depends/toolchain.cmake.in b/contrib/depends/toolchain.cmake.in index 570065560..e44882f4c 100644 --- a/contrib/depends/toolchain.cmake.in +++ b/contrib/depends/toolchain.cmake.in @@ -1,5 +1,5 @@ # Set the system name to one of Android, Darwin, FreeBSD, Linux, or Windows -SET(CMAKE_SYSTEM_NAME @depends@) +SET(CMAKE_SYSTEM_NAME @cmake_system_name@) SET(CMAKE_SYSTEM_PROCESSOR @arch@) SET(CMAKE_BUILD_TYPE @release_type@) @@ -27,12 +27,6 @@ SET(Terminfo_LIBRARY @prefix@/lib/libtinfo.a) SET(UNBOUND_INCLUDE_DIR @prefix@/include) SET(UNBOUND_LIBRARIES @prefix@/lib/libunbound.a) -if(NOT CMAKE_SYSTEM_NAME STREQUAL "Android") -SET(LIBUNWIND_INCLUDE_DIR @prefix@/include) -SET(LIBUNWIND_LIBRARIES @prefix@/lib/libunwind.a) -SET(LIBUNWIND_LIBRARY_DIRS @prefix@/lib) - -if(NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") SET(LIBUSB-1.0_LIBRARY @prefix@/lib/libusb-1.0.a) SET(LIBUDEV_LIBRARY @prefix@/lib/libudev.a) @@ -41,8 +35,11 @@ SET(Protobuf_PROTOC_EXECUTABLE @prefix@/native/bin/protoc CACHE FILEPATH "Path t SET(Protobuf_INCLUDE_DIR @prefix@/include CACHE PATH "Protobuf include dir") SET(Protobuf_INCLUDE_DIRS @prefix@/include CACHE PATH "Protobuf include dir") SET(Protobuf_LIBRARY @prefix@/lib/libprotobuf.a CACHE FILEPATH "Protobuf library") -endif() +if(NOT CMAKE_SYSTEM_NAME STREQUAL "Android") +SET(LIBUNWIND_INCLUDE_DIR @prefix@/include) +SET(LIBUNWIND_LIBRARIES @prefix@/lib/libunwind.a) +SET(LIBUNWIND_LIBRARY_DIRS @prefix@/lib) endif() SET(ZMQ_INCLUDE_PATH @prefix@/include) @@ -68,15 +65,15 @@ set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) # Find includes in target # specify the cross compiler to be used. Darwin uses clang provided by the SDK. if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") if(ARCHITECTURE STREQUAL "aarch64") - SET(CLANG_TARGET "arm64-apple-darwin11") - SET(CONF_TRIPLE "aarch64-apple-darwin11") + SET(CLANG_TARGET "arm64-apple-darwin") + SET(CONF_TRIPLE "aarch64-apple-darwin") SET(BUILD_TAG "mac-armv8") SET(CMAKE_OSX_ARCHITECTURES "arm64") set(ARM ON) set(ARM_ID "armv8-a") else() - SET(CLANG_TARGET "x86_64-apple-darwin11") - SET(CONF_TRIPLE "x86_64-apple-darwin11") + SET(CLANG_TARGET "x86_64-apple-darwin") + SET(CONF_TRIPLE "x86_64-apple-darwin") SET(BUILD_TAG "mac-x64") SET(CMAKE_OSX_ARCHITECTURES "x86_64") endif() @@ -94,8 +91,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") SET(BREW OFF) SET(PORT OFF) SET(CMAKE_OSX_SYSROOT "@prefix@/native/SDK/") - SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.08") - SET(CMAKE_CXX_STANDARD 14) + SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.13") + SET(CMAKE_CXX_STANDARD 17) SET(LLVM_ENABLE_PIC OFF) SET(LLVM_ENABLE_PIE OFF) elseif(CMAKE_SYSTEM_NAME STREQUAL "Android") @@ -144,8 +141,8 @@ elseif(ARCHITECTURE STREQUAL "aarch64") endif() if(ARCHITECTURE STREQUAL "riscv64") - set(NO_AES ON) - set(ARCH "rv64imafdc") + set(ARCH_ID "riscv64") + set(ARCH "rv64gc") endif() if(ARCHITECTURE STREQUAL "i686") diff --git a/contrib/epee/include/math_helper.h b/contrib/epee/include/math_helper.h index 6a759b515..00d695179 100644 --- a/contrib/epee/include/math_helper.h +++ b/contrib/epee/include/math_helper.h @@ -24,213 +24,20 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // - - - #pragma once +#include <cstdint> // uint64_t -#include <list> -#include <numeric> -#include <random> -#include <boost/timer/timer.hpp> -#include <boost/uuid/uuid.hpp> -#include <boost/uuid/random_generator.hpp> - -#include "syncobj.h" -#include "time_helper.h" +#ifdef _WIN32 +#include <sysinfoapi.h> // GetSystemTimeAsFileTime +#else +#include <sys/time.h> // gettimeofday +#endif namespace epee { namespace math_helper { - - template<typename val, int default_base> - class average - { - public: - - average() - { - m_base = default_base; - m_last_avg_val = 0; - } - - bool set_base() - { - CRITICAL_REGION_LOCAL(m_lock); - - m_base = default_base; - if(m_list.size() > m_base) - m_list.resize(m_base); - - return true; - } - - typedef val value_type; - - void push(const value_type& vl) - { - CRITICAL_REGION_LOCAL(m_lock); - -//#ifndef DEBUG_STUB - m_list.push_back(vl); - if(m_list.size() > m_base ) - m_list.pop_front(); -//#endif - } - - double update(const value_type& vl) - { - CRITICAL_REGION_LOCAL(m_lock); -//#ifndef DEBUG_STUB - push(vl); -//#endif - - return get_avg(); - } - - double get_avg() - { - CRITICAL_REGION_LOCAL(m_lock); - - value_type vl = std::accumulate(m_list.begin(), m_list.end(), value_type(0)); - if(m_list.size()) - return m_last_avg_val = (double)(vl/m_list.size()); - - return m_last_avg_val = (double)vl; - } - - value_type get_last_val() - { - CRITICAL_REGION_LOCAL(m_lock); - if(m_list.size()) - return m_list.back(); - - return 0; - } - - private: - unsigned int m_base; - double m_last_avg_val; - std::list<value_type> m_list; - critical_section m_lock; - }; - - -#ifdef WINDOWS_PLATFORM - - /************************************************************************/ - /* */ - /************************************************************************/ - class timing_guard_base - { - public: - virtual ~timing_guard_base(){}; - }; - - template<class T> - class timing_guard: public timing_guard_base - { - public: - timing_guard(T& avrg):m_avrg(avrg) - { - m_start_ticks = ::GetTickCount(); - } - - ~timing_guard() - { - m_avrg.push(::GetTickCount()-m_start_ticks); - } - - private: - T& m_avrg; - DWORD m_start_ticks; - }; - - template<class t_timing> - timing_guard_base* create_timing_guard(t_timing& timing){return new timing_guard<t_timing>(timing);} - -#define BEGIN_TIMING_ZONE(timing_var) { boost::shared_ptr<math_helper::timing_guard_base> local_timing_guard_ptr(math_helper::create_timing_guard(timing_var)); -#define END_TIMING_ZONE() } -#endif - -//#ifdef WINDOWS_PLATFORM_EX - template<uint64_t default_time_window> - class speed - { - public: - - speed() - { - m_time_window = default_time_window; - m_last_speed_value = 0; - } - bool chick() - { -#ifndef DEBUG_STUB - uint64_t ticks = misc_utils::get_tick_count(); - CRITICAL_REGION_BEGIN(m_lock); - m_chicks.push_back(ticks); - CRITICAL_REGION_END(); - //flush(ticks); -#endif - return true; - } - - bool chick(size_t count) - { - for(size_t s = 0; s != count; s++) - chick(); - - return true; - } - - - size_t get_speed() - { - flush(misc_utils::get_tick_count()); - return m_last_speed_value = m_chicks.size(); - } - private: - - bool flush(uint64_t ticks) - { - CRITICAL_REGION_BEGIN(m_lock); - std::list<uint64_t>::iterator it = m_chicks.begin(); - while(it != m_chicks.end()) - { - if(*it + m_time_window < ticks) - m_chicks.erase(it++); - else - break; - } - CRITICAL_REGION_END(); - return true; - } - - std::list<uint64_t> m_chicks; - uint64_t m_time_window; - size_t m_last_speed_value; - critical_section m_lock; - }; -//#endif - - template<class tlist> - void randomize_list(tlist& t_list) - { - for(typename tlist::iterator it = t_list.begin();it!=t_list.end();it++) - { - size_t offset = rand()%t_list.size(); - typename tlist::iterator it_2 = t_list.begin(); - for(size_t local_offset = 0;local_offset!=offset;local_offset++) - it_2++; - if(it_2 == it) - continue; - std::swap(*it_2, *it); - } - - } template<typename get_interval, bool start_immediate = true> class once_a_time { diff --git a/contrib/epee/include/net/http_base.h b/contrib/epee/include/net/http_base.h index 15fd30bf3..b53766780 100644 --- a/contrib/epee/include/net/http_base.h +++ b/contrib/epee/include/net/http_base.h @@ -34,6 +34,7 @@ #include <string> #include <utility> #include <list> +#include <stdint.h> #undef MONERO_DEFAULT_LOG_CATEGORY #define MONERO_DEFAULT_LOG_CATEGORY "net.http" diff --git a/contrib/epee/include/serialization/keyvalue_serialization.h b/contrib/epee/include/serialization/keyvalue_serialization.h index 06d74329f..ea767865c 100644 --- a/contrib/epee/include/serialization/keyvalue_serialization.h +++ b/contrib/epee/include/serialization/keyvalue_serialization.h @@ -105,7 +105,7 @@ public: \ #define KV_SERIALIZE_VAL_POD_AS_BLOB_OPT_N(varialble, val_name, default_value) \ do { \ static_assert(std::is_pod<decltype(this_ref.varialble)>::value, "t_type must be a POD type."); \ - bool ret = KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE_N(varialble, val_name); \ + bool ret = KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE_N(varialble, val_name) \ if (!ret) \ epee::serialize_default(this_ref.varialble, default_value); \ } while(0); diff --git a/contrib/epee/include/serialization/wire/write.h b/contrib/epee/include/serialization/wire/write.h index c18f7dbcc..c2359918c 100644 --- a/contrib/epee/include/serialization/wire/write.h +++ b/contrib/epee/include/serialization/wire/write.h @@ -30,6 +30,7 @@ #include <boost/utility/string_ref.hpp> #include <boost/range/size.hpp> #include <cstdint> +#include <iterator> #include <system_error> #include <type_traits> @@ -188,7 +189,13 @@ namespace wire_write template<typename T> inline std::size_t array_size(std::true_type, const T& source) - { return boost::size(source); } + { + static_assert( + !std::is_same<typename std::iterator_traits<typename T::const_iterator>::iterator_category, std::input_iterator_tag>{}, + "Input iterators must use json (or similar) derived classes directly" + ); + return boost::size(source); + } template<typename T> inline constexpr std::size_t array_size(std::false_type, const T&) noexcept diff --git a/contrib/epee/include/storages/portable_storage_from_bin.h b/contrib/epee/include/storages/portable_storage_from_bin.h index d8a8a4a49..9fcaf5d01 100644 --- a/contrib/epee/include/storages/portable_storage_from_bin.h +++ b/contrib/epee/include/storages/portable_storage_from_bin.h @@ -33,6 +33,9 @@ #include "portable_storage_base.h" #include "portable_storage_bin_utils.h" +#undef MONERO_DEFAULT_LOG_CATEGORY +#define MONERO_DEFAULT_LOG_CATEGORY "serialization" + #ifdef EPEE_PORTABLE_STORAGE_RECURSION_LIMIT #define EPEE_PORTABLE_STORAGE_RECURSION_LIMIT_INTERNAL EPEE_PORTABLE_STORAGE_RECURSION_LIMIT #else @@ -228,6 +231,7 @@ namespace epee default: CHECK_AND_ASSERT_THROW_MES(false, "unknown entry_type code = " << type); } + return read_ae<int8_t>(); // unreachable, dummy return to avoid compiler warning } inline @@ -319,6 +323,7 @@ namespace epee default: CHECK_AND_ASSERT_THROW_MES(false, "unknown entry_type code = " << ent_type); } + return read_se<int8_t>(); // unreachable, dummy return to avoid compiler warning } inline void throwable_buffer_reader::read(section& sec) diff --git a/contrib/epee/include/storages/portable_storage_from_json.h b/contrib/epee/include/storages/portable_storage_from_json.h index 95507328d..60acfccb8 100644 --- a/contrib/epee/include/storages/portable_storage_from_json.h +++ b/contrib/epee/include/storages/portable_storage_from_json.h @@ -31,6 +31,9 @@ #include "parserse_base_utils.h" #include "file_io_utils.h" +#undef MONERO_DEFAULT_LOG_CATEGORY +#define MONERO_DEFAULT_LOG_CATEGORY "serialization" + #define EPEE_JSON_RECURSION_LIMIT_INTERNAL 100 namespace epee diff --git a/contrib/epee/include/string_tools.h b/contrib/epee/include/string_tools.h index dbbe1906e..7fcd02726 100644 --- a/contrib/epee/include/string_tools.h +++ b/contrib/epee/include/string_tools.h @@ -127,7 +127,6 @@ namespace string_tools return s; } - bool validate_hex(uint64_t length, const std::string& str); std::string get_extension(const std::string& str); std::string cut_off_extension(const std::string& str); diff --git a/contrib/epee/src/http_auth.cpp b/contrib/epee/src/http_auth.cpp index 5071d2685..d6de6a0e1 100644 --- a/contrib/epee/src/http_auth.cpp +++ b/contrib/epee/src/http_auth.cpp @@ -217,15 +217,13 @@ namespace //// Digest Authentication template<typename Digest> - typename std::result_of<Digest()>::type generate_a1( - Digest digest, const http::login& creds, const boost::string_ref realm) + auto generate_a1(Digest digest, const http::login& creds, const boost::string_ref realm) { return digest(creds.username, u8":", realm, u8":", creds.password); } template<typename Digest> - typename std::result_of<Digest()>::type generate_a1( - Digest digest, const http::http_client_auth::session& user) + auto generate_a1(Digest digest, const http::http_client_auth::session& user) { return generate_a1(std::move(digest), user.credentials, user.server.realm); } diff --git a/contrib/epee/src/string_tools.cpp b/contrib/epee/src/string_tools.cpp index 984a151b5..3abb83c74 100644 --- a/contrib/epee/src/string_tools.cpp +++ b/contrib/epee/src/string_tools.cpp @@ -82,16 +82,6 @@ namespace string_tools return true; } //---------------------------------------------------------------------------- - bool validate_hex(uint64_t length, const std::string& str) - { - if (str.size() != length) - return false; - for (char c: str) - if (!isxdigit(c)) - return false; - return true; - } - //---------------------------------------------------------------------------- bool parse_peer_from_string(uint32_t& ip, uint16_t& port, const std::string& addres) { //parse ip and address diff --git a/contrib/gitian/gitian-linux.yml b/contrib/gitian/gitian-linux.yml index 63d2bc5d2..41915deb9 100644 --- a/contrib/gitian/gitian-linux.yml +++ b/contrib/gitian/gitian-linux.yml @@ -21,6 +21,7 @@ packages: - "g++-7-arm-linux-gnueabihf" - "gcc-arm-linux-gnueabihf" - "g++-arm-linux-gnueabihf" +- "g++-riscv64-linux-gnu" - "g++-7-multilib" - "gcc-7-multilib" - "binutils-arm-linux-gnueabihf" @@ -43,7 +44,7 @@ files: [] script: | WRAP_DIR=$HOME/wrapped - HOSTS="x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu i686-linux-gnu" + HOSTS="x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu i686-linux-gnu riscv64-linux-gnu" FAKETIME_HOST_PROGS="" FAKETIME_PROGS="date" HOST_CFLAGS="-O2 -g" @@ -159,7 +160,13 @@ script: | fi export C_INCLUDE_PATH="$EXTRA_INCLUDES" export CPLUS_INCLUDE_PATH="$EXTRA_INCLUDES" - cmake .. -DCMAKE_TOOLCHAIN_FILE=${BASEPREFIX}/${i}/share/toolchain.cmake -DBACKCOMPAT=ON -DCMAKE_SKIP_RPATH=ON + # glibc only added riscv support in 2.27, disable backwards compatibility + if [ "$i" == "riscv64-linux-gnu" ]; then + BACKCOMPAT_OPTION=OFF + else + BACKCOMPAT_OPTION=ON + fi + cmake .. -DCMAKE_TOOLCHAIN_FILE=${BASEPREFIX}/${i}/share/toolchain.cmake -DBACKCOMPAT=${BACKCOMPAT_OPTION} -DCMAKE_SKIP_RPATH=ON make ${MAKEOPTS} chmod 755 bin/* cp ../LICENSE ../README.md ../docs/ANONYMITY_NETWORKS.md bin diff --git a/contrib/gitian/gitian-osx.yml b/contrib/gitian/gitian-osx.yml index 648688bcd..74ad21ea3 100644 --- a/contrib/gitian/gitian-osx.yml +++ b/contrib/gitian/gitian-osx.yml @@ -29,7 +29,7 @@ remotes: files: [] script: | WRAP_DIR=$HOME/wrapped - HOSTS="x86_64-apple-darwin11 aarch64-apple-darwin11" + HOSTS="x86_64-apple-darwin aarch64-apple-darwin" FAKETIME_HOST_PROGS="" FAKETIME_PROGS="ar ranlib date dmg genisoimage python" |