04-26-2015, 06:57 AM | #1 |
Junior Member
Posts: 2
Karma: 10
Join Date: Apr 2015
Device: Kindle Keyboard, Kindle Touch
|
Koreader (CoolReader) GLIBC_2.11 error in Kindle 3
Hi all,
I got the Koreader (Lua bit) working on my Kindle 3 (keyboard). But when trying load file an ePub into reader (libkoreader-cre) it fails with GLIBC_2.11 dependency. Here is the application log when I ssh and run: root@kindle koreader# ./reader.lua -d /mnt/us/documents/book.epub # initializing for device Kindle3 # show reader ui # show widget Warning: Could not load rt.so, falling back to gettimeofday. # opening file /mnt/us/documents/book.epub # cannot open document /mnt/us/documents/book.epub error loading module 'libs/libkoreader-cre' from file './libs/libkoreader-cre.so': /lib/libc.so.6: version `GLIBC_2.11' not found (required by /mnt/us/koreader/./libs/libcrengine.so) Looking at the library with readelf, I can use some longjmp methods from GLIBC 2.11: $ readelf -Ws koreader-arm-linux-gnueabi/koreader/libs/libcrengine.so | grep GLIBC_2.11 14: 00000000 0 FUNC GLOBAL DEFAULT UND __longjmp_chk@GLIBC_2.11 (7) I tried to compile with static linking against glibc (-static-libgcc) but that one didn't help too. Tried with 4.8 on Ubuntu 12.04 and Mint 17.1 (= Ubuntu 14.04 trusty) Source is compiled with undefined FORTIFY and _GNU_SOURCE Any help highly welcomed. |
04-26-2015, 09:00 AM | #2 |
BLAM!
Posts: 13,497
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@abbaspour: That's because there's a specific target for the older devices (kindle-legacy) which enables some more trickery to tame down the TC. Also no real guarantee that everything works properly on devices without a touchscreen, hence the lack of official release (cf. kpdfviewer instead)
Note that this was last tested with a fairly not-so-recent MG toolchain, it might not be enough for a bleeding edge TC; see the comments in the Makefiles. And that my own tests were made (again, long ago) with a TC built against glibc 2.9, so, I obviously never ran into that one . Last edited by NiLuJe; 04-26-2015 at 09:12 AM. |
04-26-2015, 09:01 AM | #3 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
How does that behavior compare with that of Libreator?
https://www.mobileread.com/forums/sho...d.php?t=198742 (Which is KOReader, ported to keyboard devices.) |
04-26-2015, 09:10 AM | #4 |
BLAM!
Posts: 13,497
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Note that the _chk variants of longjmp come from <bits/setjmp2.h>, which definitely shouldn't be included if __USE_FORTIFY_LEVEL is 0 (i.e., -U_FORTIFY_SOURCE).
It's been a while since I meddled with KO's buildsystem, but there might be some parts of the build that don't yet honor every flag we enforce, in which case, if you can pinpoint the root issue, send a PR on GH. That said, a cursory glance at the Makefile doesn't reveal anything wonky on that front for crengine... Double check how your're setting your *FLAGS, and the sanity of the headers of your TC. I'm guessing you weren't using the kindle-legacy target? @knc1: Technically, it's a fork of the ancestor of KOReader, kindlepdfviewer . Last edited by NiLuJe; 04-26-2015 at 09:16 AM. |
04-26-2015, 09:35 AM | #5 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Note -
If you can't build against the older glibc version used on the K3, then take a look at running more than one set of system libraries at the same time. The "ARMHF on Kindle" has a worked example. (Not that you need hard float, hard float is just used as a how-to run multiple system libraries on the same system, concurrently.) |
04-26-2015, 10:23 AM | #6 |
Junior Member
Posts: 2
Karma: 10
Join Date: Apr 2015
Device: Kindle Keyboard, Kindle Touch
|
thanks for the replies. I explicitly added "-U_FORTIFY_SOURCE" as CMAKE_CXX_FLAGS inside kpvcrlib CMakeLists.txt and the longjmp_chk disappeared. but still have dynamic linking error. this time with below error.
what you reckon? should I statically link against libstdc++ ? # opening file /mnt/us/documents/book.epub # cannot open document /mnt/us/documents/book.epub error loading module 'libs/libkoreader-cre' from file './libs/libkoreader-cre.so': /usr/lib/libstdc++.so.6: version `CXXABI_ARM_1.3.3' not found (required by /mnt/us/koreader/./libs/libcrengine.so) |
04-26-2015, 11:51 AM | #7 |
BLAM!
Posts: 13,497
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@abbaspour:
Yup, -static-libstdc++ But, again, that should be the default (https://github.com/koreader/koreader...file.defs#L193 && https://github.com/koreader/koreader...efile.defs#L86). And it's explicitly always done for cre, AFAICT (https://github.com/koreader/koreader.../Makefile#L288 && https://github.com/koreader/koreader.../Makefile#L187). So, err, again, make sure nothing in your env is polluting *FLAGS or that you're not overriding them by passing them to make on the CLI. As you can see, the Makefiles are a house of cards tailored to the buildbot and the envs of a few developers, I've always directly messed w/ Makefiles.defs when I needed to adapt stuff to my TC, that's the safest move. (Also, you shouldn't have had to mess with cmake's rules for cre). Last edited by NiLuJe; 04-26-2015 at 11:59 AM. |
Tags |
coolreader, glibc, kindle 3, koreader |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Aura HD Koreader functionality vs kindle for pdf | DanCa | Kobo Developer's Corner | 4 | 06-24-2014 03:00 AM |
coolreader/koreader without fmon | peyton | Kobo Developer's Corner | 17 | 03-30-2014 05:06 PM |
Koreader v. Coolreader | 93terp | Kobo Developer's Corner | 8 | 11-05-2013 05:37 AM |
GLIBC_2.4 Missing | sean.fosterbrown | Kindle Developer's Corner | 4 | 01-25-2013 10:22 AM |