-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Workaround for GCC bug 95189 using -fno-builtin-memcmp #832
Conversation
Hmm, this is a lot simpler than what I tried! The only argument against this would be that it doesn't protect non-autoconf builds. |
Yes, but I think that's an important argument. Also, the code of |
I like @gmaxwell 's suggestion to just have a test case for it, for non-autotools builders. Another option would be to add a define in configure that the code #ifndef/#errors without... |
Hm but this should be a self-test then. Not everyone runs the tests.
Then people will just remove the Also every form of conditional compilation makes it harder for us to test on Travis reliably. I think all of these are more or less acceptable solutions but each of them has some disadvantages. What's the disadvantage of |
I think I'd be ok with this + a selftest for broken memcmp, but I don't see any downsides to the secp256k1_memcmp_var approach instead. |
No particular downsides to the other approach other than it being ugly. I won't be offended if you choose it over this. ;) |
Given how trivial memcmp is, I'd rather the consistency of everyone running the same thing and not more optional/conditional code to worry about. |
I agree with @gmaxwell, |
Note that |
obviously :) |
I don't believe there are any other stdlib functions called by the library at runtime other than memcpy (assuming you're built without malloc, otherwise I believe the only library function calls are malloc/free/memcpy). |
|
The custom memcmp got merged, so I guess this is irrelevant now? |
For native builds, this builds and runs a test for the bug itself.
When cross-compiling, it assumes any 9.x or 10.x GCC is affected.
The second commit (native test) may be more than this project needs.