diff options
-rw-r--r-- | contrib/gitian-descriptors/gitian-linux.yml | 25 | ||||
-rw-r--r-- | doc/gitian-building.md | 2 | ||||
-rw-r--r-- | src/bitcoin-cli.cpp | 7 | ||||
-rw-r--r-- | src/bitcoind.cpp | 8 | ||||
-rw-r--r-- | src/m4/ax_boost_base.m4 | 8 | ||||
-rw-r--r-- | src/qt/bitcoin.cpp | 8 |
6 files changed, 51 insertions, 7 deletions
diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml index 017a5c26a4..3c25b793d0 100644 --- a/contrib/gitian-descriptors/gitian-linux.yml +++ b/contrib/gitian-descriptors/gitian-linux.yml @@ -39,18 +39,39 @@ script: | unzip ../build/bitcoin-deps-linux${GBUILD_BITS}-gitian-r4.zip unzip ../build/boost-linux${GBUILD_BITS}-1.55.0-gitian-r1.zip cd ../build + + function do_configure { + ./configure "$@" --enable-upnp-default --prefix=$STAGING --with-protoc-bindir=$STAGING/host/bin --with-boost=$STAGING --disable-maintainer-mode --disable-dependency-tracking PKG_CONFIG_PATH="$STAGING/lib/pkgconfig" CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitcoin ${OPTFLAGS}" BOOST_CHRONO_EXTRALIBS="-lrt" + } # cd bitcoin ./autogen.sh - ./configure --prefix=$STAGING --bindir=$BINDIR --with-protoc-bindir=$STAGING/host/bin --with-boost=$STAGING --disable-maintainer-mode --disable-dependency-tracking PKG_CONFIG_PATH="$STAGING/lib/pkgconfig" CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitcoin ${OPTFLAGS}" BOOST_CHRONO_EXTRALIBS="-lrt" + do_configure make dist DISTNAME=`echo bitcoin-*.tar.gz` + + # Build dynamic versions of everything + # (with static linking to boost and openssl as well a some non-OS deps) mkdir -p distsrc cd distsrc tar --strip-components=1 -xf ../$DISTNAME - ./configure --enable-upnp-default --prefix=$STAGING --bindir=$BINDIR --with-protoc-bindir=$STAGING/host/bin --with-boost=$STAGING --disable-maintainer-mode --disable-dependency-tracking PKG_CONFIG_PATH="$STAGING/lib/pkgconfig" CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitcoin ${OPTFLAGS}" BOOST_CHRONO_EXTRALIBS="-lrt" + do_configure --bindir=$BINDIR make $MAKEOPTS make $MAKEOPTS install-strip + make $MAKEOPTS clean + + # Build fully static versions of bitcoind and bitcoin-cli for older Linux distros + STATIC_BINDIR="$HOME/bindir.static" + mkdir -p $STATIC_BINDIR + # For 32-bit, -pie cannot be used with -static, as invalid executables are generated + # For 64-bit, -pie with -static causes a link error + # Disable hardening in configure and manually pass 'static-safe' hardening flags + OPTFLAGS='-O2 -static -Wstack-protector -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wl,-z,relro -Wl,-z,now' + do_configure --bindir=$STATIC_BINDIR --disable-tests --enable-upnp-default --without-gui --disable-hardening + make $MAKEOPTS + make $MAKEOPTS install-strip + cp $STATIC_BINDIR/bitcoind $BINDIR/bitcoind.static + cp $STATIC_BINDIR/bitcoin-cli $BINDIR/bitcoin-cli.static # sort distribution tar file and normalize user/group/mtime information for deterministic output mkdir -p $OUTDIR/src diff --git a/doc/gitian-building.md b/doc/gitian-building.md index 9fef66b764..f12dce5065 100644 --- a/doc/gitian-building.md +++ b/doc/gitian-building.md @@ -49,7 +49,7 @@ on actual hardware instead of using a VM, in this case you can skip this section In the VirtualBox GUI click "Create" and choose the following parameters in the wizard: -![](gitian-building/create_vm_page1.png =100x20) +![](gitian-building/create_vm_page1.png) - Type: Linux, Debian (64 bit) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 817369fe95..ca6950a162 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -27,7 +27,12 @@ static bool AppInitRPC(int argc, char* argv[]) fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", mapArgs["-datadir"].c_str()); return false; } - ReadConfigFile(mapArgs, mapMultiArgs); + try { + ReadConfigFile(mapArgs, mapMultiArgs); + } catch(std::exception &e) { + fprintf(stderr,"Error reading configuration file: %s\n", e.what()); + return false; + } // Check for -testnet or -regtest parameter (TestNet() calls are only valid after this clause) if (!SelectParamsFromCommandLine()) { fprintf(stderr, "Error: Invalid combination of -regtest and -testnet.\n"); diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 4882a00532..17aa0c9d4b 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -70,7 +70,13 @@ bool AppInit(int argc, char* argv[]) fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", mapArgs["-datadir"].c_str()); return false; } - ReadConfigFile(mapArgs, mapMultiArgs); + try + { + ReadConfigFile(mapArgs, mapMultiArgs); + } catch(std::exception &e) { + fprintf(stderr,"Error reading configuration file: %s\n", e.what()); + return false; + } // Check for -testnet or -regtest parameter (TestNet() calls are only valid after this clause) if (!SelectParamsFromCommandLine()) { fprintf(stderr, "Error: Invalid combination of -regtest and -testnet.\n"); diff --git a/src/m4/ax_boost_base.m4 b/src/m4/ax_boost_base.m4 index f941b27ec4..4f93a0e094 100644 --- a/src/m4/ax_boost_base.m4 +++ b/src/m4/ax_boost_base.m4 @@ -33,7 +33,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 22 +#serial 23 AC_DEFUN([AX_BOOST_BASE], [ @@ -103,6 +103,12 @@ if test "x$want_boost" = "xyes"; then AC_REQUIRE([AC_CANONICAL_HOST]) libsubdirs="lib/${host_cpu}-${host_os} $libsubdirs" + case ${host_cpu} in + i?86) + libsubdirs="lib/i386-${host_os} $libsubdirs" + ;; + esac + dnl first we check the system location for boost libraries dnl this location ist chosen if boost libraries are installed with the --layout=system option dnl or if you install boost with RPM diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 0db4308bf6..696e65ec19 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -507,7 +507,13 @@ int main(int argc, char *argv[]) QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(mapArgs["-datadir"]))); return 1; } - ReadConfigFile(mapArgs, mapMultiArgs); + try { + ReadConfigFile(mapArgs, mapMultiArgs); + } catch(std::exception &e) { + QMessageBox::critical(0, QObject::tr("Bitcoin"), + QObject::tr("Error: Cannot parse configuration file: %1. Only use key=value syntax.").arg(e.what())); + return false; + } /// 7. Determine network (and switch to network specific options) // - Do not call Params() before this step |