sqlite-ppc.patch 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. From 67157b1aa7da0a146b7d2d5abb9237eea1f434ec Mon Sep 17 00:00:00 2001
  2. From: Daniel Kolesa <daniel@octaforge.org>
  3. Date: Fri, 23 Sep 2022 02:38:29 +0200
  4. Subject: [PATCH] fix sqlite3 on ppc with clang
  5. The __ppc__ macro is always defined on clang but not gcc, which
  6. results in sqlite mistakenly thinking that ppc64le with clang
  7. is big endian.
  8. Also disable some inline assembly stuff on ppc that is never used
  9. with gcc and probably was never tested with modern machines.
  10. ---
  11. third_party/sqlite3/src/sqlite3.c | 10 +++++-----
  12. 1 file changed, 5 insertions(+), 5 deletions(-)
  13. diff --git a/third_party/sqlite3/src/sqlite3.c b/third_party/sqlite3/src/sqlite3.c
  14. index 4f3dc68..9017062 100644
  15. --- a/third_party/sqlite3/src/sqlite3.c
  16. +++ b/third_party/sqlite3/src/sqlite3.c
  17. @@ -14317,9 +14317,9 @@ typedef INT16_TYPE LogEst;
  18. # if defined(i386) || defined(__i386__) || defined(_M_IX86) || \
  19. defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || \
  20. defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) || \
  21. - defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64)
  22. + defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) || defined(__LITTLE_ENDIAN__)
  23. # define SQLITE_BYTEORDER 1234
  24. -# elif defined(sparc) || defined(__ppc__) || \
  25. +# elif defined(sparc) || defined(__BIG_ENDIAN__) || \
  26. defined(__ARMEB__) || defined(__AARCH64EB__)
  27. # define SQLITE_BYTEORDER 4321
  28. # else
  29. @@ -20713,7 +20713,7 @@ SQLITE_PRIVATE const char **sqlite3CompileOptions(int *pnOpt);
  30. return val;
  31. }
  32. -#elif !defined(__STRICT_ANSI__) && (defined(__GNUC__) && defined(__ppc__))
  33. +#elif 0
  34. __inline__ sqlite_uint64 sqlite3Hwtime(void){
  35. unsigned long long retval;
  36. @@ -196385,9 +196385,9 @@ struct RtreeMatchArg {
  37. #if defined(i386) || defined(__i386__) || defined(_M_IX86) || \
  38. defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || \
  39. defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) || \
  40. - defined(__arm__)
  41. + defined(__arm__) || defined(__LITTLE_ENDIAN__)
  42. # define SQLITE_BYTEORDER 1234
  43. -#elif defined(sparc) || defined(__ppc__)
  44. +#elif defined(sparc) || defined(__BIG_ENDIAN__)
  45. # define SQLITE_BYTEORDER 4321
  46. #else
  47. # define SQLITE_BYTEORDER 0 /* 0 means "unknown at compile-time" */
  48. --
  49. 2.37.3