From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wr1-x42c.google.com with SMTP id k8so15091471wrh.1 for ; Mon, 07 Nov 2022 00:41:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ebLlASr8ytAsN3Q5JcyQWn+3bE0kp/ZHjOEy2flMopc=; b=NPZdGLDEzEFyJSfP5hXSZc4o0fMBEs+KZSpZysXVFFz7LIAnVpmoLzFfAfeFlQW2ID 2S6RhInXywq4c+C23ZNDXfzJd74FwJGShP+rlYz1Qz6NdhLbkwhNw9PTnZPNUBo4oP1k NV8CUIStR6CGpsn0Jp11OGOmYt4ZTBWE19ryTfFwED4qMeMb7sxfmuuuAke0vdJvDT9/ DJ47S800ZoTSTS8WCfj/n0ngEWUoebmj0yuuOGnSABtchDujjrF/mY5WP1g5jYDnmqXV og13ZYVg7nPbpgogcNGWQYJ+/2aCxNJ0Nz8O42oJIP+LENnqZDeDutOjycNj/YEJOFpQ egZw== 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-Google-Smtp-Source: AMsMyM7riAsBAoOwk1qvADvHN+9jqR8dMlXRc0bpfQ8nWPB1oNDPbaZn+N6naghyiF/YW3atzqj4ww== 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) From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= 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 Content-Transfer-Encoding: 8bit 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 List-Id: 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 -- 2.34.1