Martin Liška wrote:
[SNIP]
However, LTO breaks nm really badly and with -fno-common this variable
gets marked as "T" in the nm output.
Thank you for identification of the root cause. I've just created a
nm issue
for that:
https://sourceware.org/bugzilla/show_bug.cgi?id=25355
It is clear that defect 25355 never will be fixed - by design plugin
architecture is not suitable for lto and nobody would like to work on
new version ( LD_PLUGIN_API_VERSION 2? ).
So apparently it's a known limitation of the LTO plugin. Question is
whether
we can somehow workaround that?
Work-around was already provided - please see following feedback :
https://lists.gnu.org/archive/html/libtool/2020-01/msg00027.html
Let me quote Nick Bowler feedback:
========================
Workaround: add -ffat-lto-objects to CFLAGS so you get proper symbol
tables in object files and then set NM='nm --plugin ""' to completely
disable the busted LTO support in nm.
For example:
./configure CFLAGS='-flto -fno-common -ffat-lto-objects' NM='nm --plugin ""'
========================
Martin
[SNIP]