Skip to content
This repository has been archived by the owner on Dec 9, 2018. It is now read-only.

Link error #136

Closed
aleksander opened this issue Apr 17, 2017 · 4 comments
Closed

Link error #136

aleksander opened this issue Apr 17, 2017 · 4 comments

Comments

@aleksander
Copy link
Contributor

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
Copy link
Owner

japaric commented Apr 17, 2017

Hmm, interesting. What crate are you building?

@japaric
Copy link
Owner

japaric commented Apr 17, 2017

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
Copy link
Contributor Author

aleksander commented Apr 17, 2017

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- added a commit to tbu-/steed that referenced this issue Apr 19, 2017
This is fallout from rust-lang/rust#40409 which requires that all
allocators provide a `__rust_alloc_zeroed` function.

Fixes japaric#136.
@tbu-
Copy link
Collaborator

tbu- commented Apr 19, 2017

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

anatol pushed a commit to anatol/steed that referenced this issue May 3, 2017
This is fallout from rust-lang/rust#40409 which requires that all
allocators provide a `__rust_alloc_zeroed` function.

Fixes japaric#136.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants