Merge pull request #2507 from XiaodongLoong/master

-buildmode=pie is not supported for the mips arch
This commit is contained in:
Silvin Lubecki 2020-05-13 11:59:53 +02:00 committed by GitHub
commit 5bf109154f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -9,6 +9,16 @@ source ./scripts/build/.variables
echo "Building dynamically linked $TARGET"
export CGO_ENABLED=1
go build -o "${TARGET}" -tags pkcs11 --ldflags "${LDFLAGS}" -buildmode=pie "${SOURCE}"
case "$(go env GOARCH)" in
mips*|ppc64)
# pie build mode is not supported on mips architectures
GO_BUILDMODE=""
;;
*)
GO_BUILDMODE="-buildmode=pie"
;;
esac
go build -o "${TARGET}" -tags pkcs11 --ldflags "${LDFLAGS}" ${GO_BUILDMODE} "${SOURCE}"
ln -sf "$(basename "${TARGET}")" build/docker