anp / rusl

An experimental (read: DONT USE) musl libc implementation in Rust.
Other
292 stars 12 forks source link

#![no_std_no_really_i_mean_it] #21

Closed mrhota closed 7 years ago

mrhota commented 7 years ago

va_list pulls in std even though rusl claims it is no_std in its crate root.

If we change the dependency to va_list = { version = "whatever", features = ["no_std"] }, then rustc will not link libstd with rusl. But then it starts complaining about missing panic_fmt. So we have to provide an empty def for that, along the lines described here: https://doc.rust-lang.org/book/no-stdlib.html

Then libc-test tests start to fail spectacularly. On my machine, the linker complains about undefined reference to '__muloti4' for every object file ever.

anp commented 7 years ago

Did you also try providing the eh_personality lang item (and maybe eh_unwind_resume)? I'm pretty sure I had this set up correctly before:

https://github.com/dikaiosune/rusl/commit/e55ab010bda98a60f88609f3ca3c76d17755ebad#diff-b4aea3e418ccdb71239b96952d9cddb6R5

Removed here because I didn't properly investigate why adding va_list caused a conflict with them:

https://github.com/dikaiosune/rusl/commit/deb822aa93586206ed3b33661d2bd0231dc2daac#diff-b4aea3e418ccdb71239b96952d9cddb6L68

This is a good catch on your part -- thanks for looking into it.

mrhota commented 7 years ago

It turns out I just got it working by adding compiler_builtins to dependencies.

https://github.com/rust-lang-nursery/compiler-builtins

(In addition to the instructions there, you also have to add compiler_builtins_lib to feature list in the rusl's crate root)

I'll push up a fix.