[Mesa-dev] cflags mess with llvm builds

Xavier Chantry chantry.xavier at gmail.com
Fri Sep 24 05:06:51 PDT 2010


When gallium llvm is enabled, configure.ac does the following :
LLVM_CFLAGS=`$LLVM_CONFIG --cflags`

This is the result on my system :
-I/usr/include  -DNDEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS
-D__STDC_CONSTANT_MACROS -O2 -fomit-frame-pointer -fPIC

I specifically set -O0 to easier gdb debugging and
-fno-omit-frame-pointer to use some profiling tools, but they were
both silently overridden by llvm cflags.

Also scons/llvm.py only uses cppflags, not cflags, which at least
gives a better result
 llvm-config --cppflags : -I/usr/include  -DNDEBUG -D_GNU_SOURCE
-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS

then src/gallium/Makefile.template has :
ifeq ($(MESA_LLVM),1)
LIBRARY_DEFINES += $(LLVM_CFLAGS)
endif

Do we want / need these definitions for all the code in src/gallium,
or is it possible to add them only in the parts that do use llvm and
need the definitions from llvm-config --cppflags ?

I found it weird that enabling or disabling gallium llvm resulted in
nv50 gallium built with different gcc flags.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-configure.ac-use-llvm-config-cppflags-instead-of-cfl.patch
Type: text/x-patch
Size: 1204 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100924/6b12906e/attachment.bin>


More information about the mesa-dev mailing list