Bug 75505 - [clover] Build failure with clang 3.4 and libc++
Summary: [clover] Build failure with clang 3.4 and libc++
Status: RESOLVED NOTOURBUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: 10.1
Hardware: x86-64 (AMD64) FreeBSD
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-25 18:35 UTC by Jean-Sébastien Pédron
Modified: 2014-02-25 21:12 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Build failure with clang 3.4 (7.17 KB, text/plain)
2014-02-25 18:35 UTC, Jean-Sébastien Pédron
Details

Description Jean-Sébastien Pédron 2014-02-25 18:35:24 UTC
Created attachment 94726 [details]
Build failure with clang 3.4

Clover from Mesa 10.1-rc2 fails to build when using clang 3.4 and libc++, instead of GCC 4.7+ and libstdc++.
 
I first apply the patch available in #74098, 3rd comment to fix a previous build failure.

The output is attached.
Comment 1 Jean-Sébastien Pédron 2014-02-25 20:13:36 UTC
I found out a difference between GCC's "functional" header and libc++'s one:

  - in GCC, all "operator()" methods are const:
    operator()(...) const

  - in libc++, they aren't:
    operator() (_ArgTypes&&... __args)

Changing the above line to:
  operator() (_ArgTypes&&... __args) const
fixes the build.

I have zero knowledge of C++, so I'm not sure that's a valid fix.
Comment 2 Francisco Jerez 2014-02-25 21:12:55 UTC
(In reply to comment #1)
> I found out a difference between GCC's "functional" header and libc++'s one:
> 
>   - in GCC, all "operator()" methods are const:
>     operator()(...) const
> 
>   - in libc++, they aren't:
>     operator() (_ArgTypes&&... __args)
> 
> Changing the above line to:
>   operator() (_ArgTypes&&... __args) const
> fixes the build.
> 
> I have zero knowledge of C++, so I'm not sure that's a valid fix.

Right, this is a bug in libc++'s implementation of mem_fn().  It seems to have been fixed already in r199848.  You should try a more recent version of libc++.

Thanks.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.