From patchwork Mon Feb 20 20:14:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai Tietz X-Patchwork-Id: 142185 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 4FBC7B6F9F for ; Tue, 21 Feb 2012 07:15:47 +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=1330373748; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Received-SPF:Received:MIME-Version:Received:Received:Date: Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=xVlkxLaSZgytUklbqfnm3UMlumw=; b=U847dCFNy+YB3ryja/N/TkqaP4v32FjVYU+Lcn/p9nyez1logWok/tKC6JMr7S Gj0Th0EQn6fjfFJZipvogjZKnc+UPosgdte/iBcYs2cpiov8f1HLfYmTTyyQjTTW 6H8HG4ob6hurFr1BteZutT6NldBschDiKfxBl1U8QaJpE= 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-SPF:Authentication-Results:Received:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Cc:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=DA9PjISPFuJuAQ0BN8IHH7xXiIjWXfUzvhm3blHR+GhgXupxh4RFNmH5XbfXxa sL/gfG3MvhM5wuzM6jCnlIcdeDjHD8EeF+hfqogJxZGgpcrsg5Teh8NMBh7yZ5Yq dtIrq+8KmToIHQXa34rc9uTiZTWSmzouQfYqAshHFPS6E=; Received: (qmail 13364 invoked by alias); 20 Feb 2012 20:15:22 -0000 Received: (qmail 13268 invoked by uid 22791); 20 Feb 2012 20:15:07 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-tul01m020-f175.google.com (HELO mail-tul01m020-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 20 Feb 2012 20:14:53 +0000 Received: by obhx4 with SMTP id x4so8014439obh.20 for ; Mon, 20 Feb 2012 12:14:53 -0800 (PST) Received-SPF: pass (google.com: domain of ktietz70@googlemail.com designates 10.60.22.228 as permitted sender) client-ip=10.60.22.228; Authentication-Results: mr.google.com; spf=pass (google.com: domain of ktietz70@googlemail.com designates 10.60.22.228 as permitted sender) smtp.mail=ktietz70@googlemail.com; dkim=pass header.i=ktietz70@googlemail.com Received: from mr.google.com ([10.60.22.228]) by 10.60.22.228 with SMTP id h4mr10365170oef.57.1329768893366 (num_hops = 1); Mon, 20 Feb 2012 12:14:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.60.22.228 with SMTP id h4mr8924853oef.57.1329768893326; Mon, 20 Feb 2012 12:14:53 -0800 (PST) Received: by 10.182.33.103 with HTTP; Mon, 20 Feb 2012 12:14:53 -0800 (PST) Date: Mon, 20 Feb 2012 21:14:53 +0100 Message-ID: Subject: [patch gthr.h]: Fix PR libstdc++/52300 Gthreads functions linking error at dynamic linking with libstdc++ when using MinGW. From: Kai Tietz To: GCC Patches Cc: Richard Henderson 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, this patch fixes for mingw target gthread-linking issues about weak-symbols. The issue is that pe-coff's weak support is partial present, but it isn't fully compatible to ELF-version. For static libraries it works in this case equivalent, but for shared (DLL) version it doesn't. Therefore it makes sense to disable in gthread the use of WEAK. This patch fixes libstdc++ and OpenMP issues we recognized using POSIX-threading API. ChangeLog libgcc/ 2012-02-20 Kai Tietz PR libstdc++/52300 * gthr.h (GTHREAD_USE_WEAK): Define as zero for mingw. Tested for i686-w64-mingw32, x86_64-w64-mingw32, and regression-tested for x86_64-unkown-linux-gnu. Ok for apply? Regards, Kai Index: gthr.h =================================================================== --- gthr.h (revision 184333) +++ gthr.h (working copy) @@ -135,6 +135,14 @@ */ #if SUPPORTS_WEAK +/* The pe-coff weak support isn't fully compatible to ELF's weak. + For static libraries it might would work, but as we need to deal + with shared versions too, we disable it for mingw-targets. */ +#ifdef __MINGW32__ +#undef GTHREAD_USE_WEAK +#define GTHREAD_USE_WEAK 0 +#endif + #ifndef GTHREAD_USE_WEAK #define GTHREAD_USE_WEAK 1 #endif