From 1b2bf53e825f2e79d10ba13bbcc7eeb5129d262d Mon Sep 17 00:00:00 2001 From: q66 Date: Mon, 11 Nov 2019 03:03:14 +0100 Subject: [PATCH] build-style/go: allow usage with gccgo compiler This checks if gcc-go-tools have been specified in host deps and if so, use gccgo to build (gcc-go-tools conflicts with go). Also, since gccgo is not a multi-compiler, we need to override GCCGO to get cross-builds. The gccgo for target is always installed, as it's a part of our cross-toolchains. [ci skip] --- common/environment/build-style/go.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/common/environment/build-style/go.sh b/common/environment/build-style/go.sh index ce0bdcc18b4..a0cf330d600 100644 --- a/common/environment/build-style/go.sh +++ b/common/environment/build-style/go.sh @@ -1,9 +1,18 @@ -if [ -z "$archs" ]; then - archs="aarch64* armv[567]* i686* x86_64* ppc64le*" +if [ "${hostmakedepends##*gcc-go-tools*}" ]; then + # gc compiler + if [ -z "$archs" ]; then + archs="aarch64* armv[567]* i686* x86_64* ppc64le*" + fi + hostmakedepends+=" go" + nopie=yes +else + # gccgo compiler + if [ "$CROSS_BUILD" ]; then + # target compiler to use; otherwise it'll just call gccgo + export GCCGO="${XBPS_CROSS_TRIPLET}-gccgo" + fi fi -hostmakedepends+=" go" nostrip=yes -nopie=yes case "$XBPS_TARGET_MACHINE" in aarch64*) export GOARCH=arm64;;