Re: Are clang++ and libc++ compatible?

From: Tijl Coosemans <tijl_at_coosemans.org>
Date: Tue, 12 Nov 2013 22:19:46 +0100
On Tue, 12 Nov 2013 12:19:22 -0800 Steve Kargl wrote:
> On Tue, Nov 12, 2013 at 09:55:56AM -0800, Steve Kargl wrote:
>> On Tue, Nov 12, 2013 at 06:37:39PM +0100, Dimitry Andric wrote:
>>> On 12 Nov 2013, at 17:54, Steve Kargl <sgk_at_troutmask.apl.washington.edu> wrote:
>>>> 
>>>>      struct Entry {
>>>>        time_t date;
>>>>        Severity severity;
>>>>        std::deque<Entry> messages;
>>>>        std::string message;
>>>>        bool is_child;
>>>>        Entry() : is_child(false) { }
>>>>      };
>>> 
>>> I think the problem is that the code tries to use std::deque<Entry> as a
>>> member of struct Entry, before it is completely defined.  This is not
>>> allowed by the standard, although some libraries (e.g. GNU libstdc++)
>>> apparently permit it for some container types.
>>> 
>>> You could try to work around it with -fdelayed-template-parsing, but I
>>> am not sure if it will help.  Alternatively, compile the code with
>>> libstdc++, or rewrite it to conform. :-)
>> 
>> Thanks for the suggestions.  -fdelayed-template-parsing did not
>> help.  (Un)fortunately, I know very little about C++, so rewriting
>> the code is not option for me.  I guess I'll add a USE_GCC to the
>> port's Makefile to if it will build. 
>
> Sigh.  Adding USE_GCC isn't the solution.

There's a similar problem with graphics/blender.  There's a class
TreeElement which links to its parent TreeElement like this:

std::map<std::string, TreeElement>::const_iterator parent;

Works with libstdc++, fails with libc++.  If the standard doesn't
specify this it would still be a very convenient extension.

> % pan
> Segmentation fault (core dumped)
> % ldd /usr/local/bin/pan | grep ++
>         libstdc++.so.6 => /usr/local/lib/gcc46/libstdc++.so.6 (0x3c52bf000)
>         libc++.so.1 => /usr/lib/libc++.so.1 (0x3c81ea000)
> 
> This can't be good.  And, unfortunately, testing math/octave shows
> no better :(
> 
> % octave
> Segmentation fault (core dumped)
> % ldd /usr/local/bin/octave-3.6.4 | grep ++
>         libstdc++.so.6 => /usr/local/lib/gcc46/libstdc++.so.6 (0x3c92ec000)
>         libc++.so.1 => /usr/lib/libc++.so.1 (0x3c9801000)

This could be because you enabled the OPENMP option in math/fftw3.
Received on Tue Nov 12 2013 - 20:19:58 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:44 UTC