projects/aports·blob master · refs

39 lines · 1.7 KiB

1Patch-Source: https://github.com/chimera-linux/cports/blob/0b7b1b1/contrib/firefox/patches/sqlite-ppc.patch
2From 67157b1aa7da0a146b7d2d5abb9237eea1f434ec Mon Sep 17 00:00:00 2001
3From: Daniel Kolesa <[email protected]>
4Date: Fri, 23 Sep 2022 02:38:29 +0200
5Subject: [PATCH] fix sqlite3 on ppc with clang
6
7The __ppc__ macro is always defined on clang but not gcc, which
8results in sqlite mistakenly thinking that ppc64le with clang
9is big endian.
10
11Also disable some inline assembly stuff on ppc that is never used
12with gcc and probably was never tested with modern machines.
13
14rebased 2024-01-24 by @ptrcnull:
15upstream removed the __ppc__ check,
16adding 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
21diff --git a/third_party/sqlite3/src/sqlite3.c b/third_party/sqlite3/src/sqlite3.c
22index 9443127..8593d8a 100644
23--- a/third_party/sqlite3/src/sqlite3.c
24+++ b/third_party/sqlite3/src/sqlite3.c
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) || \