]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix collection and processing of autoprofile data for target libs
authorEugene Rozenfeld <erozen@microsoft.com>
Tue, 27 Jun 2023 20:58:14 +0000 (13:58 -0700)
committerEugene Rozenfeld <erozen@microsoft.com>
Thu, 29 Jun 2023 01:21:49 +0000 (18:21 -0700)
cc1, cc1plus, and lto  built during STAGEautoprofile need to be built with
debug info since they are used to build target libs. -gtoggle was
turning off debug info for this stage.

create_gcov should be passed prev-gcc/cc1, prev-gcc/cc1plus, and prev-gcc/lto
instead of stage1-gcc/cc1, stage1-gcc/cc1plus, and stage1-gcc/lto when
processing profile data collected while building target libraries.

Tested on x86_64-pc-linux-gnu.

ChangeLog:

* Makefile.in: Remove -gtoggle for STAGEautoprofile
* Makefile.tpl: Remove -gtoggle for STAGEautoprofile

gcc/c/ChangeLog:

* Make-lang.in: Pass correct stage cc1 when processing
profile data collected while building target libraries

gcc/cp/ChangeLog:

* Make-lang.in: Pass correct stage cc1plus when processing
profile data collected while building target libraries

gcc/lto/ChangeLog:

* Make-lang.in: Pass correct stage lto when processing
profile data collected while building target libraries

Makefile.in
Makefile.tpl
gcc/c/Make-lang.in
gcc/cp/Make-lang.in
gcc/lto/Make-lang.in

index 45f09f9308f21eb0cc691bd5668b2f29397aa0b9..f19a9db621e3b5182145968f026c07aacaa90cc5 100644 (file)
@@ -635,7 +635,7 @@ STAGEtrain_TFLAGS = $(filter-out -fchecking=1,$(STAGE3_TFLAGS))
 STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use -fprofile-reproducible=parallel-runs
 STAGEfeedback_TFLAGS = $(STAGE4_TFLAGS)
 
-STAGEautoprofile_CFLAGS = $(STAGE2_CFLAGS) -g
+STAGEautoprofile_CFLAGS = $(filter-out -gtoggle,$(STAGE2_CFLAGS)) -g
 STAGEautoprofile_TFLAGS = $(STAGE2_TFLAGS)
 
 STAGEautofeedback_CFLAGS = $(STAGE3_CFLAGS)
index 6bcee3021c91c519eea1ee5c78f0e62a7cd27c73..3a5b7ed3c9209b0c1fddba2f4a4f789d697ed937 100644 (file)
@@ -558,7 +558,7 @@ STAGEtrain_TFLAGS = $(filter-out -fchecking=1,$(STAGE3_TFLAGS))
 STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use -fprofile-reproducible=parallel-runs
 STAGEfeedback_TFLAGS = $(STAGE4_TFLAGS)
 
-STAGEautoprofile_CFLAGS = $(STAGE2_CFLAGS) -g
+STAGEautoprofile_CFLAGS = $(filter-out -gtoggle,$(STAGE2_CFLAGS)) -g
 STAGEautoprofile_TFLAGS = $(STAGE2_TFLAGS)
 
 STAGEautofeedback_CFLAGS = $(STAGE3_CFLAGS)
index 20840aceab611fb7bb8936ec5a0316a7a4a5c34e..79bc0dfd1cf60cd3683c1a65b58fe469640ff924 100644 (file)
@@ -113,10 +113,10 @@ create_fdas_for_cc1: ../stage1-gcc/cc1$(exeext) ../prev-gcc/$(PERF_DATA)
          echo $$perf_path; \
          if [ -f $$perf_path ]; then \
            profile_name=cc1_$$component_in_prev_target.fda; \
-           $(CREATE_GCOV) -binary ../stage1-gcc/cc1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
+           $(CREATE_GCOV) -binary ../prev-gcc/cc1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
          fi; \
        done;
-#\f
+#
 # Build hooks:
 
 c.info:
index c08ee91447e62e7b82fa575a6b6d6ba12258227e..ba5e8766e9907a59a56dbe73347df219bad22eef 100644 (file)
@@ -211,10 +211,10 @@ create_fdas_for_cc1plus: ../stage1-gcc/cc1plus$(exeext) ../prev-gcc/$(PERF_DATA)
          echo $$perf_path; \
          if [ -f $$perf_path ]; then \
            profile_name=cc1plus_$$component_in_prev_target.fda; \
-           $(CREATE_GCOV) -binary ../stage1-gcc/cc1plus$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
+           $(CREATE_GCOV) -binary ../prev-gcc/cc1plus$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
          fi; \
        done;
-#\f
+#
 # Build hooks:
 
 c++.all.cross: g++-cross$(exeext)
index 4f6025100a3e9d68db8f6a98624822f704364605..98aa9f4cc39a1541ea98c89bb837964fe476de29 100644 (file)
@@ -130,7 +130,7 @@ create_fdas_for_lto1: ../stage1-gcc/lto1$(exeext) ../prev-gcc/$(PERF_DATA)
          echo $$perf_path; \
          if [ -f $$perf_path ]; then \
            profile_name=lto1_$$component_in_prev_target.fda; \
-           $(CREATE_GCOV) -binary ../stage1-gcc/lto1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
+           $(CREATE_GCOV) -binary ../prev-gcc/lto1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
          fi; \
        done;