Android's 3.4 and 3.5 clang crashes in backend when compiling Android's latest copy of compiler-rt to a mips64 target. The crashes happens on every recently-added CRT_HAS_128BIT compiler_rt/lib/builtins/* routine that uses the mode(TI) 128-bit integer datatype. compile command for reduced example: prebuilts/clang/linux-x86/host/3.5/bin/clang -target mips64el-linux-android clangbug.c Source code for reduced test case clangbug.c: typedef int ti_int __attribute__ ((mode (TI))); ti_int bug(ti_int a, ti_int b) { return a + b; } This gives the compile-time failure message: fatal error: error in backend: Cannot select: 0xf8852f88: i64,glue = addc 0xf8852dd8, 0xf8850d00 [ORD=8] [ID=34] 0xf8852dd8: i64,ch = load 0xf8852d48, 0xf8851690, 0xf8851720<LD8[%1](align=16)> [ORD=6] [ID=32] 0xf8851690: i64 = FrameIndex<0> [ID=9] 0xf8851720: i64 = undef [ID=10] 0xf8850d00: i64,ch = CopyFromReg 0xf8843490, 0xf8850c70 [ORD=1] [ID=17] 0xf8850c70: i64 = Register %vreg2 [ID=3] In function: bug clang: error: clang frontend command failed with exit code 70 (use -v to see invocation) clang version 3.5 Target: mips64el--linux-android This problem is preventing all builds of the mips64 version of Android at AOSP. As a workaround until the mips64 codegen is made solid for this datatype and that compiler is available at aosp, we are removing these unneeded CRT_HAS_128BIT library routines via the compiler_rt patch http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140616/222726.html
This recently broke Android compilation for MIPS64, so I would like to see a better resolution here. Right now, I have to define this in order to even build a sufficient compiler-rt. Are there any updates here?
Can someone try reverting r224488 in compiler-rt and check that MIPS64 is fine? I can build for MIPS64, which was apparently the original issue (crashes in instruction selection). I don't have a great way to test this compiler-rt, however, since I have no way to execute the testcases for these functions.
With current compilers at Aosp master branch, mips64 Android builds and boots successfully on the Android emulator, with compiler-rt patch https://android-review.googlesource.com/#/c/124723/1 reverted.
This seems to have been resolved but the ticket wasn't marked as such. Feel free to re-open if this ticket should be open.