Skip to content

Commit f8e68f7

Browse files
committed
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)
2 parents 86eb461 + d23b0a2 commit f8e68f7

File tree

10 files changed

+31
-144
lines changed

10 files changed

+31
-144
lines changed

.travis.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@ matrix:
2525
fast_finish: true
2626
include:
2727
- compiler: ": ARM"
28-
env: HOST=arm-linux-gnueabihf PACKAGES="g++-arm-linux-gnueabihf" DEP_OPTS="NO_QT=1" GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat"
28+
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"
2929
- compiler: ": bitcoind"
30-
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"
30+
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"
3131
- compiler: ": No wallet"
32-
env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat"
32+
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"
3333
- compiler: ": 32-bit + dash"
34-
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"
34+
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"
3535
- compiler: ": Cross-Mac"
36-
env: HOST=x86_64-apple-darwin11 PACKAGES="cmake libcap-dev libz-dev libbz2-dev" OSX_SDK=10.9 GOAL="deploy"
36+
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"
3737
- compiler: ": Win64"
38-
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"
38+
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"
3939
- compiler: ": Win32"
40-
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"
40+
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"
4141
install:
4242
- if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get update; fi
4343
- if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES; fi

configure.ac

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ AC_ARG_ENABLE([hardening],
115115

116116
AC_ARG_ENABLE([reduce-exports],
117117
[AS_HELP_STRING([--enable-reduce-exports],
118-
[attempt to reduce exported symbols in the resulting executables (default is yes)])],
118+
[attempt to reduce exported symbols in the resulting executables (default is no)])],
119119
[use_reduce_exports=$enableval],
120-
[use_reduce_exports=auto])
120+
[use_reduce_exports=no])
121121

122122
AC_ARG_ENABLE([ccache],
123123
[AS_HELP_STRING([--enable-ccache],
@@ -133,7 +133,7 @@ AC_ARG_ENABLE([lcov],
133133

134134
AC_ARG_ENABLE([glibc-back-compat],
135135
[AS_HELP_STRING([--enable-glibc-back-compat],
136-
[enable backwards compatibility with glibc and libstdc++])],
136+
[enable backwards compatibility with glibc])],
137137
[use_glibc_compat=$enableval],
138138
[use_glibc_compat=no])
139139

@@ -471,22 +471,14 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([
471471
[
472472
AC_MSG_RESULT(no)
473473
if test x$use_reduce_exports = xyes; then
474-
AC_MSG_ERROR([Cannot find a working visibility attribute. Use --disable-reduced-exports.])
474+
AC_MSG_ERROR([Cannot find a working visibility attribute. Use --disable-reduce-exports.])
475475
fi
476-
AC_MSG_WARN([Cannot find a working visibility attribute. Disabling reduced exports.])
477-
use_reduce_exports=no
478476
]
479477
)
480478

481-
if test x$use_reduce_exports != xno; then
479+
if test x$use_reduce_exports = xyes; then
482480
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[RE_CXXFLAGS="-fvisibility=hidden"],
483-
[
484-
if test x$use_reduce_exports = xyes; then
485-
AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduced-exports.])
486-
fi
487-
AC_MSG_WARN([Cannot set default symbol visibility. Disabling reduced exports.])
488-
use_reduce_exports=no
489-
])
481+
[AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduce-exports.])])
490482
fi
491483

492484
LEVELDB_CPPFLAGS=
@@ -533,7 +525,7 @@ AX_BOOST_THREAD
533525
AX_BOOST_CHRONO
534526

535527

536-
if test x$use_reduce_exports != xno; then
528+
if test x$use_reduce_exports = xyes; then
537529
AC_MSG_CHECKING([for working boost reduced exports])
538530
TEMP_CPPFLAGS="$CPPFLAGS"
539531
CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS"
@@ -547,25 +539,14 @@ if test x$use_reduce_exports != xno; then
547539
#endif
548540
]])],[
549541
AC_MSG_RESULT(yes)
550-
],[:
551-
if test x$use_reduce_exports = xauto; then
552-
use_reduce_exports=no
553-
else
554-
if test x$use_reduce_exports = xyes; then
555-
AC_MSG_ERROR([boost versions < 1.49 are known to be broken with reduced exports. Use --disable-reduced-exports.])
556-
fi
557-
fi
558-
AC_MSG_RESULT(no)
559-
AC_MSG_WARN([boost versions < 1.49 are known to have symbol visibility issues. Disabling reduced exports.])
542+
],[
543+
AC_MSG_ERROR([boost versions < 1.49 are known to be broken with reduced exports. Use --disable-reduce-exports.])
560544
])
561545
CPPFLAGS="$TEMP_CPPFLAGS"
562546
fi
563-
564-
elif test x$use_reduce_exports = xauto; then
565-
use_reduce_exports=yes
566547
fi
567548

568-
if test x$use_reduce_exports != xno; then
549+
if test x$use_reduce_exports = xyes; then
569550
CXXFLAGS="$CXXFLAGS $RE_CXXFLAGS"
570551
AX_CHECK_LINK_FLAG([[-Wl,--exclude-libs,ALL]], [RELDFLAGS="-Wl,--exclude-libs,ALL"])
571552
fi
@@ -827,7 +808,7 @@ else
827808
fi
828809

829810
AC_MSG_CHECKING([whether to reduce exports])
830-
if test x$use_reduce_exports != xno; then
811+
if test x$use_reduce_exports = xyes; then
831812
AC_MSG_RESULT([yes])
832813
else
833814
AC_MSG_RESULT([no])

contrib/gitian-descriptors/gitian-linux.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ packages:
1515
- "faketime"
1616
- "bsdmainutils"
1717
- "binutils-gold"
18+
- "libstdc++6-4.6-pic"
1819
reference_datetime: "2013-06-01 00:00:00"
1920
remotes:
2021
- "url": "https://github.com/bitcoin/bitcoin.git"
@@ -23,7 +24,7 @@ files: []
2324
script: |
2425
WRAP_DIR=$HOME/wrapped
2526
HOSTS="i686-pc-linux-gnu x86_64-unknown-linux-gnu"
26-
CONFIGFLAGS="--enable-upnp-default --enable-glibc-back-compat"
27+
CONFIGFLAGS="--enable-upnp-default --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++"
2728
FAKETIME_HOST_PROGS=""
2829
FAKETIME_PROGS="date ar ranlib nm strip"
2930
@@ -69,6 +70,14 @@ script: |
6970
make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
7071
done
7172
73+
# Ubuntu precise hack: Not an issue in later versions.
74+
# Precise's libstdc++.a is non-pic. There's an optional libstdc++6-4.6-pic
75+
# package which provides libstdc++_pic.a, but the linker can't find it.
76+
# Symlink it to a path that will be included in our link-line so that the
77+
# linker picks it up before the default libstdc++.a.
78+
# This is only necessary for 64bit.
79+
ln -s /usr/lib/gcc/x86_64-linux-gnu/4.6/libstdc++_pic.a ${BASEPREFIX}/x86_64-unknown-linux-gnu/lib/libstdc++.a
80+
7281
# Create the release tarball using (arbitrarily) the first host
7382
./autogen.sh
7483
./configure --prefix=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`

contrib/gitian-descriptors/gitian-osx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ files:
2727
script: |
2828
WRAP_DIR=$HOME/wrapped
2929
HOSTS="x86_64-apple-darwin11"
30-
CONFIGFLAGS="--enable-upnp-default GENISOIMAGE=$WRAP_DIR/genisoimage"
30+
CONFIGFLAGS="--enable-upnp-default --enable-reduce-exports GENISOIMAGE=$WRAP_DIR/genisoimage"
3131
FAKETIME_HOST_PROGS=""
3232
FAKETIME_PROGS="ar ranlib date dmg genisoimage"
3333

contrib/gitian-descriptors/gitian-win.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ files: []
2626
script: |
2727
WRAP_DIR=$HOME/wrapped
2828
HOSTS="x86_64-w64-mingw32 i686-w64-mingw32"
29-
CONFIGFLAGS="--enable-upnp-default"
29+
CONFIGFLAGS="--enable-upnp-default --enable-reduce-exports"
3030
FAKETIME_HOST_PROGS="g++ ar ranlib nm windres strip"
3131
FAKETIME_PROGS="date makensis zip"
3232

depends/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ SDK_PATH ?= $(BASEDIR)/SDKs
66
NO_QT ?=
77
NO_WALLET ?=
88
NO_UPNP ?=
9-
USE_LINUX_STATIC_QT5 ?=
109
FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources
1110

1211
BUILD = $(shell ./config.guess)

depends/README.usage

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ NO_QT: Don't download/build/cache qt and its dependencies
2323
NO_WALLET: Don't download/build/cache libs needed to enable the wallet
2424
NO_UPNP: Don't download/build/cache packages needed for enabling upnp
2525
DEBUG: disable some optimizations and enable more runtime checking
26-
USE_LINUX_STATIC_QT5: Build a static qt5 rather than shared qt4. Linux only.
2726

2827
If some packages are not built, for example 'make NO_WALLET=1', the appropriate
2928
options will be passed to bitcoin's configure. In this case, --disable-wallet.

depends/packages/packages.mk

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@ native_packages := native_ccache native_comparisontool
44
qt_native_packages = native_protobuf
55
qt_packages = qrencode protobuf
66

7-
qt46_linux_packages = qt46 expat dbus libxcb xcb_proto libXau xproto freetype libX11 xextproto libXext xtrans libICE libSM
8-
qt5_linux_packages= qt expat dbus libxcb xcb_proto libXau xproto freetype fontconfig libX11 xextproto libXext xtrans
9-
7+
qt_linux_packages= qt expat dbus libxcb xcb_proto libXau xproto freetype fontconfig libX11 xextproto libXext xtrans
108
qt_darwin_packages=qt
119
qt_mingw32_packages=qt
1210

13-
qt_linux_$(USE_LINUX_STATIC_QT5):=$(qt5_linux_packages)
14-
qt_linux_:=$(qt46_linux_packages)
15-
qt_linux_packages:=$(qt_linux_$(USE_LINUX_STATIC_QT5))
1611

1712
wallet_packages=bdb
1813

src/Makefile.am

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ libbitcoin_util_a_SOURCES = \
280280

281281
if GLIBC_BACK_COMPAT
282282
libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
283-
libbitcoin_util_a_SOURCES += compat/glibcxx_compat.cpp
284283
endif
285284

286285
# cli: shared between bitcoin-cli and bitcoin-qt
@@ -372,7 +371,6 @@ libbitcoinconsensus_la_SOURCES = \
372371

373372
if GLIBC_BACK_COMPAT
374373
libbitcoinconsensus_la_SOURCES += compat/glibc_compat.cpp
375-
libbitcoinconsensus_la_SOURCES += compat/glibcxx_compat.cpp
376374
endif
377375

378376
libbitcoinconsensus_la_LDFLAGS = -no-undefined $(RELDFLAGS)

src/compat/glibcxx_compat.cpp

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)