Skip to content

Commit

Permalink
BUILD: Work around an issue with gitian builds
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mjmacleod committed Mar 20, 2020
1 parent 746829d commit f14840d
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 45 deletions.
2 changes: 1 addition & 1 deletion contrib/gitian-descriptors/gitian-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion contrib/gitian-descriptors/gitian-osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion contrib/gitian-descriptors/gitian-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
96 changes: 54 additions & 42 deletions depends/hosts/default.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f14840d

Please sign in to comment.