github.com/sijibomii/docker@v0.0.0-20231230191044-5cf6ca554647/hack/make/gccgo (about) 1 #!/bin/bash 2 set -e 3 4 BINARY_NAME="docker-$VERSION" 5 BINARY_EXTENSION="$(binary_extension)" 6 BINARY_FULLNAME="$BINARY_NAME$BINARY_EXTENSION" 7 8 source "${MAKEDIR}/.go-autogen" 9 10 if [[ "${BUILDFLAGS[@]}" =~ 'netgo ' ]]; then 11 EXTLDFLAGS_STATIC+=' -lnetgo' 12 fi 13 # gccgo require explicit flag -pthread to allow goroutines to work. 14 go build -compiler=gccgo \ 15 -o "$DEST/$BINARY_FULLNAME" \ 16 "${BUILDFLAGS[@]}" \ 17 -gccgoflags " 18 -g 19 $EXTLDFLAGS_STATIC 20 -Wl,--no-export-dynamic 21 -ldl 22 -pthread 23 " \ 24 ./docker 25 26 echo "Created binary: $DEST/$BINARY_FULLNAME" 27 ln -sf "$BINARY_FULLNAME" "$DEST/docker$BINARY_EXTENSION" 28 29 copy_containerd "$DEST" "hash" 30 hash_files "$DEST/$BINARY_FULLNAME"