From 3e10b93106dea94e5747ab32fe4ac765aa22f9bc Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 1 Oct 2014 13:37:30 +1300 Subject: [PATCH] Use code generation to set IAMSTATIC instead of -X Signed-off-by: Michael Hudson-Doyle --- .gitignore | 1 + hack/make.sh | 3 ++- hack/make/binary | 11 +++++++++++ hack/make/dynbinary | 9 +++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2a86e41ca..6f6cfa168 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ docs/AWS_S3_BUCKET docs/GIT_BRANCH docs/VERSION docs/GITCOMMIT +dockerversion/static.go diff --git a/hack/make.sh b/hack/make.sh index d6da3057f..5d0ddd879 100755 --- a/hack/make.sh +++ b/hack/make.sh @@ -94,6 +94,8 @@ if [ -z "$DOCKER_CLIENTONLY" ]; then DOCKER_BUILDTAGS+=" daemon" fi +rm -f dockerversion/static.go + # Use these flags when compiling the tests and final binary LDFLAGS=' -w @@ -115,7 +117,6 @@ TESTFLAGS+=" -test.timeout=${TIMEOUT}" EXTLDFLAGS_STATIC_DOCKER="$EXTLDFLAGS_STATIC -lpthread -Wl,--unresolved-symbols=ignore-in-object-files" LDFLAGS_STATIC_DOCKER=" $LDFLAGS_STATIC - -X $DOCKER_PKG/dockerversion.IAMSTATIC true -extldflags \"$EXTLDFLAGS_STATIC_DOCKER\" " diff --git a/hack/make/binary b/hack/make/binary index b97069a85..2c71f201b 100755 --- a/hack/make/binary +++ b/hack/make/binary @@ -3,6 +3,17 @@ set -e DEST=$1 +: ${IAMSTATIC:=true} + +cat > dockerversion/static.go < dockerversion/static.go <