patch-ext_standard_crc32_c 939 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --- php-7.4.24.orig/ext/standard/crc32.c 2021-09-21 13:23:20.000000000 +0200
  2. +++ php-7.4.24/ext/standard/crc32.c 2021-09-29 10:27:37.144637295 +0200
  3. @@ -23,7 +23,6 @@
  4. #if HAVE_AARCH64_CRC32
  5. # include <arm_acle.h>
  6. # if defined(__linux__)
  7. -# include <sys/auxv.h>
  8. # include <asm/hwcap.h>
  9. # endif
  10. @@ -32,13 +31,6 @@ static inline int has_crc32_insn() {
  11. static int res = -1;
  12. if (res != -1)
  13. return res;
  14. -# if defined(HWCAP_CRC32)
  15. - res = getauxval(AT_HWCAP) & HWCAP_CRC32;
  16. - return res;
  17. -# elif defined(HWCAP2_CRC32)
  18. - res = getauxval(AT_HWCAP2) & HWCAP2_CRC32;
  19. - return res;
  20. -# else
  21. res = 0;
  22. return res;
  23. # endif
  24. @@ -85,13 +77,6 @@ PHP_NAMED_FUNCTION(php_if_crc32)
  25. crc = crcinit^0xFFFFFFFF;
  26. -#if HAVE_AARCH64_CRC32
  27. - if (has_crc32_insn()) {
  28. - crc = crc32_aarch64(crc, p, nr);
  29. - RETURN_LONG(crc^0xFFFFFFFF);
  30. - }
  31. -#endif
  32. -
  33. for (; nr--; ++p) {
  34. crc = ((crc >> 8) & 0x00FFFFFF) ^ crc32tab[(crc ^ (*p)) & 0xFF ];
  35. }