Skip to content

Linking fails with GNU gold #10630

Closed
Closed
@luqmana

Description

@luqmana

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binaries

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions