Skip to content
Permalink
Browse files

Go: adding main configure CFLAGS and LDFLAGS to module build flags.

This makes ASAN buildbot workers to work out-of-the-box.
  • Loading branch information
mar0x committed Jan 28, 2020
1 parent 4eb2d30 commit 4024b18bcc070240a5d1d79ff255b8209dd6908d
Showing with 10 additions and 1 deletion.
  1. +10 −1 auto/modules/go
@@ -85,6 +85,14 @@ if grep ^$NXT_GO: $NXT_MAKEFILE 2>&1 > /dev/null; then
exit 1;
fi

NXT_GO_LDFLAGS=

for o in ${CFLAGS} ${NXT_CC_OPT}; do
case "$o" in
-fsanitize* | -L* | -l*) NXT_GO_LDFLAGS="${NXT_GO_LDFLAGS} $o" ;;
esac
done

cat << END >> $NXT_MAKEFILE

.PHONY: ${NXT_GO}
@@ -116,8 +124,9 @@ ${NXT_GO}-install-env: \$(DESTDIR)\$(NXT_GO_DST)/src/${NXT_GO_PKG}/env.go \
install -d \$(DESTDIR)\$(NXT_GO_DST)/src/${NXT_GO_PKG}
$echo "package unit" > \$@
$echo "/*" >> \$@
$echo "#cgo CFLAGS: ${CFLAGS} ${NXT_CC_OPT}" >> \$@
$echo "#cgo CPPFLAGS: -I${PWD}/src -I${PWD}/${NXT_BUILD_DIR}" >> \$@
$echo "#cgo LDFLAGS: -L${PWD}/${NXT_BUILD_DIR}" >> \$@
$echo "#cgo LDFLAGS: -L${PWD}/${NXT_BUILD_DIR} ${NXT_GO_LDFLAGS} ${NXT_LD_OPT}" >> \$@
$echo "*/" >> \$@
$echo 'import "C"' >> \$@

0 comments on commit 4024b18

Please sign in to comment.
You can’t perform that action at this time.