Enable "netgo" library when we build a static binary with gccgo

Signed-off-by: Tatsushi Inagaki <e29253@jp.ibm.com>
Upstream-commit: bcd5e20a094e63093a95840f4f3342d981752708
Component: engine
This commit is contained in:
Tatsushi Inagaki
2015-04-08 04:41:03 -04:00
parent fc9842cd3d
commit 2cc2a96cc1
2 changed files with 4 additions and 0 deletions

View File

@ -12,6 +12,7 @@ go build --compiler=gccgo \
-g
-Wl,--no-export-dynamic
$EXTLDFLAGS_STATIC_DOCKER
-lnetgo
" \
./dockerinit

View File

@ -8,6 +8,9 @@ BINARY_FULLNAME="$BINARY_NAME$BINARY_EXTENSION"
source "$(dirname "$BASH_SOURCE")/.go-autogen"
if [[ "${BUILDFLAGS[@]}" =~ 'netgo ' ]]; then
EXTLDFLAGS_STATIC_DOCKER+=' -lnetgo'
fi
go build -compiler=gccgo \
-o "$DEST/$BINARY_FULLNAME" \
"${BUILDFLAGS[@]}" \