Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Sep 2021 19:32:43 +0000
From:      bugzilla-noreply@freebsd.org
To:        erlang@FreeBSD.org
Subject:   [Bug 258494] lang/erlang lang/erlang-runtime21 lang/erlang-runtime23: clang 13 build breaks dtrace if PGO is enabled
Message-ID:  <bug-258494-38768-wbnLHhCVM3@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-258494-38768@https.bugs.freebsd.org/bugzilla/>
References:  <bug-258494-38768@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D258494

--- Comment #1 from Dimitry Andric <dim@FreeBSD.org> ---
(In reply to Dimitry Andric from comment #0)
> Something in beam_emu_pu.o (emitted by clang or llvm 13) is tripping up d=
trace, but I have very little knowledge about dtrace so I need help here. :)

So there are two objects that are instrumented with profile generation code,
beam_emu_pg.o and erl_process_pg.o. These are linked into a beam.smp execut=
able
which generates profile data, and the data is used to build beam_emu_pu.o a=
nd
erl_process_pu.o.

The difference between llvm 12 and llvm 13 output is in the produced sectio=
ns
for the _pu.o files. With llvm 12, there is a .llvm.call-graph-profile sect=
ion
(to be used by the linker to rearrange 'hot' and 'cold' parts):

  [Nr] Name              Type            Address          Off    Size   ES =
Flg
Lk Inf Al
...
  [19] .llvm.call-graph-profile LOOS+0xfff4c02  0000000000000000 02e9f0 000=
e80
10   E 21   0  1

whereas with llvm 13, there is an additional .rel.llvm.call-graph-profile
section:

  [Nr] Name              Type            Address          Off    Size   ES =
Flg
Lk Inf Al
...
  [17] .llvm.call-graph-profile LOOS+0xfff4c09  0000000000000000 0279a9 000=
750
08   E 22   0  1
  [18] .rel.llvm.call-graph-profile REL             0000000000000000 030888
001d40 10     22  17  8

I have verified that removing the .rel.llvm.call-graph-profile section from=
 the
_pu.o files (using objcopy --remove .rel.llvm.call-graph-profile) makes dtr=
ace
not crash anymore.

However, I think the .rel.llvm.call-graph-profile section might contain
information that is useful to the linker. So the question is still what is =
in
this particular section that makes dtrace crash.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-258494-38768-wbnLHhCVM3>