| 1 | Patch-Source: https://github.com/chimera-linux/cports/blob/0b7b1b1/contrib/firefox/patches/sqlite-ppc.patch
|
| 2 | From 67157b1aa7da0a146b7d2d5abb9237eea1f434ec Mon Sep 17 00:00:00 2001
|
| 3 | From: Daniel Kolesa <[email protected]>
|
| 4 | Date: Fri, 23 Sep 2022 02:38:29 +0200
|
| 5 | Subject: [PATCH] fix sqlite3 on ppc with clang
|
| 6 |
|
| 7 | The __ppc__ macro is always defined on clang but not gcc, which
|
| 8 | results in sqlite mistakenly thinking that ppc64le with clang
|
| 9 | is big endian.
|
| 10 |
|
| 11 | Also disable some inline assembly stuff on ppc that is never used
|
| 12 | with gcc and probably was never tested with modern machines.
|
| 13 |
|
| 14 | rebased 2024-01-24 by @ptrcnull:
|
| 15 | upstream removed the __ppc__ check,
|
| 16 | adding a __LITTLE_ENDIAN__ check to match what they do
|
| 17 | ---
|
| 18 | third_party/sqlite3/src/sqlite3.c | 10 +++++-----
|
| 19 | 1 file changed, 5 insertions(+), 5 deletions(-)
|
| 20 |
|
| 21 | diff --git a/third_party/sqlite3/src/sqlite3.c b/third_party/sqlite3/src/sqlite3.c
|
| 22 | index 9443127..8593d8a 100644
|
| 23 | |
| 24 | |
| 25 | @@ -14874,2 +14874,4 @@ typedef INT16_TYPE LogEst;
|
| 26 | # define SQLITE_BYTEORDER 4321
|
| 27 | +# elif defined(__LITTLE_ENDIAN__) && __LITTLE_ENDIAN__==1
|
| 28 | +# define SQLITE_BYTEORDER 1234
|
| 29 | # elif defined(i386) || defined(__i386__) || defined(_M_IX86) || \
|
| 30 | @@ -36340,3 +36342,3 @@ SQLITE_PRIVATE int sqlite3VListNameToNum(VList *pIn, const char *zName, int nNam
|
| 31 |
|
| 32 | -#elif !defined(__STRICT_ANSI__) && (defined(__GNUC__) && defined(__ppc__))
|
| 33 | +#elif 0
|
| 34 |
|
| 35 | @@ -207002,2 +207004,4 @@ struct RtreeMatchArg {
|
| 36 | # define SQLITE_BYTEORDER 4321
|
| 37 | +# elif defined(__LITTLE_ENDIAN__) && __LITTLE_ENDIAN__==1
|
| 38 | +# define SQLITE_BYTEORDER 1234
|
| 39 | # elif defined(i386) || defined(__i386__) || defined(_M_IX86) || \
|