[OE-core] [PATCH 5/7] go.bbclass: Use a global Go build flags
Matt Madison
matt at madison.systems
Tue Sep 5 10:39:09 UTC 2017
On Mon, Sep 4, 2017 at 2:06 PM, Otavio Salvador <otavio at ossystems.com.br> wrote:
> We now use a GOBUILDFLAGS to provide a global variable to control the
> build flags to be given to Go.
>
> This change is based on the meta-golang[1] layer. Thanks to Matt
> Madison <matt at madison.systems> for his work on this.
>
> 1. https://github.com/madisongh/meta-golang
>
> Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
> ---
>
> meta/classes/go.bbclass | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
> index e073cb91b5..45f2add810 100644
> --- a/meta/classes/go.bbclass
> +++ b/meta/classes/go.bbclass
> @@ -5,6 +5,8 @@ GOROOT = "${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
> GOBIN_FINAL_class-native = "${GOROOT_FINAL}/bin"
> GOBIN_FINAL = "${GOROOT_FINAL}/${GO_BUILD_BINDIR}"
>
> +export GOBUILDFLAGS ?= "-x -v ${GO_EXTLDFLAGS}"
You might want to omit the '-x' flag here as a default. It's useful
when debugging problems with the toolchain, but can make it harder to
find error messages emitted by the compiler.
And I don't think GO_EXTLDFLAGS is being set anywhere (yet)?
Thanks,
-Matt
> +
> export GOOS = "${TARGET_GOOS}"
> export GOARCH = "${TARGET_GOARCH}"
> export GOARM = "${TARGET_GOARM}"
> @@ -32,7 +34,7 @@ GO_INSTALL ?= "${GO_IMPORT}/..."
> do_go_compile() {
> GOPATH=${S}:${STAGING_LIBDIR}/${TARGET_SYS}/go go env
> if [ -n "${GO_INSTALL}" ]; then
> - GOPATH=${S}:${STAGING_LIBDIR}/${TARGET_SYS}/go go install -v ${GO_INSTALL}
> + GOPATH=${S}:${STAGING_LIBDIR}/${TARGET_SYS}/go go install ${GOBUILDFLAGS} ${GO_INSTALL}
> fi
> }
>
> --
> 2.14.1
>
More information about the Openembedded-core
mailing list