From patchwork Thu Nov 17 16:19:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 82740 Delivered-To: patch@linaro.org Received: by 10.182.1.168 with SMTP id 8csp980559obn; Thu, 17 Nov 2016 08:20:02 -0800 (PST) X-Received: by 10.55.110.69 with SMTP id j66mr4810026qkc.92.1479399602816; Thu, 17 Nov 2016 08:20:02 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id g34si1146401qtc.112.2016.11.17.08.20.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Nov 2016 08:20:02 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-441838-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-441838-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-441838-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; q=dns; s=default; b=ZFig6HVNXO8ffrj f9W9rfagjswLPitG8uuIViIQojuKe8LGb/hWz9AMYCWqgy0z6uNQKVLMKMB6pive hqCCJ20vwllNjyQqZb/bWl0FyFPfse2wDMVCbhkp+GkHnB8HZYIXe9kEX85AFB+p yf2vdwN0a/xuHzcEuc39SB1FBa68= 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 :mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; s=default; bh=5E3hba5gyy0U55PqEYtvE O6rd1o=; b=GfvPYdubl5ISwAWlGvSEGVfhO+wPx/x6TZ4Dn9OnGmjw8nHLeblTC l6RVfxES8qUeERZ3xL01ZWPo28B8CfHB9v9dF+RvTmsCDG/cFZDsZcTd6xEr+/Ma pmFBVXWbg1O9MgU/7z6kZDAF6aaZU9UAH+glJWN/M2WeC2ksDSEQ/4= Received: (qmail 97167 invoked by alias); 17 Nov 2016 16:19:41 -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 96669 invoked by uid 89); 17 Nov 2016 16:19:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=H*i:sk:SNcKwVy, H*f:8ZVP3o4DV, H*i:8ZVP3o4DV, H*f:sk:SNcKwVy X-HELO: mail-qk0-f181.google.com Received: from mail-qk0-f181.google.com (HELO mail-qk0-f181.google.com) (209.85.220.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 17 Nov 2016 16:19:30 +0000 Received: by mail-qk0-f181.google.com with SMTP id q130so227358749qke.1 for ; Thu, 17 Nov 2016 08:19:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GEM/hzdKo5UiZ6hp9rM8n9eIIS3k2FN2z50WDTpN7lI=; b=l9nL8jr9A4tGqfpPkaxPWhipMV5PeBeY7TrIIZwR6DtcVyRLKFFhZ9s8NMEcpariri fP5SnpLqquG4I4F9arzo/YET86Y4pPstVdWIavCNwOI9sko823qxWyBoyjdMM9oLX58t 9v4s3iKstD4yjVkSYiL60JxSoNX0VJa5KoMFEs1tkqoMwdevxVhOyKp8JWGfE4DHrMD5 bQr4Z6dXnp0Rj2c0//pObM9s8iD7TfbbF7z31mIv6FNGrJC6G++Co6pCY4BFR4had8zV 2aVecGAG55ndl3pNOBFQTY0W5EwaQQafFclVZMJOjteAuFlpZz4IPLMFalNjwMHWKGU4 KwUA== X-Gm-Message-State: AKaTC03EQySH8hKuCVRO4So2lzBj68qT5KfRSryryZ9Fr2T8sjqt3xcx0cpZEVEUcDJTbyBZobZ6MRNMTi9imqkb X-Received: by 10.55.120.6 with SMTP id t6mr4053005qkc.83.1479399568547; Thu, 17 Nov 2016 08:19:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.28.226 with HTTP; Thu, 17 Nov 2016 08:19:27 -0800 (PST) In-Reply-To: References: From: Christophe Lyon Date: Thu, 17 Nov 2016 17:19:27 +0100 Message-ID: Subject: Re: [PATCH] Fix PR78333 To: Richard Biener Cc: Rainer Orth , "gcc-patches@gcc.gnu.org" X-IsSubscribed: yes On 17 November 2016 at 11:27, Christophe Lyon wrote: > On 17 November 2016 at 10:53, Richard Biener wrote: >> On Thu, 17 Nov 2016, Rainer Orth wrote: >> >>> Hi Richard, >>> >>> >> Probably providing dummy implemenations as in the original testcase in >>> >> the PR is enough? >>> > >>> > Maybe { dg-require weak } plus weak definitions of the cyg_profile funcs? >>> > Or simply restrict the test to { target *-*-linux* }? >>> >>> the only existing dg-do run testcase (gcc.dg/20001117-1.c) just has >>> >>> void __attribute__((no_instrument_function)) >>> __cyg_profile_func_enter(void *this_fn, void *call_site) >>> { >>> if (call_site == (void *)0) >>> abort (); >>> } >>> >>> void __attribute__((no_instrument_function)) >>> __cyg_profile_func_exit(void *this_fn, void *call_site) >>> { >>> if (call_site == (void *)0) >>> abort (); >>> } >>> >>> In the case at hand, we could do with empty implementations. This >>> certainly works on Solaris. >> >> Ok. Christophe, can you add the above and verify it works for you >> (and then commit)? >> > OK, I'm taking a look. > I tested and committed (r242553) the attached patch (on arm-none-eabi and arm-none-linux-gnueabihf). I used empty function as suggested by Rainer. Thanks, Christophe >> Thanks, >> Richard. Fix PR78333 testcase for non-glibc systems. 2016-11-17 Christophe Lyon gcc/testsuite/ * gcc.dg/pr78333.c: Add empty implementations of __cyg_profile_func_enter() and __cyg_profile_func_exit() to avoid problems on non-glibc systems. diff --git a/gcc/testsuite/gcc.dg/pr78333.c b/gcc/testsuite/gcc.dg/pr78333.c index fd3669c..ca037e5 100644 --- a/gcc/testsuite/gcc.dg/pr78333.c +++ b/gcc/testsuite/gcc.dg/pr78333.c @@ -1,6 +1,19 @@ /* { dg-do link } */ /* { dg-options "-finstrument-functions" } */ +/* Add empty implementations of __cyg_profile_func_enter() and + __cyg_profile_func_exit() to avoid problems on non-glibc + systems. */ +void __attribute__((no_instrument_function)) +__cyg_profile_func_enter(void *this_fn, void *call_site) +{ +} + +void __attribute__((no_instrument_function)) +__cyg_profile_func_exit(void *this_fn, void *call_site) +{ +} + extern inline __attribute__((gnu_inline, always_inline)) int foo () { } int main() {