On 3/13/2012 11:37 PM, Marijn Haverbeke wrote:

Thanks for digging into this so deeply. This probably also explains
why the non-optimized build currently fails on Windows (#959) -- it
simply generates binaries that are too big.

Yeah, probably the same bug.

The prospects are looking a little bleak, I guess. Debugging linkers
sounds like it'll get hairy.

In this case it turned out to be not so bad once I found something that was actually hitting a power-of-two. 65536 relocs. Hello!

While the nominal COFF section header field is a u16 for storing reloc counts -- and overflow + corruption here is what was going wrong -- it turns out PE/COFF has defined behavior for handling overflow: a header bit and an extra synthetic reloc. Microsoft tools and GNU tools already implement this and aren't bitten by it. LLVM-MC doesn't. Or didn't. I implemented it (BFD shows how) and it all works fine. The change is here:

https://github.com/brson/llvm/commit/4119fda4c6c4df372bd6edbbb08d48c7941577b5#diff-0

With this change your code bootstraps on my machine, bots are cycling currently. I've upgraded our LLVM to a version carrying this patch, so if they're in a good mood, you should be good go now.

CC'ing Bigcheese from LLVM-land. I imagine he'll want this.

-Graydon
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to