From 6cbaa65b55aceda8205ef0e383ce4e5fe4659f39 Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Wed, 28 Oct 2020 22:16:25 +0000 Subject: [PATCH] Gitian builds: Remove manual CFLAGS and CXXFLAGS from descriptor. Before Zcash launched, we were heavily relying on `zcutil/build.sh` to apply our Zcash-specific hardening flags. The Gitian deterministic build system obviously didn't use our script, so the corresponding flags were manually added to `gitian-linux.yml`. Since then, we have migrated all of our flags into `configure.ac`. Manually setting them in the Gitian descriptor is no longer necessary, and should have been removed at the same time. This didn't cause any noticeable issues, however, leaving it undetected until we migrated to Clang in zcash/zcash#4613, and performed a Gitian build for 4.1.0-rc1. The Gitian failure was caused by linker flags specific to C++ being used in configuration tests for secp256k1 (a C library). This causes ldd to emit warnings, which are then converted to errors by the -Werror flags that were added to CFLAGS and CXXFLAGS by `gitian-linux.yml`. CI did not encounter this because it uses the standard `--enable-werror` config flag, which adds `-Werror` to CXXFLAGS but not CFLAGS. Co-authored-by: Jack Grigg Signed-off-by: Daira Hopwood --- contrib/gitian-descriptors/gitian-linux.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml index 6a083b87416..b7f91f5eb58 100644 --- a/contrib/gitian-descriptors/gitian-linux.yml +++ b/contrib/gitian-descriptors/gitian-linux.yml @@ -32,12 +32,12 @@ files: [] script: | WRAP_DIR=$HOME/wrapped HOSTS="x86_64-linux-gnu" - CONFIGFLAGS="--enable-glibc-back-compat --enable-reduce-exports --disable-bench --enable-hardening" + CONFIGFLAGS="--enable-glibc-back-compat --enable-reduce-exports --disable-bench --enable-hardening --enable-werror" MAKEOPTS="V=1" FAKETIME_HOST_PROGS="" FAKETIME_PROGS="date ar ranlib nm strip objcopy" - HOST_CFLAGS="-fwrapv -fno-strict-aliasing -Werror -g" - HOST_CXXFLAGS="-fwrapv -fno-strict-aliasing -Werror -g" + HOST_CFLAGS="" + HOST_CXXFLAGS="" HOST_LDFLAGS=-static-libstdc++ export QT_RCC_TEST=0