Hello, Thomas> > I'd suggest to start with filling necessary bits in the > > X86RegisterInfo.cpp. This includes frame moves information and > > description of stack layout. > I looked at X86RegisterInfo.cpp, but I think that it already supports > x86-64. At least there were no obvious places were the code would only > work for 32bit mode.Right. See my last e-mail to Dale. It's really amazing :)> After comparing the generated assembler code with native gcc code I > think the generated code is fine, just the exception handler info in > the non-code sections is broken/missing.It seems, that EH dwarf information emission is disabled in X86TargetAsmInfo.cpp. Remove the is64Bit() condition near "SupportExceptionHandling = true" line in X86Subtarget::isELF section. Also, don't forget to add --enable-eh switch to llc invocation. You will need to link .S with your native unwinding runtime (so, use g++ to link, not llvm-g++) -- WBR, Anton Korobeynikov
On Feb 9, 2008, at 2:48 PM, Anton Korobeynikov wrote:>> After comparing the generated assembler code with native gcc code I >> think the generated code is fine, just the exception handler info in >> the non-code sections is broken/missing. > It seems, that EH dwarf information emission is disabled in > X86TargetAsmInfo.cpp. Remove the is64Bit() condition near > "SupportExceptionHandling = true" line in X86Subtarget::isELF section. > > Also, don't forget to add --enable-eh switch to llc invocation.Just in case it doesn't work the first time:) patch 46029 might be helpful. That made it work on Darwin for me, and it's possible some of the changes there are also applicable to Linux. Compare your .s with g++ output.> You will need to link .S with your native unwinding runtime (so, use > g++ > to link, not llvm-g++)This is not necessary on Darwin, btw, the unwinding stuff Just Worked too.
Where we are on the subject... Are we sure EH is done for x86? These two tests have never worked on Mac OS X / x86: SPEC/CINT2006/471.omnetpp Shootout-C++/except Evan On Feb 9, 2008, at 2:57 PM, Dale Johannesen wrote:> > On Feb 9, 2008, at 2:48 PM, Anton Korobeynikov wrote: >>> After comparing the generated assembler code with native gcc code I >>> think the generated code is fine, just the exception handler info in >>> the non-code sections is broken/missing. >> It seems, that EH dwarf information emission is disabled in >> X86TargetAsmInfo.cpp. Remove the is64Bit() condition near >> "SupportExceptionHandling = true" line in X86Subtarget::isELF >> section. >> >> Also, don't forget to add --enable-eh switch to llc invocation. > > Just in case it doesn't work the first time:) patch 46029 might be > helpful. That made it work on Darwin for me, and it's possible some > of the changes there are also applicable to Linux. Compare your .s > with g++ output. > >> You will need to link .S with your native unwinding runtime (so, use >> g++ >> to link, not llvm-g++) > > This is not necessary on Darwin, btw, the unwinding stuff Just Worked > too. > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev