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

rust-native & rust-cross: "error: multiple dylib candidates for std found" #6

Closed
codyps opened this issue Jun 15, 2015 · 8 comments
Closed

Comments

@codyps
Copy link
Member

codyps commented Jun 15, 2015

Need to be more careful about how we tell rustc's build process to search for libraries to link against, in particular we need to convince it not to search ${libdir} when doing the initial builds.

The problem there is the search of ${libdir} is:

  • necessary to find rust-llvm
  • is also part of our generated target.json (so invocations of the final rustc to build other things look in ${libdir}).
@codyps
Copy link
Member Author

codyps commented Aug 5, 2015

CFG_LLVM_LINKAGE_FILE=/home/buildbot_slave/buildbot/yocto-basic/obj/tmp/work/x86_64-poky-linux-gnueabi/rust-cross-arm/1.1.0-r0/build/x86_64-linux/rt/llvmdeps.rs LD_LIBRARY_PATH=/home/buildbot_slave/buildbot/yocto-basic/obj/tmp/work/x86_64-poky-linux-gnueabi/rust-cross-arm/1.1.0-r0/build/x86_64-linux/stage0/lib/arm-poky-linux-gnueabi:$LD_LIBRARY_PATH   x86_64-linux/stage0/bin/rustc --cfg stage0  -O --cfg rtopt --cfg ndebug -g -C rpath -C prefer-dynamic -Z no-landing-pads --target=x86_64-linux --sysroot "x86_64-linux/stage0" -L "x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib"  -W warnings -L "x86_64-linux/rt" -L "/home/buildbot_slave/buildbot/yocto-basic/obj/tmp/sysroots/x86_64-linux/usr/lib"   --out-dir x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib -C extra-filename=-e9599659 /home/buildbot_slave/buildbot/yocto-basic/obj/tmp/work/x86_64-poky-linux-gnueabi/rust-cross-arm/1.1.0-r0/rustc-1.1.0/src/librustc_llvm/lib.rs
| info: now are following matches for libstd-*.so libraries:
| x86_64-linux/stage1/lib/arm-poky-linux-gnueabi/libstd-e9599659.so
| /home/buildbot_slave/buildbot/yocto-basic/obj/tmp/work/x86_64-poky-linux-gnueabi/rust-cross-arm/1.1.0-r0/rustc-1.1.0/src/libarena/lib.rs:1:1: 1:1 error: multiple dylib candidates for `std` found
| /home/buildbot_slave/buildbot/yocto-basic/obj/tmp/work/x86_64-poky-linux-gnueabi/rust-cross-arm/1.1.0-r0/rustc-1.1.0/src/libarena/lib.rs:1 // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|                                                                                                                                            ^
| /home/buildbot_slave/buildbot/yocto-basic/obj/tmp/work/x86_64-poky-linux-gnueabi/rust-cross-arm/1.1.0-r0/rustc-1.1.0/src/libarena/lib.rs:1:1: 1:1 note: candidate #1: /home/buildbot_slave/buildbot/yocto-basic/obj/tmp/work/x86_64-poky-linux-gnueabi/rust-cross-arm/1.1.0-r0/build/x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib/libstd-e9599659.so
| /home/buildbot_slave/buildbot/yocto-basic/obj/tmp/work/x86_64-poky-linux-gnueabi/rust-cross-arm/1.1.0-r0/rustc-1.1.0/src/libarena/lib.rs:1 // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|                                                                                                                                            ^
| /home/buildbot_slave/buildbot/yocto-basic/obj/tmp/work/x86_64-poky-linux-gnueabi/rust-cross-arm/1.1.0-r0/rustc-1.1.0/src/libarena/lib.rs:1:1: 1:1 note: candidate #2: /home/buildbot_slave/buildbot/yocto-basic/obj/tmp/sysroots/x86_64-linux/usr/lib/rustlib/x86_64-linux/lib/libstd-e9599659.so
| /home/buildbot_slave/buildbot/yocto-basic/obj/tmp/work/x86_64-poky-linux-gnueabi/rust-cross-arm/1.1.0-r0/rustc-1.1.0/src/libarena/lib.rs:1 // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|                                                                                                                                            ^
| /home/buildbot_slave/buildbot/yocto-basic/obj/tmp/work/x86_64-poky-linux-gnueabi/rust-cross-arm/1.1.0-r0/rustc-1.1.0/src/liblog/lib.rs:1:1: 1:1 error: multiple dylib candidates for `std` found
| /home/buildbot_slave/buildbot/yocto-basic/obj/tmp/work/x86_64-poky-linux-gnueabi/rust-cross-arm/1.1.0-r0/rustc-1.1.0/src/liblog/lib.rs:1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|                                                                                                                                          ^
| /home/buildbot_slave/buildbot/yocto-basic/obj/tmp/work/x86_64-poky-linux-gnueabi/rust-cross-arm/1.1.0-r0/rustc-1.1.0/src/liblog/lib.rs:1:1: 1:1 note: candidate #1: /home/buildbot_slave/buildbot/yocto-basic/obj/tmp/sysroots/x86_64-linux/usr/lib/rustlib/x86_64-linux/lib/libstd-e9599659.so
| /home/buildbot_slave/buildbot/yocto-basic/obj/tmp/work/x86_64-poky-linux-gnueabi/rust-cross-arm/1.1.0-r0/rustc-1.1.0/src/liblog/lib.rs:1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|                                                                                                                                          ^
| /home/buildbot_slave/buildbot/yocto-basic/obj/tmp/work/x86_64-poky-linux-gnueabi/rust-cross-arm/1.1.0-r0/rustc-1.1.0/src/liblog/lib.rs:1:1: 1:1 note: candidate #2: /home/buildbot_slave/buildbot/yocto-basic/obj/tmp/work/x86_64-poky-linux-gnueabi/rust-cross-arm/1.1.0-r0/build/x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib/libstd-e9599659.so
| /home/buildbot_slave/buildbot/yocto-basic/obj/tmp/work/x86_64-poky-linux-gnueabi/rust-cross-arm/1.1.0-r0/rustc-1.1.0/src/liblog/lib.rs:1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|                                                                                                                                          ^
| /home/buildbot_slave/buildbot/yocto-basic/obj/tmp/work/x86_64-poky-linux-gnueabi/rust-cross-arm/1.1.0-r0/rustc-1.1.0/src/liblog/lib.rs:1:1: 1:1 error: found possibly newer version of crate `core` which `std` depends on
| /home/buildbot_slave/buildbot/yocto-basic/obj/tmp/work/x86_64-poky-linux-gnueabi/rust-cross-arm/1.1.0-r0/rustc-1.1.0/src/liblog/lib.rs:1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|                                                                                                                                          ^
| 

@codyps
Copy link
Member Author

codyps commented Aug 5, 2015

Unclear if this is solvable with current rustc behavior due to the need to link against our external llvm.

ie: we want dylibs, but we want to ignore the dylibs that aren't llvm. Rustc's command line doesn't let us do that.

Easy solution would be to ignore lib conflicts by selecting the first lib.

@codyps
Copy link
Member Author

codyps commented Aug 20, 2015

It's also possible that we might be able to adjust the hash rustc appends to libraries to include bitbake's PV + PR, which might aleviate our issues.

https://github.com/Heather/gentoo-rust/blob/master/dev-lang/rust/rust-1.2.0.ebuild#L50

@codyps
Copy link
Member Author

codyps commented Aug 25, 2015

Right now my workaround for this (error: multiple dylib candidates for std found) has been to cleansstate of the rust packages (native and cross) and retry.

@codyps codyps changed the title Appears to occasionally link the final rustc against the system rustc libraries (if any are installed) "error: multiple dylib candidates for std found" Aug 25, 2015
@codyps codyps changed the title "error: multiple dylib candidates for std found" rust-native & rust-cross: "error: multiple dylib candidates for std found" Aug 25, 2015
@codyps
Copy link
Member Author

codyps commented Aug 25, 2015

rust-lang/rust#14650 might be adaptable to resolve this in rustc directly.

@codyps
Copy link
Member Author

codyps commented Aug 25, 2015

| CFG_LLVM_LINKAGE_FILE=/home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/build/x86_64-linux/rt/llvmdeps.rs LD_LIBRARY_PATH=/home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/build/x86_64-linux/stage0/lib/arm-poky-linux-gnueabi:$LD_LIBRARY_PATH   x86_64-linux/stage0/bin/rustc --cfg stage0  -O --cfg rtopt -g -C rpath -C prefer-dynamic -Z no-landing-pads --target=x86_64-linux --sysroot "x86_64-linux/stage0" -L "x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib"  -W warnings -L "x86_64-linux/rt" -L "/home/cody/obj/y/tmp/sysroots/x86_64-linux/usr/lib"    --out-dir x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib -C extra-filename=-d8ace771 /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/librustc_llvm/lib.rs
| info: now are following matches for libstd-*.so libraries:
| x86_64-linux/stage1/lib/arm-poky-linux-gnueabi/libstd-d8ace771.so
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libarena/lib.rs:1:1: 1:1 error: multiple dylib candidates for `std` found
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libarena/lib.rs:1 // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|                                                                                                  ^
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libarena/lib.rs:1:1: 1:1 note: candidate #1: /home/cody/obj/y/tmp/sysroots/x86_64-linux/usr/lib/rustlib/x86_64-linux/lib/libstd-d8ace771.so
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libarena/lib.rs:1 // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|                                                                                                  ^
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libarena/lib.rs:1:1: 1:1 note: candidate #2: /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/build/x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib/libstd-d8ace771.so
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libarena/lib.rs:1 // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|                                                                                                  ^
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libarena/lib.rs:1:1: 1:1 error: found possibly newer version of crate `core` which `std` depends on
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libarena/lib.rs:1 // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|                                                                                                  ^
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libarena/lib.rs:1:1: 1:1 note: perhaps this crate needs to be recompiled?
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libarena/lib.rs:1 // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|                                                                                                  ^
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libarena/lib.rs:1:1: 1:1 note: crate `core` path #1: /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/build/x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib/libcore-d8ace771.rlib
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libarena/lib.rs:1:1: 1:1 note: crate `std` path #1: /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/build/x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib/libstd-d8ace771.rlib
| error: aborting due to 2 previous errors
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/mk/target.mk:171: recipe for target 'x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib/stamp.arena' failed
| make: *** [x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib/stamp.arena] Error 101
| make: *** Waiting for unfinished jobs....
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libflate/lib.rs:1:1: 1:1 error: multiple dylib candidates for `std` found
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libflate/lib.rs:1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|                                                                                                  ^
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libflate/lib.rs:1:1: 1:1 note: candidate #1: /home/cody/obj/y/tmp/sysroots/x86_64-linux/usr/lib/rustlib/x86_64-linux/lib/libstd-d8ace771.so
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libflate/lib.rs:1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|                                                                                                  ^
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libflate/lib.rs:1:1: 1:1 note: candidate #2: /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/build/x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib/libstd-d8ace771.so
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libflate/lib.rs:1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|                                                                                                  ^
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libflate/lib.rs:1:1: 1:1 error: found possibly newer version of crate `core` which `std` depends on
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libflate/lib.rs:1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|                                                                                                  ^
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libflate/lib.rs:1:1: 1:1 note: perhaps this crate needs to be recompiled?
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libflate/lib.rs:1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|                                                                                                  ^
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libflate/lib.rs:1:1: 1:1 note: crate `core` path #1: /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/build/x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib/libcore-d8ace771.rlib
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libflate/lib.rs:1:1: 1:1 note: crate `std` path #1: /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/build/x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib/libstd-d8ace771.rlib
| error: aborting due to 2 previous errors
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libgetopts/lib.rs:1:1: 1:1 error: multiple dylib candidates for `std` found
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libgetopts/lib.rs:1 // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|                                                                                                    ^
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libgetopts/lib.rs:1:1: 1:1 note: candidate #1: /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/build/x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib/libstd-d8ace771.so
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libgetopts/lib.rs:1 // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|                                                                                                    ^
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libgetopts/lib.rs:1:1: 1:1 note: candidate #2: /home/cody/obj/y/tmp/sysroots/x86_64-linux/usr/lib/rustlib/x86_64-linux/lib/libstd-d8ace771.so
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libgetopts/lib.rs:1 // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|                                                                                                    ^
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/mk/target.mk:171: recipe for target 'x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib/stamp.flate' failed
| make: *** [x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib/stamp.flate] Error 101
| error: aborting due to previous error
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/mk/target.mk:171: recipe for target 'x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib/stamp.getopts' failed
| make: *** [x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib/stamp.getopts] Error 101
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/liblog/lib.rs:1:1: 1:1 error: multiple dylib candidates for `std` found
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/liblog/lib.rs:1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|                                                                                                ^
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/liblog/lib.rs:1:1: 1:1 note: candidate #1: /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/build/x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib/libstd-d8ace771.so
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/liblog/lib.rs:1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|                                                                                                ^
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/liblog/lib.rs:1:1: 1:1 note: candidate #2: /home/cody/obj/y/tmp/sysroots/x86_64-linux/usr/lib/rustlib/x86_64-linux/lib/libstd-d8ace771.so
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/liblog/lib.rs:1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|                                                                                                ^
| error: aborting due to previous error
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libgraphviz/lib.rs:1:1: 1:1 error: multiple dylib candidates for `std` found
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libgraphviz/lib.rs:1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|                                                                                                     ^
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libgraphviz/lib.rs:1:1: 1:1 note: candidate #1: /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/build/x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib/libstd-d8ace771.so
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libgraphviz/lib.rs:1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|                                                                                                     ^
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libgraphviz/lib.rs:1:1: 1:1 note: candidate #2: /home/cody/obj/y/tmp/sysroots/x86_64-linux/usr/lib/rustlib/x86_64-linux/lib/libstd-d8ace771.so
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libgraphviz/lib.rs:1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|                                                                                                     ^
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libfmt_macros/lib.rs:1:1: 1:1 error: multiple dylib candidates for `std` found
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libfmt_macros/lib.rs:1 // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|                                                                                                       ^
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libfmt_macros/lib.rs:1:1: 1:1 note: candidate #1: /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/build/x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib/libstd-d8ace771.so
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libfmt_macros/lib.rs:1 // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|                                                                                                       ^
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libfmt_macros/lib.rs:1:1: 1:1 note: candidate #2: /home/cody/obj/y/tmp/sysroots/x86_64-linux/usr/lib/rustlib/x86_64-linux/lib/libstd-d8ace771.so
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/src/libfmt_macros/lib.rs:1 // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|                                                                                                       ^
| /home/cody/obj/y/tmp/work/x86_64-linux/rust-cross-arm/1.2.0-r0/rustc-1.2.0/mk/target.mk:171: recipe for target 'x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib/stamp.log' failed
| make: *** [x86_64-linux/stage0/lib/arm-poky-linux-gnueabi/rustlib/x86_64-linux/lib/stamp.log] Error 101
| error: aborting due to previous error
| error: aborting due to previous error

@codyps
Copy link
Member Author

codyps commented Aug 25, 2015

It appears to reproduce easily by doing

# this one should complete, if not, clean both and retry
bitbake image-using-rust-native-and-rust-cross

# clean one out to force a rebuild
bitbake -c cleansstate rust-cross-arm

# this one fails with the error seen in this issue.
bitbake image-using-rust-native-and-rust-cross

A really bad work-around (that would only fix things for clean sysroots) might be to configure task dependencies to cause both rust variants to wait for the other before installing.

@codyps
Copy link
Member Author

codyps commented Aug 26, 2015

Alternately, a direct reproduction with bitbake:

mkdir src/llvm/b
cd src/llvm/b
../configure --prefix=$HOME/rust-prefix --enable-targets=x86,x86_64,arm,aarch64,mips,powerpc --enable-optimized --disable-assertions --disable-docs --enable-bindings=none --enable-keep-symbols
make -j10 && make install
cd ../../
mkdir b
../configure --llvm-root=$HOME/rust-prefix --prefix=$HOME/rust-prefix --disable-manage-submodules

# succeeds
make -j10 && make install

# force a rebuild
make clean

# fails due to  'error: multiple dylib candidates for `std` found'
make -j10 && make install

Because this error is being emitted by the rustc snapshot building stage0, we can't resolve this in meta-rust by patching the compiler itself, instead we need to look at adjusting the flags passed to the rustc snapshot to avoid it.

@codyps codyps closed this as completed in a626e68 Aug 26, 2015
codyps referenced this issue in codyps/rust Aug 26, 2015
…BDIR

This fixes the case where we try to re-build & re-install rust to the
same prefix (without uninstalling) while using an llvm-root that is the
same as the prefix.

Without this, builds like that fail with:
	'error: multiple dylib candidates for `std` found'

See https://github.com/jmesmon/meta-rust/issues/6 for some details.

May also be related to rust-lang#20342.
bors referenced this issue in rust-lang/rust Aug 27, 2015
This fixes the case where we try to re-build & re-install rust to the
same prefix (without uninstalling) while using an llvm-root that is the
same as the prefix.

Without this, builds like that fail with:
	'error: multiple dylib candidates for `std` found'

See https://github.com/jmesmon/meta-rust/issues/6 for some details.

May also be related to #20342.
ashie pushed a commit to webdino/meta-rust that referenced this issue Nov 23, 2018
…-license-checksum

Fix checksums missed in Firefox 38.6.1esr update.
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

1 participant