ashleygwilliams / x86-kernel

a simple x86 kernel, extended with Rust
MIT License
224 stars 47 forks source link

`make` fails with rust nightly (2016-09-15) #8

Open cengiz-io opened 8 years ago

cengiz-io commented 8 years ago

Hello there!

First of all, thanks for the amazing talk at RustFest!

I'm assuming this is the repo which contains source to the demo that you've done.

And I'm trying to run it on my debian unstable, which has gcc 6.2.0 and rustc 1.13.0-nightly (1265cbf4e 2016-09-15)

Although libmy_os.a is built without errors, ld fails to link it.

please ignore the warning I reshaped lines for easier reading

   Compiling rlibc v0.1.4
   Compiling my_os v1.0.0 (file:///home/cengiz/Code/rust/x86-kernel)
warning: this feature has been stable since 1.6.0. Attribute no longer needed, #[warn(stable_features)] on by default
 --> src/lib.rs:1:12
  |
1 | #![feature(no_std)]
  |            ^^^^^^

    Finished debug [unoptimized + debuginfo] target(s) in 0.21 secs

target/x86_64-unknown-linux-gnu/debug/libmy_os.a(my_os.0.o): 

In function `core::option::{{impl}}::map<&u8,(usize, &u8),closure>':
/buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libcore/option.rs:383: 
undefined reference to `_Unwind_Resume'

target/x86_64-unknown-linux-gnu/debug/libmy_os.a(my_os.0.o): 
In function `core::iter::{{impl}}::next<core::slice::Iter<u8>>':
/buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libcore/iter/mod.rs:1107: 
undefined reference to `_Unwind_Resume'

Makefile:33: recipe for target 'build/kernel-x86_64.bin' failed
make: *** [build/kernel-x86_64.bin] Error 1

Maybe we should pass libc to ld also.

I'm out of ideas.

cengiz-io commented 8 years ago

2 additions to my submission:

  1. -Z no-landing-pads seems to be deprecated (in favor of -C panic=abort)
  2. This issue seems relevant: https://github.com/rust-lang/rust/issues/34409
ashleygwilliams commented 8 years ago

hi @cengizIO ! thanks for this. this repo is actually a bit old. the demos in my talk live here: https://github.com/intermezzOS/rustfest2016/tree/gh-pages/demos

that being said- i should probably fix this one too. i'll check it out today! thanks for such a detailed issue :)