Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile Error: missing section for relocation target type..FEeY9FdU #5486

Closed
csqshz opened this issue Mar 14, 2019 · 2 comments
Closed

Compile Error: missing section for relocation target type..FEeY9FdU #5486

csqshz opened this issue Mar 14, 2019 · 2 comments

Comments

@csqshz
Copy link

csqshz commented Mar 14, 2019

Consu version

v1.4.3 and v0.7, I didn't try other releases.

Golang version

==go-1.12==. It is ok with other releases, but failed with go-1.12.

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

How to reproduce

Build consul by Yocto Project.

  1. ~$: git clone git://git.yoctoproject.org/poky
  2. ~$: cd poky/
  3. ~/poky: git clone git://git.yoctoproject.org/meta-cloud-services
    ~/poky: git clone git://git.yoctoproject.org/meta-virtualization
    ~/poky: git clone git://git.openembedded.org/meta-openembedded
  4. ~/poky: source ../oe-init-build-env
  5. ~/poky/build: vi conf/bblayers.conf
    Add six paths to BBLAYERS:
    BBLAYERS ?= " \
    /ala-lpggp22/hsong/poky-qcon/meta
    /ala-lpggp22/hsong/poky-qcon/meta-poky
    /ala-lpggp22/hsong/poky-qcon/meta-yocto-bsp
    /ala-lpggp22/hsong/poky-qcon/meta-virtualization
    /ala-lpggp22/hsong/poky-qcon/meta-cloud-services
    /ala-lpggp22/hsong/poky-qcon/meta-openembedded/meta-python
    /ala-lpggp22/hsong/poky-qcon/meta-openembedded/meta-networking
    /ala-lpggp22/hsong/poky-qcon/meta-openembedded/meta-filesystems
    /ala-lpggp22/hsong/poky-qcon/meta-openembedded/meta-oe
    "
  6. bitbake consul
    This command will build consul and its dependencies.
    Then the issue will prompt when doing do_compile of consul.

Extract main compile command from prject script:

121 go_do_compile() {
122     export TMPDIR="/ala-lpggp22/hsong/poky/build/tmp/work/core2-64-poky-linux/consul/git-r0/go-tmp"
123     if [ -n "github.com/hashicorp/consul/..." ]; then
124         if [ -n "-linkshared" ]; then
125             echo "------"
126             x86_64-poky-linux-go install -p 128 -v -ldflags="-r /usr/lib/go/pkg/linux_amd64_dynlink  -extldflags ' -m64 -march=core2 -mtu    ne=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 -fs    tack-protector-strong -Wl,-z,relro,-z,now'" -buildmode=pie `go_list_packages`
127             rm -rf /ala-lpggp22/hsong/poky/build/tmp/work/core2-64-poky-linux/consul/git-r0/build/bin
128         fi
129         echo "======="
130         x86_64-poky-linux-go install -linkshared -p 128 -v -ldflags="-r /usr/lib/go/pkg/linux_amd64_dynlink  -extldflags ' -m64 -march=co    re2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --s    ysroot=/ala-lpggp22/hsong/poky/build/tmp/work/core2-64-poky-linux/consul/git-r0/recipe-sysroot -Wl,-rpath-link=/ala-lpggp22/hsong/poky/bu    ild/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-ne    eded -fstack-protector-strong -Wl,-z,relro,-z,now'" -buildmode=pie `go_list_packages`
131     fi
132 }

Analysis

It failed at above code line:130 with -linkshared argument.
It will pass if delete -linkshared.

The error info come from:

golang/src/cmd/link/internal/ld/data.go: func relocsym(ctxt *Link, s *sym.Symbol)

I suspect it is relatd to my environment.


I have no enough knowledge about relocation. So anyone can give me some direction on how to trace or fix the issue?

Thanks.

@csqshz
Copy link
Author

csqshz commented Mar 18, 2019

I found the following commit introduced the issue.
Golang: 685aca45dc8435df7b7e8059a42a8a98efdaf22c
https://github.com/golang/go/commit/685aca45dc8435df7b7e8059a42a8a98efdaf22c

@pearkes
Copy link
Contributor

pearkes commented Apr 3, 2019

I think this is out of scope for us @csqshz. We'll continue to build for all platforms possible with Golang minus a few that are incompatible with various libraries we use, but can't go beyond that.

Consul does build with 1.12.1 today, if that helps.

@pearkes pearkes closed this as completed Apr 3, 2019
jpuhlman pushed a commit to MontaVista-OpenSourceTechnology/meta-cloud-services that referenced this issue Apr 9, 2019
Source: meta-cloud-services
MR: 00000
Type: Integration
Disposition: Merged from meta-cloud-services
ChangeID: 394aee1
Description:

We are currently seeing the following error:
type..eUfRrckI: missing section for relocation target type..FEeY9FdU
...

This is similar to the reported issues
http://www.lyddzz.com/github_/golang/go/issues/30768
and
hashicorp/consul#5486 (but this one appears
to be a report of 'our' issue so isn't really valid)

The go.bbclass currently completes 2 builds (if GO_DYNLINK is set),
one without '-linkshared' and one with. The '--linkshared' option is
marked as experimental (https://golang.org/cmd/link/ -- "-linkshared
Link against installed Go shared libraries (experimental)").

By setting GO_LINKSHARED prior to inheriting go.bbclass we can
overwrite the default compile behavior and only perform the build
without the '-linkshared' option. This shouldn't change the
functionality of consul and we can revert to the default behavior when
the issues have been addressed.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants