Thread: Native Kpw tool chain
View Single Post
Old 10-05-2012, 10:18 AM   #17
knc1
Embedded Cheerleader
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 6,664
Karma: 5850002
Join Date: Feb 2012
Device: Too many.
Quote:
Originally Posted by NiLuJe View Post
FWIW, that looks suspiciously identical to the TC used on the K5 .

Meaning that's eglibc 2.12(.1) .

With the same CPU, so, yeah, that's nice, means a single binary for the whole K4/K5/KPW range .
Nice translation.

What follows is my translation as requested by ixtab:

Quote:
Originally Posted by knc1 View Post
This one is a bit easier to deal with than the older Kindles:
The (cross-) compiled, native executables in the Kindle version 5.2.0 firmware shipped first on the Kindle paperwhite device in October, 2012 shows build dates of September, 2012.

For the best chance of re-using the existing libraries and code already installed on the machine, the recommended practice is to use the same or a very similar tool-chain, library set, and compile time option set.

Examination of the binaries with recent build dates discovers the following about the tool-chain in use by the vendor:

(cross-) compiler:
Code:
000618 GCC: (Linaro GCC 4.5-2011.05-0) 4.5.4 20110505 (prerelease)
000654 GCC: (Ubuntu/Linaro 4.4.4-14ubuntu1) 4.4.5 20100909 (prerelease)
Which is typical of the versions being shipped with Ubuntu/Oneiric (11.10).
http://packages.ubuntu.com/search?ke...ic&section=all

The tool-chain in use pre-dates those of the Ubuntu Linaro project:
https://launchpad.net/linaro-toolchain-binaries/trunk
The tool-chain in use pre-dates the entire Linaro project.
View the above link for reference while reading the following comments.

The recommendation for doing "compatible work" is a choice of two courses:

Use the most recent Linaro tool-chain prior to the shift to armelhf as the standard:
https://launchpad.net/linaro-toolcha...estone/2012.04
Or
Re-build an armel tool-chain from the least buggy, recent, tool-chain:
https://launchpad.net/linaro-toolcha...estone/2012.09
By selecting the crosstool-ng bundle on that page and making the configuration changes required to select the tool-chain and libc default options that best match that of the vendor's tool-chain setup.
This second choice, even using the automated tool-chain builder, one that only those with experience in building system tool-chains and libraries should attempt.

System libraries:
Code:
core2quad lib $ file libc-2.12.1.so
libc-2.12.1.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, stripped
A less than recent libc, using kernel header ABI of 2.6.16.

Although not the more recent libc that is shipping with Ubuntu/Oneiric (11.10):
http://packages.ubuntu.com/search?ke...ic&section=all
In fact, ARM cross-support even in Ubuntu/Natty (11.04) is not that old:
http://packages.ubuntu.com/source/na...toolchain-base

As can be seen from the above link (which lists version details of the dependencies), probably the best recommendation that can be made here is to use the second choice above (crosstool-ng) and set its configuration to download and build the older, 2.6.12 system library set.
Be certain to also set the kernel headers selection to 2.6.16 (the prior "build ABI standard") in the crosstool-ng configuration for the system libraries.

Note: The same comments above apply to using Buildroot (which can use crosstool-ng for its tool-chain building).

As to other compiler options, hints here:
Code:
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "7-A"
  Tag_CPU_arch: v7
  Tag_CPU_arch_profile: Application
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-2
  Tag_FP_arch: VFPv3
  Tag_Advanced_SIMD_arch: NEONv1
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_align_preserved: 8-byte, except leaf SP
  Tag_ABI_enum_size: int
  Tag_ABI_HardFP_use: SP and DP
  Tag_DIV_use: Not allowed
  Tag_Virtualization_use: TrustZone
Ensuring that the above options are the defaults when building a "vendor compatible" tool-chain as described above is also a "good idea" (tm)
knc1 is offline   Reply With Quote