[Mesa-dev] [PATCH] clover: Fix building with latest llvm

Bruno Jimenez brunojimen at gmail.com
Sun Mar 2 02:17:36 PST 2014


On Sun, 2014-03-02 at 04:26 -0500, Ilia Mirkin wrote:
> On Sat, Mar 1, 2014 at 7:35 PM, Francisco Jerez <currojerez at riseup.net> wrote:
> > Bruno Jiménez <brunojimen at gmail.com> writes:
> >
> >> Recently, llvm has changed to use c++11, so we also should use it
> >> ---
> >>  src/gallium/state_trackers/clover/Makefile.am | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/src/gallium/state_trackers/clover/Makefile.am b/src/gallium/state_trackers/clover/Makefile.am
> >> index ece2b38..cc9311c 100644
> >> --- a/src/gallium/state_trackers/clover/Makefile.am
> >> +++ b/src/gallium/state_trackers/clover/Makefile.am
> >> @@ -37,7 +37,7 @@ libcltgsi_la_SOURCES = \
> >>       tgsi/compiler.cpp
> >>
> >>  libclllvm_la_CXXFLAGS = \
> >> -     -std=c++98 \
> >> +     -std=c++11 \
> >
> > I think this will break earlier versions of LLVM in subtle ways --
> > mainly because the C++98 and C++11 standard libraries are not guaranteed
> > to be binary compatible with each other.  We should probably use
> > LLVM_CXXFLAGS to detect which -std flag LLVM was built with and make
> > sure we use the same.
> >
> >>       $(VISIBILITY_CXXFLAGS) \
> >>       $(LLVM_CPPFLAGS) \
> >>       $(DEFINES) \
> >> @@ -49,7 +49,7 @@ libclllvm_la_SOURCES = \
> >>       llvm/invocation.cpp
> >>
> >>  libclover_la_CXXFLAGS = \
> >> -     -std=c++0x \
> >> +     -std=c++11 \
> >
> > This looks good to me (though it's not strictly related to fixing LLVM).
> 
> Not sure if it's a concern, but I think gcc only supports std=c++11
> starting with 4.7. (Not a huge deal for me -- gentoo marked 4.7 as
> stable a while back, but it might be for others.)
> 
>   -ilia

I don't know if there's going to be a lot of people trying to build
clover with a recent version of llvm and a compiler that doesn't support
c++11. But maybe in that case, the option should be disabled.

Francisco, I'm afraid that my knowledge of autotools is NULL but I will
try.

Thanks!
Bruno



More information about the mesa-dev mailing list