From owner-freebsd-ports@FreeBSD.ORG Tue Jul 10 07:18:15 2012 Return-Path: Delivered-To: freebsd-ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF2531065672 for ; Tue, 10 Jul 2012 07:18:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 4DE528FC19 for ; Tue, 10 Jul 2012 07:18:15 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:f5a1:37a7:b01a:4353] (unknown [IPv6:2001:7b8:3a7:0:f5a1:37a7:b01a:4353]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 861BB5C37; Tue, 10 Jul 2012 09:18:13 +0200 (CEST) Message-ID: <4FFBD734.5030909@FreeBSD.org> Date: Tue, 10 Jul 2012 09:18:12 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120619 Thunderbird/14.0 MIME-Version: 1.0 To: freebsd-ports@FreeBSD.org References: <4FF15A89.3000204@eskk.nu> <4FF2E349.5000202@FreeBSD.org> <20120704191351.GB70705@server.rulingia.com> <4FF49F51.8070600@FreeBSD.org> In-Reply-To: <4FF49F51.8070600@FreeBSD.org> X-Enigmail-Version: 1.5a1pre Content-Type: multipart/mixed; boundary="------------040909020304060906050701" Cc: Peter Jeremy , Leslie Jensen Subject: Re: make failed for editors/libreoffice X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 07:18:15 -0000 This is a multi-part message in MIME format. --------------040909020304060906050701 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 2012-07-04 21:53, Dimitry Andric wrote: > On 2012-07-04 21:13, Peter Jeremy wrote: >> On 2012-Jul-03 14:19:21 +0200, Dimitry Andric wrote: >>> On 2012-07-02 10:23, Leslie Jensen wrote: >>> ... >>>> Assertion failed: (EST != EST_Delayed && EST != EST_Uninstantiated), >>>> function isNothrow, file >>>> /usr/ports/lang/clang/work/llvm-3.1.src/tools/clang/lib/CodeGen/../../include/clang/AST/Type.h, >>>> line 2873. ... > I have been mailed a set of .ii files, and I was able to reproduce the > assert, not only with clang 3.1 release, but also with clang trunk, > unfortunately. So it seems a regression; it only happens when you pass > -std=gnu++11 (or c++11). > > I'm reducing the testcase as I mail this, and I will add it to > http://llvm.org/bugs/show_bug.cgi?id=12763 (which seems to be the most > likely bug report for this). It turned out this particular bug was yet another issue, but it was fixed by upstream now. I have a patch ready for -CURRENT, but if anyone can try it out, and confirm it now allows you to build LibreOffice without this particular assertion, that would be great. :) Apply attached patch to your src tree, then build and install clang as follows (or just do a buildworld/installworld, if you have CPU to spare): make -C /usr/src/lib/clang all make -C /usr/src/usr.bin/clang/clang all install Then retry building the LibreOffice port. Any feedback appreciated! --------------040909020304060906050701 Content-Type: text/x-diff; name="clang-trunk-r159895.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="clang-trunk-r159895.diff" Pull in r159895 from upstream clang trunk: When marking virtual functions as used for a class' vtable, mark all functions which will appear in the vtable as used, not just those ones which were declared within the class itself. Fixes an issue reported as comment#3 in PR12763 -- we sometimes assert in codegen if we try to emit a reference to a function declaration which we've not marked as referenced. This also matches gcc's observed behavior. This should fix clang assertions when building certain components of the LibreOffice port. Index: contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp =================================================================== --- contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp (revision 238149) +++ contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp (working copy) @@ -10937,14 +10937,23 @@ bool Sema::DefineUsedVTables() { void Sema::MarkVirtualMembersReferenced(SourceLocation Loc, const CXXRecordDecl *RD) { - for (CXXRecordDecl::method_iterator i = RD->method_begin(), - e = RD->method_end(); i != e; ++i) { - CXXMethodDecl *MD = *i; + // Mark all functions which will appear in RD's vtable as used. + CXXFinalOverriderMap FinalOverriders; + RD->getFinalOverriders(FinalOverriders); + for (CXXFinalOverriderMap::const_iterator I = FinalOverriders.begin(), + E = FinalOverriders.end(); + I != E; ++I) { + for (OverridingMethods::const_iterator OI = I->second.begin(), + OE = I->second.end(); + OI != OE; ++OI) { + assert(OI->second.size() > 0 && "no final overrider"); + CXXMethodDecl *Overrider = OI->second.front().Method; - // C++ [basic.def.odr]p2: - // [...] A virtual member function is used if it is not pure. [...] - if (MD->isVirtual() && !MD->isPure()) - MarkFunctionReferenced(Loc, MD); + // C++ [basic.def.odr]p2: + // [...] A virtual member function is used if it is not pure. [...] + if (!Overrider->isPure()) + MarkFunctionReferenced(Loc, Overrider); + } } // Only classes that have virtual bases need a VTT. --------------040909020304060906050701--