Skip to content

compiler_builtins & compiler_builtins_shim leading multiple matching crates #218

Open
@jparris

Description

Hi there,

I'm having problems compiling compiler_builtins under xargo. I'm pretty sure it's because compiler_builtins_shim is being compiled under the name compiler_builtins.

Xargo build

gerd:munin$ rm -rf ~/.xargo/
gerd:munin$ cargo clean
gerd:munin$ RUST_TARGET_PATH=`pwd` xargo build --target=x86_64-uefi
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling cc v1.0.15
   Compiling core v0.0.0 (file:///home/parrisj/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore)
   Compiling compiler_builtins v0.0.0 (file:///home/parrisj/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/rustc/compiler_builtins_shim)
   Compiling alloc v0.0.0 (file:///home/parrisj/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc)
    Finished release [optimized] target(s) in 55.91s
    Finished release [optimized] target(s) in 0.01s
   Compiling compiler_builtins v0.1.0 (file:///home/parrisj/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcompiler_builtins)
    Finished release [optimized] target(s) in 3.74s
   Compiling uefi v0.1.0 (file:///home/parrisj/src/munin)
error[E0464]: multiple matching crates for `compiler_builtins`
  |
  = note: candidates:
          crate `compiler_builtins`: /home/parrisj/.xargo/lib/rustlib/x86_64-uefi/lib/libcompiler_builtins-c9c3a92f88e65908.rlib
          crate `compiler_builtins`: /home/parrisj/.xargo/lib/rustlib/x86_64-uefi/lib/libcompiler_builtins-434f0f90969062e4.rlib

error[E0463]: can't find crate for `compiler_builtins`

error: aborting due to 2 previous errors

Some errors occurred: E0463, E0464.
For more information about an error, try `rustc --explain E0463`.
error: Could not compile `uefi`.

To learn more, run the command again with --verbose.

Target

gerd:munin$ cat x86_64-uefi.json 
{
  "llvm-target": "x86_64-pc-windows-msvc",
  "target-endian": "little",
  "target-pointer-width": "64",
  "target-c-int-width": "32",
  "os": "uefi",
  "arch": "x86_64",
  "data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
  "linker-flavor": "lld-link",
  "pre-link-args": {
    "lld-link": [
      "/Subsystem:EFI_Application",
      "/Entry:efi_main"
    ]
  },
  "panic-strategy": "abort",
  "default-hidden-visibility": true,
  "executables": true,
  "exe-suffix": ".efi",
  "is-like-windows": true
}

Cargo

gerd:munin$ cat Cargo.toml
[package]
name = "uefi"
version = "0.1.0"
authors = ["jon parris <parrisj@gmail.com>"]

[lib]
name = "libuefi"
path = "uefi-lib/lib.rs"

[[bin]]
name = "uefi-app"
path = "uefi-test/src/main.rs"

[dependencies]
rlibc = "1.0"

[profile.dev]
panic = "abort"

[profile.release]
panic = "abort"

Xargo

gerd:munin$ cat Xargo.toml 
[dependencies]
alloc = {}

[dependencies.core]
stage = 0

[dependencies.compiler_builtins]
features = ["mem"]
stage = 1

Version info

gerd:munin$ xargo -V
xargo 0.3.12
cargo 1.27.0-nightly (af3f1cd29 2018-05-03)
gerd:munin$ rustc -V
rustc 1.27.0-nightly (428ea5f6b 2018-05-06)

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions