11-24-2019, 06:38 PM | #1 | ||
rm -rf /
Posts: 219
Karma: 3333683
Join Date: Nov 2019
Location: United Kingdom
Device: K5, KT, KT2, KT3, KT4, KV, PW2, PW3, PW4, PW5
|
Compiling the Amazon toolchain?
I've been trying to follow these instructions from TOOLCHAIN_BUILD_HOW-TO.txt in order to build a toolchain that is able to compile kernel modules for my firmware:
Quote:
Quote:
|
||
11-24-2019, 07:30 PM | #2 |
BLAM!
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
I don't think anyone here ever went with bitbake, but I did notice that file, and that it pointed to a wonderfully outdated yocto tag .
FWIW, the current link for that is probably on https://www.yoctoproject.org/softwar...ived-releases/ People building a whole bunch of stuff have gone with BuildRoot in the past, but I've personally only ever used crosstool-ng and then basically scripted stuff myself. If you only need a TC, and not actually a giant "build-me-a-distro" machinery, c.f., https://github.com/koreader/koxtoolchain which is basically a frontend to my setup. If you intend to build kernel modules (and only modules), you *may* need something using a GCC version closer to what's used to build your device's kernel. I personally don't have a config for that on Kindle (but I do for Kobos). Last edited by NiLuJe; 11-24-2019 at 07:35 PM. |
12-04-2019, 11:43 AM | #3 |
rm -rf /
Posts: 219
Karma: 3333683
Join Date: Nov 2019
Location: United Kingdom
Device: K5, KT, KT2, KT3, KT4, KV, PW2, PW3, PW4, PW5
|
Just following this up in case anyone else is interested: @NiLuJe's toolchain is suitable for compiling Linux kernel modules, but you need to make a small tweak to the Linux sources first (at least for 3.0.35).
When compiling a module for the first time, I encountered this error: Code:
CHK include/linux/version.h CHK include/generated/utsrelease.h make[1]: 'include/generated/mach-types.h' is up to date. CC kernel/bounds.s In file included from include/linux/compiler.h:48:0, from include/linux/stddef.h:4, from include/linux/posix_types.h:4, from include/linux/types.h:17, from include/linux/page-flags.h:8, from kernel/bounds.c:9: include/linux/compiler-gcc.h:94:1: fatal error: linux/compiler-gcc7.h: No such file or directory #include gcc_header(__GNUC__) ^~~~ compilation terminated. /home/ubuntu/linux3/./Kbuild:35: recipe for target 'kernel/bounds.s' failed make[1]: *** [kernel/bounds.s] Error 1 Makefile:990: recipe for target 'prepare0' failed make: *** [prepare0] Error 2 Code:
ln include/linux/compiler-gcc4.h include/linux/compiler-gcc7.h |
12-06-2019, 12:26 PM | #4 |
BLAM!
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Yeah, FWIW, I've had to jump through a few hoops with older kernel releases on Kobo, too, even when using a GCC 4.9 TC.
Mostly simple/stupid fixes which are usually pretty obvious once you grok the error message . Good to know that modules built w/ GCC 7 worked out fine, though . And that Amazon finally stopped shipping kernel sources with missing non-trivial headers (because that was a thing at one point ^^). Last edited by NiLuJe; 12-06-2019 at 12:29 PM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compiling for Lubuntu (regarding compiling instructions) | jgratero | Sigil | 5 | 07-15-2012 07:54 PM |
Toolchain Problems | benjaminvm | Sony Reader Dev Corner | 3 | 12-02-2008 10:03 PM |
iLiad How to build iPDF with toolchain? | ericshliao | iRex Developer's Corner | 2 | 01-23-2008 11:15 AM |
iLiad Compiling iLiad toolchain for MacOSX | Mike Kostousov | iRex Developer's Corner | 3 | 09-20-2007 11:54 PM |
PRS-500 Compiling for Reader: toolchain and libraries? | igorsk | Sony Reader Dev Corner | 6 | 12-26-2006 01:11 PM |