From 2e568375ea3410a67ed4d7cb18a2cabd4ece0580 Mon Sep 17 00:00:00 2001 From: Barnabas Debreczeni Date: Sat, 5 Mar 2016 15:21:22 +0100 Subject: [PATCH] Gitian: fix check-symbols for armhf builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit amrhf builds leak Boost symbols, so @laanwj’s linker script hack was added back to armhf builds. Also added ld-linux-armhf.so.3 to the list of allowed libraries in symbol-check.py. --- contrib/devtools/symbol-check.py | 1 + .../gitian-descriptors/gitian-linux-armhf.yml | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/contrib/devtools/symbol-check.py b/contrib/devtools/symbol-check.py index 4ad5136f79e..7ea6b5c97c3 100755 --- a/contrib/devtools/symbol-check.py +++ b/contrib/devtools/symbol-check.py @@ -62,6 +62,7 @@ ALLOWED_LIBRARIES = { 'librt.so.1', # real-time (clock) 'ld-linux-x86-64.so.2', # 64-bit dynamic linker 'ld-linux.so.2', # 32-bit dynamic linker +'ld-linux-armhf.so.3', # 32-bit armhf dynamic linker # bitcoin-qt only 'libX11-xcb.so.1', # part of X11 'libX11.so.6', # part of X11 diff --git a/contrib/gitian-descriptors/gitian-linux-armhf.yml b/contrib/gitian-descriptors/gitian-linux-armhf.yml index c47b9f5571f..020e2c2dff6 100644 --- a/contrib/gitian-descriptors/gitian-linux-armhf.yml +++ b/contrib/gitian-descriptors/gitian-linux-armhf.yml @@ -23,9 +23,20 @@ remotes: "dir": "bitcoin" files: [] script: | + # Avoid exporting *any* symbols from the executable + # This avoids conflicts between the libraries statically linked into bitcoin and any + # libraries we may link dynamically (such as Qt and OpenSSL, see issue #4094). + # It also avoids start-up overhead to not export any unnecessary symbols. + # To do this, build a linker script that marks all symbols as local. + LINKER_SCRIPT=$HOME/build/linker_version_script + echo ' + { + local: *; + };' > $LINKER_SCRIPT WRAP_DIR=$HOME/wrapped HOSTS="arm-linux-gnueabihf" - CONFIGFLAGS="--enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++" + CONFIGFLAGS="--enable-glibc-back-compat --enable-reduce-exports" + CONFIGLDFLAGS="-static-libstdc++ -Wl,--version-script=$LINKER_SCRIPT" FAKETIME_HOST_PROGS="" FAKETIME_PROGS="date ar ranlib nm strip" @@ -95,9 +106,10 @@ script: | mkdir -p ${INSTALLPATH} tar --strip-components=1 -xf ../$SOURCEDIST - ./configure --prefix=${BASEPREFIX}/${i} --bindir=${INSTALLPATH}/bin --includedir=${INSTALLPATH}/include --libdir=${INSTALLPATH}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} + ./configure --prefix=${BASEPREFIX}/${i} --bindir=${INSTALLPATH}/bin --includedir=${INSTALLPATH}/include --libdir=${INSTALLPATH}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} LDFLAGS="${CONFIGLDFLAGS}" make ${MAKEOPTS} make ${MAKEOPTS} -C src check-security + make ${MAKEOPTS} -C src check-symbols make install-strip cd installed find . -name "lib*.la" -delete