[Mesa-dev] [PATCHES] clang compatibility

nobled nobled at dreamwidth.org
Sun Aug 29 17:03:37 PDT 2010

Eric Anholt <eric at anholt.net> wrote:
> On Sun, 22 Aug 2010 05:35:19 -0400, nobled <nobled at dreamwidth.org> wrote:
>> The first three attached patches make it possible to compile Mesa with
>> LLVM/Clang:
>> 1. Add -lstdc++ when linking glsl_compiler and glcpp
>> 2. Move -lstdc++ from the Gallium-specific Makefile.dri to
>> DRI_LIB_DEPS in configure (fixes linking classic Mesa drivers)
>> 3. Since autoconf gives GCC=yes even when using clang (since it just
>> tests for the __GNUC__ macro), don't check for a minimum version of
>> 3.3 if $(CC) points to a clang executable. (unfortunately I'm not sure
>> how to properly detect clang, short of test-compiling a file that
>> contains #ifdef __clang__. I.e. if $(CC) = 'cc', and 'cc' is an
>> alternatives symlink to llvm-clang, this doesn't detect that case.)
> From #llvm:
> <anholt> is it intended that when linking a c++ app with clang that -lstdc++ has to be explicitly specified?
> <aKor> anholt: link via clang++
> <aKor> :)
> <nicholas> yes, same as with gcc. try linking with clang++ instead.
> <anholt> ah, my 2.7 clang packages don't come with a clang++ binary
> <dgregor> anholt: don't use 2.7 for C++. For c++, you'll need to use
> clang from Subversion
> <dgregor> anholt: adding -lstdc++ is the wrong solution. clang++ is just
> a symlink to clang, by the way. you can add it yourself

Point. So scratch the first two patches. And #4 is obsolete now. But
Mesa *does* need a version of #3 to work (much better version

And can
> 5. program: Fix struct/class confusion
> 6. dr/radeon: Fix printf format
> 7. llvmpipe: Fix memory leak
go in?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0010-Make-configure-work-with-clang.patch
Type: text/x-patch
Size: 1106 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100829/9c72e525/attachment.bin>

More information about the mesa-dev mailing list