https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123923

            Bug ID: 123923
           Summary: autoprofiledbootstrap seems to profile make instead of
                    cc1/cc1plus/lto1
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: gcov-profile
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dhruvc at gcc dot gnu.org
  Target Milestone: ---

May be related to #121038.

It seems like autoprofiledbootstrap runs the `gcc-auto-profile` script on the
make invocation instead of the compiler:

gcc/Makefile.in:

        ...
        $$s/gcc/config/$(cpu_type)/$(AUTO_PROFILE) \
        $(MAKE) $(BASE_FLAGS_TO_PASS) \
        ...

This leads to none of the child processes getting profiled. I tested this on
x86 and aarch64, and checked by running perf buildid-list on the generated
perf.data file - also tried perf report and saw only functions from
/usr/bin/make in the perf profile.

>> perf buildid-list -i prev-gcc/perf.data
aff9c7b2c5c294612904563fa3da88cb054d313d [kernel.kallsyms]
962097804b5c10ba831958fbb9609cb6d0c1101f /usr/bin/make
c38e00ddd72e215a9df1c295fe7d461a2ef398ff
/usr/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1
18bd53323ef323ab973aa9dbc34867e4ea53c9cd [vdso]
aa6e122fa39ae02d412afb49d75e33281fcd2805 /usr/lib/aarch64-linux-gnu/libc.so.6
be49fa95e8d5f9adc2d850e7967b3c3082466448 /usr/bin/bash
3fda2240c8e158de2469564940bafefff7728b8c
/usr/lib/aarch64-linux-gnu/libtinfo.so.6.3
10f22bd1e76f31552e181f7a56864b409e8358a4 /usr/bin/sed
c75884f277ff5378c93112e0ebe3c531f6389c7e
/usr/lib/aarch64-linux-gnu/libacl.so.1.1.2301
229c89976d3d26ae29d29e45f8c75ddc90476949
/usr/lib/aarch64-linux-gnu/libselinux.so.1
b24878bea7df91144117e16de1c3452c1cb58a37
/usr/lib/aarch64-linux-gnu/libpcre2-8.so.0.10.4
7ce56ef394483cd3eda6d09867e5183c944668d5 /usr/bin/cat

cc1 is simply absent here. This means that the profile being used to optimize
GCC does not contain anything from GCC? Am I doing something wrong here? The
specific steps I used were:

../gcc/configure --enable-bootstrap --enable-languages=c,c++,fortran
--prefix=<...> --with-build-config=bootstrap-lto --enable-linker-build-id
--disable-multilib
make autoprofiledbootstrap -j$(nproc) -Oline

Reply via email to