05-06-2016, 11:48 AM | #31 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
I hate struggling with toolchains. Not my cup of tea. If somebody can give me some useful hints about compiling WORKING binaries for the PXA255 in the K1, please do so. Thanks.
|
05-06-2016, 12:45 PM | #32 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
I tried building gcc from the amazon source code for my K1, but it errored out during the compile -- perhaps a configuration error. So I tried another prebuilt toolchain:
https://github.com/samsheff/Amazon-K...ross-Toolchain However, a "hello world" built with that segfaults on my K1. Windows toolchains are much more backwards compatible. Why does linux need a specific flavor of a specific version of a toolchain (and even with specific flags, for kernel builds)? How do sane people figure out which specific set of options? There is too much to read and too little time. And as I said, the tcc for kindles creates code that also does not work on my K1. What is so different about an armv5 that all the existing kindle binaries either are not recognized as executable, or get "illegal instruction", or segfault? I need to put this aside for a bit, and go outdoors before it starts snowing again... |
Advert | |
|
05-06-2016, 01:08 PM | #33 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
The usual suspect is the difference in how un-aligned accesses are handle ARMv5 and ARMvLater.
Use only aligned accesses to work-around the problem. Hmm... There should be compiler flags to 'fix' your source code for you during compile. |
05-06-2016, 01:14 PM | #34 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
I tested my hello.c built with the PXA255 toolchain (supposedly compatible with the K1), and it ran fine in my K5. So it I *can* compile code that works on the K1, perhaps it will also work on later kindles without recompiling? I hope so... But then I will need to recompile ALL the hacks I want to support, so they can run on "all the kindles"...
So, yeah, now I need to learn enough ins and outs about "compiler flags", eh? I never had these problems on windows, though I was fond of building everything with vc6 for win98 (so it would work on "all the windows boxen")... Time to find the LOWEST COMMON DENOMINATOR toolchain that can support all the kindles (with the exception of kernel modules, which I also plan to build when I have *time* to get compatible toolchains working for each specific kernel version, and with all the right flags and options set)... I am not a happy camper right now, and I am not getting an younger burning time trying unsuccessfully to build apps from source. Even COBOL was easier than THIS! And yes, some of my COBOL programs were dynamically loading tcclib.dll (to be compliant with LGPL), and they used tcc to compile and run C scripts (used as search filters). Even that was easier than this... But at least now I have a toolchain that I can use to compile my kindle video player (with sound support). I want gmplay to support the K1 2-bit video as well (4 pixels per byte). When I have time, I want to try pumping sound out the accessory port pads on the bottom of most kindles, and also perhaps out the power LEDs. A photocell connected to amplified speakers would not be so bad, for kindle sound, would it? But the accessory power pads can drive an LED reading light, so they ought to be able to drive a small speaker or headphones, I think... Last edited by geekmaster; 05-06-2016 at 04:04 PM. |
05-06-2016, 03:44 PM | #35 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Your looking at it, the K1 is the lowest common denominator.
Everything else is ARMv6 or ARMv7 (both of which run ARMv5 code). |
Advert | |
|
05-06-2016, 04:06 PM | #36 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Now if I could just find or build a toolchain that works on the K1 PXA255 (unlike the toolchains that were SUPPOSED to support this processor but failed when I tested them). It would also be nice if tcc could be tweaked to work on it too...
|
05-06-2016, 04:22 PM | #37 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
I tried adding -march=armv5 to the gcc command line. Still not working. Not sure what to try next...
|
05-06-2016, 04:36 PM | #38 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
-mtune=xscale -mno-unaligned-access
Ref: https://gcc.gnu.org/onlinedocs/gcc-4...ml#ARM-Options Last edited by knc1; 05-06-2016 at 04:39 PM. |
05-06-2016, 04:42 PM | #39 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
The older gcc versions that were supposed to support the PXA255 processor did not support -mfloat-abi=softfp. I tried building with the latest gcc in my recent linux mint, with -march=armv5 and -mfloat-abi=softfp, but still not working.
Any idea what flags (and/or gcc versions) I should use, so I can support the armv5 K1 instead of just armv7+ processors? |
05-06-2016, 04:52 PM | #40 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
My NSLU2 is an Intel Xscale IXP420 device -
I have a complete, self-hosting, install of Debian on it - I know, I set it up to build the entire install from source (it took 3 or 4 days IIRC). So it is possible. Didn't you once tell me you had an NSLU-2 also? Use it to native compile your code for Xscale under NSLU2/Debian. Xscale is really, really old - I can only guess beyond what I have already posted. Note: The XScale architecture is based on the ARMv5TE ISA without the floating point instructions. Ref: https://en.wikipedia.org/wiki/XScale Last edited by knc1; 05-06-2016 at 04:56 PM. |
05-06-2016, 10:35 PM | #41 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Google for a Debian/Arm/qemu-static chroot - -
The is fairly well documented, you have a choice of directions. The one I found easiest to follow is: https://wiki.debian.org/ArmHardFloatChroot Modifying names and things to use the ARMel and the NSLU2 xScale tar-ball in your case. I have several of those installed and they each worked the first time tried. Notes: For the i.MX6 touchscreen devices (they all are) - Debian Jessie is a good match to the system libraries. I haven't found a problem yet. For the K1 - I think you will be stuck with Debian 3 to get a decent match with the installed system libraries. Then, since the NSLU2/Debian tar-ball is still posted, run that in your qemu chroot (emulation on a current desktop will be a lot faster than the NSLU2 is ). https://www.cyrius.com/debian/nslu2/ Note that the Debian 3 tar-bar is still posted there (or linked to from there). Trivia: The Peter Korsgaard mentioned there is now the lead maintainer of BuildRoot. |
05-07-2016, 12:21 AM | #42 | |||
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
Quote:
Quote:
Last edited by geekmaster; 05-07-2016 at 12:27 AM. |
|||
05-07-2016, 08:25 AM | #43 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
I don't recall any of what you quoted - mine "just worked".
|
05-07-2016, 09:32 AM | #44 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Those quotes were from a link on the page you linked. Sadly, that armv5b toolchain also built code that does not work on my k1 (not found and/or segfault issues).
I noticed that tcc configure supports options for armv4 (and also cross compiling). Time to play with that for a bit, though I will still need a real gcc... I am not sure why we seem to need a unique toolchain for each device we intend to support. There MUST be some compile flags to set to generate armv4 code on a modern device -- I feel like such a noob slogging in this toolchain muckery (too much time in the mainframe COBOL and MS windows development worlds). |
05-07-2016, 09:39 AM | #45 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
I am thinking strange thoughts -- would it make ANY sense to run qemu on my K1 so it can support apps compiled for newer arm processors? Nah...
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
geekmaster vacation | geekmaster | Kindle Developer's Corner | 2 | 03-19-2012 09:18 PM |