[meta-virtualization] Help: consul do_compile failed after go upgrade to v1.12.

Mark Asselstine mark.asselstine at windriver.com
Mon Mar 25 11:10:09 PDT 2019


On Mon, Mar 18, 2019 at 11:38 PM Bruce Ashfield
<bruce.ashfield at gmail.com> wrote:
>
> On Mon, Mar 18, 2019 at 11:16 PM Hongzhi, Song
> <hongzhi.song at windriver.com> wrote:
> >
> > Hi Bruce,
> >
> > There is a failure on do_compile of consul under meta-cloud-services.
> >
> > This is introduced by go-1.12 which was upgraded several days ago.
> >
>
> Yep. I had also noticed this and reported it on the #overc freenode channel.
> My hands are full with a few other issues, but I'm hoping to have a closer
> look at it by the end of the week.
>
> But if anyone else has a patch, I wouldn't object to it :D

The issue is we are often overwriting GOROOT when we should not be.
Actually the go.bbclass is doing this when it should not be. This is
covered in detail here:
https://dave.cheney.net/2013/06/14/you-dont-need-to-set-goroot-really

As describe GOROOT is already properly set in our cross compiled go
tool and should not be overwritten. We can see this patch by doing the
equivalent of 'go env GOROOT' in a devshell (replacing go with the
full cross go toolname).

By overwriting GOROOT we are getting a mixmatch of std pkgs as well I
am not quite sure what tools are used as the GOROOT is used to define
two other paths:
$GOROOT/pkg/tool/$GOOS_$GOARCH and $GOROOT/pkg/$GOOS_$GOARCH
and $GOROOT/pkg/tool/$GOOS_$GOARCH simply doesn't exist.

I still need to do some investigation around this but I am able to
reproduce the issue and I am able to resolve the issue by not setting
GOROOT. Once I am satisfied with my findings I will send something
out, at this point it looks like a patch to oe-core's go.bbclass.

MarkA

>
> Bruce
>
> >
> > But it can't be reproduced on my ubuntu-host, while only be reproduced on Yocto.
> >
> > I try my best to fix it but has no result.
> >
> > So, I will be great appreciate for anyone's help.
> >
> >
> > Thanks,
> >
> > Hongzhi
> >
> >
> > There are some info about the failure:
> >
> >
> > Error info:
> >
> > [
> >
> > # github.com/hashicorp/consul/connect/certgen
> > type..eUfRrckI: missing section for relocation target type..FEeY9FdU
> > type..eUfRrckI: reloc 8 (R_CALL) to non-elf symbol type..FEeY9FdU (outer=type..FEeY9FdU) 49 (SABIALIAS)
> > # github.com/hashicorp/consul
> > type..eUfRrckI: missing section for relocation target type..FEeY9FdU
> > type..K6Uq9NPs: missing section for relocation target type..tBBUxeDj
> >
> > ]
> >
> > The above info come from go/src/cmd/link/internal/ld/data.go
> >
> >
> > Commit ID from go upstream:
> >
> > 685aca45dc8435df7b7e8059a42a8a98efdaf22c
> >
> > cmd/compile, cmd/link: separate stable and internal ABIs
> >
> >
> > Script: consul: run.do_compile
> >
> > The following command failed with -linkshared. It will pass if remove -linkshared.
> >
> > x86_64-poky-linux-go install -linkshared -p 128 -v -ldflags="-r /usr/lib/go/pkg/linux_amd64_dynlink  -extldflags ' -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/ala-lpggp22/hsong/poky/build/tmp/work/core2-64-poky-linux/consul/git-r0/recipe-sysroot -Wl,-rpath-link=/ala-lpggp22/hsong/poky/build/tmp/work/core2-64-poky-linux/consul/git-r0/recipe-sysroot/usr/lib/go/pkg/linux_amd64_dynlink -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now'" -buildmode=pie `go_list_packages`
> >
> >
> > [EOF]
> >
> >
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II
> --
> _______________________________________________
> meta-virtualization mailing list
> meta-virtualization at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-virtualization


More information about the meta-virtualization mailing list