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
bn_ppc.c: Fix build failure on AIX with XLC/XLCLANG #17497
Conversation
These compilers define _ARCH_PPC64 for 32 bit builds so we cannot depend solely on this define to identify 32 bit build. Fixes openssl#17087
@@ -40,7 +40,7 @@ int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, | |||
* no opportunity to figure it out... | |||
*/ | |||
|
|||
#if defined(_ARCH_PPC64) | |||
#if defined(_ARCH_PPC64) && !defined(__ILP32__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other instances of the use of this macro which look suspect to me, e.g. see crypto/sha/sha512.c
Also bn_local.h does this correctly, but in a different way:
# elif defined(_ARCH_PPC64) && defined(SIXTY_FOUR_BIT_LONG)
Should we be consistent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO that is a different condition. I am not sure about them being equivalent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for the other instances, I am not sure about them, I suppose they are either working for the platform from #17087 correctly or not compiled in for other reasons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. We can run with this as is - but I'm not entirely convinced there isn't another issue lurking somewhere.
This pull request is ready to merge |
Merged to master and 3.0 branches. Thank you for the review. |
These compilers define _ARCH_PPC64 for 32 bit builds
so we cannot depend solely on this define to identify
32 bit build.
Fixes #17087