Add -fno-lto for GCC and compatibles

87 views
Skip to first unread message

Jeffrey Walton

unread,
May 5, 2021, 2:23:41 PM5/5/21
to Crypto++ Users List
Hi Everyone,

LTO is slowly accumulating bugs. From what I have seen in the
post-mortems, it looks like LTO is either (1) results in a compile
error (older compilers) or (2) results in a runtime error (newer
compilers).

For (2), it appears LTO mishandles code with GCC extended inline
assembly. To build the library with LTO, you have to use
-DCRYPTOPP_DISABLE_ASM. That gets us past the self tests but causes a
slowdown in the library.

Worse, most users and distros are not aware of the LTO problems so the
library gets built with it but without -DCRYPTOPP_DISABLE_ASM.

I think we should add -fno-lto when GCC and compatibles support it.

What do you think?

Jeff

Uri Blumenthal

unread,
May 5, 2021, 3:45:06 PM5/5/21
to cryptop...@googlegroups.com
I don't see a good alternative. -fno-lto seems it.

> On May 5, 2021, at 14:23, Jeffrey Walton <nolo...@gmail.com> wrote:
>
> Hi Everyone,
> --
> You received this message because you are subscribed to the Google Groups "Crypto++ Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to cryptopp-user...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/cryptopp-users/CAH8yC8nJERS3-Y4KNZfz15fu9PJDJpE%2BZM-KmV7RcMv-oTth8w%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages