-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't mount encrypted partition when LTO is enabled #164
Comments
Stupid aliasing rules ... anyway, it should be fixed now, at the expense of encryption speed ... |
So, after a few more tests, I found the following:
Apparently, the reason was that I had done some pointer casting in aes.Encrypt and aes.Decrypt (void * to uint32_t *) in order to speed up things. GCC was of the opinion though that aes.Encrypt/Decrypt did not write anything, and that the uint32_t * did not alias the void *, and therefore the whole call to aes.Decrypt could be optimized out ... So I don't really know what's better ... having somewhat slower code, or using -fno-strict-alias when compiling with GCC and LTO ... |
On Wednesday January 04 2023 18:42:33 Simon Gander wrote:
So I don't really know what's better ... having somewhat slower code, or using -fno-strict-alias when compiling with GCC and LTO ...
I'd say the latter because that's a condition you can check for and handle at configure time. And the flag need only be passed when compiling that single file.
FWIW, doesn't `-fno-strict-alias` reenable us to do the things we could do in C, back when we were still allowed to know better than the compiler and *write* optimised code?
|
… speed ..." This reverts commit 1f041d7.
Originally reported as https://bugzilla.redhat.com/show_bug.cgi?id=1950208
Using the current git HEAD version (ee71aa5)
This seems to be caused by Fedora enabling LTO by default in its builds:
https://fedoraproject.org/wiki/LTOByDefault
Building with LTO generate quite a few new warnings compared to without LTO, including a fair bunch of signedness issues, which are probably symptoms of places that LTO will eventually modify and thus break.
The text was updated successfully, but these errors were encountered: