Merge pull request #5819

d23b0a2 depends: always use static qt5 for linux (Cory Fields)
3448b13 build: fix typo in configure help (Cory Fields)
c95ac83 gitian: fix x86_64 build with static libstdc++ (Cory Fields)
0671516 build: change reduce exports/static libstdc++ options for gitian and travis (Cory Fields)
aa36730 build: remove libstdc++ backwards-compat (Cory Fields)
3ee028f build: disable reduced exports by default (Cory Fields)
This commit is contained in:
Wladimir J. van der Laan 2015-03-03 16:27:37 +01:00
commit f8e68f7bfb
No known key found for this signature in database
GPG key ID: 74810B012346C9A6
10 changed files with 31 additions and 144 deletions

View file

@ -25,19 +25,19 @@ matrix:
fast_finish: true
include:
- compiler: ": ARM"
env: HOST=arm-linux-gnueabihf PACKAGES="g++-arm-linux-gnueabihf" DEP_OPTS="NO_QT=1" GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat"
env: HOST=arm-linux-gnueabihf PACKAGES="g++-arm-linux-gnueabihf" DEP_OPTS="NO_QT=1" GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports"
- compiler: ": bitcoind"
env: HOST=x86_64-unknown-linux-gnu PACKAGES="bc" DEP_OPTS="NO_QT=1 NO_UPNP=1 DEBUG=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat CPPFLAGS=-DDEBUG_LOCKORDER"
env: HOST=x86_64-unknown-linux-gnu PACKAGES="bc" DEP_OPTS="NO_QT=1 NO_UPNP=1 DEBUG=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports CPPFLAGS=-DDEBUG_LOCKORDER"
- compiler: ": No wallet"
env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat"
env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports"
- compiler: ": 32-bit + dash"
env: HOST=i686-pc-linux-gnu PACKAGES="g++-multilib bc" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" USE_SHELL="/bin/dash"
env: HOST=i686-pc-linux-gnu PACKAGES="g++-multilib bc" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++" USE_SHELL="/bin/dash"
- compiler: ": Cross-Mac"
env: HOST=x86_64-apple-darwin11 PACKAGES="cmake libcap-dev libz-dev libbz2-dev" OSX_SDK=10.9 GOAL="deploy"
env: HOST=x86_64-apple-darwin11 PACKAGES="cmake libcap-dev libz-dev libbz2-dev" BITCOIN_CONFIG="--enable-reduce-exports" OSX_SDK=10.9 GOAL="deploy"
- compiler: ": Win64"
env: HOST=x86_64-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-dev wine bc" RUN_TESTS=true GOAL="deploy" BITCOIN_CONFIG="--enable-gui" MAKEJOBS="-j2"
env: HOST=x86_64-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-dev wine bc" RUN_TESTS=true GOAL="deploy" BITCOIN_CONFIG="--enable-gui --enable-reduce-exports" MAKEJOBS="-j2"
- compiler: ": Win32"
env: HOST=i686-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-i686 g++-mingw-w64-i686 binutils-mingw-w64-i686 mingw-w64-dev wine bc" RUN_TESTS=true GOAL="deploy" BITCOIN_CONFIG="--enable-gui" MAKEJOBS="-j2"
env: HOST=i686-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-i686 g++-mingw-w64-i686 binutils-mingw-w64-i686 mingw-w64-dev wine bc" RUN_TESTS=true GOAL="deploy" BITCOIN_CONFIG="--enable-gui --enable-reduce-exports" MAKEJOBS="-j2"
install:
- if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get update; fi
- if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES; fi

View file

@ -115,9 +115,9 @@ AC_ARG_ENABLE([hardening],
AC_ARG_ENABLE([reduce-exports],
[AS_HELP_STRING([--enable-reduce-exports],
[attempt to reduce exported symbols in the resulting executables (default is yes)])],
[attempt to reduce exported symbols in the resulting executables (default is no)])],
[use_reduce_exports=$enableval],
[use_reduce_exports=auto])
[use_reduce_exports=no])
AC_ARG_ENABLE([ccache],
[AS_HELP_STRING([--enable-ccache],
@ -133,7 +133,7 @@ AC_ARG_ENABLE([lcov],
AC_ARG_ENABLE([glibc-back-compat],
[AS_HELP_STRING([--enable-glibc-back-compat],
[enable backwards compatibility with glibc and libstdc++])],
[enable backwards compatibility with glibc])],
[use_glibc_compat=$enableval],
[use_glibc_compat=no])
@ -471,22 +471,14 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([
[
AC_MSG_RESULT(no)
if test x$use_reduce_exports = xyes; then
AC_MSG_ERROR([Cannot find a working visibility attribute. Use --disable-reduced-exports.])
AC_MSG_ERROR([Cannot find a working visibility attribute. Use --disable-reduce-exports.])
fi
AC_MSG_WARN([Cannot find a working visibility attribute. Disabling reduced exports.])
use_reduce_exports=no
]
)
if test x$use_reduce_exports != xno; then
if test x$use_reduce_exports = xyes; then
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[RE_CXXFLAGS="-fvisibility=hidden"],
[
if test x$use_reduce_exports = xyes; then
AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduced-exports.])
fi
AC_MSG_WARN([Cannot set default symbol visibility. Disabling reduced exports.])
use_reduce_exports=no
])
[AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduce-exports.])])
fi
LEVELDB_CPPFLAGS=
@ -533,7 +525,7 @@ AX_BOOST_THREAD
AX_BOOST_CHRONO
if test x$use_reduce_exports != xno; then
if test x$use_reduce_exports = xyes; then
AC_MSG_CHECKING([for working boost reduced exports])
TEMP_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS"
@ -547,25 +539,14 @@ if test x$use_reduce_exports != xno; then
#endif
]])],[
AC_MSG_RESULT(yes)
],[:
if test x$use_reduce_exports = xauto; then
use_reduce_exports=no
else
if test x$use_reduce_exports = xyes; then
AC_MSG_ERROR([boost versions < 1.49 are known to be broken with reduced exports. Use --disable-reduced-exports.])
fi
fi
AC_MSG_RESULT(no)
AC_MSG_WARN([boost versions < 1.49 are known to have symbol visibility issues. Disabling reduced exports.])
],[
AC_MSG_ERROR([boost versions < 1.49 are known to be broken with reduced exports. Use --disable-reduce-exports.])
])
CPPFLAGS="$TEMP_CPPFLAGS"
fi
elif test x$use_reduce_exports = xauto; then
use_reduce_exports=yes
fi
if test x$use_reduce_exports != xno; then
if test x$use_reduce_exports = xyes; then
CXXFLAGS="$CXXFLAGS $RE_CXXFLAGS"
AX_CHECK_LINK_FLAG([[-Wl,--exclude-libs,ALL]], [RELDFLAGS="-Wl,--exclude-libs,ALL"])
fi
@ -827,7 +808,7 @@ else
fi
AC_MSG_CHECKING([whether to reduce exports])
if test x$use_reduce_exports != xno; then
if test x$use_reduce_exports = xyes; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])

View file

@ -15,6 +15,7 @@ packages:
- "faketime"
- "bsdmainutils"
- "binutils-gold"
- "libstdc++6-4.6-pic"
reference_datetime: "2013-06-01 00:00:00"
remotes:
- "url": "https://github.com/bitcoin/bitcoin.git"
@ -23,7 +24,7 @@ files: []
script: |
WRAP_DIR=$HOME/wrapped
HOSTS="i686-pc-linux-gnu x86_64-unknown-linux-gnu"
CONFIGFLAGS="--enable-upnp-default --enable-glibc-back-compat"
CONFIGFLAGS="--enable-upnp-default --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++"
FAKETIME_HOST_PROGS=""
FAKETIME_PROGS="date ar ranlib nm strip"
@ -69,6 +70,14 @@ script: |
make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
done
# Ubuntu precise hack: Not an issue in later versions.
# Precise's libstdc++.a is non-pic. There's an optional libstdc++6-4.6-pic
# package which provides libstdc++_pic.a, but the linker can't find it.
# Symlink it to a path that will be included in our link-line so that the
# linker picks it up before the default libstdc++.a.
# This is only necessary for 64bit.
ln -s /usr/lib/gcc/x86_64-linux-gnu/4.6/libstdc++_pic.a ${BASEPREFIX}/x86_64-unknown-linux-gnu/lib/libstdc++.a
# Create the release tarball using (arbitrarily) the first host
./autogen.sh
./configure --prefix=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`

View file

@ -27,7 +27,7 @@ files:
script: |
WRAP_DIR=$HOME/wrapped
HOSTS="x86_64-apple-darwin11"
CONFIGFLAGS="--enable-upnp-default GENISOIMAGE=$WRAP_DIR/genisoimage"
CONFIGFLAGS="--enable-upnp-default --enable-reduce-exports GENISOIMAGE=$WRAP_DIR/genisoimage"
FAKETIME_HOST_PROGS=""
FAKETIME_PROGS="ar ranlib date dmg genisoimage"

View file

@ -26,7 +26,7 @@ files: []
script: |
WRAP_DIR=$HOME/wrapped
HOSTS="x86_64-w64-mingw32 i686-w64-mingw32"
CONFIGFLAGS="--enable-upnp-default"
CONFIGFLAGS="--enable-upnp-default --enable-reduce-exports"
FAKETIME_HOST_PROGS="g++ ar ranlib nm windres strip"
FAKETIME_PROGS="date makensis zip"

View file

@ -6,7 +6,6 @@ SDK_PATH ?= $(BASEDIR)/SDKs
NO_QT ?=
NO_WALLET ?=
NO_UPNP ?=
USE_LINUX_STATIC_QT5 ?=
FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources
BUILD = $(shell ./config.guess)

View file

@ -23,7 +23,6 @@ NO_QT: Don't download/build/cache qt and its dependencies
NO_WALLET: Don't download/build/cache libs needed to enable the wallet
NO_UPNP: Don't download/build/cache packages needed for enabling upnp
DEBUG: disable some optimizations and enable more runtime checking
USE_LINUX_STATIC_QT5: Build a static qt5 rather than shared qt4. Linux only.
If some packages are not built, for example 'make NO_WALLET=1', the appropriate
options will be passed to bitcoin's configure. In this case, --disable-wallet.

View file

@ -4,15 +4,10 @@ native_packages := native_ccache native_comparisontool
qt_native_packages = native_protobuf
qt_packages = qrencode protobuf
qt46_linux_packages = qt46 expat dbus libxcb xcb_proto libXau xproto freetype libX11 xextproto libXext xtrans libICE libSM
qt5_linux_packages= qt expat dbus libxcb xcb_proto libXau xproto freetype fontconfig libX11 xextproto libXext xtrans
qt_linux_packages= qt expat dbus libxcb xcb_proto libXau xproto freetype fontconfig libX11 xextproto libXext xtrans
qt_darwin_packages=qt
qt_mingw32_packages=qt
qt_linux_$(USE_LINUX_STATIC_QT5):=$(qt5_linux_packages)
qt_linux_:=$(qt46_linux_packages)
qt_linux_packages:=$(qt_linux_$(USE_LINUX_STATIC_QT5))
wallet_packages=bdb

View file

@ -280,7 +280,6 @@ libbitcoin_util_a_SOURCES = \
if GLIBC_BACK_COMPAT
libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
libbitcoin_util_a_SOURCES += compat/glibcxx_compat.cpp
endif
# cli: shared between bitcoin-cli and bitcoin-qt
@ -372,7 +371,6 @@ libbitcoinconsensus_la_SOURCES = \
if GLIBC_BACK_COMPAT
libbitcoinconsensus_la_SOURCES += compat/glibc_compat.cpp
libbitcoinconsensus_la_SOURCES += compat/glibcxx_compat.cpp
endif
libbitcoinconsensus_la_LDFLAGS = -no-undefined $(RELDFLAGS)

View file

@ -1,94 +0,0 @@
// Copyright (c) 2009-2014 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <cstddef>
#include <istream>
#include <stdexcept>
#include <typeinfo>
#ifndef _GLIBCXX_USE_NOEXCEPT
#define _GLIBCXX_USE_NOEXCEPT throw()
#endif
namespace std
{
const char* bad_exception::what() const throw()
{
return "std::bad_exception";
}
const char* bad_cast::what() const throw()
{
return "std::bad_cast";
}
const char* bad_alloc::what() const throw()
{
return "std::bad_alloc";
}
namespace __detail
{
struct _List_node_base {
void _M_hook(std::__detail::_List_node_base* const __position) throw() __attribute__((used))
{
_M_next = __position;
_M_prev = __position->_M_prev;
__position->_M_prev->_M_next = this;
__position->_M_prev = this;
}
void _M_unhook() __attribute__((used))
{
_List_node_base* const __next_node = _M_next;
_List_node_base* const __prev_node = _M_prev;
__prev_node->_M_next = __next_node;
__next_node->_M_prev = __prev_node;
}
_List_node_base* _M_next;
_List_node_base* _M_prev;
};
} // namespace detail
template ostream& ostream::_M_insert(bool);
template ostream& ostream::_M_insert(long);
template ostream& ostream::_M_insert(double);
template ostream& ostream::_M_insert(unsigned long);
template ostream& ostream::_M_insert(const void*);
template ostream& __ostream_insert(ostream&, const char*, streamsize);
template istream& istream::_M_extract(long&);
template istream& istream::_M_extract(unsigned short&);
out_of_range::~out_of_range() _GLIBCXX_USE_NOEXCEPT {}
length_error::~length_error() _GLIBCXX_USE_NOEXCEPT {}
// Used with permission.
// See: https://github.com/madlib/madlib/commit/c3db418c0d34d6813608f2137fef1012ce03043d
void ctype<char>::_M_widen_init() const
{
char __tmp[sizeof(_M_widen)];
for (unsigned __i = 0; __i < sizeof(_M_widen); ++__i)
__tmp[__i] = __i;
do_widen(__tmp, __tmp + sizeof(__tmp), _M_widen);
_M_widen_ok = 1;
// Set _M_widen_ok to 2 if memcpy can't be used.
for (unsigned __i = 0; __i < sizeof(_M_widen); ++__i)
if (__tmp[__i] != _M_widen[__i]) {
_M_widen_ok = 2;
break;
}
}
void __throw_out_of_range_fmt(const char*, ...) __attribute__((__noreturn__));
void __throw_out_of_range_fmt(const char* err, ...)
{
// Safe and over-simplified version. Ignore the format and print it as-is.
__throw_out_of_range(err);
}
} // namespace std