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

collect2: fatal error: cannot find 'ld' #26

Closed
richardweinberger opened this issue May 3, 2018 · 4 comments
Closed

collect2: fatal error: cannot find 'ld' #26

richardweinberger opened this issue May 3, 2018 · 4 comments

Comments

@richardweinberger
Copy link

richardweinberger commented May 3, 2018

On Linux the build fails:

$ bazel build --verbose_failures runsc
INFO: Analysed target //runsc:runsc (0 packages loaded).
INFO: Found 1 target...
ERROR: /home/rw/homerw_old/work/gvisor/vdso/BUILD:8:1: Executing genrule //vdso:vdso failed (Exit 1): bash failed: error executing command
(cd /home/rw/.cache/bazel/_bazel_rw/5842f54b5499609ce9d6a4a0b7803cf7/execroot/main &&
exec env -
PATH=/opt/make/bin/:/opt/make/bin/:/home/rw/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/usr/lib/mit/bin:/usr/lib/mit/sbin
/bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; /usr/bin/gcc -I. -O2 -std=c++11 -fPIC -fuse-ld=gold -m64 -shared -nostdlib -Wl,-soname=linux-vdso.so.1 -Wl,--hash-style=sysv -Wl,--no-undefined -Wl,-Bsymbolic -Wl,-z,max-page-size=4096 -Wl,-z,common-page-size=4096 -Wl,-Tvdso/vdso.lds -o bazel-out/k8-fastbuild/genfiles/vdso/vdso.so vdso/vdso.cc vdso/vdso_time.cc && bazel-out/host/bin/vdso/check_vdso --check-data --vdso bazel-out/k8-fastbuild/genfiles/vdso/vdso.so ')

Use --sandbox_debug to see verbose messages from the sandbox
collect2: fatal error: cannot find 'ld'
compilation terminated.
Target //runsc:runsc failed to build
INFO: Elapsed time: 0.622s, Critical Path: 0.41s
FAILED: Build did NOT complete successfully


@hugelgupf
Copy link
Collaborator

What distro are you on?

You may have to install the gold linker, e.g.

apt-get install binutils-gold

on Ubuntu.

@richardweinberger
Copy link
Author

Installing gold did the trick, thanks!
I'm on OpenSUSE Leap.

shentubot pushed a commit that referenced this issue May 3, 2018
Updates #26.

PiperOrigin-RevId: 195303940
chanwit pushed a commit to chanwit/gvisor that referenced this issue May 8, 2018
Updates google#26.

PiperOrigin-RevId: 195303940
Change-Id: I833cee55b5df6196ed90c1f8987c3c9c07204678
tonistiigi pushed a commit to tonistiigi/gvisor that referenced this issue Jan 29, 2019
Updates google#26.

PiperOrigin-RevId: 195303940
Change-Id: I833cee55b5df6196ed90c1f8987c3c9c07204678
Upstream-commit: 18ebda3
tonistiigi pushed a commit to tonistiigi/gvisor that referenced this issue Jan 30, 2019
Updates google#26.

PiperOrigin-RevId: 195303940
Change-Id: I833cee55b5df6196ed90c1f8987c3c9c07204678
Upstream-commit: 18ebda3
@baibai841
Copy link

do you solute this question? I also meet it

@milantracy
Copy link
Contributor

@baibai841 you may want to try #26 (comment) to install gold linker.

let me know if that works for you. Otherwise, can you create a new issue to let us know how to reproduce it?

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

4 participants