|
|
Thread Tools | Search this Thread |
08-20-2012, 09:00 PM | #31 | |
( ͡° ͜ʖ ͡°){ʇ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
|
Quote:
Hmm not sure I can point BR at an older glibc version but Ill go find out. possibly... : ) I do have a gentoo installation on my machine now (err but I still can get my x server to boot so I shelved it) perhaps one say I will have a play on there also - one day. thanks for everyones help. Just attempting to implement knc1's fiddle now. |
|
08-20-2012, 09:24 PM | #32 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Well, after all of this discussion, it reads as if a path forward has been decided on. That's fine.
No need for the "knc1 hack" using the loader manually, with a manually set list of libraries and with LD_DEBUG set to print a verbose report of what is happening . . . . It would probably only report what you have deduced (the hard way). - - - - What with all of these detail problems, it is a bit hard to step back and look at the overall picture - - This system that the decades of *nix work has come up with is actually pretty solid. About 99% of applications build and run across a wide mixture of ages and version of system libraries. Its just the other 1% that prove to be the P.I.T.A. things to "get right". A 6 year old tool-chain, a decade old system library - and hundreds of the newest "bleeding edge" version softwares build and run? Yup, that is really an exceptional design accomplishment. |
Advert | |
|
08-20-2012, 09:35 PM | #33 | |
( ͡° ͜ʖ ͡°){ʇ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
|
Mindblowing really.
Honestly expected far less success. I would be intrigued to know if I can get more built with the more recent c version. A lot of the them choked on C errors IIRC... (well obviously errors in c I mean language specific looking deaths) So that's a big driver for me in terms of 'should I bother?' As a test I just renamed the extra libc.so.6.NEW & libc-2.3.6.so.NEW, which results in all the apps loading beautifully - that I have tested so far. EDIT: Just using: source start.sh where start.sh is Quote:
Older > newer in terms of 'likely to work' on all devices. ermm.. hmm... I'll think. But yeah. gobsmacker. Last edited by twobob; 08-20-2012 at 09:50 PM. |
|
08-20-2012, 09:45 PM | #34 |
BLAM!
Posts: 13,492
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@twobob/knc1: Yeah, the glibc's ABI backwards compatibility has been pretty solid, in my experience, without too much burden . That's why your current binaries should work with the Kindle's newer glibc. (Keep in mind that glibc isn't only libc.so, though, there a whole bunch of other core library in there: libm, libcrypt and libdl being the most prominent of those).
For a stark comparison, libstdc++ is a whole different kettle of fish. There *is* ABI compatibility, but there have been so much change in the API over the years that you usually *need* to ship it/static link it to make sure it won't blow up, especially on older systems... There's still a libstdc++-v3 package available in nearly every distro out there to provide support for older dynamically linked binary/proprietary C++ apps for this very reason. Last edited by NiLuJe; 08-20-2012 at 09:51 PM. |
08-20-2012, 09:55 PM | #35 |
( ͡° ͜ʖ ͡°){ʇ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
|
erm one thought.
when we run the apps whats to stop us simply saying: In a shell script that lives in the same directory as the binary. export LD_LIBRARY_PATH=$PWD/libs:/usr/lib:/lib Then reverting when it dies? Then I can shove the libs in a nice tidy relative directory (assuming they don't do anything suicidal on FAT like generate sym links in the directory) and we can all go home for Tea Thoughts on that? the Tea is non optional. Other beverages will be served for heretics. Seem's simple and elegant. there must be a flaw. : ) Last edited by twobob; 08-20-2012 at 10:10 PM. Reason: disclaimer |
Advert | |
|
08-20-2012, 10:27 PM | #36 |
( ͡° ͜ʖ ͡°){ʇ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
|
okay so to this end let's use an app. fftw-wisdom is one I was wanting to play with : )
For obvious reasons. so step 1) use readelf to find dependant stuffs. (I've tidied the output up) Code:
[root@kindle bin]# readelf -d fftw-wisdom 22566: calling init: /lib/libc.so.6 22566: calling init: /lib/libgcc_s.so.1 22566: calling init: /mnt/us/usr/lib/libz.so.1 22566: initialize program: readelf 22566: transferring control: readelf Dynamic section at offset 0xa00c contains 27 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [libfftw3.so.3] 0x00000001 (NEEDED) Shared library: [libm.so.6] 0x00000001 (NEEDED) Shared library: [libc.so.6] 0x0000000f (RPATH) Library rpath: [/home/you/BLDS/buildroot/build/fftw-3.3/.libs] 22566: calling fini: readelf [0] 22566: calling fini: /mnt/us/usr/lib/libz.so.1 [0] 22566: calling fini: /lib/libgcc_s.so.1 [0] 22566: calling fini: /lib/libc.so.6 [0] 22566: Ugly RPATH there. : \ So anyways, I figure. b) copy the stuff to a test folder and nerf my handsets env variables. then c) launch it via a VERY simple one or two liner script. perhaps a generic one accepting the app as an argument, or if that is too much typing just one per app. the requirement would be that the $PWD is the executing directory and perhaps this too could be coerced within the script. Certainly a [ -e] or something won't hurt. okay well I'm hooking this up now. libs in /libs folder app in root. script in root. Code:
#!/bin/sh ###################################### #suck, squeeze, bang, blow? ###################################### #One way #env LD_LIBRARY_PATH=$PWD:/usr/local/bin:/bin:/usr/bin:/usr/sbin:/sbin\ #./fftw-wisdom #Another way /lib/ld-linux.so.3 --library-path $PWD/lib:/usr/lib:/lib \ --inhibit-rpath libfftw3.so.3 ./fftw-wisdom Last edited by twobob; 08-20-2012 at 11:00 PM. Reason: Ugly RPATH there. : \ added two ways |
08-20-2012, 10:31 PM | #37 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
You may have to over-ride that library rpath (it is still set for the buildroot environment) in you launcher script.
Too late, too tired, to remember how to do that. |
08-20-2012, 10:38 PM | #38 | |
( ͡° ͜ʖ ͡°){ʇ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
|
Quote:
/lib/ld-linux.so.3 --library-path $PWD/lib:/lib/usr/lib --inhibit-rpath libfftw3.so.3 readelf -d ./fftw-wisdom I'll check the scope of the declaration. Last edited by twobob; 08-20-2012 at 10:48 PM. |
|
08-20-2012, 10:45 PM | #39 |
BLAM!
Posts: 13,492
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@twobob: That's essentially what most binary/proprietary apps/games distributed out of a PMS do. Use a wrapper script that tweaks the searchpaths to use their bundled libs over the system's.
You don't even strictly need to reset the env later if you're not doing anything else, since you're tweaking the env of *this* process and its potential children, and this process just returns at the end of the script. (You can also just one-line it using the neat little 'env' tool from coreutils (busybox has an applet for it, too. No idea if it's enabled on the K3). env BLAH=blah BLUH=bluh /bin/blah) Last edited by NiLuJe; 08-20-2012 at 10:49 PM. |
08-20-2012, 10:49 PM | #40 |
( ͡° ͜ʖ ͡°){ʇ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
|
oh it is - I've used it I believe. EDIT YEP: happy days then : )
Ill package this up then and give it a test. Usage: env [-iu] [-] [name=value]... [command] Print the current environment or run a program after setting up the specified environment Options: -, -i Start with an empty environment -u Remove variable from the environment Nice. Last edited by twobob; 08-20-2012 at 10:52 PM. |
08-21-2012, 01:12 AM | #41 | ||
( ͡° ͜ʖ ͡°){ʇ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
|
FFtw - Packaged in the new way.
Quote:
Binaries, Script, Src's + license enc. usage ./fftw.sh (you can call it from anywhere) ./fftw.sh contains: Quote:
Hopefully THIS is a decent way to package things. Obviously some launcher stuff might be nicer in the long term for appropriate apps. : D |
||
08-21-2012, 09:03 AM | #42 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
LGN: Launcher Glue New
Aside from the connected use of "cd ..." and "$PWD" -
You almost have it down to a one-liner: Code:
#!/lib/ld-linux.so.3 --library-path $PWD/lib:/usr/lib:/lib --inhibit-rpath libfftw3.so.3 ./fftw-wisdom Whatever the final version of that "policy implementor" becomes, the above demonstrates the overall behavior. (Sorry if this reads like I am preaching/teaching or something else, no insult intended to anyone, not even if the above meets the GM whitespace standard.) Next (rhetorical) question: How to avoid writing (or having the build system write) one of those above for each and every new application? In answer, start by reading what is written above in the prototype launcher glue. What does the first two characters, the Splat-Bang, in a *nix script do? It causes the loading mechanism used to start an executable to search for a program (other than the elf loader) to interpret the rest of the file. Now, ask yourself, what mechanism does binfmt_misc provide? It is a loading mechanism that selects a program to interpret the rest of the file based on either extension or magic number. The "program" may be any executable, including a script "wrapper". Ah, so, as the light begins to dawn .... Now we can see why that crazy old fool was asking for mod binfmt_misc. Suppose that the above single line glue code began with a six character magic number: Code:
#!ld.3 --library-path $PWD/lib:/usr/lib:/lib --inhibit-rpath libfftw3.so.3 ./fftw-wisdom That wrapper can be used to determine the variables of the "glue code" launcher. For a more advanced usage, to get a Kindle to "swallow" anything we add-in, see the following reference. When reading the reference: http://www.kernel.org/doc/Documentation/binfmt_misc.txt You will find examples of how binfmt_misc can read the elf header of the file to be run. One of the first things in the elf header is the interpreter to be used and some other flag bits. I.E: Not only can we "glue in" applications using a mis-matched glibc, we can "glue in" applications that aren't even built against glibc of any version. (the uClibc loader has a different name, only I need to re-build the uClibc used in the emulator because the current one was built without a required option). Note: The binfmt_misc mecanisum is the base upon which a loader for signed binaries can be built. Amazon/lab126 requires a signed update file to make changes to the installed system but **assumes** anything found on the file system was the result of such a signed installation process. I.E: The Kindles call the OTA updater by name, but as far as its coding can tell, the thing with the "OTA updater" name might churn butter. If the thing with the "OTA updater" name was a signed binary, things would not be as easy to modify as they are. Not impossilbe to modify (when using binfmt_misc), just extra insurance that the binary was from a trusted source and intended for a specific Kindle make/model/firmware. And the test would be made each time the load attempt was made. Last edited by knc1; 08-21-2012 at 09:55 AM. |
08-21-2012, 04:08 PM | #43 |
( ͡° ͜ʖ ͡°){ʇ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
|
|
08-21-2012, 07:17 PM | #44 |
( ͡° ͜ʖ ͡°){ʇ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
|
err by that i mean after i sleep. been awake almost 48h now. after!
|
Tags |
apps, benchmark, buildroot, kindle 3, tools |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Android [WIP] Overclocking the PE | plasticarmyman | enTourage eDGe | 16 | 06-11-2012 07:08 PM |
IQ Benchmarking | frth | PocketBook | 0 | 01-03-2012 07:58 AM |
MID benchmarking | ondabeach | Alternative Devices | 0 | 04-12-2010 01:20 AM |
Seriously thoughtful I always knew Windows was a WIP | GeoffC | Lounge | 4 | 02-06-2010 02:20 AM |
Benchmarking PDF speeds on ebook readers | Jürgen Hubert | 2 | 01-07-2010 07:40 PM |