openssl_fix_for_x32.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. Upstream-Status: Pending
  2. Received from H J Liu @ Intel
  3. Make the assembly syntax compatible with x32 gcc. Othewise x32 gcc throws errors.
  4. Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/07/13
  5. ported the patch to the 1.0.0e version
  6. Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/01
  7. Index: openssl-1.0.2/crypto/bn/bn.h
  8. ===================================================================
  9. --- openssl-1.0.2.orig/crypto/bn/bn.h
  10. +++ openssl-1.0.2/crypto/bn/bn.h
  11. @@ -173,6 +173,13 @@ extern "C" {
  12. # endif
  13. # endif
  14. +/* Address type. */
  15. +#ifdef _WIN64
  16. +#define BN_ADDR unsigned long long
  17. +#else
  18. +#define BN_ADDR unsigned long
  19. +#endif
  20. +
  21. /*
  22. * assuming long is 64bit - this is the DEC Alpha unsigned long long is only
  23. * 64 bits :-(, don't define BN_LLONG for the DEC Alpha
  24. Index: openssl-1.0.2/crypto/bn/bn_exp.c
  25. ===================================================================
  26. --- openssl-1.0.2.orig/crypto/bn/bn_exp.c
  27. +++ openssl-1.0.2/crypto/bn/bn_exp.c
  28. @@ -638,7 +638,7 @@ static int MOD_EXP_CTIME_COPY_FROM_PREBU
  29. * multiple.
  30. */
  31. #define MOD_EXP_CTIME_ALIGN(x_) \
  32. - ((unsigned char*)(x_) + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - (((size_t)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK))))
  33. + ((unsigned char*)(x_) + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - (((BN_ADDR)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK))))
  34. /*
  35. * This variant of BN_mod_exp_mont() uses fixed windows and the special