Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 11-24-2019, 06:38 PM   #1
katadelos
rm -rf /
katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.
 
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:
Building the Toolchain

To build the toolchain, You need to setup a poky 1.8.1 environment

To setup environment:

Clone Poky 1.8.1 by following the instruction from https://www.yoctoproject.org/downloads/core/fido181

Execute the folling command to setup a environment
$ source poky/oe-init-build-env build
$ cd build

To build toolchain,execute the follwing command after setting up an environment

$ bitbake gcc-cross
The link to yoctoproject.org is dead but was archived by the Wayback Machine, which led me to a download link for poky-fido-13.0.1.tar.bz2. After decompressing the file, setting up an environment and running bitbake gcc-cross, bitbake throws this error:
Quote:
WARNING: Host distribution "Ubuntu-18.04" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Parsing recipes: 100% |########################################| Time: 00:01:05
Parsing of 884 .bb files complete (0 cached, 884 parsed). 1285 targets, 41 skipped, 0 masked, 0 errors.
ERROR: Nothing PROVIDES 'gcc-cross'. Close matches:
gcc-cross-i586

Summary: There was 1 WARNING message shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
I tried bitbake gcc-cross-i586, but this seems to target a different architecture completely and fails when attempting to compile automake. Has anyone been able to compile a toolchain using the provided instructions?
katadelos is offline   Reply With Quote
Old 11-24-2019, 07:30 PM   #2
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
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.
NiLuJe is offline   Reply With Quote
Old 12-04-2019, 11:43 AM   #3
katadelos
rm -rf /
katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.
 
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
This is simple to fix - all you need to do is create a hard link to the file that the compiler is expecting to find:
Code:
ln include/linux/compiler-gcc4.h include/linux/compiler-gcc7.h
Once this is done, you should be good to go.
katadelos is offline   Reply With Quote
Old 12-06-2019, 12:26 PM   #4
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
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.
NiLuJe is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 10:23 PM.


MobileRead.com is a privately owned, operated and funded community.