mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Refactor the handling of static-related build flags
This is as discussed with @shykes on IRC
This commit is contained in:
parent
fb8d488896
commit
d789750851
3 changed files with 3 additions and 4 deletions
|
@ -45,7 +45,7 @@ if [ -n "$(git status --porcelain)" ]; then
|
|||
fi
|
||||
|
||||
# Use these flags when compiling the tests and final binary
|
||||
LDFLAGS='-X main.GITCOMMIT "'$GITCOMMIT'" -X main.VERSION "'$VERSION'" -w -linkmode external -extldflags "-lpthread -static -Wl,--unresolved-symbols=ignore-in-object-files"'
|
||||
LDFLAGS='-X main.GITCOMMIT "'$GITCOMMIT'" -X main.VERSION "'$VERSION'" -w'
|
||||
BUILDFLAGS='-tags netgo'
|
||||
|
||||
bundle() {
|
||||
|
|
|
@ -2,6 +2,5 @@
|
|||
|
||||
DEST=$1
|
||||
|
||||
go build -o $DEST/docker-$VERSION -ldflags "$LDFLAGS" $BUILDFLAGS ./docker
|
||||
|
||||
go build -o $DEST/docker-$VERSION -ldflags "$LDFLAGS -linkmode external -extldflags \"-lpthread -static -Wl,--unresolved-symbols=ignore-in-object-files\"" $BUILDFLAGS ./docker
|
||||
echo "Created binary: $DEST/docker-$VERSION"
|
||||
|
|
|
@ -17,7 +17,7 @@ bundle_test() {
|
|||
set -x
|
||||
cd $test_dir
|
||||
go test -i
|
||||
go test -v -ldflags "$LDFLAGS" $BUILDFLAGS $TESTFLAGS
|
||||
go test -v -ldflags "$LDFLAGS -linkmode external -extldflags \"-lpthread -static -Wl,--unresolved-symbols=ignore-in-object-files\"" $BUILDFLAGS $TESTFLAGS
|
||||
) done
|
||||
} 2>&1 | tee $DEST/test.log
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue