[LLVMdev] LLVM on OpenBSD

Duncan Sands baldrick at free.fr
Wed Jun 18 07:32:53 PDT 2008


On Wednesday 18 June 2008 15:08:46 Edd Barrett wrote:
> Holger Schurig wrote:
> >> With 3.3.5 my first test took 5 times to produce a non "bus
> >> error" build. There were no 'make cleans' in between.
> >>
> >> What is going on?
> > 
> > You mean you used your bsd-ports-provided gcc to compile LLVM and 
> > you've got 4 times a bus-error during the build?  In this case, 
> > it cannot be a LLVM problem.
> Ok, to clarify,
> I have tried the OpenBSD provided gcc-3.3.5 (which is considered the
> least buggy version of gcc) and also with gcc-4.2 from ports.
> Sometimes you get a clean build of llvm, sometimes you don't and instead
> get a bus error.

if I understand right the problem is that you are unable to build LLVM
because your system gcc (and another gcc you tried) tends to crash during
the build?

> > In the linux-community, people say that bus-error's are almost 
> > always because of faulty hardware, e.g. problem with DRAM 
> > timing, overheated CPU, power-supply that cannot provide enought 
> > power during current surges, things like that.
> That is one reason a bus error might occur, but my more common
> understanding of a bus error is data not properly aligned with the byte
> boundaries and/or out of range memory at the physical level.
> The machine I am building on is my workstation which I use 9-4.30
> mon-fri. I run all manner of apps without any problems, so if it were
> bad hardware it would have shown itself by now surely.

gcc is however notorious for exposing bad memory problems.

> As a test I got another developer to try on a different machine and he 
> has the same problem. In another test he  also tried a more aggressive 
> malloc.conf (a mechanism which causes malloc to do all sorts of 
> randomisation and page filling to test for memory based bugs) and a 
> completely different error was encountered:
> SelectionDAG.cpp:2602: warning: converting of negative value
> `-1' to `long long

If I understand right, tweaking your system malloc caused the system
gcc to behave differently when compiling LLVM?

> Also we found that without specifying --enable-optimized, the 
> optimisations were still present:
> -O3 -fomit-frame-pointer -Woverloaded-virtual -pedantic
> -Wall -W -Wwrite-strings -Wno-long-long -Wunused -Wno-unused-parameter
> -O3

--enable-optimized is not about whether or not compiler optimizations
are performed when building LLVM, it is about whether the built version
of LLVM performs internal checks when run.



More information about the llvm-dev mailing list