On Thursday 11 October 2007 02:39, Duncan Sands wrote:> Hi David, > > > "LLVM type size doesn't match GCC type size!"' failed. > > this assertion checks that gcc types are converted into > LLVM types of the same size. Try running cc1 in gdb. > When you hit the assertion, go up a few stack frames > until you get to ConvertType. Do > call debug_tree(type) > That will tell you what the gcc type was. From that > and the LLVM type it should be clear what the ultimate > cause of the problem was.Ok, I think this must be related to the warning about 64-bit code. debug_type reveals the gcc type to be a function pointer of size 32, which would indicate 32-bit code. The llvm type is PointerTyID of size 64, indicating 64-bit code. This happens at line 796 of llvm-types.cpp: if (Ty->getTypeID() == Type::VoidTyID) Ty = Type::Int8Ty; // void* -> sbyte* return TypeDB.setType(type, PointerType::get(Ty)); Somehow PointerType::get is returning a 64-bit pointer even though -m32 was passed to llvm-gcc. I'll see if I can figure out where the 64-bit code warning is emitted and what triggers it. -Dave
On Thursday 11 October 2007 11:24, David Greene wrote:> Somehow PointerType::get is returning a 64-bit pointer even though > -m32 was passed to llvm-gcc. > > I'll see if I can figure out where the 64-bit code warning is emitted and > what triggers it.Aha! I found this previous thread: http://lists.cs.uiuc.edu/pipermail/llvmdev/2007-May/009177.html I am now trying to build with --disable-multilib. I'll bet llvm-gcc doesn't support multilib compilers right now. I'll let you know how it turns out. -Dave
On Thursday 11 October 2007 11:34, David Greene wrote:> Aha! I found this previous thread: > > http://lists.cs.uiuc.edu/pipermail/llvmdev/2007-May/009177.html > > I am now trying to build with --disable-multilib. I'll bet llvm-gcc > doesn't support multilib compilers right now. I'll let you know how it > turns out.And of course this is in README.LLVM which I didn't bother to read since I had previously been building on 32-bit only machines. :) -Dave
On Thu, 11 Oct 2007, David Greene wrote:> On Thursday 11 October 2007 11:24, David Greene wrote: >> Somehow PointerType::get is returning a 64-bit pointer even though >> -m32 was passed to llvm-gcc. >> >> I'll see if I can figure out where the 64-bit code warning is emitted and >> what triggers it. > > Aha! I found this previous thread: > > http://lists.cs.uiuc.edu/pipermail/llvmdev/2007-May/009177.html > > I am now trying to build with --disable-multilib. I'll bet llvm-gcc doesn't > support multilib compilers right now. I'll let you know how it turns out.Hrm, it does on darwin. This is probably a target-specific bug, probably something missing from gcc/confing/linux.h. In any case, if this works, please add a comment to README.LLVM in llvm-gcc so that future people know about this. Thanks! -Chris -- http://nondot.org/sabre/ http://llvm.org/