From patchwork Mon Nov 7 08:41:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 16323 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1923127wru; Mon, 7 Nov 2022 00:53:59 -0800 (PST) X-Google-Smtp-Source: AMsMyM7XUHZTAPF965dFQiKQzyxidFyDUAidD0QN289k7rNRoyr7DFfoQjXyrrtcFICZMaT2tfsW X-Received: by 2002:a17:906:f149:b0:7ad:e210:690e with SMTP id gw9-20020a170906f14900b007ade210690emr36092546ejb.427.1667811239094; Mon, 07 Nov 2022 00:53:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667811239; cv=none; d=google.com; s=arc-20160816; b=uEOrTztAnBRP6O0KKg9AUE8t8OseGuZTDRo8rsLbm39cTQOlqcm6f8eQdrSB5IQ8Y9 Jg5nnXtAYVSYb/s/X5dG12CijuTArTqyQJeJHbm92NTil3e22qardW0qGRj2zQWVNLdr 5jnqd85kxPNf3PdNTU17GIs/Q+XSS4VQCeq1tO5psUjyGr2LIuTvU1gfqyjYOhLapud8 kNK0JHR9KqvW4mFfy6aN/L593wgd8gXQVGSP/tqzrfUkmzNLRo4P3/qpq6ZD00ZoRYHA tcOMqkz6cvPI+6c7ax/sxjPCUZvH8+W0dakIsdGM9GwIsRkDRZPAleSNXg6khDOtldk9 EyNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=ebLlASr8ytAsN3Q5JcyQWn+3bE0kp/ZHjOEy2flMopc=; b=PnKkQfvtmcc48sLbDuQJlm/wJqvjdtJFqG0v+6Wa5OSWzyIc24nHIEQwy/WYuXGJMj rfnOB1nIgamoNlwoJVl/wO5BeyRS+mO6e7PkXCBcpKiWoebHQWhGDlrlWfIvyTz9tTWS 8r6k2HW2P9f1VfpZC7zQqzqV8OL7dk3kPFXk1ss9d3OHCKNI7HFYMnJUksu1iA034BDB sGrseig1LICSnqIHLliP1U2Hux/XCV4T+WS/ea71sYk0eZubeDXb1Ne1OdI6dqncdxK7 Hkh1FrAcLypV/bsmbX13EhaDJZdje6bfGc4l2gZgKqZ0uM0lt+UWxrcvVRf/IPM8VECq OGBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ZhUkSoki; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id qb15-20020a1709077e8f00b0078ddf8926d2si8453486ejc.827.2022.11.07.00.53.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Nov 2022 00:53:59 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ZhUkSoki; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 90EBA38245BD for ; Mon, 7 Nov 2022 08:47:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 90EBA38245BD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667810863; bh=ebLlASr8ytAsN3Q5JcyQWn+3bE0kp/ZHjOEy2flMopc=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=ZhUkSokim7JvVPO7kRaJgvLWOIaOTtNallJJRrqpI8PP93BpnSwrlKd6XL3H2gaiY kNq5thrfH4HTItJS5u5XtScrF3+eq3hXRHx2Fte5TUpSx/vUWaVgziQ3dG3FXovPgj VwiBcrPZ3BzvtBlSlpTQzDZDwrsMFUXqwcS6YVwU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id C577638582B1 for ; Mon, 7 Nov 2022 08:41:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C577638582B1 Received: by mail-wr1-x42c.google.com with SMTP id k8so15091471wrh.1 for ; Mon, 07 Nov 2022 00:41:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ebLlASr8ytAsN3Q5JcyQWn+3bE0kp/ZHjOEy2flMopc=; b=ZuFJ+UtaDPtQboRH/oNyQex3wa3Y0kWFfAzuPBECq1BN/BQ0JDHORFwpVmzNB0H/Bq X4Q8jUGAXufKewqyVXTfPanhY8hs5n4/QNDSX1n3pcFf0llfudOxgCfYWrPUAlcTnX8n EGedjEISqOf8PQoYlytjqc0UH9XArFnRpFSq+aPFEkMh/lovLQiXWPxyb19onpFPUku0 2bhf/s1Sj1eUqF5kYPi5OTlO9GT79V+7LqEKNUJEh0p6PTQaWvk9e8gGT/I4Cpw+eJnj YGZMsp1abvJkh/+GI6oQ7CxB5h//r3SH0FcyOClMhjj5nrUSadi2aYODC13WJltgUUJq 3ELw== X-Gm-Message-State: ACrzQf3V+YpoFlQVnph1egKKiCpAmzqAiOWytVaV6yWAPDJ+PN6BsOuV AXkGNMZnIwh891niqAWlvEKV4jkv/IPKaQ== X-Received: by 2002:a5d:650c:0:b0:236:49d9:8e83 with SMTP id x12-20020a5d650c000000b0023649d98e83mr30630751wru.714.1667810515649; Mon, 07 Nov 2022 00:41:55 -0800 (PST) Received: from poulhies-Precision-5550.lan (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id i2-20020a05600c354200b003c71358a42dsm14349669wmq.18.2022.11.07.00.41.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Nov 2022 00:41:55 -0800 (PST) To: gcc-patches@gcc.gnu.org Cc: Cedric Landet Subject: [COMMITTED] ada: Document that gprof won't work on windows with PIE. Date: Mon, 7 Nov 2022 09:41:52 +0100 Message-Id: <20221107084152.152087-1-poulhies@adacore.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748826837741844857?= X-GMAIL-MSGID: =?utf-8?q?1748826837741844857?= From: Cedric Landet Document that gprof won't work on windows with PIE and -no-pie must be used. gcc/ada/ * doc/gnat_ugn/gnat_and_program_execution.rst: Mention the needed -no-pie for windows to use gprof. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/doc/gnat_ugn/gnat_and_program_execution.rst | 8 ++++++-- gcc/ada/gnat_ugn.texi | 7 +++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/gcc/ada/doc/gnat_ugn/gnat_and_program_execution.rst b/gcc/ada/doc/gnat_ugn/gnat_and_program_execution.rst index e827d1f9841..c239c363eae 100644 --- a/gcc/ada/doc/gnat_ugn/gnat_and_program_execution.rst +++ b/gcc/ada/doc/gnat_ugn/gnat_and_program_execution.rst @@ -1252,8 +1252,8 @@ most often, and are therefore the most time-consuming. better handle Ada programs and multitasking. It is currently supported on the following platforms -* linux x86/x86_64 -* windows x86 +* Linux x86/x86_64 +* Windows x86/x86_64 (without PIE support) In order to profile a program using ``gprof``, several steps are needed: @@ -1291,6 +1291,10 @@ Note that only the objects that were compiled with the ``-pg`` switch will be profiled; if you need to profile your whole project, use the ``-f`` gnatmake switch to force full recompilation. +Note that on Windows, gprof does not support PIE. The ``-no-pie`` switch +should be added to the linker flags to disable this feature. + + .. _Program_execution: diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index ff5cfa9dbce..385f1d3deb5 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -19552,10 +19552,10 @@ It is currently supported on the following platforms @itemize * @item -linux x86/x86_64 +Linux x86/x86_64 @item -windows x86 +Windows x86/x86_64 (without PIE support) @end itemize In order to profile a program using @code{gprof}, several steps are needed: @@ -19614,6 +19614,9 @@ Note that only the objects that were compiled with the @code{-pg} switch will be profiled; if you need to profile your whole project, use the @code{-f} gnatmake switch to force full recompilation. +Note that on Windows, gprof does not support PIE. The @code{-no-pie} switch +should be added to the linker flags to disable this feature. + @node Program execution,Running gprof,Compilation for profiling,Profiling an Ada Program with gprof @anchor{gnat_ugn/gnat_and_program_execution id23}@anchor{175}@anchor{gnat_ugn/gnat_and_program_execution program-execution}@anchor{176} @subsubsection Program execution