From 45aecd9c3c1729bf7060ac01a147ca714f175d04 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Fri, 24 May 2019 11:36:20 +0300 Subject: [PATCH] osx: switch to gcc-8 static build --- depends/builders/darwin.mk | 8 ++++---- src/Makefile.am | 5 +++++ src/chain.h | 2 +- src/consensus/params.h | 4 ++-- src/crypto/verus_hash.h | 1 + src/main.cpp | 4 +++- src/miner.cpp | 2 +- src/script/script_ext.cpp | 1 + zcutil/build-mac.sh | 2 +- 9 files changed, 19 insertions(+), 10 deletions(-) diff --git a/depends/builders/darwin.mk b/depends/builders/darwin.mk index f9b066fcf..cbbc5a667 100644 --- a/depends/builders/darwin.mk +++ b/depends/builders/darwin.mk @@ -1,5 +1,5 @@ -build_darwin_CC = gcc-6 -build_darwin_CXX = g++-6 +build_darwin_CC = gcc-8 +build_darwin_CXX = g++-8 build_darwin_AR: = $(shell xcrun -f ar) build_darwin_RANLIB: = $(shell xcrun -f ranlib) build_darwin_STRIP: = $(shell xcrun -f strip) @@ -10,8 +10,8 @@ build_darwin_SHA256SUM = shasum -a 256 build_darwin_DOWNLOAD = curl --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -L -f -o #darwin host on darwin builder. overrides darwin host preferences. -darwin_CC= gcc-6 -darwin_CXX= g++-6 +darwin_CC= gcc-8 +darwin_CXX= g++-8 darwin_AR:=$(shell xcrun -f ar) darwin_RANLIB:=$(shell xcrun -f ranlib) darwin_STRIP:=$(shell xcrun -f strip) diff --git a/src/Makefile.am b/src/Makefile.am index 874c3a8b4..a1b403b07 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -574,6 +574,11 @@ if ENABLE_PROTON komodod_LDADD += $(LIBBITCOIN_PROTON) $(PROTON_LIBS) endif +# [+] Decker: use static linking for libstdc++.6.dylib, libgomp.1.dylib, libgcc_s.1.dylib +if TARGET_DARWIN +komodod_LDFLAGS += -static-libgcc +endif + # bitcoin-cli binary # komodo_cli_SOURCES = bitcoin-cli.cpp komodo_cli_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CFLAGS) diff --git a/src/chain.h b/src/chain.h index 0b6e2b046..d5310e4e5 100644 --- a/src/chain.h +++ b/src/chain.h @@ -335,7 +335,7 @@ public: nSolution = block.nSolution; } - int32_t SetHeight(int32_t height) + void SetHeight(int32_t height) { this->chainPower.nHeight = height; } diff --git a/src/consensus/params.h b/src/consensus/params.h index b7dc8b475..0ea5b1fff 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -115,8 +115,8 @@ struct Params { int64_t AveragingWindowTimespan() const { return nPowAveragingWindow * nPowTargetSpacing; } int64_t MinActualTimespan() const { return (AveragingWindowTimespan() * (100 - nPowMaxAdjustUp )) / 100; } int64_t MaxActualTimespan() const { return (AveragingWindowTimespan() * (100 + nPowMaxAdjustDown)) / 100; } - int32_t SetSaplingHeight(int32_t height) { vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight = height; } - int32_t SetOverwinterHeight(int32_t height) { vUpgrades[Consensus::UPGRADE_OVERWINTER].nActivationHeight = height; } + void SetSaplingHeight(int32_t height) { vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight = height; } + void SetOverwinterHeight(int32_t height) { vUpgrades[Consensus::UPGRADE_OVERWINTER].nActivationHeight = height; } uint256 nMinimumChainWork; }; } // namespace Consensus diff --git a/src/crypto/verus_hash.h b/src/crypto/verus_hash.h index 5ac49c209..f6cb3d9bd 100644 --- a/src/crypto/verus_hash.h +++ b/src/crypto/verus_hash.h @@ -86,6 +86,7 @@ class CVerusHashV2 result = buf2; curPos = 0; std::fill(buf1, buf1 + sizeof(buf1), 0); + return *this; } int64_t *ExtraI64Ptr() { return (int64_t *)(curBuf + 32); } diff --git a/src/main.cpp b/src/main.cpp index 3d2f19b55..84f1b611a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3839,7 +3839,8 @@ bool static DisconnectTip(CValidationState &state, bool fBare = false) { int32_t komodo_activate_sapling(CBlockIndex *pindex) { - uint32_t blocktime,prevtime; CBlockIndex *prev; int32_t i,transition=0,height,prevht,activation = 0; + uint32_t blocktime,prevtime; CBlockIndex *prev; int32_t i,transition=0,height,prevht; + int32_t activation = 0; if ( pindex == 0 ) { fprintf(stderr,"komodo_activate_sapling null pindex\n"); @@ -3897,6 +3898,7 @@ int32_t komodo_activate_sapling(CBlockIndex *pindex) fprintf(stderr,"%s sapling activation at %d\n",ASSETCHAINS_SYMBOL,activation); ASSETCHAINS_SAPLING = activation; } + return activation; } static int64_t nTimeReadFromDisk = 0; diff --git a/src/miner.cpp b/src/miner.cpp index 01ee92234..c4944fbad 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -840,7 +840,7 @@ int32_t roundrobin_delay; arith_uint256 HASHTarget,HASHTarget_POW; // wait for peers to connect -int32_t waitForPeers(const CChainParams &chainparams) +void waitForPeers(const CChainParams &chainparams) { if (chainparams.MiningRequiresPeers()) { diff --git a/src/script/script_ext.cpp b/src/script/script_ext.cpp index 613b50c05..a0786fa9c 100644 --- a/src/script/script_ext.cpp +++ b/src/script/script_ext.cpp @@ -70,6 +70,7 @@ const CScriptExt &CScriptExt::AddCheckLockTimeVerify(int64_t unlocktime) const *((CScript *)this) << OP_DROP; return *this; } + return *this; } // combined CLTV script and P2PKH diff --git a/zcutil/build-mac.sh b/zcutil/build-mac.sh index 138508cb5..0a9ec688a 100755 --- a/zcutil/build-mac.sh +++ b/zcutil/build-mac.sh @@ -44,7 +44,7 @@ make "$@" -C ./depends/ V=1 NO_QT=1 NO_PROTON=1 ./autogen.sh CPPFLAGS="-I$PREFIX/include -arch x86_64" LDFLAGS="-L$PREFIX/lib -arch x86_64 -Wl,-no_pie" \ -CXXFLAGS='-arch x86_64 -I/usr/local/Cellar/gcc\@6/6.4.0_2/include/c++/6.4.0/ -I$PREFIX/include -fwrapv -fno-strict-aliasing -Werror -g -Wl,-undefined -Wl,dynamic_lookup' \ +CXXFLAGS='-arch x86_64 -I/usr/local/Cellar/gcc\@6/6.4.0_2/include/c++/6.4.0/ -I$PREFIX/include -fwrapv -fno-strict-aliasing -Wno-builtin-declaration-mismatch -Werror -g -Wl,-undefined -Wl,dynamic_lookup' \ ./configure --prefix="${PREFIX}" --with-gui=no "$HARDENING_ARG" "$LCOV_ARG" make "$@" V=1 NO_GTEST=1 STATIC=1