Bug#968461: libbenchmark-dev: libbenchmark_main.a doesn't contain main() function

Timo Röhling timo at gaussglocke.de
Sun Nov 15 09:16:09 GMT 2020


On Sun, 16 Aug 2020 03:10:38 +0300 Alexander Kernozhitsky
<sh200105 at mail.ru> wrote:
> Currently benchmark_main.a doesn't contain any useful symbols. But it must
> contain main() function. So, my code is unable to link and reports
that main()
> is missing.
I ran into the same bug. I suspect that it is caused by the -flto flag,
which makes GCC compile to an intermediate code that is meant to be
consumed at the linker stage. However, static libraries are not linked,
the object files are merely put together into the .a archive. You need
to either disable LTO, or add the -ffat-lto-objects flag to make GCC
emit native object code, too.

Cheers
Timo


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/debian-science-maintainers/attachments/20201115/8d635767/attachment.sig>


More information about the debian-science-maintainers mailing list