-
Notifications
You must be signed in to change notification settings - Fork 62
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
Build fails with strict-aliasing violations #1852
Comments
@eli-schwartz thanks for the report. Will see to it. |
@eli-schwartz When using your compile options, I get a few other error messages surprisingly related to lines such as |
@alaingdl @slayoo @pjb7687 using |
Gentoo builds gdl with a USE="openmp" option, and openmp is default-enabled for all packages. So it's technically possible to build without it, but you'd have to go out of your way to do so. If you look in my attached build log, the metadata header shows:
and the cmake configure command is:
The One Definition Rule would get verified at link time, but strict-aliasing errored out at compile time, so it never got that far. That's probably why I didn't notice it. And maybe I should have tested without -Werror=strict-aliasing, just to see if there were additional link errors, but I guess I forgot. :D |
Hold on, I just tried this and despite building with |
@eli-schwartz I made changes in #1860, should make the initial error disappear. At least when using |
I tried to build with the following *FLAGS to optimize the build:
-flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing
The -Werror=* flags are important to detect cases where the compiler can try to optimize based on assuming UB cannot happen, and miscompile code that has UB in it. strict-aliasing issues are always bad but LTO can make them even worse.
I got this error:
Originally reported downstream: https://bugs.gentoo.org/930966
Full build log: build.log
The text was updated successfully, but these errors were encountered: