Permalink
Please sign in to comment.
Browse files
Enable gccgo build support. The build needs to be run as
for dynamic binary - ./project/make.sh dyngccgo for static binary - ./project/make.sh gccgo
- Loading branch information...
Showing
with
79 additions
and 1 deletion.
- +29 −0 project/make/.dockerinit-gccgo
- +1 −1 project/make/.integration-daemon-start
- +23 −0 project/make/dyngccgo
- +26 −0 project/make/gccgo
| @@ -0,0 +1,29 @@ | ||
| +#!/bin/bash | ||
| +set -e | ||
| + | ||
| +IAMSTATIC="true" | ||
| +source "$(dirname "$BASH_SOURCE")/.go-autogen" | ||
| + | ||
| +go build --compiler=gccgo \ | ||
| + -o "$DEST/dockerinit-$VERSION" \ | ||
| + "${BUILDFLAGS[@]}" \ | ||
| + --gccgoflags " | ||
| + -g | ||
| + -Wl,--no-export-dynamic | ||
| + $EXTLDFLAGS_STATIC_DOCKER | ||
| + " \ | ||
| + ./dockerinit | ||
| + | ||
| +echo "Created binary: $DEST/dockerinit-$VERSION" | ||
| +ln -sf "dockerinit-$VERSION" "$DEST/dockerinit" | ||
| + | ||
| +sha1sum= | ||
| +if command -v sha1sum &> /dev/null; then | ||
| + sha1sum=sha1sum | ||
| +else | ||
| + echo >&2 'error: cannot find sha1sum command or equivalent' | ||
| + exit 1 | ||
| +fi | ||
| + | ||
| +# sha1 our new dockerinit to ensure separate docker and dockerinit always run in a perfect pair compiled for one another | ||
| +export DOCKER_INITSHA1="$($sha1sum $DEST/dockerinit-$VERSION | cut -d' ' -f1)" |
| @@ -0,0 +1,23 @@ | ||
| +#!/bin/bash | ||
| +set -e | ||
| + | ||
| +DEST=$1 | ||
| + | ||
| +if [ -z "$DOCKER_CLIENTONLY" ]; then | ||
| + source "$(dirname "$BASH_SOURCE")/.dockerinit-gccgo" | ||
| + | ||
| + hash_files "$DEST/dockerinit-$VERSION" | ||
| +else | ||
| + # DOCKER_CLIENTONLY must be truthy, so we don't need to bother with dockerinit :) | ||
| + export DOCKER_INITSHA1="" | ||
| +fi | ||
| +# DOCKER_INITSHA1 is exported so that other bundlescripts can easily access it later without recalculating it | ||
| + | ||
| +( | ||
| + export IAMSTATIC="false" | ||
| + export EXTLDFLAGS_STATIC_DOCKER='' | ||
| + export LDFLAGS_STATIC_DOCKER='' | ||
| + export BUILDFLAGS=( "${BUILDFLAGS[@]/netgo /}" ) # disable netgo, since we don't need it for a dynamic binary | ||
| + export BUILDFLAGS=( "${BUILDFLAGS[@]/static_build /}" ) # we're not building a "static" binary here | ||
| + source "$(dirname "$BASH_SOURCE")/gccgo" | ||
| +) |
| @@ -0,0 +1,26 @@ | ||
| +#!/bin/bash | ||
| +set -e | ||
| + | ||
| +DEST=$1 | ||
| +BINARY_NAME="docker-$VERSION" | ||
| +BINARY_EXTENSION="$(binary_extension)" | ||
| +BINARY_FULLNAME="$BINARY_NAME$BINARY_EXTENSION" | ||
| + | ||
| +source "$(dirname "$BASH_SOURCE")/.go-autogen" | ||
| + | ||
| +go build --compiler=gccgo \ | ||
| + -o "$DEST/$BINARY_FULLNAME" \ | ||
| + "${BUILDFLAGS[@]}" \ | ||
| + --gccgoflags " | ||
| + -g | ||
| + $EXTLDFLAGS_STATIC_DOCKER | ||
| + -Wl,--no-export-dynamic | ||
| + -ldl | ||
| + " \ | ||
| + ./docker | ||
| + | ||
| + | ||
| +echo "Created binary: $DEST/$BINARY_FULLNAME" | ||
| +ln -sf "$BINARY_FULLNAME" "$DEST/docker$BINARY_EXTENSION" | ||
| + | ||
| +hash_files "$DEST/$BINARY_FULLNAME" |
0 comments on commit
b34e0cd