[Mesa-dev] [PATCH] gallium/auxiliary: Fix build with newer LLVM.

Johannes Obermayr johannesobermayr at gmx.de
Mon Nov 19 12:00:07 PST 2012


Am Montag, 12. November 2012, 15:44:36 schrieb Tom Stellard:
> On Fri, Nov 09, 2012 at 01:56:44PM +0000, Tom Stellard wrote:
> > On Sun, Oct 28, 2012 at 03:58:14AM -0700, Jose Fonseca wrote:
> > > We use LLVM in a few other directories. Shouldn't we be putting this a bit higher up? For example in LLVM_CXXFLAGS?
> > > 
> > > I just noticed that src/gallium/state_trackers/clover uses exceptions. So this won't fly everywhere...
> > >
> > 
> > I don't think -fno-exceptions is required to fix the build, just
> > -fno-rtti, which I think is only necessary when you are sub-classing
> > LLVM classes.  gallivm looks to be the only place that sub-classes LLVM
> > classes (drivers/radeon does this too, but its build has been temporarily
> > disabled).
> > 
> > However, I think the real issue may be that LLVM_CXXFLAGS are missing
> > from CXXFLAGS.  LLVM_CXXFLAGS should have -fno-rtti.
> > 
> > Does the attached patch fix the problem?
> >

Output of llvm-config --cxxflags does not have -fno-rtti (snapshot as of 20121117.1759):

$ llvm-config --cxxflags
-I/usr/include -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g  -fPIC -fvisibility-inlines-hidden -O2 -g  -D_GNU_SOURCE -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS

But with the attached patch it builds again :-)

> 
> If there are no objections, I'm going to commit this patch later today.
> This build breakage is blocking several important radeonsi fixes, and I
> would like to get it resolved.
> 
> -Tom
> 
> 
> > From 9639dea17e96aa8c59046117015b861fd0c0584e Mon Sep 17 00:00:00 2001
> > From: Tom Stellard <thomas.stellard at amd.com>
> > Date: Fri, 9 Nov 2012 07:59:33 -0500
> > Subject: [PATCH] auxillary: Append LLVM_CXXFLAGS to CXXFLAGS
> > 
> > ---
> >  src/gallium/auxiliary/Makefile |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> > 
> > diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile
> > index 3ba3f9c..dc28003 100644
> > --- a/src/gallium/auxiliary/Makefile
> > +++ b/src/gallium/auxiliary/Makefile
> > @@ -13,6 +13,7 @@ C_SOURCES += \
> >  	$(GALLIVM_SOURCES)
> >  CPP_SOURCES += \
> >  	$(GALLIVM_CPP_SOURCES)
> > +CXXFLAGS += $(LLVM_CXXFLAGS)
> >  endif
> >  
> >  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20121119/4be73a40/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Make-sure-LLVM_CXXFLAGS-has-fno-rtti-on-LLVM-3.2.patch
Type: text/x-patch
Size: 1017 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20121119/4be73a40/attachment-0001.bin>


More information about the mesa-dev mailing list