From f14840d3e11f44f2daf9559c86d8674ead8b9506 Mon Sep 17 00:00:00 2001 From: Malcolm MacLeod Date: Fri, 20 Mar 2020 10:44:37 +0200 Subject: [PATCH] BUILD: Work around an issue with gitian builds The changes for android/iOS compiles are so mehow breaking gitian builds (using the wrong nm). It isn't clear to me why, so for now for the sake of pragmatism I just introduce a way to disable the changes for gitian, we should later figure this out and fix it properly though. --- contrib/gitian-descriptors/gitian-linux.yml | 2 +- contrib/gitian-descriptors/gitian-osx.yml | 2 +- contrib/gitian-descriptors/gitian-win.yml | 2 +- depends/hosts/default.mk | 96 ++++++++++++--------- 4 files changed, 57 insertions(+), 45 deletions(-) diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml index b24232cae8..b1f16be3e0 100644 --- a/contrib/gitian-descriptors/gitian-linux.yml +++ b/contrib/gitian-descriptors/gitian-linux.yml @@ -133,7 +133,7 @@ script: | if [ -d "$EXTRA_INCLUDES" ]; then export HOST_ID_SALT="$EXTRA_INCLUDES" fi - make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" + make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" GITIAN_BUILD="1" unset HOST_ID_SALT done diff --git a/contrib/gitian-descriptors/gitian-osx.yml b/contrib/gitian-descriptors/gitian-osx.yml index d912eb164e..0699b73fb0 100644 --- a/contrib/gitian-descriptors/gitian-osx.yml +++ b/contrib/gitian-descriptors/gitian-osx.yml @@ -107,7 +107,7 @@ script: | ORIGWRAPPATH="$PATH" for i in $HOSTS; do export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGWRAPPATH} - make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" + make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" GITIAN_BUILD="1" done # Faketime for binaries diff --git a/contrib/gitian-descriptors/gitian-win.yml b/contrib/gitian-descriptors/gitian-win.yml index dd66752054..c0c440c16a 100644 --- a/contrib/gitian-descriptors/gitian-win.yml +++ b/contrib/gitian-descriptors/gitian-win.yml @@ -145,7 +145,7 @@ script: | BASEPREFIX=`pwd`/depends # Build dependencies for each host for i in $HOSTS; do - make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" + make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" GITIAN_BUILD="1" GITIAN_BUILD="1" done # Faketime for binaries diff --git a/depends/hosts/default.mk b/depends/hosts/default.mk index 59ade65d0d..bf305de518 100644 --- a/depends/hosts/default.mk +++ b/depends/hosts/default.mk @@ -2,61 +2,73 @@ ifneq ($(host),$(build)) host_toolchain:=$(host)- endif -ifeq ($(CC),) +ifeq ($(GITIAN_BUILD),1) default_host_CC = $(host_toolchain)gcc -else - default_host_CC= $(CC) -endif - -ifeq ($(CXX),) default_host_CXX = $(host_toolchain)g++ + default_host_AR = $(host_toolchain)ar + default_host_RANLIB = $(host_toolchain)ranlib + default_host_STRIP = $(host_toolchain)strip + default_host_LIBTOOL = $(host_toolchain)libtool + default_host_INSTALL_NAME_TOOL = $(host_toolchain)install_name_tool + default_host_OTOOL = $(host_toolchain)otool + default_host_NM = $(host_toolchain)nm else - default_host_CXX = $(CXX) -endif + ifeq ($(CC),) + default_host_CC = $(host_toolchain)gcc + else + default_host_CC= $(CC) + endif -ifeq ($(AR),) - default_host_AR = $(host_toolchain)ar - ifeq (, $(shell which $(default_host_AR))) - default_host_AR = ar + ifeq ($(CXX),) + default_host_CXX = $(host_toolchain)g++ + else + default_host_CXX = $(CXX) endif -else - default_host_AR = $(AR) -endif -ifeq ($(RANLIB),) - default_host_RANLIB = $(host_toolchain)ranlib - ifeq (, $(shell which $(default_host_RANLIB))) - default_host_RANLIB = ranlib + ifeq ($(AR),) + default_host_AR = $(host_toolchain)ar + ifeq (, $(shell which $(default_host_AR))) + default_host_AR = ar + endif + else + default_host_AR = $(AR) endif -else - default_host_RANLIB = $(RANLIB) -endif -ifeq ($(STRIP),) - default_host_STRIP = $(host_toolchain)strip - ifeq (, $(shell which $(default_host_STRIP))) - default_host_STRIP = strip + ifeq ($(RANLIB),) + default_host_RANLIB = $(host_toolchain)ranlib + ifeq (, $(shell which $(default_host_RANLIB))) + default_host_RANLIB = ranlib + endif + else + default_host_RANLIB = $(RANLIB) endif -else - default_host_STRIP = $(RANLIB) -endif -ifeq ($(LIBTOOL),) - default_host_LIBTOOL = $(host_toolchain)libtool - ifeq (, $(shell which $(default_host_LIBTOOL))) - default_host_LIBTOOL = libtool + ifeq ($(STRIP),) + default_host_STRIP = $(host_toolchain)strip + ifeq (, $(shell which $(default_host_STRIP))) + default_host_STRIP = strip + endif + else + default_host_STRIP = $(RANLIB) endif -else - default_host_LIBTOOL = $(LIBTOOL) -endif -ifeq ($(NM),) - default_host_NM = $(host_toolchain)nm - ifeq (, $(shell which $(default_host_NM))) - default_host_NM = nm + ifeq ($(LIBTOOL),) + default_host_LIBTOOL = $(host_toolchain)libtool + ifeq (, $(shell which $(default_host_LIBTOOL))) + default_host_LIBTOOL = libtool + endif + else + default_host_LIBTOOL = $(LIBTOOL) + endif + + ifeq ($(NM),) + default_host_NM = $(host_toolchain)nm + ifeq (, $(shell which $(default_host_NM))) + default_host_NM = nm + endif + else + default_host_NM = $(NM) endif -else - default_host_NM = $(NM) endif default_host_INSTALL_NAME_TOOL = $(host_toolchain)install_name_tool