Bug#744792: clang-3.4: unusable with libstdc++ from gcc 4.9

Jason Rhinelander jagerman at jagerman.com
Fri May 9 14:38:56 UTC 2014


Hi,

Sylvestre Ledru wrote:
> On 14/04/2014 21:40, Ben Longbons wrote:
>> Package: clang-3.4
>> Version: 1:3.4-2
>> Severity: grave
>> Justification: renders package unusable
>>
>> Dear Maintainer,
>>
>> clang 3.4 can't use libstdc++ 4.9's headers, due to changes in
>> <bits/c++config.h>
> Thanks for the bug report.
> For now, it is just normal severity:
> * we are still using gcc 4.8 as default

Indeed, and clang itself is still buildable with gcc 4.8, but that isn't 
the main issue here.

Rather the issue is that compiling user programs with clang breaks: 
C++11 code (and possibly other C++ standard levels, but I didn't test) 
that includes the <cstddef> header will fail to compile if the 
libstdc++-4.9-dev package is installed, which will happen, for instance, 
if someone installs g++-4.9.  I think this qualifies the bug as at least 
'important', if not 'grave'.

> * gcc 4.9 has not (yet) been released.

It has now been released, and is available in testing for most 
architectures.  I installed g++-4.9 to try it out; doing so broke 
compilation with clang++.

Upstream has discussed the problem and has fixes for it; it requires 
these two patches to llvm:

http://llvm.org/viewvc/llvm-project?view=revision&revision=201729
http://llvm.org/viewvc/llvm-project?view=revision&revision=201843

Upstream mailing list discussion regarding the two above changes is here:

http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-May/072711.html


I've applied the patches locally and can verify that they do solve the 
problem.  Here's a simple example of the error without the patches applied:

jagerman at loki:~$ cat test.cpp
#include <iostream>
#include <cstddef>
int main() { std::cout << "hi!\n"; }

jagerman at loki:~$ clang++ -std=c++11 test.cpp
In file included from test.cpp:2:
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/cstddef:51:11: 
error:
       no member named 'max_align_t' in the global namespace
   using ::max_align_t;
         ~~^
1 error generated.



Jason Rhinelander

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4255 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-llvm-team/attachments/20140509/69ccee0c/attachment.bin>


More information about the Pkg-llvm-team mailing list