Build problems, LLVM 2.0's GCC front-end.

I’m getting behaviour I don’t understand from my attempt to build the GCC front end under Ubuntu Edgy. Everything seems to work fine until I hit this:

stage1/xgcc -Bstage1/ -B/home/michael/software/i686-pc-linux-gnu/bin/ -c -O2 -g -fomit-frame-pointer -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -DHAVE_CONFIG_H -I. -Iobjc -I../../gcc -I../../gcc/objc -I../../gcc/../include -I../../gcc/../libcpp/include ../../gcc/objc/objc-act.c -o objc/objc-act.o
../../gcc/objc/objc-act.c: In function ‘objc_init’:
../../gcc/objc/objc-act.c:714: warning: empty body in an if-statement
../../gcc/objc/objc-act.c: In function ‘objc_init_exceptions’:
../../gcc/objc/objc-act.c:7638: error: ‘darwin_macosx_version_min’ undeclared (first use in this function)
../../gcc/objc/objc-act.c:7638: error: (Each undeclared identifier is reported only once
../../gcc/objc/objc-act.c:7638: error: for each function it appears in.)
../../gcc/objc/objc-act.c: In function ‘generate_v2_shared_structures’:
../../gcc/objc/objc-act.c:11925: warning: signed and unsigned type in conditional expression
make[2]: *** [objc/objc-act.o] Error 1
make[2]: Leaving directory /home/michael/Development/llvm-gcc4-2.0.source/build/gcc’ make[1]: *** [stage2_build] Error 2 make[1]: Leaving directory /home/michael/Development/llvm-gcc4-2.0.source/build/gcc'
make: *** [bootstrap] Error 2

Now I have absolutely no idea why it’s doing ANYTHING at all with darwin_macosx_ given that it seems to have correctly identified earlier that I’m on an i686-pc-linux-gnu system. (The command line kind of gives me a hint that it figured that out.) I don’t see anything in the configure script that helps with this. What’s more, I don’t see anything in the configure script that allows me to turn off Objective-C, despite the fact I’ll never actually use that language. How can I either turn off Objective-C (and bypass the error) or get it to stop trying to compile MacOS-specific code?

Hi,

I don't see anything in the configure script that allows me to turn off
Objective-C, despite the fact I'll never actually use that language.
How can I either turn off Objective-C (and bypass the error) or get it
to stop trying to compile MacOS-specific code?

Try to configure with switch --enable-languages=c,c++.

Wojtek

As was mentioned, please configure with --enable-languages=c,c++. More generally, make sure you follow the instructions in README.LLVM at the top of the llvm-gcc source tree.

-Chris

Chris,

As was mentioned, please configure with --enable-languages=c,c++.
More generally, make sure you follow the instructions in README.LLVM
at the top of the llvm-gcc source tree.

I think my objc-unbreak patch for 4.2 should be applied to 4.0 as well.
I'll investigate.