![]() |
#16 |
Penguin
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,017
Karma: 4742434
Join Date: Jul 2012
Device: Kindle Touch 5.3.2.1
|
|
![]() |
![]() |
![]() |
#17 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
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
|
um,
"you should also specify ‘conv=notrunc’ unless you want the output file to be truncated before being appended to" yeah... but okay okay I get your point :P Since the file should not actually BE MOUNTED at that point... that should be safe. EDIT: Updated ma post to reflect your wise observation. Last edited by twobob; 09-24-2013 at 12:47 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#18 | |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 457
Karma: 1287375
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
|
Quote:
I tried to compile Midnight Commander. I know there is a version on here: https://www.mobileread.com/forums/sho...3&postcount=24 but I wanted to try it myself, maybe with sftp (not in the other one). This is the error I get: Code:
./mc: error while loading shared libraries: invalid mode for dlopen(): Invalid argument I'm sure this is a complete newbie error, I just can't seem to get it? |
|
![]() |
![]() |
![]() |
#19 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
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
|
hmm... are you still using that SID version of dos1's?
or the wheezy seed I posted? |
![]() |
![]() |
![]() |
#20 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
dlopen() is implemented in libdl (yeah, that one is easy, some are much harder to find). The libdl header files imported during the build had to match what was expected in the mc code, or it would not have built. But it did build, it just doesn't run. Now those parts of the messages that look informative? Ah, those things are not standardized, so it is best to confirm what is happening by some means other than the message text. Use the strace utility on mc when you run it next time - - - That will show what is being passed and in what format. (Of course, take hints from the error messages, look first to see what is being passed to the dlopen's mode argument.) If you are doing this inside of twobob's chroot image - I am pretty sure he did not strip out the manual and info documents (we only talked about stripping out some backup files) - So the 'man' command should work for all of the above inside the chroot. |
|
![]() |
![]() |
Advert | |
|
![]() |
#21 | |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 457
Karma: 1287375
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
|
Quote:
error portion of the outside_chroot log: Code:
User:/tmp/framework:/bin/sh\n", 1024) = 429 close(3) = 0 munmap(0x4001e000, 4096) = 0 mkdir("/tmp/mc-root", 0700) = -1 EEXIST (File exists) lstat64("/tmp/mc-root", {st_mode=S_IFDIR|0700, st_size=40, ...}) = 0 getuid32() = 0 stat64("libX11.so", {st_mode=S_IFREG|0755, st_size=1126040, ...}) = 0 futex(0x404810a0, 0x81 /* FUTEX_??? */, 2147483647) = 0 writev(2, [{"./mc", 4}, {": ", 2}, {"error while loading shared libraries", 36}, {": ", 2}, {"", 0}, {"", 0}, {"invalid mode for dlopen()", 25}, {": ", 2}, {"Invalid argument", 16}, {"\n", 1}], 10) = 88 exit_group(127) = ? I can run mc that I built inside the chroot just fine. I'm using the image twobob posted above, resized to 2Gb, on the Kindle, the latest version: http://ftp.midnight-commander.org/mc-4.8.10.tar.bz2 I compiled it with the prefix twobob uses above (/mnt/us/extensions/mc) and added flags to not build the documentation. I might rebuild it later if I can get it to work! I exported the whole deal outside the chroot, and specify LD_LIBRARY_PATH=../lib:$LD_LIBRARY_PATH ./mc on the command line. Any more help would be GREATLY appreciated! PS: congrats on the 5000 post barrier, knc1! Last edited by brianinmaine; 09-27-2013 at 12:25 AM. |
|
![]() |
![]() |
![]() |
#22 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
The program does find and open libdl (for the function dlopen() )
Code:
open("../lib/libdl.so.2", O_RDONLY) = 3 Sorry, I don't see anything more than the error messages we saw earlier. Have run out of guesses. |
![]() |
![]() |
![]() |
#23 | |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 457
Karma: 1287375
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
|
Quote:
Thank you again, knc1! |
|
![]() |
![]() |
![]() |
#24 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
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
|
hmm... yeah... interesting.
arm-linux-gnueabi/libdl.so.2 huh... I'll have a play in a bit. hmm... you know... have you tried the scripty wangle? cd thing/bin /lib/ld-linux.so.3 --library-path $PWD/../lib ./thing (or w/e the relative path) Sounds like that is a libc thing maybe? chuck me a binary? Last edited by twobob; 09-27-2013 at 06:53 AM. |
![]() |
![]() |
![]() |
#25 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Keep in mind that trying to load a library built for the wrong architecture is known to trigger all kinds of weird and helpful (not) errors
![]() (That's a wild guess, but given the initial subject, maybe not that far off target ![]() |
![]() |
![]() |
![]() |
#26 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
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 I worked through your example....
here's what I did downloaded your codebase loaded/mounted debian shoved the code in /usr/local/src/mc-4.8.10 (well /mnt/us/debian/usr/local/src/mc-4.8.10 as viewed externally ) get the stuff we need to build this lot apt-get build-dep mc configure it (keep it simple) / make it / install it ./configure --prefix=/mnt/us/extensions/mc/usr make; make install then copy everything from the resulting /mnt/us/debian/mnt/us/extensions/mc to /mnt/us/extensions/mc tidy up the missing libs: cd /mnt/us/extensions/mc cp /mnt/us/debian/usr/lib/arm-linux-gnueabi/libgpm.so.2 usr/lib/ cp /mnt/us/debian/lib/arm-linux-gnueabi/libslang.so.2 usr/lib/ make a run script... (let's read it) cat /mnt/us/extensions/mc/mc Code:
#!/bin/sh LD_LIBRARY_PATH=/mnt/us/extensions/mc/usr/lib:/usr/lib:/lib /mnt/us/extensions/mc/usr/bin/mc (attached) Hope that helps. Last edited by twobob; 09-27-2013 at 08:51 AM. |
![]() |
![]() |
![]() |
#27 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 457
Karma: 1287375
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
|
NO FAIR
![]() Aside from this, Is there a way to use the kindle libraries to compile against? I tar.gzipped them and and put them anywhere. I uncompressed to /kindle/lib and /kindle/usr/lib. Is there some compile setting or something? Also, I have used sshfs before, not for a chroot though. Could you share your script 'remote-debian' or whatever from that other thread? |
![]() |
![]() |
![]() |
#28 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
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
|
the remote-debian thing was a "bad idea" in terms of compilation.
it runs things just fine but extremely heavy traffic (caused by compilation) can lock up the device sadly ![]() in terms of the libs... drop them in your toolchains include folder. |
![]() |
![]() |
![]() |
#29 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@brianinmaine: Wanting to link against "the Kindle's libraries" is a good idea in theory, but in practice, the libraries (at link-time) don't dictate much, the headers do, and amazon doesn't ship headers in their FW (not unlike a binary Linux distro, which is why you have a -dev/-devel package for each package)
![]() So, if you *really* want to link against the same stuff, you'll need to replicate the Kindle sysroot *with* the development files (the headers). (ie. cross-compile the exact same versions of what you care about as the device you target). Fortunately for us, we can get away with building against newer/older stuff, as long as we're building against something that is ABI compatible with what the Kindle runs. That's where API/ABI, sover & symbol versionning come into play, and you start to dig into the inner workings of the ELF binary format. Last edited by NiLuJe; 09-27-2013 at 09:39 PM. |
![]() |
![]() |
![]() |
#30 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
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
|
and for the headers... I use buildroot to spit out some and then splatter them either in my TC includes or just link them with the -I/location flag.
notable exception is the eink header - but that is certainly available from various places too. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compiling for Lubuntu (regarding compiling instructions) | jgratero | Sigil | 5 | 07-15-2012 07:54 PM |
Cross compiling for the Kindle - wrong glibc version | ninjageckoattack | Kindle Developer's Corner | 14 | 02-25-2012 04:44 PM |
cross compiling links | dent | Kindle Developer's Corner | 1 | 02-07-2011 08:42 AM |
cross-compiling gstreamer for the kindle3 | dent | Kindle Developer's Corner | 9 | 02-04-2011 08:39 AM |
Problems compiling | unkilbeeg | Sigil | 1 | 09-13-2009 01:49 PM |