From bf9a37a6bc91cedd8a5a41bf48a0ded028da4b4e Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sat, 28 Sep 2024 20:37:59 +0200 Subject: [PATCH 1/6] Update LuaJIT to 20270904 (Fix an unused function warning) --- thirdparty/luajit/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/luajit/CMakeLists.txt b/thirdparty/luajit/CMakeLists.txt index f51296e72..45dd565b2 100644 --- a/thirdparty/luajit/CMakeLists.txt +++ b/thirdparty/luajit/CMakeLists.txt @@ -99,7 +99,7 @@ endif() append_tree_install_commands(INSTALL_CMD src/jit jit) external_project( - DOWNLOAD GIT f725e44cda8f359869bf8f92ce71787ddca45618 + DOWNLOAD GIT 87ae18af97fd4de790bb6c476b212e047689cc93 https://github.com/LuaJIT/LuaJIT PATCH_FILES ${PATCH_FILES} PATCH_COMMAND ${PATCH_CMD} From 64eb38a034368fa527af4b506223e7e84f5c417e Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sat, 28 Sep 2024 20:39:41 +0200 Subject: [PATCH 2/6] Update FBInk --- thirdparty/fbink/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/fbink/CMakeLists.txt b/thirdparty/fbink/CMakeLists.txt index b31a7dc79..6b01f18fa 100644 --- a/thirdparty/fbink/CMakeLists.txt +++ b/thirdparty/fbink/CMakeLists.txt @@ -56,7 +56,7 @@ else() endif() external_project( - DOWNLOAD GIT 48ba071e41803bd3924d6156dedb10e467c4bdf1 + DOWNLOAD GIT 21cce1029a6f4de2048e98d7bf2fff81c3852e60 https://github.com/NiLuJe/FBInk.git BUILD_COMMAND ${BUILD_CMD} INSTALL_COMMAND ${INSTALL_CMD} From 0b36c8671bfc9b5c2de894945b34ca17e12450a1 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sat, 28 Sep 2024 20:39:52 +0200 Subject: [PATCH 3/6] Update KoboUSBMS Use the future-proof USB PIDs for the latest Tolino/Kobo devices. --- thirdparty/kobo-usbms/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/kobo-usbms/CMakeLists.txt b/thirdparty/kobo-usbms/CMakeLists.txt index 34cd888bf..2b27c0567 100644 --- a/thirdparty/kobo-usbms/CMakeLists.txt +++ b/thirdparty/kobo-usbms/CMakeLists.txt @@ -14,7 +14,7 @@ endif() append_install_commands(INSTALL_CMD ${CMAKE_BUILD_TYPE}/KoboUSBMS.tar.gz DESTINATION data) external_project( - DOWNLOAD GIT cf994cca555eac242121b32ff57fe863e6249661 + DOWNLOAD GIT 3c14b5421968ecd688715ff258d43197817d29a1 https://github.com/koreader/KoboUSBMS.git BUILD_COMMAND ${BUILD_CMD} INSTALL_COMMAND ${INSTALL_CMD} From 5c1cda830273fa80ecf41e176b7e31d5efdc012d Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sat, 28 Sep 2024 20:45:36 +0200 Subject: [PATCH 4/6] kindlehf: Switch to -mtune=cortex-a7 Should somewhat bias towards MTK SoCs, without entirely jumping to the A53 (because both feature in-order pipelines). --- Makefile.defs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile.defs b/Makefile.defs index 8b175b47a..ff219e499 100644 --- a/Makefile.defs +++ b/Makefile.defs @@ -425,6 +425,8 @@ ARM64_GENERIC_ARCH:=-march=armv8-a ARMV7_A8_ARCH:=-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mthumb # Cortex A9 (Kindle PW2) ARMV7_A9_ARCH:=-march=armv7-a -mtune=cortex-a9 -mfpu=neon -mthumb +# Cortex A7 (Kobo Sage & Elipsa) +ARMV7_A7_ARCH:=-march=armv7-a -mtune=cortex-a7 -mfpu=neon -mthumb # Mirror the NDK's armeabi-v7a APP_ABI (cf. #201) ifeq ($(ANDROID_ARCH), arm) ANDROID_ARM_ARCH:=-march=armv7-a -mfpu=vfpv3-d16 @@ -489,7 +491,8 @@ else ifeq ($(TARGET), kindlepw2) COMPAT_CXXFLAGS:=$(UBUNTU_COMPAT_CFLAGS) endif else ifeq ($(TARGET), kindlehf) - ARM_ARCH:=$(ARMV7_A9_ARCH) + # We bias towards in-order CPUs (e.g., A53) + ARM_ARCH:=$(ARMV7_A7_ARCH) ARM_ARCH+=-mfloat-abi=hard ifeq ($(TARGET_MACHINE), arm-linux-gnueabihf) COMPAT_CFLAGS:=$(UBUNTU_COMPAT_CFLAGS) From f754bf8232a03de5e30674390d1ad859292bf1e5 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sat, 28 Sep 2024 21:03:04 +0200 Subject: [PATCH 5/6] Add kobov4 & kobov5 build targets kobov4 exists just because the TC exists, but we won't actually ship binaries for it. On the other hand, since kobov5 implies packaging changes, we *will* make use of its greatly updated userland. --- Makefile.defs | 42 ++++++++++++++++++++++++++++++++++++++++-- README.md | 12 ++++++++---- 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/Makefile.defs b/Makefile.defs index ff219e499..385cdfb78 100644 --- a/Makefile.defs +++ b/Makefile.defs @@ -128,6 +128,7 @@ else ifeq ($(TARGET), kindle) #Use the generic linaro TC for debugging CHOST?=arm-linux-gnueabi endif + GLIBC_VERSION_MAX = 2.12 else ifeq ($(TARGET), kindlepw2) KINDLE=1 HAS_KINDLEPW2_TC:=$(shell command -v arm-kindlepw2-linux-gnueabi-gcc 2> /dev/null) @@ -145,6 +146,7 @@ else ifeq ($(TARGET), kindlehf) else CHOST?=arm-linux-gnueabihf endif + GLIBC_VERSION_MAX = 2.20 else ifeq ($(TARGET), kindle-legacy) KINDLE=1 CHOST?=arm-kindle-linux-gnueabi @@ -160,6 +162,26 @@ else ifeq ($(TARGET), kobo) endif USE_LJ_WPACLIENT=1 GLIBC_VERSION_MAX = 2.15 +else ifeq ($(TARGET), kobov4) + KOBO=1 + HAS_KOBOV4_TC:=$(shell command -v arm-kobov4-linux-gnueabihf-gcc 2> /dev/null) + ifdef HAS_KOBOV4_TC + CHOST?=arm-kobov4-linux-gnueabihf + else + CHOST?=arm-linux-gnueabihf + endif + USE_LJ_WPACLIENT=1 + GLIBC_VERSION_MAX = 2.19 +else ifeq ($(TARGET), kobov5) + KOBO=1 + HAS_KOBOV5_TC:=$(shell command -v arm-kobov5-linux-gnueabihf-gcc 2> /dev/null) + ifdef HAS_KOBOV5_TC + CHOST?=arm-kobov5-linux-gnueabihf + else + CHOST?=arm-linux-gnueabihf + endif + USE_LJ_WPACLIENT=1 + GLIBC_VERSION_MAX = 2.35 else ifeq ($(TARGET), ubuntu-touch) CHOST?=arm-linux-gnueabihf SDL=1 @@ -423,10 +445,12 @@ ARMV7_GENERIC_ARCH:=-march=armv7-a -mtune=generic-armv7-a -mfpu=vfpv3 -mthumb ARM64_GENERIC_ARCH:=-march=armv8-a # Cortex A8 (K4, Kindle Touch, PW1, Kobos since the Touch) ARMV7_A8_ARCH:=-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mthumb -# Cortex A9 (Kindle PW2) +# Cortex A9 (e.g., Kindle PW2) ARMV7_A9_ARCH:=-march=armv7-a -mtune=cortex-a9 -mfpu=neon -mthumb -# Cortex A7 (Kobo Sage & Elipsa) +# Cortex A7 (e.g., Kobo Sage & Elipsa) ARMV7_A7_ARCH:=-march=armv7-a -mtune=cortex-a7 -mfpu=neon -mthumb +# Cortex A53 (MTK SoCs on an armv7 software stack) +ARMV7_A53_ARCH:=-march=armv7-a -mtune=cortex-a53 -mfpu=neon -mthumb # Mirror the NDK's armeabi-v7a APP_ABI (cf. #201) ifeq ($(ANDROID_ARCH), arm) ANDROID_ARM_ARCH:=-march=armv7-a -mfpu=vfpv3-d16 @@ -458,6 +482,20 @@ ifeq ($(TARGET), kobo) COMPAT_CFLAGS:=$(UBUNTU_COMPAT_CFLAGS) COMPAT_CXXFLAGS:=$(UBUNTU_COMPAT_CFLAGS) endif +else ifeq ($(TARGET), kobov4) + ARM_ARCH:=$(ARMV7_A9_ARCH) + ARM_ARCH+=-mfloat-abi=hard + ifeq ($(TARGET_MACHINE), arm-linux-gnueabihf) + COMPAT_CFLAGS:=$(UBUNTU_COMPAT_CFLAGS) + COMPAT_CXXFLAGS:=$(UBUNTU_COMPAT_CFLAGS) + endif +else ifeq ($(TARGET), kobov5) + ARM_ARCH:=$(ARMV7_A53_ARCH) + ARM_ARCH+=-mfloat-abi=hard + ifeq ($(TARGET_MACHINE), arm-linux-gnueabihf) + COMPAT_CFLAGS:=$(UBUNTU_COMPAT_CFLAGS) + COMPAT_CXXFLAGS:=$(UBUNTU_COMPAT_CFLAGS) + endif else ifeq ($(TARGET), ubuntu-touch) ARM_ARCH:=$(ARMV7_A8_ARCH) ARM_ARCH+=-mfloat-abi=hard diff --git a/README.md b/README.md index fa28a667a..752dbbc94 100644 --- a/README.md +++ b/README.md @@ -19,13 +19,17 @@ Follow these steps: * automatically fetch thirdparty sources with Makefile: * make sure you have `patch`, `wget`, `unzip`, `git` and `svn` installed * run `make fetchthirdparty`. -* run `make TARGET=kindlehf` For kindle models running fw >= 5.16.3 (Paperwhite 4 and later) +* run `make TARGET=kindlehf` For kindle models running FW >= 5.16.3 (Paperwhite 4 and later) -* run `make TARGET=kindlepw2` For Kindle models >= Paperwhite 2. +* or run `make TARGET=kindlepw2` For Kindle models >= Paperwhite 2. -* run `make TARGET=kindle` For Kindle models >= Kindle 4 < Paperwhite 2. +* or run `make TARGET=kindle` For Kindle models >= Kindle 4 < Paperwhite 2. -* run `make TARGET=kindle-legacy` for Kindle DXG/2/3 devices. +* or run `make TARGET=kindle-legacy` for Kindle DXG/2/3 devices. + +* or run `make TARGET=kobov5` for Kobo/Tolino devices runing FW >= 5.x + +* or run `make TARGET=kobov4` for Mk.7 & up Kobo devices running FW 4.x * or run `make TARGET=kobo` for Kobo devices. From 5a7f0c2080a95e35b8722c1d8b02d0d329449e6a Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sun, 29 Sep 2024 14:48:13 +0200 Subject: [PATCH 6/6] We still need the HB hack on armv6 ;'( --- thirdparty/harfbuzz/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/harfbuzz/CMakeLists.txt b/thirdparty/harfbuzz/CMakeLists.txt index 7dd57f586..7b9dcfd32 100644 --- a/thirdparty/harfbuzz/CMakeLists.txt +++ b/thirdparty/harfbuzz/CMakeLists.txt @@ -18,7 +18,7 @@ list(APPEND PATCH_CMD COMMAND ${ISED} "/^#line/d" src/hb-buffer-deserialize-text-unicode.hh ) -# We've apparently hit a weird corner-case w/ XText where GCC/STL atomics *sometimes* horribly blow up on an ARM1136JF-S CPU w/ GCC 7.5... +# We've apparently hit a weird corner-case w/ XText where GCC/STL atomics *sometimes* horribly blow up on an ARM1136JF-S CPU w/ GCC 7.5 & up... # c.f., https://github.com/koreader/koreader/issues/5780 & https://github.com/koreader/koreader/issues/6024 # NOTE: Our initial approach was to only disable atomics in a very dirty manner, which only helped with the first issue. # This, on the other hand, appears to help with both.