From patchwork Tue Feb 5 16:10:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 218286 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id EEFEF2C02B3 for ; Wed, 6 Feb 2013 03:11:10 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1360685471; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Message-ID:Date:From:User-Agent:MIME-Version: To:CC:Subject:References:In-Reply-To:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=7gZA12CQsE2+XanPejdp7a52d0w=; b=aqj7DwtigfixEhrjIlgjAsz6xuOm9DohwwJpeCb8hiduZptJ1GrCYh6indQmb5 4H22Zl5T7NMgSnLbVw8OVDxarxBd4WgHe41R5BpTyS4Q7V7nKLZmoEsJxU9VzMtN B9jwdd98FlUKYWHjZMEd5311ySKyMn386WN3MHkSybS5s= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=OOmBZveDm+SQuvV060gZoLYQnHyIXSJuTc/N3DsX6HTSq4+7wfffO4DI/H49Tp 3HaXKMolSPMxRta1PABjyZaiY8Eu+GSEmzsHbGQbl1MDpYI7O0/aQ9K2AwWJpYuK Jf0HoG35xo3l4xxlFmoX+tmG1sfeaccH6OOKA4sQVyGKE=; Received: (qmail 17274 invoked by alias); 5 Feb 2013 16:10:58 -0000 Received: (qmail 17255 invoked by uid 22791); 5 Feb 2013 16:10:55 -0000 X-SWARE-Spam-Status: No, hits=-5.2 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED, RCVD_IN_HOSTKARMA_NO, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 05 Feb 2013 16:10:51 +0000 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r15GAniq011723 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 5 Feb 2013 16:10:50 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r15GAmqY002987 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 5 Feb 2013 16:10:48 GMT Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id r15GAlFW016466; Tue, 5 Feb 2013 10:10:47 -0600 Received: from [192.168.1.4] (/79.33.220.94) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 05 Feb 2013 08:10:47 -0800 Message-ID: <51112F05.2070404@oracle.com> Date: Tue, 05 Feb 2013 17:10:45 +0100 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2 MIME-Version: 1.0 To: Dodji Seketeli CC: GCC Patches , =?UTF-8?B?RnJhbsOnb2lzIER1bW9u?= =?UTF-8?B?dA==?= , Jonathan Wakely , Benjamin De Kosnik Subject: Re: [PATCH] Add missing explicit instantiation for std::lower_bound template References: <8738xcm5xc.fsf@redhat.com> In-Reply-To: <8738xcm5xc.fsf@redhat.com> X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi Dodji, On 02/04/2013 04:53 PM, Dodji Seketeli wrote: > Hello, > > Since commit r195676[1], it looks like > libstdc++-v3/src/c++11/hashtable_c++0x.cc is missing an explicit > instantiation for std::lower_bound. This leads to libstdc++.so having > the symbol for that (missing) instantiation be undefined, thus > preventing executables from being linked with libstdc++. Note that I can confirm this only if I build with less optimization than the default -O2, say -O. That may explain why nobody noticed earlier. > The patchlet below seems to fixed the issue for me. Indeed, I think we want something like that. Thanks. In terms of nits, formatting and types (who knows, maybe on some systems a std::size_t is an unsigned long long), I would write something like the attached. Please double check that it works for you and go ahead. Thanks again, Paolo. ////////////////// Index: hashtable_c++0x.cc =================================================================== --- hashtable_c++0x.cc (revision 195759) +++ hashtable_c++0x.cc (working copy) @@ -94,4 +94,11 @@ namespace __detail _GLIBCXX_END_NAMESPACE_VERSION } // namespace __detail + + // Instantiation. + template + const unsigned long* + lower_bound(const unsigned long*, + const unsigned long*, + const size_t&); } // namespace std