Skip to content

Linking fails with GNU gold #10630

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

Closed
luqmana opened this issue Nov 24, 2013 · 2 comments
Closed

Linking fails with GNU gold #10630

luqmana opened this issue Nov 24, 2013 · 2 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries

Comments

@luqmana
Copy link
Member

luqmana commented Nov 24, 2013

I'm encountering this failure at link time now that #10620 has landed.

error: linking with `cc` failed: exit code: 1
note: cc arguments: -L/scratch/laden/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib -m64 -o x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-6425b930ca146ae9-0.9-pre.so x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/std.o -lrustrt -lrt -lpthread -L/scratch/laden/rust/build/.rust -L/scratch/laden/rust/build -Wl,--as-needed -shared -Wl,-O -lrt -ldl -lm -lmorestack -lrustrt -Wl,-rpath,$ORIGIN/. -Wl,-rpath,/scratch/laden/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib -Wl,-rpath,/scratch/laden/local/lib/rustc/x86_64-unknown-linux-gnu/lib
note: /usr/bin/ld.gold.real: fatal error: -O: invalid option value (expected an integer): -lrt
collect2: error: ld returned 1 exit status

error: aborting due to previous error
task 'rustc' failed at 'explicit failure', /scratch/laden/rust/src/libsyntax/diagnostic.rs:102
task '<main>' failed at 'explicit failure', /scratch/laden/rust/src/librustc/lib.rs:396
make: *** [x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd.so] Error 101

This happens for me when ld is symlinked to gold (GNU gold (GNU Binutils for Debian 2.22) 1.11).

@thestinger
Copy link
Contributor

We should be passing -O1 instead of -O.

@emberian
Copy link
Member

Closed by #10633

flip1995 pushed a commit to flip1995/rust that referenced this issue Apr 11, 2023
Fix links in Clippy book

Links to README.md files must actually be links to index.md files,
because of the inner workings of `mdbook`.

Also use the latest mdbook version in CI.

---

Blocks rust-lang#110003 (comment)

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries
Projects
None yet
Development

No branches or pull requests

3 participants