Revert "Use code generation to set IAMSTATIC instead of -X"

This reverts commit 3e10b93106dea94e5747ab32fe4ac765aa22f9bc.

Conflicts:
	.gitignore
	hack/make.sh
	hack/make/dynbinary

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 17e0a15386c2a2ff01417d66e37683bd9a2a79c8
Component: engine
This commit is contained in:
Jessica Frazelle
2014-10-28 16:25:50 -07:00
parent 862c4beedc
commit 7c82a1653d
4 changed files with 2 additions and 44 deletions

View File

@ -5,14 +5,6 @@ DEST=$1
if [ -z "$DOCKER_CLIENTONLY" ]; then
# dockerinit still needs to be a static binary, even if docker is dynamic
cat > dockerversion/static.go <<EOF
// AUTOGENERATED FILE; see hack/make/binary and hack/make/dynbinary
package dockerversion
func init() {
IAMSTATIC = true
}
EOF
go build \
-o "$DEST/dockerinit-$VERSION" \
"${BUILDFLAGS[@]}" \
@ -47,17 +39,7 @@ fi
# exported so that "dyntest" can easily access it later without recalculating it
(
export LDFLAGS_STATIC_DOCKER=""
cat > dockerversion/init.go <<EOF
// AUTOGENERATED FILE; see hack/make/dynbinary, hack/make/dyntest-integration and dyntest-unit
package dockerversion
func init() {
INITSHA1 = "$DOCKER_INITSHA1"
INITPATH = "$DOCKER_INITPATH"
}
EOF
export IAMSTATIC=false
export LDFLAGS_STATIC_DOCKER="-X $DOCKER_PKG/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\" -X $DOCKER_PKG/dockerversion.INITPATH \"$DOCKER_INITPATH\""
export BUILDFLAGS=( "${BUILDFLAGS[@]/netgo /}" ) # disable netgo, since we don't need it for a dynamic binary
source "$(dirname "$BASH_SOURCE")/binary"
)