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-16-2012, 01:03 PM   #61
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
Quote:
Originally Posted by xueyou2 View Post
/mnt/us/tcc #pwd
/mnt/us/tcc
/mnt/us/tcc #./uninstall
*** tcc uninstalled ***
/mnt/us/tcc #./install
*** tcc installed ***
Uninstall with /mnt/us/tcc/uninstall
Compile demo.c with "tccmake demo"
mnt/us/tcc #ls -al /usr/lib/libm*


-rwxr-xr-x 1 root root usr/lib/libmenu.so.5->libmenu.so.5.4
lrwxrwxrwx 1root root usr/lib/libmenu.so.5.4

-rwxr-xr-x 1root root usr/lib/libmp3-parser-arm11_elunux.so
Thank you.(With usbnetwork i can access the kindle i still find the same result.)
That shows a missing symlink, as though you used an OLD install script.

Please show the output of this command:

cat /mnt/us/tcc/install

Thanks.

Last edited by geekmaster; 05-16-2012 at 02:23 PM.
geekmaster is offline   Reply With Quote
Old 05-16-2012, 11:49 PM   #62
xueyou2
Connoisseur
xueyou2 can eat soup with a fork.xueyou2 can eat soup with a fork.xueyou2 can eat soup with a fork.xueyou2 can eat soup with a fork.xueyou2 can eat soup with a fork.xueyou2 can eat soup with a fork.xueyou2 can eat soup with a fork.xueyou2 can eat soup with a fork.xueyou2 can eat soup with a fork.xueyou2 can eat soup with a fork.xueyou2 can eat soup with a fork.
 
Posts: 58
Karma: 9096
Join Date: Apr 2012
Device: none
#cat /mnt/us/tcc/install
#!/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
mntroot ro >/dev/null
echo "*** tcc installed ***"
echo Uninstall with /mnt/us/tcc/uninstall
echo Compile demo.c with "tccmake demo"

xueyou2 is offline   Reply With Quote
Old 05-17-2012, 12:41 AM   #63
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
This line "cd /usr/bin >/dev/null" says "change directory to /usr/bin and discard output".

This line "[[ -e libm.so ]]||ln -s /lib/libm.so.6 libm.so" says (while in /usr/bin) "if libm.so does not exists, create a link called libm.so that points to /lib/libm.so.6"

However, earlier you showed "mnt/us/tcc #ls -al /usr/lib/libm*" (after running install) with output that did NOT contain libm.so. This should not be possible without some kind of error message.

Try executing the statements from a command prompt instead of inside the script.

Specifically, "cd /usr/lib", then "ln -s /lib/libm.so.6 libm.so"

If that fails to create the symlink (it works on my K3 with 3.3), you could try "ln -s /lib/libm-2.5.so libm.so" instead (because libm.so.6 is just a symlink itself).

I do not know why your 3.3 is acting differently from my 3.3, but I have seen cases were there were problems creating a symlink to a symlink. So, in your case symlink directly to the library instead of the other symlink as shown above.

Last edited by geekmaster; 05-17-2012 at 12:43 AM.
geekmaster is offline   Reply With Quote
Old 05-17-2012, 01:37 AM   #64
xueyou2
Connoisseur
xueyou2 can eat soup with a fork.xueyou2 can eat soup with a fork.xueyou2 can eat soup with a fork.xueyou2 can eat soup with a fork.xueyou2 can eat soup with a fork.xueyou2 can eat soup with a fork.xueyou2 can eat soup with a fork.xueyou2 can eat soup with a fork.xueyou2 can eat soup with a fork.xueyou2 can eat soup with a fork.xueyou2 can eat soup with a fork.
 
Posts: 58
Karma: 9096
Join Date: Apr 2012
Device: none
Quote:
Originally Posted by geekmaster View Post
This line "cd /usr/bin >/dev/null" says "change directory to /usr/bin and discard output".

This line "[[ -e libm.so ]]||ln -s /lib/libm.so.6 libm.so" says (while in /usr/bin) "if libm.so does not exists, create a link called libm.so that points to /lib/libm.so.6"

However, earlier you showed "mnt/us/tcc #ls -al /usr/lib/libm*" (after running install) with output that did NOT contain libm.so. This should not be possible without some kind of error message.

Try executing the statements from a command prompt instead of inside the script.

Specifically, "cd /usr/lib", then "ln -s /lib/libm.so.6 libm.so"

If that fails to create the symlink (it works on my K3 with 3.3), you could try "ln -s /lib/libm-2.5.so libm.so" instead (because libm.so.6 is just a symlink itself).

I do not know why your 3.3 is acting differently from my 3.3, but I have seen cases were there were problems creating a symlink to a symlink. So, in your case symlink directly to the library instead of the other symlink as shown above.

Yes,it works!Great!

PHP Code:
cd /usr/lib
ln 
-/lib/libm.so.6 libm.so

 

/mnt/us/tcctccmake hello -lm
/mnt/us/tcc$ ./hello

x
=144.000000sqrt(x)=12.000000 

Thank you !master.
xueyou2 is offline   Reply With Quote
Old 05-17-2012, 02:08 AM   #65
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
Quote:
Originally Posted by xueyou2 View Post
Yes,it works!Great!
...
Thank you !master.
You are welcome.

I suppose I need to make the script a little smarter. Instead of checking "exists" (-e), it could look for a "file" (-f) of various common versions of libm.*, and link directly to that.

I do not know why the K3 had to be different. My older install script worked fine on DX,DXG,K4,K5. But K3 was missing the math lib symlink (and may have more missing lib links too).

Last edited by geekmaster; 05-17-2012 at 03:02 AM.
geekmaster is offline   Reply With Quote
Old 05-17-2012, 09:32 AM   #66
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
I do not know why the K3 had to be different. My older install script worked fine on DX,DXG,K4,K5. But K3 was missing the math lib symlink (and may have more missing lib links too).
The K3, v-3.2.1 image I am looking at looks to have a number of "strange things" about its library installation. Both in the compiler search path(s) and the runtime loader's search path(s).

Almost as if lab126 was only concerned about making their own software work and to H... with anyone else's.

For instance, the contents of /etc/ld.so.conf does not correspond to the library installation locations - unless they have some "invented here" program diddling with the run-time loader.

Unfortunately, my K3 is "out of service" for a photo shoot, so I can't actually check its behavior.
knc1 is offline   Reply With Quote
Old 05-17-2012, 09:37 AM   #67
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
Quote:
Originally Posted by knc1 View Post
The K3, v-3.2.1 image I am looking at looks to have a number of "strange things" about its library installation. Both in the compiler search path(s) and the runtime loader's search path(s).

Almost as if lab126 was only concerned about making their own software work and to H... with anyone else's.

For instance, the contents of /etc/ld.so.conf does not correspond to the library installation locations - unless they have some "invented here" program diddling with the run-time loader.

Unfortunately, my K3 is "out of service" for a photo shoot, so I can't actually check its behavior.
Another good reason to static link all your apps so they don't need any external loadable libraries. I like static linking so my apps will run on any eink kindle, with no worries about library version mismatch errors, but missing symlinks and other amazon screwups is yet another reason to static link.
geekmaster is offline   Reply With Quote
Old 05-17-2012, 09:39 AM   #68
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
By the way, I noticed that even when I do a major edit to an existing post, it does NOT add my new signature line. Apparently, only the site mods can add my signature to my old posts.
geekmaster is offline   Reply With Quote
Old 05-17-2012, 09:47 AM   #69
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
Two quick notes;

The thread topic is about tcc - so here we are interested in the compiler's search paths.
Question: does tcc support a --static option?

My mention of the runtime loader (which also uses the library files mentioned) is a related issue, but in that case the application would generate an error message when run, not while it was being compiled.

Hmm...
There is a (rarely used) way to poke the runtime loader so that it reports what it is doing, but I have forgotten the details, I will need a bit of RTFM to re-learn that trick.
knc1 is offline   Reply With Quote
Old 05-17-2012, 10:15 AM   #70
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
tcc options only use a single "-" (even "-help")":
Code:
# tcc -help
tcc version 0.9.25 - Tiny C Compiler - Copyright (C) 2001-2006 Fabrice Bellard
usage: tcc [-v] [-c] [-o outfile] [-Bdir] [-bench] [-Idir] [-Dsym[=val]] [-Usym]
           [-Wwarn] [-g] [-b] [-bt N] [-Ldir] [-llib] [-shared] [-soname name]
           [-static] [infile1 infile2...] [-run infile args...]

General options:
  -v          display current version, increase verbosity
  -c          compile only - generate an object file
  -o outfile  set output filename
  -Bdir       set tcc internal library path
  -bench      output compilation statistics
  -run        run compiled source
  -fflag      set or reset (with 'no-' prefix) 'flag' (see man page)
  -Wwarning   set or reset (with 'no-' prefix) 'warning' (see man page)
  -w          disable all warnings
Preprocessor options:
  -E          preprocess only
  -Idir       add include path 'dir'
  -include f  #include file 'f' before everything else
  -Dsym[=val] define 'sym' with value 'val'
  -Usym       undefine 'sym'
  -M          generate include list. Implies -E
  -dM         generate macros list. Implies -E
  -MT file    use 'file' as target for -M.
Linker options:
  -Ldir       add library path 'dir'
  -llib       link with dynamic or static library 'lib'
  -shared     generate a shared library
  -soname     set name for shared library to be used at runtime
  -static     static linking
  -rdynamic   export all global symbols to dynamic linker
  -r          generate (relocatable) object file
Debugger options:
  -g          generate runtime debug info
  -bt N       show N callers in stack traces
Ignored options (for gcc compatibility):
  -std=X      
  -MD name
  -MP
  -isystem dir
geekmaster is offline   Reply With Quote
Old 05-17-2012, 11:22 AM   #71
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
Thanks. My own Kindle is "out of service" so I could not check that for myself.
knc1 is offline   Reply With Quote
Old 05-23-2012, 03:50 AM   #72
deep
Enthusiast
deep began at the beginning.
 
Posts: 29
Karma: 10
Join Date: May 2012
Device: Kindle Touch
Im not sure if I deleted this file, but if run

Code:
tccmake cfile -lpthread 

it shows tcc: file '/usr/lib/libpthread_nonshared.a' not found
I use the version 1.5 provided by geekmaster...
deep is offline   Reply With Quote
Old 05-23-2012, 06:33 AM   #73
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
Im not sure if I deleted this file, but if run

Code:
tccmake cfile -lpthread 

it shows tcc: file '/usr/lib/libpthread_nonshared.a' not found
I use the version 1.5 provided by geekmaster...
That input with that message indicates a broken symbolic link chain.
That is: the /usr/lib/libpthread library is a link to a non-existent file.

What Kindle model? (the Kindle Touch in your info box?)
What Firmware version?
knc1 is offline   Reply With Quote
Old 05-23-2012, 06:41 AM   #74
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
What Kindle model? (the Kindle Touch in your info box?)
What Firmware version?
Yes it's the Kindle Touch...
Firmware is 5.1.0 ....

Yes probably a broken symlink .. I dont have the code sourcery libraries with me though ... maybe someone could share it ?
deep is offline   Reply With Quote
Old 05-23-2012, 07:39 AM   #75
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 it's the Kindle Touch...
Firmware is 5.1.0 ....

Yes probably a broken symlink .. I dont have the code sourcery libraries with me though ... maybe someone could share it ?
First...

Please post the results of this command:
Code:
ls -l /lib/libpthread* /usr/lib/libpthread*
If it is only a broken link rather than a missing file, that will give the information required for directions on how to fix it (similar to the libm problem).
knc1 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 11:12 PM.


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