japaric / steed

[INACTIVE] Rust's standard library, free of C dependencies, for Linux systems
519 stars 22 forks source link

Link error #136

Closed aleksander closed 7 years ago

aleksander commented 7 years ago

I'm trying to build crate with xargo as noted in readme:

curl -L https://raw.githubusercontent.com/japaric/steed/master/Xargo.std.toml > Xargo.toml
curl -LO https://raw.githubusercontent.com/japaric/steed/master/docker/x86_64-unknown-linux-steed.json
xargo build --target x86_64-unknown-linux-steed

The following error occurs:

ld.lld: error: undefined symbol: __rust_allocate_zeroed
>>> referenced by heap.rs:74 (/home/usov/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc/heap.rs:74)
>>>               resolve-240a1ff8cdd5c4fd.0.o:(alloc::heap::allocate_zeroed::hd2157b4681ba8fda) in archive /home/usov/src/resolve-test/target/x86_64-unknown-linux-steed/debug/deps/libresolve-240a1ff8cdd5c4fd.rlib

ld.lld: error: undefined symbol: __rust_allocate_zeroed
>>> referenced by heap.rs:74 (/home/usov/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc/heap.rs:74)
>>>               idna-be6e683175e98a5b.0.o:(alloc::heap::allocate_zeroed::hd2157b4681ba8fda) in archive /home/usov/src/resolve-test/target/x86_64-unknown-linux-steed/debug/deps/libidna-be6e683175e98a5b.rlib

Almost the same with xargo rustc --target x86_64-unknown-linux-steed -- -C linker=gcc -Z linker-flavor=gcc:

/home/usov/src/resolve-test/target/x86_64-unknown-linux-steed/debug/deps/libresolve-240a1ff8cdd5c4fd.rlib(resolve-240a1ff8cdd5c4fd.0.o): In function `alloc::heap::allocate_zeroed':
/home/usov/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc/heap.rs:74: undefined reference to `__rust_allocate_zeroed'
/home/usov/src/resolve-test/target/x86_64-unknown-linux-steed/debug/deps/libidna-be6e683175e98a5b.rlib(idna-be6e683175e98a5b.0.o): In function `alloc::heap::allocate_zeroed':
/home/usov/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc/heap.rs:74: undefined reference to `__rust_allocate_zeroed'
collect2: error: ld returned 1 exit status
japaric commented 7 years ago

Hmm, interesting. What crate are you building?

japaric commented 7 years ago

It seems the problem comes from using a recent nightly as #135 also failed. I don't have time to look into the cause right now but you could try switching to an older nightly in the meantime.

aleksander commented 7 years ago

What crate are you building?

I'm trying to build resolve crate to see if we could use it to solve #101

you could try switching to an older nightly in the meantime.

Yes you are right. The problem is only reproduced with last nightly. Build successfull with 2017-04-15 nightly.

tbu- commented 7 years ago

Reported to ralloc as well: redox-os/ralloc#50.