09-27-2012, 04:54 PM | #706 | |
Just a Noob
Posts: 145
Karma: 162610
Join Date: Aug 2011
Device: Kindle 3
|
Quote:
I took another look at Makefile, but couldn't find any more places where *FLAGS were not passed down. I then went to Linaro site, and downloaded 2012.04 binaries (the last ones for gnueabi - the newer ones are all gnueabihf). I got the same results as with Ubunutu's Linaro. (Not really surprising... gcc -Q -v gave this: Code:
GNU C (crosstool-NG linaro-1.13.1-2012.04-20120426 - Linaro GCC 2012.04) version 4.7.1 20120402 (prerelease) (arm-linux-gnueabi) compiled by GNU C version 4.1.3 20080704 (prerelease) (Ubuntu 4.1.2-27ubuntu1), GMP version 5.0.2, MPFR version 3.1.0, MPC version 0.9 The settings I used are supposed to override any problematic defaults: Code:
CFLAGS:=-O3 -fno-stack-protector -U_FORTIFY_SOURCE -D_GNU_SOURCE $(SYSROOT) CXXFLAGS:=-O3 -fno-stack-protector -U_FORTIFY_SOURCE -fno-use-cxa-atexit $(SYSROOT) ARM_CFLAGS:=-march=armv6j -mtune=arm1136jf-s -marm -mfloat-abi=softfp -mfpu=vfp Both Linaro 2012.04 and Ubuntu Linaro use -imultilib and -imultiarch, so they might be the problem. None of the other TCs I tried (and NiLuJe's version) use it. In the end, I compiled hello.c with 2012.04 using Code:
arm-linux-gnueabi-gcc -O3 -fno-stack-protector -U_FORTIFY_SOURCE -D_GNU_SOURCE -march=armv6j -mtune=arm1136jf-s -marm -mfloat-abi=softfp -mfpu=vfp hello.c -o hello I'm now of the opinion that Linaro/Ubuntu somehow compile their TC in a way that makes them incompatible with Kindle 3, and that switches won't fix it. (Disclaimer: Noob's opinion - possibly wrong). If someone can prove it wrong, I'd really like to hear it. Last edited by Kai771; 09-28-2012 at 02:23 PM. |
|
09-27-2012, 07:29 PM | #707 | |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
I use that one all the time. works great.
EDIT: I used: Quote:
I configure my system as outlined at minimodding http://minimodding.com/article9-Kind...ng-custom-apps to run custom apps Last edited by twobob; 12-23-2012 at 09:23 PM. Reason: added my flavour |
|
09-27-2012, 08:11 PM | #708 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Let us see **when** it segfaults. You can find a static built strace in the tools index. |
|
09-28-2012, 05:43 AM | #709 | |
Just a Noob
Posts: 145
Karma: 162610
Join Date: Aug 2011
Device: Kindle 3
|
@twobob
Sorry if I misunderstood something, but isn't cortex-a8 and vfpv3 for Kindle 5? I have a Kindle 3. Did you try running on K3 something compiled with Linaro? One other thing, on http://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html they say: Quote:
I wanted to ask one more thing: both you and NiLuJe use -O2 instead of -O3. Is it wrong to use -O3? @knc1 Thanks for advice. I'll give it a go as soon as I get home |
|
09-28-2012, 07:16 AM | #710 | |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
hi when I looked at your name yesterday it said "Kindle" I thought? Perhaps not.
So, I took a best guess as you were fiddling around with "futuristic" TC's (as far as a 3 is concerned) at a touch. FWIW I go for -02 as thumb in the air for release, I just build as-is for my own stuff, I would rather have the extra info for when things go wrong. Niluje did discuss with others at great length the pro's and cons of optimisations on several other threads which is how I came about my numbers. Relied on the shoulders of others. Happens a lot on here I got the: Quote:
I have a 3 also, perhaps when I get done fiddling with the Touch I'll go back and look at building some random TC's via buildroot (although the CS 2007.q3 has served me well given it's age) but it's not a priority until the current "can-build" list is exhausted. In the future perhaps I should read back the 48 pages to check my facts. Although as I have now noticed you have "Kindle 3" as the device there is no need. IIRC I did actually download this entire thing and run it through a build (without comment) the first time people started complaining about building it. Perhaps given a little free time there will be an opportunity to mirror your efforts this side and see what falls to pieces. Sounds like fun, can't be today though. Other fun on the cards. I assume there is a good reason you have chosen such an interesting flavour of TC and given a bit of time I will be interested to hear the reasons. Good fortune. Last edited by twobob; 09-28-2012 at 07:22 AM. |
|
09-28-2012, 08:16 AM | #711 | |
Just a Noob
Posts: 145
Karma: 162610
Join Date: Aug 2011
Device: Kindle 3
|
@twobob
No problem at all, just wanted to be sure I didn't miss something. Quote:
Then I tried CS toolchains (all of them) and with a lot of help from others succeeded (with most of them). Now it's Linaro. Just wanted to see what works (and what we can make work). Kinda like "We do stuff so you don't have too" . But of course, everyone is welcome to try too. P.S. I hope you don't find me too strange for considering this kind of thing "fun" . Last edited by Kai771; 09-28-2012 at 08:23 AM. |
|
09-28-2012, 08:40 AM | #712 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
hell no. respect
|
09-28-2012, 09:17 AM | #713 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Read twobob's thread reporting the results of each CS/MG toolchain. I guess we can call what you did as "independent confirmation" - other than the artifacts caused by your local problems. |
|
09-28-2012, 11:15 AM | #714 | |
Just a Noob
Posts: 145
Karma: 162610
Join Date: Aug 2011
Device: Kindle 3
|
Quote:
But, if I understood it correctly, the goal of that thread was to make QEMU VM, under which you run gcc, which compile linux apps. My goal was a bit different. I was only interested in compiling kpdfview. I managed that first with x-tools-glibc2.5-gcc4.2.4.tar.gz, but since that file seemed controversial, I tried with CS next, since it was the default in kpdfview makefile. Actually, I lied in this post: the first CS TC I tried was 2008q1, because twobob said "I recommend the CS (Code Sourcery) 2008q1 now since it is the last TC that compiles natively (Runs applications without replacing the onboard system libraries) for the Kindle 3 ". It didn't work, as can be seen in my previous posts (default makefile has bugs that need to be fixed in order to be able to compile it with versions newer than 2007q3). THEN I downloaded all . So, this is "what TC can you use and how to build kpdfviewer" and not "what TCs are good for kindle cross compiling". Both topics have a lot in common, but the first one is more specific. That said, I do plan to try out stuff from DIY - KeK a bit later. Wait for me! Now, I followed your advice, and this is the output: Code:
execve("./hello-linaro", ["./hello-linaro"], [/* 13 vars */]) = 0 brk(0) = 0x11000 uname({sys="Linux", node="kindle", ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4001b000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/var/run/ld.so.cache", O_RDONLY) = 20 fstat64(20, {st_mode=S_IFREG|0644, st_size=14282, ...}) = 0 mmap2(NULL, 14282, PROT_READ, MAP_PRIVATE, 20, 0) = 0x4001c000 close(20) = 0 open("/lib/libc.so.6", O_RDONLY) = 20 read(20, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\250J\1\000"..., 512) = 512 fstat64(20, {st_mode=S_IFREG|0755, st_size=1348230, ...}) = 0 mmap2(NULL, 1135004, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 20, 0) = 0x40025000 mprotect(0x4012e000, 28672, PROT_NONE) = 0 mmap2(0x40135000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 20, 0x108) = 0x40135000 mmap2(0x40138000, 8604, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40138000 mprotect(0xbea67000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC|PROT_GROWSDOWN) = 0 close(20) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40020000 syscall_983045(0x400204a0, 0x400204a0, 0x40024058, 0x40020b78, 0x40, 0x40024058, 0, 0xf0005, 0x6fffff40, 0x8034, 0x40024000, 0xbea67b6c, 0, 0xbea67890, 0x40014974, 0x400020c0, 0x20000010, 0x400204a0, 0, 0, 0xc764, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) = 0 mprotect(0x40135000, 8192, PROT_READ) = 0 munmap(0x4001c000, 14282) = 0 --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV +++ Process 1707 detached |
|
09-28-2012, 11:20 AM | #715 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
You must have skipped reading the document linked to in the topmost post.
http://knetconnect.com/KeK/KeK_reference.html Which serves as a description of the files in the resource pool. |
09-28-2012, 11:29 AM | #716 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Code:
open("/var/run/ld.so.cache", O_RDONLY) = 20 fstat64(20, {st_mode=S_IFREG|0644, st_size=14282, ...}) = 0 mmap2(NULL, 14282, PROT_READ, MAP_PRIVATE, 20, 0) = 0x4001c000 Code:
munmap(0x4001c000, 14282) = 0 --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV +++ Process 1707 detached twobob has written extensively on how to do that. |
|
09-28-2012, 11:58 AM | #717 |
Just a Noob
Posts: 145
Karma: 162610
Join Date: Aug 2011
Device: Kindle 3
|
@knc1
Thanks for explaining what's happening. Transfering glibc that came with Linaro to Kindle, and making the app use that lib is not something I want to do. I don't want to link them statically either. I want the app to use Kindle's glibc. So, to rephrase what I said earlier: Ubuntu/Linaro compiled their TC and it's libraries in a way that makes them incompatible with Kindle 3's libraries. Would you say that this is correct? If you compile Linaro gcc yourself, you can make it compatible with Kindle 3 (that's what NiLuJe did, I think), but the binaries that ship with Ubuntu, or are distributed from Linaro are not. @NiLuJe What's your opinion? |
09-28-2012, 12:39 PM | #718 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Read twobob's work.
He shows how to get an application (on /mnt/us) to use system files and libraries, also on /mnt/us. No changes required to the Kindle system files. |
09-28-2012, 01:13 PM | #719 |
BLAM!
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@Kai771: Just for confirmation: run file on a binary built by the Ubuntu/Linaro TC: What minimum version of the Linux kernel does it report? [ie. ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.22, not stripped]
I'm guessing something way newer than the 2.6.22/2.6.26 of the K2/K3, which would explain why it's segfaulting on a stupid stuff: ABI mismatch. I remember that kind of error being somewhat more user-friendly on x86, where the loader actually tells you why it can't run a binary instead of segfaulting in your face, but, hey... As for O2 vs. O3, it has the potential of starting a holy war, but basically: I'm not a huge fan of using O3 as the goto 'default' setting. Use it when you know it's gonna be useful, otherwise, it more often than not *lowers* the performance (especially on such a tiny CPU), and almost always ends up generating larger binaries. That said, Linaro does recommend defaulting to O3/Ofast on ARMv7 with their TC. |
09-28-2012, 01:21 PM | #720 | ||
Just a Noob
Posts: 145
Karma: 162610
Join Date: Aug 2011
Device: Kindle 3
|
Quote:
I read Linaro 2012.04 README (I guess I should've read it long ago... so stupid of me): Quote:
|
||
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
KOReader: a document reader for PDF, DJVU, EPUB, FB2, HTML, ... (GPLv3) | hawhill | Kindle Developer's Corner | 1269 | 02-27-2024 11:49 AM |
Librerator - multi-format e-reader, fork of KPV | Kai771 | Kindle Developer's Corner | 432 | 10-06-2017 12:20 PM |
Yet another PDF viewer (muPDF based) | melihron | PocketBook | 66 | 09-02-2014 03:03 AM |
Text-based PDF to Mobi, etc./Kindle 3 | kidblue | Calibre | 41 | 07-20-2012 03:19 PM |
muPDF on Kindle DX!! | DairyKnight | Kindle Developer's Corner | 8 | 03-21-2010 03:39 AM |