Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The great TC update (GCC 14.2 for everyone) #41

Merged
merged 8 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:

strategy:
matrix:
tc: [kindle, kindle5, kindlepw2, kobo, nickel, remarkable, cervantes, pocketbook, bookeen]
tc: [kindle, kindle5, kindlepw2, kindlehf, kobo, kobov4, kobov5, nickel, remarkable, cervantes, pocketbook, bookeen]

steps:
- name: Check out Git repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -26,7 +26,7 @@ jobs:
run: tar -C ~ -czf ${{ matrix.tc }}.tar.gz x-tools

- name: Uploading artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.tc }}
path: ${{ matrix.tc }}.tar.gz
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ For example, to build a cross toolchain for legacy non-touch kindle devices, typ
./gen-tc.sh kindle
```

You can use `./gen-tc.sh -h` to get a list of supported platforms.
You can use `./gen-tc.sh -h` to get a list of supported platforms (some of which may not have a matching KOReader target, either because a port was never finished (e.g., `bookeen`), or they're just minor variants for evolving platforms where KOReader prefers to keep backwards compatibility intact (e.g., `kobov4`)).

After the build is finished, you should be able to find your cross ToolChains under the `~/x-tools` directory.

Expand Down Expand Up @@ -73,11 +73,14 @@ Due to a whole lot of legacy baggage, the names of the various Kindle TCs may be
| kindle | Kindle 2, DX, DXg, 3 | kindle-legacy |
| kindle5 | Kindle 4, Touch, PW1 | kindle |
| kindlepw2 | Kindle PW2 & everything since | kindlepw2 |
| kindlehf | Any Kindle on FW >= 5.16.3 | kindlehf |

No such worries on Kobo & Cervantes, though ;).

The nickel TC is a Kobo variant that mimics Kobo's own TC (as of FW >= 4.6). It is *not* recommended for general purpose stuff, only use it if you have a specific need for it (which should essentially be limited to working with Kobo's nickel, or Kobo's kernels).

The kobov5 TC is specifically tailored for Kobo & Tolino devices running on FW 5.x. Since that FW implies packaging differences compared to earlier iterations, it does warrant a dedicated KOReader target. (It also targets a *much* more recent glibc version).

The pocketbook TC aims for maximum backward compatibility while still keeping inkview support.

The remarkable TC aims for FW >= 2.x compatibility.
Expand Down
59 changes: 42 additions & 17 deletions gen-tc.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash -e
#
# adapted from NiLuJe's build script:
# Adapted from NiLuJe's build script:
# http://www.mobileread.com/forums/showthread.php?t=88004
# (live copy: http://trac.ak-team.com/trac/browser/niluje/Configs/trunk/Kindle/Misc/x-compile.sh)
# (live copy: https://svn.ak-team.com/svn/Configs/trunk/Kindle/Misc/x-compile.sh)
#
# =================== original header ====================
#
Expand Down Expand Up @@ -60,8 +60,7 @@ Build_CT-NG() {
unset CFLAGS CXXFLAGS LDFLAGS
ct-ng "${tc_target}"
ct-ng oldconfig
# That requires the 1.24 branch, so, don't do it on 1.23
[ ! -f "${BUILD_ROOT}/CT-NG/steps.mk" ] && ct-ng upgradeconfig
ct-ng upgradeconfig
ct-ng updatetools
nice ct-ng build
echo ""
Expand All @@ -87,7 +86,10 @@ Supported platforms:
kindle
kindle5
kindlepw2
kindlehf
kobo
kobov4
kobov5
nickel
remarkable
cervantes
Expand All @@ -106,56 +108,77 @@ case $1 in
echo "${HELP_MSG}"
exit 0
;;
kobov5)
Build_CT-NG \
https://github.com/NiLuJe/crosstool-ng.git \
a221b564b965cb3ea79d0145ee3e085d354ed5fa \
"arm-${1}-linux-gnueabihf"
;;
kobov4)
Build_CT-NG \
https://github.com/NiLuJe/crosstool-ng.git \
a221b564b965cb3ea79d0145ee3e085d354ed5fa \
"arm-${1}-linux-gnueabihf"
;;
kobo)
Build_CT-NG \
https://github.com/NiLuJe/crosstool-ng.git \
3e2d99d030cbecc0119aa08bd06d062f59669d45 \
a221b564b965cb3ea79d0145ee3e085d354ed5fa \
"arm-${1}-linux-gnueabihf"
;;
nickel)
Build_CT-NG \
https://github.com/NiLuJe/crosstool-ng.git \
3e2d99d030cbecc0119aa08bd06d062f59669d45 \
a221b564b965cb3ea79d0145ee3e085d354ed5fa \
"arm-${1}-linux-gnueabihf"
;;
kindlehf)
Build_CT-NG \
https://github.com/NiLuJe/crosstool-ng.git \
a221b564b965cb3ea79d0145ee3e085d354ed5fa \
"arm-${1}-linux-gnueabihf"
;;
kindlepw2)
Build_CT-NG \
https://github.com/NiLuJe/crosstool-ng.git \
3e2d99d030cbecc0119aa08bd06d062f59669d45 \
a221b564b965cb3ea79d0145ee3e085d354ed5fa \
"arm-${1}-linux-gnueabi"
;;
kindle5)
Build_CT-NG \
https://github.com/NiLuJe/crosstool-ng.git \
3e2d99d030cbecc0119aa08bd06d062f59669d45 \
a221b564b965cb3ea79d0145ee3e085d354ed5fa \
"arm-${1}-linux-gnueabi"
;;
kindle)
# NOTE: Don't swap away from the 1.23-kindle branch,
# this TC currently fails to build on 1.24-kindle...
# NOTE: Prevent libstdc++ from pulling in utimensat@GLIBC_2.6
export glibcxx_cv_utimensat=no

Build_CT-NG \
https://github.com/NiLuJe/crosstool-ng.git \
9954e26ad2a0781a12f0066411bc5ee5cd8b2829 \
a221b564b965cb3ea79d0145ee3e085d354ed5fa \
"arm-${1}-linux-gnueabi"
unset glibcxx_cv_utimensat
;;
remarkable)
Build_CT-NG \
https://github.com/NiLuJe/crosstool-ng.git \
3e2d99d030cbecc0119aa08bd06d062f59669d45 \
a221b564b965cb3ea79d0145ee3e085d354ed5fa \
"arm-${1}-linux-gnueabihf"
;;
cervantes)
Build_CT-NG \
https://github.com/NiLuJe/crosstool-ng.git \
3e2d99d030cbecc0119aa08bd06d062f59669d45 \
a221b564b965cb3ea79d0145ee3e085d354ed5fa \
"arm-${1}-linux-gnueabi"
;;
pocketbook)
# NOTE: Don't swap away from the 1.23-kindle branch,
# this TC currently fails to build on 1.24-kindle...
# NOTE: Prevent libstdc++ from pulling in utimensat@GLIBC_2.6
export glibcxx_cv_utimensat=no

Build_CT-NG \
https://github.com/NiLuJe/crosstool-ng.git \
9954e26ad2a0781a12f0066411bc5ee5cd8b2829 \
a221b564b965cb3ea79d0145ee3e085d354ed5fa \
"arm-${1}-linux-gnueabi"
# Then, pull InkView from the (old) official SDK...
# NOTE: See also https://github.com/pocketbook/SDK_6.3.0/tree/5.19/SDK-iMX6/usr/arm-obreey-linux-gnueabi/sysroot/usr/local for newer FWs...
Expand Down Expand Up @@ -194,11 +217,13 @@ case $1 in
-O "${HOME}/x-tools/arm-${1}-linux-gnueabi/arm-${1}-linux-gnueabi/sysroot/usr/include/bookstate.h"
chmod a-w "${HOME}/x-tools/arm-${1}-linux-gnueabi/arm-${1}-linux-gnueabi/sysroot/usr/include/bookstate.h"
chmod a-w "${HOME}/x-tools/arm-${1}-linux-gnueabi/arm-${1}-linux-gnueabi/sysroot/usr/include"

unset glibcxx_cv_utimensat
;;
bookeen)
Build_CT-NG \
https://github.com/NiLuJe/crosstool-ng.git \
3e2d99d030cbecc0119aa08bd06d062f59669d45 \
a221b564b965cb3ea79d0145ee3e085d354ed5fa \
"arm-${1}-linux-gnueabi"
;;
*)
Expand Down
14 changes: 10 additions & 4 deletions refs/x-clang-compiler-rt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Companion script to x-compile compiler-rt for Clang experiments
#
# $Id: x-clang-compiler-rt.sh 18643 2021-07-09 22:43:16Z NiLuJe $
# $Id: x-clang-compiler-rt.sh 19004 2022-12-25 17:22:43Z NiLuJe $
#
# kate: syntax bash;
#
Expand All @@ -29,9 +29,14 @@ mkdir -p "${TC_BUILD_DIR}"
cd "${TC_BUILD_DIR}"

# c.f., https://llvm.org/docs/HowToCrossCompileBuiltinsOnArm.html
CLANG_VERSION="12.0.1"
tar -I pigz -xvf /usr/portage/distfiles/llvmorg-${CLANG_VERSION}.tar.gz
cd llvm-project-llvmorg-${CLANG_VERSION}/compiler-rt
CLANG_VERSION="15.0.6"
tar xvJf /usr/portage/distfiles/llvm-project-${CLANG_VERSION}.src.tar.xz
cd llvm-project-${CLANG_VERSION}.src
tar xvJf /usr/portage/distfiles/llvm-gentoo-patchset-${CLANG_VERSION}.tar.xz
for patch in llvm-gentoo-patchset-15.0.6/* ; do
patch -p1 < "${patch}"
done
cd compiler-rt
mkdir build
cd build
# NOTE: Install path is the *live* Clang installation from the host (Gentoo paths)!
Expand All @@ -45,6 +50,7 @@ cmake .. -G Ninja \
-DCOMPILER_RT_BUILD_XRAY=OFF \
-DCOMPILER_RT_BUILD_LIBFUZZER=OFF \
-DCOMPILER_RT_BUILD_MEMPROF=OFF \
-DCOMPILER_RT_BUILD_ORC=OFF \
-DCOMPILER_RT_BUILD_PROFILE=OFF \
-DCMAKE_C_COMPILER=$(command -v clang) \
-DCMAKE_AR=$(command -v llvm-ar) \
Expand Down
Loading