Description
Since I'm playing with this, I figured I'd document some of what I've been seeing.
I've merged rust/rust@1447ce78fbd65a629f228ec8731a5cddc076a15c into the avr-support
branch. This entailed a few rounds of merge conflict resolution, as well as updating compiler-rt and the LLVM fork as well. The compiler seems to build, but I've hit some issues with compiling libcore:
./x86_64-apple-darwin/stage1/bin/rustc -C opt-level=2 -Z no-landing-pads --target avr-atmel-none -g ../src/libcore/lib.rs --out-dir libcore-avr/
Specifically, LLVM hit a few assertions when SelectionDAG::computeKnownBits
calls APInt::trunc
, APInt::sext
, and APInt::zext
because it's trying to convert a 16-bit number to a 16-bit number. These functions all expect to convert to a different size, and there are methods like zextOrSelf
that allow the same size. I hacked around that by returning *this
in all three methods (what could go wrong, right?).
The next attempt failed at an LLVM issue:
LLVM ERROR: Cannot select: t35: i8 = mulhs t2, t4
t2: i8,ch = CopyFromReg t0, Register:i8 %vreg27
t1: i8 = Register %vreg27
t4: i8,ch = CopyFromReg t0, Register:i8 %vreg25
t3: i8 = Register %vreg25
In function: _ZN3num14from_str_radix20h7837196669301488416E
Which I don't have the LLVM understanding to parse yet :-)
I'm going to try some other directions to see if I can get an executable.