Skip to content

Commit

Permalink
Build static binary with Go internal linker
Browse files Browse the repository at this point in the history
Static linking with gcc may cause segfaults at runtime on some systems
(see golang/go#13470)
  • Loading branch information
janeczku committed Mar 11, 2017
1 parent 4264044 commit d6c2e1c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ source $(dirname $0)/version
cd $(dirname $0)/..

mkdir -p bin
[ "$(uname)" != "Darwin" ] && LINKFLAGS="-linkmode external -extldflags -static -s"
go build -ldflags "-X main.Version=$VERSION $LINKFLAGS" -o bin/external-dns
CGO_ENABLED=0 go build -ldflags "-X main.Version=$VERSION -s" -o bin/external-dns

0 comments on commit d6c2e1c

Please sign in to comment.