From owner-freebsd-ports@FreeBSD.ORG Fri Oct 18 10:23:15 2013 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8098C6FB for ; Fri, 18 Oct 2013 10:23:15 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay009.isp.belgacom.be (mailrelay009.isp.belgacom.be [195.238.6.176]) by mx1.freebsd.org (Postfix) with ESMTP id 1706D2333 for ; Fri, 18 Oct 2013 10:23:14 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Am4GACULYVJbsXIr/2dsb2JhbABagwc4vmmBJBd0giUBAQU6HCMQCw4KCSUPKhABDQaIHcBlj1EHhCkDmAiBMJBYgyY6 Received: from 43.114-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.114.43]) by relay.skynet.be with ESMTP; 18 Oct 2013 12:22:06 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.7/8.14.7) with ESMTP id r9IAM4fh026208; Fri, 18 Oct 2013 12:22:05 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Fri, 18 Oct 2013 12:22:04 +0200 From: Tijl Coosemans To: Shane Ambler Subject: Re: Need some help debugging c++ code for 10.0 Message-ID: <20131018122204.5ec6ce9f@kalimero.tijl.coosemans.org> In-Reply-To: <20131008160329.729e5518@kalimero.tijl.coosemans.org> References: <5252BA55.5070806@ShaneWare.Biz> <20131008160329.729e5518@kalimero.tijl.coosemans.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: FreeBSD-ports X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Oct 2013 10:23:15 -0000 On Tue, 8 Oct 2013 16:03:29 +0200 Tijl Coosemans wrote: > On Tue, 08 Oct 2013 00:12:45 +1030 Shane Ambler wrote: >> Hi there, I am the port maintainer for opencolorio, openimageio and >> openshadinglanguage. These build and run on 9.2 with clang 3.3 but I >> have an issue on 10.0. I don't have much programming experience and even >> less with c++ which all 3 use. >> >> After ocio and oiio are installed building osl generates oslc (the osl >> script compiler) and then runs it to pre-compile the included scripts. >> This step fails on 10.0 >> >> I am fairly sure that the issue is within the ustring class - full code >> can be viewed at github.com/OpenImageIO/oiio with src/include/ustring.h >> having some info about the class. >> >> The following is from src/libutil/ustring.cpp for ustrings constructor >> >> #if defined(__GNUC__) >> // We don't want the internal 'string str' to redundantly store the >> // chars, along with our own allocation. So we use our knowledge of >> // the internal structure of gcc strings to make it point to our chars! >> // Note that we've carefully structured the TableRep fields so they >> // mimic a GCC basic_string::_Rep. >> // >> // It turns out that the first field of a gcc std::string is a >> // pointer to the characters within the basic_string::_Rep. We >> // merely redirect that pointer, though for std::string to function >> // properly, the chars must be preceeded immediately in memory by >> // the rest of basic_string::_Rep, consisting of length, capacity >> // and refcount fields. And we have designed our TableRep to do >> // just that! So now we redirect the std::string's pointer to our >> // own characters and its mocked-up _Rep. >> // >> // See /usr/include/c++/VERSION/bits/basic_string.h for the details >> // of gcc's std::string implementation. >> >> *(const char **)&str = c_str(); >> DASSERT (str.c_str() == c_str()); >> #else >> // Not gcc -- just assign the internal string. This will result in >> // double allocation for the chars. If you care about that, do >> // something special for your platform, much like we did for gcc >> // above. (Windows users, I'm talking to you.) >> str = s; >> #endif >> >> When the osl build starts to precompile the bundled osl scripts oslc >> triggers the DASSERT (which is line 137) shown above. If I adjust the >> #if (and the matching destructor) so the non-gcc fallback is used, osl >> still fails just without the assert message. > > There's a third __GNUC__ case in that header. Unlike the first two > it's ifNdef though so you need to change it into something like: > > #if !defined(__GNUC__) || defined(_LIBCPP_VERSION) Have you managed to get this working? I just noticed opencolorio is a dependency of Calligra (KDE office suite) which would be nice to have in FreeBSD 10.0.