My scenario is not cygwin. It's linux cross-compile x86_64 to aarch64 in an
Ubuntu vm so I believe this should produce line info with -flto -g yet I see
"No Line Number Statements" after Directory Table and File Name Table in the
output of objdump -g.
DWARF Version is 4.
I verified that I get line numbers if I don't specify -flto.
I have all the lto1 commands and I'd like to try to debug this myself first. Do
you have any tips on how to debug this?
Thanks,
Eugene
-Original Message-
From: Richard Biener
Sent: Friday, September 24, 2021 12:36 AM
To: Eugene Rozenfeld
Cc: gcc@gcc.gnu.org
Subject: [EXTERNAL] Re: Reporting lto bugs
On Fri, Sep 24, 2021 at 3:45 AM Eugene Rozenfeld via Gcc
wrote:
>
> I ran into a bug with lto: no line number info gets emitted when building my
> project with -flto and -g (with gcc 8.2). I'd like to provide a repro in the
> bug report but I don't know if there is an easy way to collect everything.
> The instructions at
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgcc.gnu.org%2Fbugs%2F&data=04%7C01%7CEugene.Rozenfeld%40microsoft.com%7Cb7b3ef43536943c30e3108d97f2df355%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637680657602091864%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=yGG5QtNDKjD0z4Q%2FcNmuwx5CZV8cElqGetmfmYzAwjA%3D&reserved=0
> seem to cover non-lto compilations.
> For MSVC there is an easy way to collect linker repro files for ltcg:
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs
> .microsoft.com%2Fen-us%2Fcpp%2Foverview%2Fhow-to-report-a-problem-with
> -the-visual-cpp-toolset%3Fview%3Dmsvc-160%23link-repros&data=04%7C
> 01%7CEugene.Rozenfeld%40microsoft.com%7Cb7b3ef43536943c30e3108d97f2df3
> 55%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637680657602101859%7CU
> nknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1ha
> WwiLCJXVCI6Mn0%3D%7C1000&sdata=WhtAKrM1LoveH1Jbi3Ulhrp7hUdXJ46hgh1
> osT%2BB1nc%3D&reserved=0
> Is there something similar for GCC?
We generally prefer preprocessed sources here as with other bugs - for LTO that
might mean including quite a bunch of files but there's instructions on the
wiki on how to reduce LTO testcases:
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgcc.gnu.org%2Fwiki%2FA_guide_to_testcase_reduction%23Reducing_LTO_bugs&data=04%7C01%7CEugene.Rozenfeld%40microsoft.com%7Cb7b3ef43536943c30e3108d97f2df355%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637680657602101859%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=GExhyUNJvSQgMPrSGccVj8woBTLahYVAjI%2FBvQ79QMo%3D&reserved=0
Note that for mingw and cygwin you likely run into the issue that LTO does not
support -g there (sic), see a similar issue for darwin (PR82005), there must be
a bug for mingw/cygwin as well but I can't find it right now.
Richard.
> Thanks,
>
> Eugene