Skip to content

Link error building Rust on Linux #10778

Closed
@kmcallister

Description

@kmcallister

I get this error building Rust 61443dc (master as of Dec 1) on Debian:

$ rm -fr x86_64-unknown-linux-gnu/
$ ./configure
…
$ make -j10
…
cp: x86_64-unknown-linux-gnu/stage2/lib/librustc.so
compile_and_link: x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/librustpkg.so
compile_and_link: x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/librustdoc.so
error: linking with `cc` failed: exit code: 1
note: cc arguments: '-m64' '-L/home/keegan/proj/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib' '-o' 'x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/bin/rustc' 'x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/bin/rustc.o' '-Wl,--as-needed' '-Wl,-O1' '-L/home/keegan/proj/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib' '-lstd-6425b930ca146ae9-0.9-pre' '-L/home/keegan/proj/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib' '-lrustuv-a13edc95d75df17-0.9-pre' '-L/home/keegan/proj/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib' '-lextra-aaa96aab146eb38e-0.9-pre' '-L/home/keegan/proj/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib' '-lsyntax-2bb2d559d93ae8f0-0.9-pre' '-L/home/keegan/proj/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib' '-lrustc-8581899a03b03e-0.9-pre' '-Lx86_64-unknown-linux-gnu/rt/libuv' '-Lx86_64-unknown-linux-gnu/rt/uv_support' '-L/home/keegan/proj/rust/rust/.rust' '-L/home/keegan/proj/rust/rust' '-lmorestack' '-Wl,-rpath,$ORIGIN/../lib' '-Wl,-rpath,/home/keegan/proj/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib' '-Wl,-rpath,/usr/local/lib/rustc/x86_64-unknown-linux-gnu/lib'
note: /home/keegan/proj/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/libextra-aaa96aab146eb38e-0.9-pre.so: error: undefined reference to 'ceil'
/home/keegan/proj/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/libextra-aaa96aab146eb38e-0.9-pre.so: error: undefined reference to 'log10'
/home/keegan/proj/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/libextra-aaa96aab146eb38e-0.9-pre.so: error: undefined reference to 'pow'
/home/keegan/proj/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/libextra-aaa96aab146eb38e-0.9-pre.so: error: undefined reference to 'floor'
/home/keegan/proj/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/libextra-aaa96aab146eb38e-0.9-pre.so: error: undefined reference to 'fmod'
/home/keegan/proj/rust/rust/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/libextra-aaa96aab146eb38e-0.9-pre.so: error: undefined reference to 'trunc'
collect2: error: ld returned 1 exit status

error: aborting due to previous error
task 'rustc' failed at 'explicit failure', /home/keegan/proj/rust/rust/src/libsyntax/diagnostic.rs:102
task '<main>' failed at 'explicit failure', /home/keegan/proj/rust/rust/src/librustc/lib.rs:396
make: *** [x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/bin/rustc] Error 101
make: *** Waiting for unfinished jobs....

I get the same message if I run make again. But the error might be nondeterministic; on the previous clean build the missing symbol was dlerror.

I see that neither -lm nor -ldl is present in the command line above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions