[cfe-dev] linux build fix

Chris Lattner clattner at apple.com
Fri Dec 7 21:03:11 PST 2007


On Dec 7, 2007, at 8:59 PM, Sean Middleditch wrote:

> Hi everyone!
>
> Decided to give hacking on clang a try, as I'm very much interested in
> compilers and languages and so forth.  I started out by trying to
> compile a small C program of mine that exercises a good chunk of the
> language.

Cool!

>
> Various GNU/Linux headers include the stddef.h header, which is
> in /usr/include/linux, which isn't in the system header search path.
> So, as a "hello everyone" gift, here's my first patch for the project.
> Clearly it's the most awesome patch ever, what with it being a whole
> single line in a part of a file marked as "need's to be replaced."  :)

Are you sure that this is the problem?  Can you please run "gcc -v  
test.c -c" on something?  on my linux box, I get:

#include "..." search starts here:
#include <...> search starts here:
  /usr/local/include
  /usr/lib/gcc/i586-mandriva-linux-gnu/4.0.1/include
  /usr/include
End of search list.

do you see /usr/include/linux?

> Next up is to figure out why both time_t and size_t result in a  
> variety
> of comical errors such as:
>
> ///usr/include/linux/time.h:10:2: error: type name requires a  
> specifier
> or qualifier
>        time_t  tv_sec;         /* seconds */
>        ^
>
> Out of the pages and pages of errors, almost all of them are either
> errors from time_t or size_t, so I figure fixing whatever that is will
> get me pretty close to compiling this little program.

If you send a .i file (produced with clang -E test.c > test.i), I can  
take a look.

> I'm also rather tempted to go fix whatever is causing that extra // at
> the start of the file path in the errors.  :)

:) Go for it!

-Chris



More information about the cfe-dev mailing list