haileys / rustboot

A tiny 32 bit kernel written in Rust
MIT License
1.53k stars 227 forks source link

Mutable static variables don't work #10

Open pczarn opened 11 years ago

pczarn commented 11 years ago

Rust can't compile truly freestanding, position-dependent code. It attempts to access global variables through _GLOBAL_OFFSET_TABLE_.

Currently it seems the best workaround is to compile emitted LLVM bitcode with clang -ffreestanding. However, optimizations made by clang could break things.