Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 05-23-2012, 08:09 AM   #76
deep
Enthusiast
deep began at the beginning.
 
Posts: 29
Karma: 10
Join Date: May 2012
Device: Kindle Touch
Here you go ..

Code:
[root@kindle root]# ls -l /lib/libpthread* /usr/lib/libpthread*
-rw-r--r--    1 root     root        105233 Nov  4  2011 /lib/libpthread-2.12.1.so
lrwxrwxrwx    1 root     root            20 Nov  4  2011 /lib/libpthread.so.0 -> libpthread-2.12.1.so
-rw-r--r--    1 root     root           221 Sep 11  2010 /usr/lib/libpthread.so
So the aforementioned libpthread_nonshared.a doesn't exist !

Any suggestions on where I can get the file Knc1 ?
Thanks for replying
deep is offline   Reply With Quote
Old 05-23-2012, 08:32 AM   #77
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by deep View Post
Here you go ..

Code:
[root@kindle root]# ls -l /lib/libpthread* /usr/lib/libpthread*
-rw-r--r--    1 root     root        105233 Nov  4  2011 /lib/libpthread-2.12.1.so
lrwxrwxrwx    1 root     root            20 Nov  4  2011 /lib/libpthread.so.0 -> libpthread-2.12.1.so
-rw-r--r--    1 root     root           221 Sep 11  2010 /usr/lib/libpthread.so
So the aforementioned libpthread_nonshared.a doesn't exist !

Any suggestions on where I can get the file Knc1 ?
Thanks for replying
According to the text of the command you posted, it should not have been referenced (to then have been reported as missing). That is for doing a static linked executable, and TCC (should) be defaulting to dynamic linked executables.

Note the size of /usr/lib/libpthread.so
That is too small to be the dynamic thread library. It may be an example of part of the general problem.

I am not sure what the built-in library search order is in TCC - so we will just shotgun it (or take a WAFG).
If it searchs /lib first, this will fix the problem you see:
Code:
cd /lib
ln -s libpthread-2.12.1.so libpthread.so
cd -
Note: The above presumes you are running as "root" and that /lib is in a filesystem mounted read/write.
If either of those conditions are not true, you will get an error message, post the error from the command and we can continue from there.

If no error message, retry your posted compile command.

If it searchs /usr/lib first (which I think it should, but who knows) -
The we will have to examine what that too small file with the correct name is all about.

Last edited by knc1; 05-23-2012 at 08:34 AM.
knc1 is offline   Reply With Quote
Advert
Old 05-23-2012, 08:44 AM   #78
deep
Enthusiast
deep began at the beginning.
 
Posts: 29
Karma: 10
Join Date: May 2012
Device: Kindle Touch
Quote:
Originally Posted by knc1 View Post
According to the text of the command you posted, it should not have been referenced (to then have been reported as missing). That is for doing a static linked executable, and TCC (should) be defaulting to dynamic linked executables.

Note the size of /usr/lib/libpthread.so
That is too small to be the dynamic thread library. It may be an example of part of the general problem.

I am not sure what the built-in library search order is in TCC - so we will just shotgun it (or take a WAFG).
If it searchs /lib first, this will fix the problem you see:
Code:
cd /lib
ln -s libpthread-2.12.1.so libpthread.so
cd -
Note: The above presumes you are running as "root" and that /lib is in a filesystem mounted read/write.
If either of those conditions are not true, you will get an error message, post the error from the command and we can continue from there.

If no error message, retry your posted compile command.

If it searchs /usr/lib first (which I think it should, but who knows) -
The we will have to examine what that too small file with the correct name is all about.
Hmm ... I didnt notice that !
However, still no luck

Here's what happened ...


Code:
[root@kindle /lib]# mntroot rw
system: I mntroot:def:Making root filesystem writeable
[root@kindle root]# cd /lib
[root@kindle /lib]# ln -s libpthread-2.12.1.so libpthread.so
[root@kindle /lib]# cd /mnt/us/codes
[root@kindle codes]# tccmake cfile -lpthread
tcc: file '/usr/lib/libpthread_nonshared.a' not found


And here's the output of the lib search once again
Code:
[root@kindle codes]# ls -l /lib/libpthread* /usr/lib/libpthread*
-rw-r--r--    1 root     root        105233 Nov  4  2011 /lib/libpthread-2.12.1.so
lrwxrwxrwx    1 root     root            20 May 23 18:07 /lib/libpthread.so -> libpthread-2.12.1.so
lrwxrwxrwx    1 root     root            20 Nov  4  2011 /lib/libpthread.so.0 -> libpthread-2.12.1.so
-rw-r--r--    1 root     root           221 Sep 11  2010 /usr/lib/libpthread.so
A new symlink has been added...
deep is offline   Reply With Quote
Old 05-23-2012, 09:02 AM   #79
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
That looks like the same problem as with the libm library that shows up when you add "-lm" to the tccmake command line. It will need a similar fix. I did not try it yet, but I added a possible fix to the tcc install script (see the new red line below). Try it and report your results here.
Code:
#!/bin/sh
cd /usr/lib
mntroot rw >/dev/null
ln -s /mnt/us/tcc/crt1.o
ln -s /mnt/us/tcc/crti.o
ln -s /mnt/us/tcc/crtn.o
cd /usr/bin >/dev/null
ln -s /mnt/us/tcc/tcc
ln -s /mnt/us/tcc/tccmake
[[ -e libm.so ]]||ln -s /lib/libm.so.6 libm.so
[[ -e libpthread.so ]]||ln -s /lib/libpthread.so.0 libpthread.so
mntroot ro >/dev/null       
echo "*** tcc installed ***"             
echo Uninstall with /mnt/us/tcc/uninstall
echo Compile demo.c with "tccmake demo"

Last edited by geekmaster; 05-23-2012 at 09:16 AM.
geekmaster is offline   Reply With Quote
Old 05-23-2012, 09:05 AM   #80
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by deep View Post
Hmm ... I didnt notice that !
However, still no luck

Here's what happened ...


Code:
[root@kindle /lib]# mntroot rw
system: I mntroot:def:Making root filesystem writeable
[root@kindle root]# cd /lib
[root@kindle /lib]# ln -s libpthread-2.12.1.so libpthread.so
[root@kindle /lib]# cd /mnt/us/codes
[root@kindle codes]# tccmake cfile -lpthread
tcc: file '/usr/lib/libpthread_nonshared.a' not found


And here's the output of the lib search once again
Code:
[root@kindle codes]# ls -l /lib/libpthread* /usr/lib/libpthread*
-rw-r--r--    1 root     root        105233 Nov  4  2011 /lib/libpthread-2.12.1.so
lrwxrwxrwx    1 root     root            20 May 23 18:07 /lib/libpthread.so -> libpthread-2.12.1.so
lrwxrwxrwx    1 root     root            20 Nov  4  2011 /lib/libpthread.so.0 -> libpthread-2.12.1.so
-rw-r--r--    1 root     root           221 Sep 11  2010 /usr/lib/libpthread.so
A new symlink has been added...
Correct, that was the command I had you run, to make that new link.

The above tells us that TCC is searching /usr/lib/* first in its default library search path (the fact that the behavior didn't change, it errored before it got around to searching /lib/*).

I do not have a KT or even a KT file system image, so I am not sure what tools you have on hand.
So this may get to be a few posts long...

First thing to try - the 'file' command (if it is present on a KT):
Code:
file /usr/lib/libpthread.so
If you get a: "sh file: not found" - well, then you don't have that tool on the KT.
Otherwise the file utility will identify the type of file (*nix doesn't go by file name extensions).

What the heck - (try to) run the command above - post output - we will continue with whatever happens.
EDIT: I typo'd the pathname above, now fixed.

Last edited by knc1; 05-23-2012 at 09:16 AM.
knc1 is offline   Reply With Quote
Advert
Old 05-23-2012, 09:19 AM   #81
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
See my fix above. On firmware 3.3 the /usr/lib folder is missing some "generic" symlinks to the libraries in /lib. You can compare to other firmware versions to see what is missing.

Another reported problem for some people is that a symlink to a symlink might not work sometimes (but it worked for me for libc.so). In that case change the symlink destination to the actual versions-dependent binary library file.
geekmaster is offline   Reply With Quote
Old 05-23-2012, 09:23 AM   #82
deep
Enthusiast
deep began at the beginning.
 
Posts: 29
Karma: 10
Join Date: May 2012
Device: Kindle Touch
Ok here's the output

I copied the file over to /mnt/us

and ran the command from my linux machine
Code:
/media/Kindle$ file ./libpthread.so
./libpthread.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked (uses shared libs), BuildID[sha1]=0x245a6c47c401422afb251b0bb4d29e9e309404dc, for GNU/Linux 2.6.16, not stripped
deep is offline   Reply With Quote
Old 05-23-2012, 09:23 AM   #83
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by geekmaster View Post
See my fix above. On firmware 3.3 the /usr/lib folder is missing some "generic" symlinks to the libraries in /lib. You can compare to other firmware versions to see what is missing.

Another reported problem for some people is that a symlink to a symlink might not work sometimes (but it worked for me for libc.so). In that case change the symlink destination to the actual versions-dependent binary library file.
I am about to direct the O.P. to replace that "too short" file with a symlink to the correct library.
I just want to know what that lab126 brain fart really is first.
PS: this is 5.1.0 again.
knc1 is offline   Reply With Quote
Old 05-23-2012, 09:24 AM   #84
deep
Enthusiast
deep began at the beginning.
 
Posts: 29
Karma: 10
Join Date: May 2012
Device: Kindle Touch
Quote:
Originally Posted by geekmaster View Post
See my fix above. On firmware 3.3 the /usr/lib folder is missing some "generic" symlinks to the libraries in /lib. You can compare to other firmware versions to see what is missing.

Another reported problem for some people is that a symlink to a symlink might not work sometimes (but it worked for me for libc.so). In that case change the symlink destination to the actual versions-dependent binary library file.
Yes, I guess I'll have to get the file from an older firmware version....

Thanks geekmaster
deep is offline   Reply With Quote
Old 05-23-2012, 09:26 AM   #85
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by deep View Post
Yes, I guess I'll have to get the file from an older firmware version....

Thanks geekmaster
No need for that.
You have the correct file, we just need to tell you what to do about the incorrect one first.
I would rather know what it is that I will be telling you to replace before we go that far.
knc1 is offline   Reply With Quote
Old 05-23-2012, 09:31 AM   #86
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Just do the command shown in red in this post and report your results as I had requested:
https://www.mobileread.com/forums/sho....php?p=2090431
geekmaster is offline   Reply With Quote
Old 05-23-2012, 09:31 AM   #87
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by geekmaster View Post
See my fix above. On firmware 3.3 the /usr/lib folder is missing some "generic" symlinks to the libraries in /lib. You can compare to other firmware versions to see what is missing.
Actually, that is a bit misleading - although correct for the lab126 file system layout.
There should not be any links between the content of /usr/lib/* and /lib/* - but there existance is a lab126 screw-up that we have to live with.

Quote:
Originally Posted by geekmaster View Post
Another reported problem for some people is that a symlink to a symlink might not work sometimes (but it worked for me for libc.so). In that case change the symlink destination to the actual versions-dependent binary library file.
That is what I am about to direct the O.P. to do, once I know the contents of that too short lab126 brain fart.
knc1 is offline   Reply With Quote
Old 05-23-2012, 09:33 AM   #88
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by knc1 View Post
That is what I am about to direct the O.P. to do, once I know the contents of that too short lab126 brain fart.
We could also show him how to over-ride the default search path.
So this problem is very fixable.
knc1 is offline   Reply With Quote
Old 05-23-2012, 09:37 AM   #89
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
I thought this thread was discussing 3.3 again. I looked back now and I see 5.1.0, so I will have to plug in a different kindle and poke around. The install script can get big and ugly if it has to fix too many amazon/lab126 screw-ups.

P.S. I called lab126 awhile ago, and they referred all firmware-related questions to "Seattle" (where they transferred my call). At the Seattle site, they call themselves "amazon". It is unclear who is responsible for the recent firmware fiasco.
geekmaster is offline   Reply With Quote
Old 05-23-2012, 09:38 AM   #90
deep
Enthusiast
deep began at the beginning.
 
Posts: 29
Karma: 10
Join Date: May 2012
Device: Kindle Touch
Quote:
Originally Posted by geekmaster View Post
That looks like the same problem as with the libm library that shows up when you add "-lm" to the tccmake command line. It will need a similar fix. I did not try it yet, but I added a possible fix to the tcc install script (see the new red line below). Try it and report your results here.
Code:
#!/bin/sh
cd /usr/lib
mntroot rw >/dev/null
ln -s /mnt/us/tcc/crt1.o
ln -s /mnt/us/tcc/crti.o
ln -s /mnt/us/tcc/crtn.o
cd /usr/bin >/dev/null
ln -s /mnt/us/tcc/tcc
ln -s /mnt/us/tcc/tccmake
[[ -e libm.so ]]||ln -s /lib/libm.so.6 libm.so
[[ -e libpthread.so ]]||ln -s /lib/libpthread.so.0 libpthread.so
mntroot ro >/dev/null       
echo "*** tcc installed ***"             
echo Uninstall with /mnt/us/tcc/uninstall
echo Compile demo.c with "tccmake demo"

Ok ... so here's the output after I modified my install file as above

I also tried creating the symlink !

Code:
[root@kindle tcc]# ./uninstall
*** tcc uninstalled ***
[root@kindle tcc]# ./install
*** tcc installed ***
Uninstall with /mnt/us/tcc/uninstall
Compile demo.c with tccmake demo
[root@kindle tcc]# ./install
ln: crt1.o: File exists
ln: crti.o: File exists
ln: crtn.o: File exists
ln: tcc: File exists
ln: tccmake: File exists
*** tcc installed ***
Uninstall with /mnt/us/tcc/uninstall
Compile demo.c with tccmake demo
[root@kindle tcc]# cd ../codes/
[root@kindle codes]# tccmake cfile -lpthread
tcc: file '/usr/lib/libpthread_nonshared.a' not found

Once again output of the lib search after the above

Code:
[root@kindle us]# ls -l /lib/libpthread* /usr/lib/libpthread*
-rw-r--r--    1 root     root        105233 Nov  4  2011 /lib/libpthread-2.12.1.so
lrwxrwxrwx    1 root     root            20 May 23 18:07 /lib/libpthread.so -> libpthread-2.12.1.so
lrwxrwxrwx    1 root     root            20 Nov  4  2011 /lib/libpthread.so.0 -> libpthread-2.12.1.so
-rw-r--r--    1 root     root           221 Sep 11  2010 /usr/lib/libpthread.so
deep is offline   Reply With Quote
Reply

Tags
tcc, tinycc


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
geekmaster simple touchscreen script support hack geekmaster Kindle Developer's Corner 12 04-21-2021 11:38 PM
Very simple guide to reading newspapers on the kindle, please? :) Pismire Amazon Kindle 7 06-01-2012 11:26 PM
Free (Kindle/Nook/ChristianBook) The Invitation: A Simple Guide to the Bible arcadata Deals and Resources (No Self-Promotion or Affiliate Links) 4 08-22-2011 01:05 PM
Simple guide to choosing a Creative Commons license for your work Bob Russell News 0 12-26-2006 11:10 AM


All times are GMT -4. The time now is 10:16 AM.


MobileRead.com is a privately owned, operated and funded community.