diff --git a/hack/make.sh b/hack/make.sh index 4db4349518..c78671ae7c 100755 --- a/hack/make.sh +++ b/hack/make.sh @@ -107,6 +107,16 @@ LDFLAGS_STATIC_DOCKER=" -extldflags \"$EXTLDFLAGS_STATIC_DOCKER\" " +if [ "$(uname -s)" = 'FreeBSD' ]; then + # Tell cgo the compiler is Clang, not GCC + # https://code.google.com/p/go/source/browse/src/cmd/cgo/gcc.go?spec=svne77e74371f2340ee08622ce602e9f7b15f29d8d3&r=e6794866ebeba2bf8818b9261b54e2eef1c9e588#752 + export CC=clang + + # "-extld clang" is a workaround for + # https://code.google.com/p/go/issues/detail?id=6845 + LDFLAGS="$LDFLAGS -extld clang" +fi + HAVE_GO_TEST_COVER= if \ go help testflag | grep -- -cover > /dev/null \