[Mesa-dev] LLVM_CFLAGS

Dan Nicholson dbn.lists at gmail.com
Mon Dec 6 09:41:47 PST 2010


On Mon, Dec 6, 2010 at 9:15 AM, Brian Paul <brianp at vmware.com> wrote:
> On 12/05/2010 02:06 AM, Bob Gleitsmann wrote:
>>
>> Hello,
>>
>> Can someone explain the value of including this in
>> mesa/src/gallium/Makefile.template:
>>
>> ifeq ($(MESA_LLVM),1)
>> LIBRARY_DEFINES += $(LLVM_CFLAGS)
>> endif
>>
>> ?
>> This effectively adds the LLVM cflags to gcc compiles if LLVM is enabled.
>> One
>> side-effect of this is to include -O3 optimization no matter what, making
>> debugging very difficult. Removing it seems to have no catastrophic
>> effects (or
>> even detectable ones).
>> But maybe I am missing something.
>
> We need some of the LLVM C flags to get the -I path for headers, for
> example.
>
> I think we should use llvm-config --cppflags instead of --cflags.
>
> If you're using autoconf, try changing this line:
>
>        LLVM_CFLAGS=`$LLVM_CONFIG --cflags`
>
> in configure.ac to use --cppflags instead.  Does that help?

I think the question is, what else is in llvm-config --cflags? If all
that's needed is the include paths, then --cppflags would be
sufficient. However, if there are macro definitions or compiler flags
(e.g. -fomit-frame-pointer) in --cflags that are needed to properly
use llvm, then I guess you need --cflags. This is really a bug in
llvm, but the last time someone here tried to bring it up to the llvm
people, it was dismissed. Here's that bug:

http://llvm.org/bugs/show_bug.cgi?id=8220

There's some more in the mesa archives, but I can't find the thread
now. Sadly, that bug became a discussion about pkg-config which was
not what was intended.

--
Dan


More information about the mesa-dev mailing list