[cfe-dev] linux build fix

Nuno Lopes nunoplopes at sapo.pt
Sat Dec 8 02:45:30 PST 2007


> On Fri, 2007-12-07 at 21:03 -0800, Chris Lattner wrote:
>> If you send a .i file (produced with clang -E test.c > test.i), I can
>> take a look.
>
> Ah, never mind - that /usr/include/linux patch of mine broke it.  :)  It
> was no longer pulling in the correct time.h header, among others.  I
> fixed the problems with stddef.h and friends by adding
> the /usr/lib/gcc... path to the include path for now.

Yep, you cannot add the /usr/include/linux include path to clang or it won't 
work. I did exactly the same error when I started using clang (because I 
didn't read the install instructions) :P


>  Now I'm getting a
> fun-looking segfault on compilation, which is a vastly more interesting
> problem to tackle.  :)

clang automatically prints a stack trace, which should be enough to debug 
the problem in most cases. If you don't find the bug (it's normal as you 
don't know the code yet), send here the code you are parsing that is 
triggering the segfault.


> Still getting the hang of this codebase and the finer details of C
> compilers, sorry.

>From my experience, clang is very easy and has the lower learning curve I've 
ever seen (not that I have worked with many other compilers, though).

Nuno 




More information about the cfe-dev mailing list