Bug 254001 - 13.0-BETA llvm fails to link with -fprofile-instr-generate -fcoverage-mapping
Summary: 13.0-BETA llvm fails to link with -fprofile-instr-generate -fcoverage-mapping
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 13.0-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: Dimitry Andric
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-04 03:43 UTC by ota
Modified: 2021-12-25 11:58 UTC (History)
2 users (show)

See Also:
koobs: mfc-stable13+
koobs: mfc-stable12-
koobs: mfc-stable11-


Attachments
source code and its error output (3.70 KB, text/plain)
2021-03-04 03:43 UTC, ota
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description ota 2021-03-04 03:43:27 UTC
Created attachment 222959 [details]
source code and its error output

LLVM on 13-BETA fails to link with -fprofile-instr-generate -fcoverage-mapping option:

% cc -fprofile-instr-generate -fcoverage-mapping coverage.c
ld: error: undefined hidden symbol: __llvm_profile_counter_bias
>>> referenced by InstrProfilingFile.c:966 (/usr/src/contrib/llvm-project/compil
er-rt/lib/profile/InstrProfilingFile.c:966)
>>>               InstrProfilingFile.o:(__llvm_profile_initialize_file) in archi
ve /usr/lib/clang/11.0.1/lib/freebsd/libclang_rt.profile-i386.a
>>> referenced by InstrProfilingFile.c:966 (/usr/src/contrib/llvm-project/compil
er-rt/lib/profile/InstrProfilingFile.c:966)

These options had been sufficient on 12.x-RELEASES.
Comment 1 commit-hook freebsd_committer freebsd_triage 2021-03-05 20:08:44 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=772c631af81abdb6d498d972bab79d04d3db16d0

commit 772c631af81abdb6d498d972bab79d04d3db16d0
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2021-03-05 20:06:05 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2021-03-05 20:07:07 +0000

    Add a few missed files to libclang_rt.profile-<arch>.a

    Otherwise, programs compiled with -fprofile-instr-generate will
    encounter undefined symbol errors during linking, for example
    __llvm_profile_counter_bias, lprofSetRuntimeCounterRelocation and a few
    others were missing from the profile library.

    Reported by:    ota@j.email.ne.jp
    PR:             254001
    MFC after:      3 days

 lib/libclang_rt/profile/Makefile | 2 ++
 1 file changed, 2 insertions(+)
Comment 2 commit-hook freebsd_committer freebsd_triage 2021-03-09 20:26:09 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=3f684107ef6e41b03a47d64d6e31cebc823d7448

commit 3f684107ef6e41b03a47d64d6e31cebc823d7448
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2021-03-05 20:06:05 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2021-03-09 20:25:16 +0000

    Add a few missed files to libclang_rt.profile-<arch>.a

    Otherwise, programs compiled with -fprofile-instr-generate will
    encounter undefined symbol errors during linking, for example
    __llvm_profile_counter_bias, lprofSetRuntimeCounterRelocation and a few
    others were missing from the profile library.

    Reported by:    ota@j.email.ne.jp
    PR:             254001

    (cherry picked from commit 772c631af81abdb6d498d972bab79d04d3db16d0)

 lib/libclang_rt/profile/Makefile | 2 ++
 1 file changed, 2 insertions(+)
Comment 3 commit-hook freebsd_committer freebsd_triage 2021-03-09 21:00:14 UTC
A commit in branch releng/13.0 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=64b30c36712edb44e9204e3a3436100024ffad18

commit 64b30c36712edb44e9204e3a3436100024ffad18
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2021-03-05 20:06:05 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2021-03-09 20:57:51 +0000

    Add a few missed files to libclang_rt.profile-<arch>.a

    Otherwise, programs compiled with -fprofile-instr-generate will
    encounter undefined symbol errors during linking, for example
    __llvm_profile_counter_bias, lprofSetRuntimeCounterRelocation and a few
    others were missing from the profile library.

    Approved by:    re (gjb)
    Reported by:    ota@j.email.ne.jp
    PR:             254001

    (cherry picked from commit 772c631af81abdb6d498d972bab79d04d3db16d0)
    (cherry picked from commit 3f684107ef6e41b03a47d64d6e31cebc823d7448)

 lib/libclang_rt/profile/Makefile | 2 ++
 1 file changed, 2 insertions(+)
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2021-03-15 02:33:28 UTC
^Triage: Tracker stable merge
Comment 5 commit-hook freebsd_committer freebsd_triage 2021-12-25 11:58:45 UTC
A commit in branch stable/12 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=f00ca4a1c59d6d969d1aeb0e22b5576f8cebf24e

commit f00ca4a1c59d6d969d1aeb0e22b5576f8cebf24e
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2021-03-05 20:06:05 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2021-12-25 11:50:58 +0000

    Add a few missed files to libclang_rt.profile-<arch>.a

    Otherwise, programs compiled with -fprofile-instr-generate will
    encounter undefined symbol errors during linking, for example
    __llvm_profile_counter_bias, lprofSetRuntimeCounterRelocation and a few
    others were missing from the profile library.

    Reported by:    ota@j.email.ne.jp
    PR:             254001
    MFC after:      3 days

    (cherry picked from commit 772c631af81abdb6d498d972bab79d04d3db16d0)

 lib/libclang_rt/profile/Makefile | 2 ++
 1 file changed, 2 insertions(+)