dash/ci/build_src.sh
UdjinM6 9718bb394b
build/ci: Fix --enable-glibc-back-compat and its usage (#4592)
* build: Fix `--enable-glibc-back-compat`

Compiling on Ubuntu 20.04 results in binaries that can't be run on older systems we still support (e.g. Ubuntu 16.04) and `contrib/devtools/symbol-check.py` complains about it.

Available versions for `log` for example:
$ objdump -T /lib/x86_64-linux-gnu/libm.so.6 | egrep -w 'log'
00000000000431b0 g    DF .text	0000000000000039  GLIBC_2.29  log
0000000000012360 g    DF .text	0000000000000066 (GLIBC_2.2.5) log

(i.e. the default one is 2.29)

This commit fixes the issue by picking the version we support instead of the default one.

Before:
$ objdump -T dashd | egrep -w 'log'
0000000000000000      DF *UND*	0000000000000000  GLIBC_2.29  log

After:
$ objdump -T dashd | egrep -w 'log'
0000000000000000      DF *UND*	0000000000000000  GLIBC_2.2.5 log

* ci: Add `make check-symbols` to the `build` step

* ci: Do not specify `--enable-glibc-back-compat` for non-release builds

* ci: Set correct LDFLAGS for the release build

* doc: Update docs to mention the need for `LDFLAGS=-static-libstdc++` when compiling for same host but different distro

* ci: Add `--with-sanitizers=undefined` back to `linux64` build
2021-11-30 14:13:18 +03:00

56 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
#
# This script is executed inside the builder image
export LC_ALL=C.UTF-8
set -e
source ./ci/matrix.sh
unset CC; unset CXX
unset DISPLAY
export CCACHE_COMPRESS=${CCACHE_COMPRESS:-1}
export CCACHE_SIZE=${CCACHE_SIZE:-400M}
if [ "$PULL_REQUEST" != "false" ]; then test/lint/commit-script-check.sh $COMMIT_RANGE; fi
if [ "$CHECK_DOC" = 1 ]; then
# TODO: Verify subtrees
#test/lint/git-subtree-check.sh src/crypto/ctaes
#test/lint/git-subtree-check.sh src/secp256k1
#test/lint/git-subtree-check.sh src/univalue
#test/lint/git-subtree-check.sh src/leveldb
# TODO: Check docs (re-enable after all Bitcoin PRs have been merged and docs fully fixed)
#test/lint/check-doc.py
# Check rpc consistency
test/lint/check-rpc-mappings.py .
# Run all linters
test/lint/lint-all.sh
test/lint/extended-lint-all.sh
fi
ccache --max-size=$CCACHE_SIZE
if [ -n "$USE_SHELL" ]; then
export CONFIG_SHELL="$USE_SHELL"
fi
BITCOIN_CONFIG_ALL="--disable-dependency-tracking --prefix=$BUILD_DIR/depends/$HOST --bindir=$OUT_DIR/bin --libdir=$OUT_DIR/lib"
( test -n "$USE_SHELL" && eval '"$USE_SHELL" -c "./autogen.sh"' ) || ./autogen.sh
rm -rf build-ci
mkdir build-ci
cd build-ci
../configure --cache-file=config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false)
make distdir VERSION=$BUILD_TARGET
cd dashcore-$BUILD_TARGET
./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false)
make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && make $GOAL V=1 ; false )
make $MAKEJOBS -C src check-symbols