github.com/pwn-term/docker@v0.0.0-20210616085119-6e977cce2565/cli/scripts/build/dynbinary (about) 1 #!/usr/bin/env bash 2 # 3 # Build a dynamically linked binary for the host OS/ARCH 4 # 5 6 set -eu -o pipefail 7 8 source ./scripts/build/.variables 9 10 echo "Building dynamically linked $TARGET" 11 export CGO_ENABLED=1 12 case "$(go env GOARCH)" in 13 mips*|ppc64) 14 # pie build mode is not supported on mips architectures 15 GO_BUILDMODE="" 16 ;; 17 *) 18 GO_BUILDMODE="-buildmode=pie" 19 ;; 20 esac 21 22 go build -o "${TARGET}" -tags pkcs11 --ldflags "${LDFLAGS}" ${GO_BUILDMODE} "${SOURCE}" 23 24 ln -sf "$(basename "${TARGET}")" build/docker