From f33a12b9d5f579f2a484d55e18f5f89861844a1f Mon Sep 17 00:00:00 2001 From: janeczku Date: Fri, 10 Mar 2017 20:36:08 +0100 Subject: [PATCH] Build static binary with Go internal linker Static linking with gcc may cause segfaults at runtime on some systems (see https://github.com/golang/go/issues/13470) --- scripts/build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/build b/scripts/build index d5a1e64..b3f83c5 100755 --- a/scripts/build +++ b/scripts/build @@ -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" -o bin/external-dns