graydon/rust — Issue #1251: Compiling to an output file with the same name as a native function hits LLVM assert
Author: brson
Created: 2011-12-02 06:03:43+00:00
State: open
Labels: bug, llvm, unassigned

Compile the following with `rustc unsupervise.rs -o unsupervise`

```
native mod rustrt {
fn unsupervise();
}

fn main() { }
```

```
rustc: /home/brian/Dev/rust/src/llvm/lib/MC/MCAssembler.cpp:132: uint64_t llvm::MCAsmLayout::getSymbolOffset(const llvm::MCSymbolData*) const: Assertion `SD->getFragment() && "Invalid getOffset() on undefined symbol!"' failed.
Stack dump:
0. Running pass 'Function Pass Manager' on module 'unsupervise'.
Aborted
```

Only happens on Linux (Ubuntu 10.10 here). Thanks araujo.