gcc mingw gives errors when compiling with profiler guided optimizations

Bug #1920988 reported by Fabio Gobbato
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc-mingw-w64 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When I compile a program with gcc mingw with -fprofile-generate -lgcov

I get the following errors:

/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0x7f2): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0x874): undefined reference to `__gcov_indirect_call_profiler_v3'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0x993): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0x9b7): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0x9d7): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0x9fe): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0xcf6): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0xd1a): more undefined references to `__gcov_one_value_profiler_atomic' follow
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0xfe3): undefined reference to `__gcov_indirect_call_profiler_v3'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0x3841): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0x69e5): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0x9742): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0x9751): undefined reference to `__gcov_average_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0x9760): undefined reference to `__gcov_ior_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0x97b9): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0x97c8): undefined reference to `__gcov_average_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0x97d7): undefined reference to `__gcov_ior_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0x9b85): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0xa1dd): undefined reference to `__gcov_indirect_call_profiler_v3'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0xa955): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0xa964): undefined reference to `__gcov_average_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0xa977): undefined reference to `__gcov_ior_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0xa9c0): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0xa9cf): undefined reference to `__gcov_average_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0xa9e2): undefined reference to `__gcov_ior_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0xaa3e): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0xaed5): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0xb3b9): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0xb3f0): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.text+0xd2aa): undefined reference to `__gcov_indirect_call_profiler_v3'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.data+0x29f0): undefined reference to `__gcov_merge_ior'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.data+0x29f8): undefined reference to `__gcov_merge_time_profile'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.rdata$.refptr.__gcov_indirect_call[.refptr.__gcov_indirect_call]+0x0): undefined reference to `__gcov_indirect_call'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans0.ltrans.o:<artificial>:(.rdata$.refptr.__gcov_time_profiler_counter[.refptr.__gcov_time_profiler_counter]+0x0): undefined reference to `__gcov_time_profiler_counter'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans1.ltrans.o:<artificial>:(.text+0x373): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans1.ltrans.o:<artificial>:(.text+0x407): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans1.ltrans.o:<artificial>:(.text+0xce2): undefined reference to `__gcov_indirect_call_profiler_v3'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans1.ltrans.o:<artificial>:(.text+0xdc9): undefined reference to `__gcov_indirect_call_profiler_v3'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans1.ltrans.o:<artificial>:(.text+0xe73): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans1.ltrans.o:<artificial>:(.text+0x122d): undefined reference to `__gcov_one_value_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans1.ltrans.o:<artificial>:(.text+0x1240): undefined reference to `__gcov_average_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans1.ltrans.o:<artificial>:(.text+0x124f): undefined reference to `__gcov_ior_profiler_atomic'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans1.ltrans.o:<artificial>:(.text+0x3dc2): undefined reference to `__gcov_indirect_call_profiler_v3'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans1.ltrans.o:<artificial>:(.text+0x4d24): undefined reference to `__gcov_indirect_call_profiler_v3'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans1.ltrans.o:<artificial>:(.text+0x67b6): undefined reference to `__gcov_indirect_call_profiler_v3'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans1.ltrans.o:<artificial>:(.text+0x6beb): undefined reference to `__gcov_indirect_call_profiler_v3'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/test.exe.OUuwZB.ltrans1.ltrans.o:<artificial>:(.text+0xacd9): undefined reference to `__gcov_one_value_profiler_atomic'

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: gcc-mingw-w64-x86-64 9.3.0-7ubuntu1+22~exp1ubuntu4
ProcVersionSignature: Ubuntu 5.8.0-45.51~20.04.1-generic 5.8.18
Uname: Linux 5.8.0-45-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.16
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Tue Mar 23 19:38:09 2021
InstallationDate: Installed on 2020-05-01 (326 days ago)
InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
SourcePackage: gcc-mingw-w64
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Fabio Gobbato (voyage199) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-mingw-w64 - 24.2

---------------
gcc-mingw-w64 (24.2) unstable; urgency=medium

  * Fix gcov handling: we need to tell GCC that we have headers, without
    telling it where, and then we need to correct its default assumption
    about where they are. Closes: #989862. LP: #1883933, #1920988.

 -- Stephen Kitt <email address hidden> Sat, 12 Jun 2021 18:54:10 +0200

Changed in gcc-mingw-w64 (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.