Hi there, I am a student considering a compiler design based dissertation with llvm. I am having problems building llvm on OpenBSD-current. I hope to make a port of llvm for OpenBSD once I have figured out how to build it. Observe: llvm[3]: Compiling Deserialize.cpp for Release build In file included from /home/edd/llvm/llvm-2.3/include/llvm/Bitcode/BitstreamRead er.h:18, from /home/edd/llvm/llvm-2.3/include/llvm/Bitcode/Deserialize.h :18, from Deserialize.cpp:14: /home/edd/llvm/llvm-2.3/include/llvm/Bitcode/BitCodes.h:158: warning: `class llvm::BitCodeAbbrev' only defines a private destructor and has no friends llvm[3]: Compiling DeserializeAPFloat.cpp for Release build In file included from /home/edd/llvm/llvm-2.3/include/llvm/Bitcode/BitstreamRead er.h:18, from /home/edd/llvm/llvm-2.3/include/llvm/Bitcode/Deserialize.h :18, from DeserializeAPFloat.cpp:15: /home/edd/llvm/llvm-2.3/include/llvm/Bitcode/BitCodes.h:158: warning: `class llvm::BitCodeAbbrev' only defines a private destructor and has no friends llvm[3]: Compiling DeserializeAPInt.cpp for Release build In file included from /home/edd/llvm/llvm-2.3/include/llvm/Bitcode/BitstreamRead er.h:18, from /home/edd/llvm/llvm-2.3/include/llvm/Bitcode/Deserialize.h :18, from DeserializeAPInt.cpp:15: /home/edd/llvm/llvm-2.3/include/llvm/Bitcode/BitCodes.h:158: warning: `class llvm::BitCodeAbbrev' only defines a private destructor and has no friends llvm[3]: Building Release Archive Library libLLVMBitReader.a gmake[3]: Leaving directory `/home/edd/llvm/llvm-2.3/lib/Bitcode/Reader' gmake[3]: Entering directory `/home/edd/llvm/llvm-2.3/lib/Bitcode/Writer' llvm[3]: Compiling BitWriter.cpp for Release build In file included from /home/edd/llvm/llvm-2.3/include/llvm/Argument.h:18, from /home/edd/llvm/llvm-2.3/include/llvm/Function.h:23, from /home/edd/llvm/llvm-2.3/include/llvm/Module.h:17, from /home/edd/llvm/llvm-2.3/include/llvm-c/Core.h:40, from /home/edd/llvm/llvm-2.3/include/llvm-c/BitWriter.h:22, from BitWriter.cpp:10: /home/edd/llvm/llvm-2.3/include/llvm/ParameterAttributes.h:71: warning: `inline ' is not at beginning of declaration BitWriter.cpp: In function `int LLVMWriteBitcodeToFileHandle(LLVMOpaqueModule*, int)': BitWriter.cpp:40: error: no matching function for call to ` __gnu_cxx::stdio_filebuf<char, std::char_traits<char> >::stdio_filebuf(int&, std::_Ios_Openmode)' /usr/include/g++/ext/stdio_filebuf.h:53: error: candidates are: __gnu_cxx::stdio_filebuf<char, std::char_traits<char> >::stdio_filebuf(const __gnu_cxx::stdio_filebuf<char, std::char_traits<char> >&) /usr/include/g++/ext/stdio_filebuf.h:147: error: __gnu_cxx::stdio_filebuf<_CharT, _Traits>::stdio_filebuf(std::__c_file*, std::_Ios_Openmode, long unsigned int) [with _CharT = char, _Traits std::char_traits<char>] <near match> /usr/include/g++/ext/stdio_filebuf.h:122: error: __gnu_cxx::stdio_filebuf<_CharT, _Traits>::stdio_filebuf(int, std::_Ios_Openmode, bool, long unsigned int) [with _CharT = char, _Traits std::char_traits<char>] gmake[3]: *** [/home/edd/llvm/llvm-2.3/lib/Bitcode/Writer/Release/BitWriter.o] E rror 1 gmake[3]: Leaving directory `/home/edd/llvm/llvm-2.3/lib/Bitcode/Writer' gmake[2]: *** [Writer/.makeall] Error 2 gmake[2]: Leaving directory `/home/edd/llvm/llvm-2.3/lib/Bitcode' gmake[1]: *** [Bitcode/.makeall] Error 2 gmake[1]: Leaving directory `/home/edd/llvm/llvm-2.3/lib' gmake: *** [all] Error 1 I wonder if anyone can suggest a workaround or fix. Thanks -- Best Regards Edd http://students.dec.bournemouth.ac.uk/ebarrett
On 2008-06-10, at 09:19, Edd Barrett wrote:> I am a student considering a compiler design based dissertation with > llvm. I am having problems building llvm on OpenBSD-current. I hope > to make a port of llvm for OpenBSD once I have figured out how to > build it.Hi Edd, Could you please update to r52213 or later in svn and check whether this error is resolved with your gcc? http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080609/063564.html If not, I'll just write a configure test for this as the related FIXME suggests.> llvm[3]: Compiling Deserialize.cpp for Release build > BitWriter.cpp: In function `int > LLVMWriteBitcodeToFileHandle(LLVMOpaqueModule*, > int)': > BitWriter.cpp:40: error: no matching function for call to ` > __gnu_cxx::stdio_filebuf<char, std::char_traits<char> > >::stdio_filebuf(int&, > std::_Ios_Openmode)' > /usr/include/g++/ext/stdio_filebuf.h:53: error: candidates are: > __gnu_cxx::stdio_filebuf<char, std::char_traits<char> > >::stdio_filebuf(const > __gnu_cxx::stdio_filebuf<char, std::char_traits<char> >&) > /usr/include/g++/ext/stdio_filebuf.h:147: error: > __gnu_cxx::stdio_filebuf<_CharT, > _Traits>::stdio_filebuf(std::__c_file*, > std::_Ios_Openmode, long unsigned int) [with _CharT = char, > _Traits > std::char_traits<char>] <near match> > /usr/include/g++/ext/stdio_filebuf.h:122: error: > __gnu_cxx::stdio_filebuf<_CharT, _Traits>::stdio_filebuf(int, > std::_Ios_Openmode, bool, long unsigned int) [with _CharT = char, > _Traits > std::char_traits<char>]— Gordon
On Wed, Jun 11, 2008 at 11:49 AM, Gordon Henriksen <gordonhenriksen at mac.com> wrote:> Could you please update to r52213 or later in svn and check whether > this error is resolved with your gcc?Latest trunk fixes that error. Next problem :) llvm[3]: Building ARM.td register information header with tblgen llvm[3]: Building ARM.td register names with tblgen llvm[3]: Building ARM.td register info implementation with tblgen llvm[3]: Building ARM.td instruction names with tblgen llvm[3]: Building ARM.td instruction information with tblgen llvm[3]: Building ARM.td assembly writer with tblgen llvm[3]: Building ARM.td instruction selector implementation with tblgen assertion "getOperator()->isSubClassOf("SDNodeXForm") && "Unknown node type!"" failed: file "CodeGenDAGPatterns.cpp", line 949, function "ApplyTypeConstraints" gmake[3]: *** [/tmp/llvm/lib/Target/ARM/Debug/ARMGenDAGISel.inc.tmp] Abort trap (core dumped) gmake[3]: Leaving directory `/tmp/llvm/lib/Target/ARM' gmake[2]: *** [ARM/.makeall] Error 2 gmake[2]: Leaving directory `/tmp/llvm/lib/Target' gmake[1]: *** [Target/.makeall] Error 2 gmake[1]: Leaving directory `/tmp/llvm/lib' gmake: *** [all] Error 1 -- Best Regards Edd http://students.dec.bournemouth.ac.uk/ebarrett
Hello, Edd> > llvm[3]: Building ARM.td instruction selector implementation with tblgen > > assertion "getOperator()->isSubClassOf("SDNodeXForm") && "Unknown node > > type!"" failed: file "CodeGenDAGPatterns.cpp", line 949, function > > "ApplyTypeConstraints"Could you please try with gcc 4.x and check, whether this problem exists for you or not. -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University.
On Thu, Jun 12, 2008 at 11:41 AM, Anton Korobeynikov <asl at math.spbu.ru> wrote:> Hello, Edd > >> > llvm[3]: Building ARM.td instruction selector implementation with tblgen >> > assertion "getOperator()->isSubClassOf("SDNodeXForm") && "Unknown node >> > type!"" failed: file "CodeGenDAGPatterns.cpp", line 949, function >> > "ApplyTypeConstraints" > Could you please try with gcc 4.x and check, whether this problem exists > for you or not.gcc4.2 works fine. -- Best Regards Edd http://students.dec.bournemouth.ac.uk/ebarrett
Hi guys, Edd Barrett wrote:> Hi there, > > I am a student considering a compiler design based dissertation with > llvm. I am having problems building llvm on OpenBSD-current. I hope to > make a port of llvm for OpenBSD once I have figured out how to build > it.We still have not had any luck building llvm. Since last time, we have rebuilt gcc with -O0 incase of gcc optimisation bugs to no avail. I believe Andrew stress tested our gcc-3.3.5 by building itself many times over. What wer the results Andrew? FWIW gcc-4.2 shows the same error as 3.3.5 (see below). Here is a backtrace (courtesy of Andrew) of the tblgen run, which aborts about 50% of the time when it feels like it: #1 0x04e521a3 in abort () at /usr/src/lib/libc/stdlib/abort.c:68 #2 0x04df29d7 in __assert2 (file=0x3c0018e1 "CodeGenDAGPatterns.cpp", line=934, func=0x3c0020a6 "ApplyTypeConstraints", failedexpr=0x3c002400 "getOperator()->isSubClassOf(\"SDNodeXForm\") && \"Unknown node type!\"") at /usr/src/lib/libc/gen/assert.c:52 #3 0x1c0d0bcd in llvm::TreePatternNode::ApplyTypeConstraints (this=0x7dfc0700, TP=@0x7c0fb6c0, NotRegisters=false) at CodeGenDAGPatterns.cpp:934 #4 0x1c0cfb6b in llvm::TreePatternNode::ApplyTypeConstraints (this=0x7dfc0740, TP=@0x7c0fb6c0, NotRegisters=false) at CodeGenDAGPatterns.cpp:829 #5 0x1c0cfb6b in llvm::TreePatternNode::ApplyTypeConstraints (this=0x7c0fb7c0, TP=@0x7c0fb6c0, NotRegisters=false) at CodeGenDAGPatterns.cpp:829 #6 0x1c0d407c in llvm::TreePattern::InferAllTypes (this=0x7c0fb6c0) at CodeGenDAGPatterns.cpp:1182 #7 0x1c0d66ac in llvm::CodeGenDAGPatterns::ParsePatternFragments (this=0xcfbd1330) at CodeGenDAGPatterns.cpp:1368 #8 0x1c0d47b9 in CodeGenDAGPatterns (this=0xcfbd1330, R=@0x3c04465c) at CodeGenDAGPatterns.cpp:1225 #9 0x1c174c65 in DAGISelEmitter (this=0xcfbd1328, R=@0x3c04465c) at DAGISelEmitter.h:30 #10 0x1c173e40 in main (argc=11, argv=0xcfbd15a4) at TableGen.cpp:178 (I believe Andrew added a line to insert a breakpoint for gdb in the above backtrace) gmake[3]: Entering directory `/usr/ports/devel/llvm/w-llvm-2.3/llvm-2.3/lib/Target/ARM' llvm[3]: Building ARM.td register information header with tblgen llvm[3]: Building ARM.td register names with tblgen llvm[3]: Building ARM.td register info implementation with tblgen llvm[3]: Building ARM.td instruction names with tblgen llvm[3]: Building ARM.td instruction information with tblgen assertion "getOperator()->isSubClassOf("SDNodeXForm") && "Unknown node type!"" failed: file "CodeGenDAGPatterns.cpp", line 934, function "ApplyTypeConstraints" gmake[3]: *** [/usr/ports/devel/llvm/w-llvm-2.3/llvm-2.3/lib/Target/ARM/Debug/ARMGenInstrInfo.inc.tmp] Abort trap (core dumped) Does this shed any light on the situation? Thanks
On Thu, Jun 26, 2008 at 03:17:24PM +0100, Edd Barrett wrote:>> I hope to make a port of llvm for OpenBSD once I have figured out how to >> build it. > Here is a backtrace (courtesy of Andrew) of the tblgen run, which aborts > about 50% of the time when it feels like it:As a further bit of info, the way to trigger this bug is to cd into "lib/Target/ARM" and do "make clean && make". Around 12 files are then built; at any given point, there's a high likelihood that one of these fails with the assertion error Edd mentioned. Every so often all 12 compile in one go; repeat and rinse, and the bug will trigger sooner rather than later. Although nothing is certain, my guess (based on my own experience porting the Converge language to various platforms) would be that this bug is quite possibly cross platform, but is more like to be triggered by OpenBSD's malloc (which has a few tricks, such as allocating pages randomly across the entire VM space, which tend to highlight such things). If all the files compile successfull then the simple examples (Fibonacci etc.) included in LLVM seem to work fine. Most of the test suite seems to pass too, although I haven't yet fully understood why some tests fail (I don't think it's related to the above bug). I am happy to give an account on one of my OpenBSD boxes to any LLVM developer(s) who would like to look into this problem. Laurie -- http://tratt.net/laurie/ -- Personal http://convergepl.org/ -- The Converge programming language