Skip to content

build failed with libstd-71b07a99.so: undefined symbol: clock_gettime #29956

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
alsam opened this issue Nov 20, 2015 · 3 comments
Closed

build failed with libstd-71b07a99.so: undefined symbol: clock_gettime #29956

alsam opened this issue Nov 20, 2015 · 3 comments

Comments

@alsam
Copy link

alsam commented Nov 20, 2015

Hello All,
Used to build the nightly smoothly, but today it failed with the messages:

tail make.LOG2
cp x86_64-unknown-linux-gnu/rt/libcompiler-rt.a x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler-rt.a
MATCHES=""; if [ -n "$MATCHES" ] ; then echo "warning: removing previous" \'libcore-*.so\' "libraries:" $MATCHES; rm $MATCHES ; fi
MATCHES=""; if [ -n "$MATCHES" ] ; then echo "warning: removing previous" \'libcore-*.rlib\' "libraries:" $MATCHES; rm $MATCHES ; fi
CFG_LLVM_LINKAGE_FILE=/home/asamoilo/work/github/rust/x86_64-unknown-linux-gnu/rt/llvmdeps.rs LD_LIBRARY_PATH=/home/asamoilo/work/github/rust/x86_64-unknown-linux-gnu/stage1/lib:$LD_LIBRARY_PATH   x86_64-unknown-linux-gnu/stage1/bin/rustc --cfg stage1  -O --cfg rtopt -C prefer-dynamic --target=x86_64-unknown-linux-gnu  -D warnings -L "x86_64-unknown-linux-gnu/rt" -L native="/home/asamoilo/work/github/rust/x86_64-unknown-linux-gnu/llvm/Release/lib"      --out-dir x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib -C extra-filename=-71b07a99 src/libcore/lib.rs
info: now are following matches for libcore-*.so libraries:
info: now are following matches for libcore-*.rlib libraries:
x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-71b07a99.rlib
LD_LIBRARY_PATH=/home/asamoilo/work/github/rust/x86_64-unknown-linux-gnu/stage1/lib:$LD_LIBRARY_PATH   x86_64-unknown-linux-gnu/stage1/bin/rustc --cfg stage1  -O --cfg rtopt -C prefer-dynamic --target=x86_64-unknown-linux-gnu  --emit=obj -o x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/rsbegin.o /home/asamoilo/work/github/rust/src/rtstartup/rsbegin.rs
x86_64-unknown-linux-gnu/stage1/bin/rustc: symbol lookup error: /home/asamoilo/work/github/rust/x86_64-unknown-linux-gnu/stage1/lib/libstd-71b07a99.so: undefined symbol: clock_gettime
make: *** [x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/rsbegin.o] Error 127

running it manually:

D_LIBRARY_PATH=/home/asamoilo/work/github/rust/x86_64-unknown-linux-gnu/stage1/lib:$LD_LIBRARY_PATH   x86_64-unknown-linux-gnu/stage1/bin/rustc --cfg stage1  -O --cfg rtopt -C prefer-dynamic --target=x86_64-unknown-linux-gnu  --emit=obj -o x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/rsbegin.o /home/asamoilo/work/github/rust/src/rtstartup/rsbegin.rs
x86_64-unknown-linux-gnu/stage1/bin/rustc: symbol lookup error: /home/asamoilo/work/github/rust/x86_64-unknown-linux-gnu/stage1/lib/libstd-71b07a99.so: undefined symbol: clock_gettime
ldd /home/asamoilo/work/github/rust/x86_64-unknown-linux-gnu/stage1/lib/libstd-71b07a99.so
        linux-vdso.so.1 =>  (0x00007fff5f5ff000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f68f345e000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f68f3240000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f68f302a000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f68f2c97000)
        /lib64/ld-linux-x86-64.so.2 (0x00000031c6600000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f68f2a12000)

Don't you think adding -lrt to libstd-*.so solve the problem?
Thanks!

@sfackler
Copy link
Member

cc @alexcrichton probably fallout from #29894?

@alsam
Copy link
Author

alsam commented Nov 21, 2015

Thanks a lot.
I've read comments carefully and have got that the changes to libc in nursery that is an additional -lrt
https://github.com/rust-lang-nursery/libc/pull/66/files#r45526364
have already shipped. Unfortunately my rust sandbox stuck to the previous version of
./src/liblibc/src/unix/mod.rs after ./configure script.
Anyway editing manually the above file:

+        #[link(name = "rt")]

solved the issue.

@alsam
Copy link
Author

alsam commented Nov 21, 2015

Closing as the problem has been resolved.
Thanks!

@alsam alsam closed this as completed Nov 21, 2015
alexcrichton added a commit to alexcrichton/rust that referenced this issue Nov 22, 2015
bors added a commit that referenced this issue Nov 22, 2015
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