Skip to content

Commit 64be7f7

Browse files
committed
gitian: Build boost dependency for linux
Instead of using the boost provided by Ubuntu 12.04, build our own dependency like we do for Windows. This allows using a much newer version (1.55 versus 1.46) as well as building with `-fPIC` so that `-pie` can be used in the x86-64 build.
1 parent 7eb99a8 commit 64be7f7

File tree

3 files changed

+49
-8
lines changed

3 files changed

+49
-8
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: "boost"
3+
suites:
4+
- "precise"
5+
architectures:
6+
- "i386"
7+
- "amd64"
8+
packages:
9+
- "unzip"
10+
- "pkg-config"
11+
- "libtool"
12+
- "faketime"
13+
- "bsdmainutils"
14+
- "zip"
15+
reference_datetime: "2011-01-30 00:00:00"
16+
remotes: []
17+
files:
18+
- "boost_1_55_0.tar.bz2"
19+
script: |
20+
STAGING="$HOME/install"
21+
export LIBRARY_PATH="$STAGING/lib"
22+
# Input Integrity Check
23+
echo "fff00023dd79486d444c8e29922f4072e1d451fc5a4d2b6075852ead7f2b7b52 boost_1_55_0.tar.bz2" | shasum -c
24+
25+
mkdir -p "$STAGING"
26+
tar xjf boost_1_55_0.tar.bz2
27+
cd boost_1_55_0
28+
GCCVERSION=$(g++ -E -dM $(mktemp --suffix=.h) | grep __VERSION__ | cut -d ' ' -f 3 | cut -d '"' -f 2)
29+
# note: bjam with -d+2 reveals that -O3 is implied by default, no need to provide it in cxxflags
30+
echo "using gcc : $GCCVERSION : g++
31+
:
32+
<cxxflags>\"-frandom-seed=boost1 -fPIC\"
33+
;" > user-config.jam
34+
35+
./bootstrap.sh --without-icu
36+
37+
./bjam toolset=gcc threadapi=pthread threading=multi variant=release link=static runtime-link=shared --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 --layout=tagged --build-type=complete --prefix="$STAGING" $MAKEOPTS install
38+
39+
cd "$STAGING"
40+
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
41+
export FAKETIME=$REFERENCE_DATETIME
42+
zip -r $OUTDIR/boost-linux${GBUILD_BITS}-1.55.0-gitian-r1.zip *

contrib/gitian-descriptors/gitian-linux.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,7 @@ architectures:
66
- "i386"
77
- "amd64"
88
packages:
9-
- "qt4-qmake"
109
- "libqt4-dev"
11-
- "libboost-system-dev"
12-
- "libboost-filesystem-dev"
13-
- "libboost-program-options-dev"
14-
- "libboost-thread-dev"
15-
- "libboost-test-dev"
1610
- "libssl-dev"
1711
- "git-core"
1812
- "unzip"
@@ -29,6 +23,8 @@ remotes:
2923
files:
3024
- "bitcoin-deps-linux32-gitian-r1.zip"
3125
- "bitcoin-deps-linux64-gitian-r1.zip"
26+
- "boost-linux32-1.55.0-gitian-r1.zip"
27+
- "boost-linux64-1.55.0-gitian-r1.zip"
3228
script: |
3329
STAGING="$HOME/install"
3430
OPTFLAGS='-O2'
@@ -39,17 +35,18 @@ script: |
3935
mkdir -p $STAGING
4036
cd $STAGING
4137
unzip ../build/bitcoin-deps-linux${GBUILD_BITS}-gitian-r1.zip
38+
unzip ../build/boost-linux${GBUILD_BITS}-1.55.0-gitian-r1.zip
4239
cd ../build
4340
#
4441
cd bitcoin
4542
export TAR_OPTIONS=--mtime=`echo $REFERENCE_DATETIME | awk '{ print $1 }'`
4643
./autogen.sh
47-
./configure --prefix=$STAGING --bindir=$BINDIR --with-protoc-bindir=$STAGING/host/bin --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}"
44+
./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"
4845
make dist
4946
mkdir -p distsrc
5047
cd distsrc
5148
tar --strip-components=1 -xf ../bitcoin-*.tar.*
52-
./configure --prefix=$STAGING --bindir=$BINDIR --with-protoc-bindir=$STAGING/host/bin --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}"
49+
./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"
5350
make $MAKEOPTS
5451
make $MAKEOPTS install-strip
5552
mkdir -p $OUTDIR/src

doc/release-process.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ Release Process
5353
cd ..
5454
./bin/gbuild ../bitcoin/contrib/gitian-descriptors/deps-linux.yml
5555
mv build/out/bitcoin-deps-*.zip inputs/
56+
./bin/gbuild ../bitcoin/contrib/gitian-descriptors/boost-linux.yml
57+
mv build/out/boost-linux-*.zip inputs/
5658
./bin/gbuild ../bitcoin/contrib/gitian-descriptors/boost-win32.yml
5759
mv build/out/boost-win32-*.zip inputs/
5860
./bin/gbuild ../bitcoin/contrib/gitian-descriptors/deps-win32.yml

0 commit comments

Comments
 (0)