Browse Source

osx: switch to gcc-8 static build

pull/27/head
DeckerSU 5 years ago
parent
commit
45aecd9c3c
  1. 8
      depends/builders/darwin.mk
  2. 5
      src/Makefile.am
  3. 2
      src/chain.h
  4. 4
      src/consensus/params.h
  5. 1
      src/crypto/verus_hash.h
  6. 4
      src/main.cpp
  7. 2
      src/miner.cpp
  8. 1
      src/script/script_ext.cpp
  9. 2
      zcutil/build-mac.sh

8
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)

5
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)

2
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;
}

4
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

1
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); }

4
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;

2
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())
{

1
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

2
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

Loading…
Cancel
Save