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

build failure: librustc-d252d482-0.11.0-pre.so: undefined reference to `std::__detail::_Prime_rehash_policy::_M_need_rehash(unsigned long, unsigned long, unsigned long) const' #14404

Closed
alsam opened this issue May 24, 2014 · 2 comments

Comments

@alsam
Copy link

alsam commented May 24, 2014

Hello All,

I met the following build failure for the top of tree rust
(last commit 39c1ecd):

rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/bin/rustc
error: linking with `cc` failed: exit code: 1
note: cc '-m64' '-L' '/opt/scratch/work/rust/rust/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-o' 'x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/bin/rustc' 'x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/bin/rustc.o' '-lmorestack' '-nodefaultlibs' '-Wl,--gc-sections' '-Wl,--as-needed' '-Wl,-O1' '-L' '/opt/scratch/work/rust/rust/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-lnative-1fb5e2c0-0.11.0-pre' '-L' '/opt/scratch/work/rust/rust/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-lrustc-d252d482-0.11.0-pre' '-L' '/opt/scratch/work/rust/rust/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-lsyntax-555559ea-0.11.0-pre' '-L' '/opt/scratch/work/rust/rust/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-lflate-92afea7e-0.11.0-pre' '-L' '/opt/scratch/work/rust/rust/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-larena-063bff73-0.11.0-pre' '-L' '/opt/scratch/work/rust/rust/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-lgetopts-c94737d1-0.11.0-pre' '-L' '/opt/scratch/work/rust/rust/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-lterm-4e4945a5-0.11.0-pre' '-L' '/opt/scratch/work/rust/rust/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-lfmt_macros-5125f3bd-0.11.0-pre' '-L' '/opt/scratch/work/rust/rust/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-lgraphviz-7b3cf89d-0.11.0-pre' '-L' '/opt/scratch/work/rust/rust/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-ltime-4bb3739b-0.11.0-pre' '-L' '/opt/scratch/work/rust/rust/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-lserialize-0352aab7-0.11.0-pre' '-L' '/opt/scratch/work/rust/rust/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-lcollections-d412c0c4-0.11.0-pre' '-L' '/opt/scratch/work/rust/rust/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-llog-cd053230-0.11.0-pre' '-L' '/opt/scratch/work/rust/rust/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-lsync-305341d2-0.11.0-pre' '-L' '/opt/scratch/work/rust/rust/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-lrand-2ea8f361-0.11.0-pre' '-L' '/opt/scratch/work/rust/rust/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-lstd-59beb4f7-0.11.0-pre' '-L' '/opt/scratch/work/rust/rust/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-llibc-4f9a876d-0.11.0-pre' '-L' '/opt/scratch/work/rust/rust/.rust' '-L' '/opt/scratch/work/rust/rust' '-Wl,-Bdynamic' '-lpthread' '-lrt' '-ldl' '-lm' '-lstdc++' '-lrt' '-ldl' '-lpthread' '-lgcc_s' '-lpthread' '-lc' '-lm' '-Wl,-rpath,$ORIGIN/../lib' '-Wl,-rpath,/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-lcompiler-rt'
note: /opt/scratch/work/rust/rust/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc-d252d482-0.11.0-pre.so: undefined reference to `std::__detail::_Prime_rehash_policy::_M_next_bkt(unsigned long) const'
/opt/scratch/work/rust/rust/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc-d252d482-0.11.0-pre.so: undefined reference to `std::__detail::_Prime_rehash_policy::_M_need_rehash(unsigned long, unsigned long, unsigned long) const'
collect2: ld returned 1 exit status

The compiler used for building

g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/gcc_4_8/libexec/gcc/x86_64-linux-gnu/4.8.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../gcc-4.8.1/configure --build=x86_64-linux-gnu --prefix=/usr/gcc_4_8 --with-gmp=/usr/gcc_4_8 --with-mpfr=/usr/gcc_4_8 --with-mpc=/usr/gcc_4_8 --enable-checking=release --enable-languages=c,c++,fortran --disable-multilib --program-suffix=-4.8
Thread model: posix
gcc version 4.8.1 (GCC) 

Thanks

@alexcrichton
Copy link
Member

I've seen this happen when there's a stale LLVM build lying around or possibly when clang/gcc get mixed up when building LLVM. Do either of those ring a bell for you? Also, have you tried building from a fresh checkout?

@alsam
Copy link
Author

alsam commented May 26, 2014

Thanks a lot for the hint.
Indeed it was a conflict between outdated /usr/bin/cc

ll `which cc`
lrwxrwxrwx 1 root root 20 Oct 21  2010 /usr/bin/cc -> /etc/alternatives/cc*
asamoilov@atlant:/opt/scratch/work/rust/rust$ ll /etc/alternatives/cc
lrwxrwxrwx 1 root root 12 Oct 21  2010 /etc/alternatives/cc -> /usr/bin/gcc*

and gcc-4.8.1
installed in other place. After resolving the conflict the build process passed smoothly.
So actually this is not a bug.

@alsam alsam closed this as completed May 26, 2014
bors added a commit to rust-lang-ci/rust that referenced this issue Jun 5, 2023
Remove client side proc-macro version check

The server already verifies versions due to ABI picking now so there shouldn't be a need for the client side check anymore
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