From patchwork Sun Sep 7 18:12:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 386735 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 930121400D5 for ; Mon, 8 Sep 2014 04:12:25 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=N9U1tpdlimpQQRamW C+pWyu8giBQw2FhO82406/7Lrw9COe2HnpouDPLRA1f1Nq1PKbXctPBmIHbpgAc6 L4i18JoOaag3Nz9EchoTJgHPQWrOQf4/pgy1Gqxyd7ejPBtLlYf6nN0tT3Njb4IY kxcDiZcYeBA8fAAPfKBriTMAwk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=lmloXOBsxR0blsbKNsDUayi fXCs=; b=mds7AT9DrIK5Csesl9nbaZHwTKEcsX41hj68iv4SislsuQie/y3YM7l P5eY+sxK7irjYpxJmWFARAwTRVx+kBj6Jli4K6Nd4KdUV3SjMhTRPwCSBZn9m3D4 qzEg/M8cz6MAOKCVuqsg9YdHpVhJwWLCOW9fyOQPE3m6WqQcUclE= Received: (qmail 11354 invoked by alias); 7 Sep 2014 18:12:18 -0000 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 Received: (qmail 11342 invoked by uid 89); 7 Sep 2014 18:12:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qc0-f178.google.com Received: from mail-qc0-f178.google.com (HELO mail-qc0-f178.google.com) (209.85.216.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 07 Sep 2014 18:12:16 +0000 Received: by mail-qc0-f178.google.com with SMTP id x13so14440130qcv.37 for ; Sun, 07 Sep 2014 11:12:13 -0700 (PDT) X-Received: by 10.224.30.14 with SMTP id s14mr27742155qac.70.1410113533852; Sun, 07 Sep 2014 11:12:13 -0700 (PDT) Received: from ?IPv6:2601:6:8380:343:a2a8:cdff:fe3e:b48? ([2601:6:8380:343:a2a8:cdff:fe3e:b48]) by mx.google.com with ESMTPSA id l7sm5873715qaf.16.2014.09.07.11.12.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 07 Sep 2014 11:12:12 -0700 (PDT) Message-ID: <540C9FFA.1080807@acm.org> Date: Sun, 07 Sep 2014 14:12:10 -0400 From: Nathan Sidwell User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 MIME-Version: 1.0 To: "roger@nextmovesoftware.com" CC: GCC Patches Subject: Re: fix gfcov regression References: In-Reply-To: X-IsSubscribed: yes On 09/05/14 03:06, roger@nextmovesoftware.com wrote: > ../../../../gcc/libgcc/libgcov-interface.c:137:1: warning: alias definitions not > supported in Mach-O; ignored > ALIAS (__gcov_reset_int, __gcov_reset); That doesn't sound like it's going to work then. I've gone with the attached patch. If someone wants to invest time using an alias on targets that support it, that'd be great! nathan 2014-09-05 Nathan sidwell * libgcov-interface.c (STRONG_ALIAS): Rename to ... (ALIAS_weak): ... here. Use forwarding function. Adjust uses. Index: libgcc/libgcov-interface.c =================================================================== --- libgcc/libgcov-interface.c (revision 214972) +++ libgcc/libgcov-interface.c (working copy) @@ -42,11 +42,14 @@ void __gcov_dump (void) {} #else - /* Some functions we want to bind in this dynamic object, but have an - overridable global alias. */ -#define STRONG_ALIAS(src,dst) \ - extern __typeof (src) dst __attribute__((alias (#src))) + overridable global alias. Unfortunately not all targets support + aliases, so we just have a forwarding function. That'll be tail + called, so the cost is a single jump instruction.*/ + +#define ALIAS_void(src,dst) \ + void dst (void) \ + { src (); } extern __gthread_mutex_t __gcov_flush_mx ATTRIBUTE_HIDDEN; extern __gthread_mutex_t __gcov_flush_mx ATTRIBUTE_HIDDEN; @@ -133,7 +136,7 @@ __gcov_reset_int (void) __gcov_root.dumped = 0; } -STRONG_ALIAS (__gcov_reset_int, __gcov_reset); +ALIAS_void (__gcov_reset_int, __gcov_reset); #endif /* L_gcov_reset */