08-12-2012, 10:18 AM | #181 |
Carpe diem, c'est la vie.
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) |
08-12-2012, 10:18 AM | #182 |
( ͡° ͜ʖ ͡°){ʇ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
|
@NuPogodi
The long and the short of it is. No, not without effort. HTH |
Advert | |
|
08-12-2012, 10:57 AM | #183 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
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. |
|
08-12-2012, 11:25 AM | #184 |
Going Viral
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'
|
08-12-2012, 12:50 PM | #185 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
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:
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]#
Last edited by geekmaster; 08-12-2012 at 01:15 PM. |
Advert | |
|
08-12-2012, 01:38 PM | #186 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
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. |
|
08-12-2012, 01:54 PM | #187 |
Carpe diem, c'est la vie.
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.
|
01-16-2018, 10:53 AM | #188 |
Evangelist
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. |
04-21-2021, 07:09 PM | #189 |
Member
Posts: 11
Karma: 10
Join Date: Apr 2021
Device: KPW4
|
hello!
Does #include "header.h" works in tcc? |
Tags |
tcc, tinycc |
|
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 |