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 08-12-2012, 10:18 AM   #181
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
When I use "tcc-static" on my kindle, while doing a static build, I get this:

[root@kindle us]# tccmake parmtest -static
tcc: error: undefined symbol 'exit'
tcc: error: undefined symbol 'printf'

What do I need to link to it? (No time to RTFM the KeK stuff right now)
geekmaster is offline   Reply With Quote
Old 08-12-2012, 10:18 AM   #182
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
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
@NuPogodi

The long and the short of it is.

No, not without effort. HTH
twobob is offline   Reply With Quote
Advert
Old 08-12-2012, 10:57 AM   #183
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
When I use "tcc-static" on my kindle, while doing a static build, I get this:

[root@kindle us]# tccmake parmtest -static
tcc: error: undefined symbol 'exit'
tcc: error: undefined symbol 'printf'

What do I need to link to it? (No time to RTFM the KeK stuff right now)
Using tcc-repo-top:

Well, printf is easy, <stdio.h>
One of the ones that at least tcc-dynamic mishandles (it can't find stddef.h any longer).

Not sure about the "exit" one.
The library symbol names are things like _at_exit and _fini but maybe there is (or should be) an 'exit'.

Does tcc do:
tcc -E
?
Maybe that would help track it down.

Last edited by knc1; 08-12-2012 at 10:59 AM.
knc1 is offline   Reply With Quote
Old 08-12-2012, 11:25 AM   #184
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
gcc doesn't like 'exit' either, try: 'return 0'
knc1 is offline   Reply With Quote
Old 08-12-2012, 12:50 PM   #185
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
gcc doesn't like 'exit' either, try: 'return 0'
Those errors were from the program posted above by NuPogodi when compiled with -static, which has "return 0". Apparently that calls an exit function. I changed it to include <stdio.h> instead of "stdio.h", and to print argc (and reformatted it).

Leaving out -static gets no errors, but creates a file that is not recognized as executable on the kindle, and hexdump shows that it references uclibc.

The tcc I got from lrizzo ALSO has those link problems with -static, so it may be unrelated to how it was built. Leaving out -static results in an executable program, but it gets a large negative argc value.

parmtest.c:
PHP Code:
#include <stdio.h>
#include <stdlib.h>

int main(int argcchar **argv) {
    
int i;
    
printf ("argc=%d\n"argc);
    
printf ("argv[0]=(%s)\n"argv[0]);
    for (
i=1;i<5;i++) printf("argv[%d]=(%s)\n",i,argv[i]);
    if (
argc<2printf("No args\n");
    return 
0;

Code:
[root@kindle tcc]# ./tcc-knc1 -E
tcc version 0.9.25 - Tiny C Compiler - Copyright (C) 2001-2006 Fabrice Bellard
Usage: tcc [options...] [-o outfile] [-c] infile(s)...
       tcc [options...] -run infile [arguments...]
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 and include 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'
  -Dsym[=val] define 'sym' with value 'val'
  -Usym       undefine 'sym'
Linker options:
  -Ldir       add library path 'dir'
  -llib       link with dynamic or static library 'lib'
  -pthread    link with -lpthread and -D_REENTRANT (POSIX Linux)
  -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
Misc options:
  -MD         generate target dependencies for make
  -MF depfile put generated dependencies here
[root@kindle tcc]#
Code:
[root@kindle tcc]# ./tcc-lrizzo -E
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
[root@kindle tcc]#
I am curious why they output different usage, but the same version number. And lrizzo's build has more preprocessor options.

Last edited by geekmaster; 08-12-2012 at 01:15 PM.
geekmaster is offline   Reply With Quote
Advert
Old 08-12-2012, 01:38 PM   #186
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 am curious why they output different usage, but the same version number. And lrizzo's build has more preprocessor options.
Because I didn't think to check the Makefile version number before I built it.
It is really 0.9.26-prerelease not the reported 0.9.25

Usually, things in git repos have the makefile "EXTRA_VERSION" thing set to the commit id of where it is pulled from (head in this case).

This one did not do it that way.
I did mention it (somewhere) but never fixed it and rebuilt it.
Not after I found that the Makefile was not its only problem enhancement.
knc1 is offline   Reply With Quote
Old 08-12-2012, 01:54 PM   #187
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
If somebody finds a better tcc with which to update the package in the first post, please provide it or a link to it. I looked multiple times, but only found dead links to ARM binaries. I also tried building it from source (more that once) without success. I really want a static build that will work on all the kindles without the funky fixes that tccmake has to do to make the kindle libraries work. I think a static tcc would not be overly large.
geekmaster is offline   Reply With Quote
Old 01-16-2018, 10:53 AM   #188
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
Recently tried this on my kindles.
Everything works fine.
Only... Geekmaster's e-ink demo program crashes with a segfault on PW1, though it works OK on PW3 and KT3.
nasser is offline   Reply With Quote
Old 04-21-2021, 07:09 PM   #189
Amias
Member
Amias began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Apr 2021
Device: KPW4
Question

hello!
Does #include "header.h" works in tcc?
Amias 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 06:34 AM.


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