1 Compiling ELinks with Tiny C Compiler
2 =====================================
4 ELinks has been successfully compiled with http://www.tinycc.org/[Tiny
5 C Compiler] version 0.9.23, however there are several problems.
6 This file lists some of these problems and their possible solutions.
8 Perl uses unsupported -Wl,-E
9 ----------------------------
11 ----------------------------------------------------------------------
12 checking for Perl... no
13 ----------------------------------------------------------------------
17 ----------------------------------------------------------------------
18 configure:18039: checking for Perl
19 configure:18082: tcc -o conftest ... -rdynamic conftest.c -Wl,-E ... -lperl ... >&5
20 tcc: unsupported linker option '-E'
21 configure:18088: $? = 1
23 configure:18106: result: no
24 ----------------------------------------------------------------------
26 The `-Wl,-E` option comes from this command:
28 ----------------------------------------------------------------------
29 perl -MExtUtils::Embed -e ldopts
30 ----------------------------------------------------------------------
32 TCC 0.9.23 does not support the option, so ELinks builds without Perl.
34 Python uses unsupported -Xlinker -export-dynamic
35 ------------------------------------------------
37 ----------------------------------------------------------------------
38 checking for Python... yes
39 checking for python... /usr/bin/python
41 Browser scripting ............... Guile, Lua, SpiderMonkey
42 ----------------------------------------------------------------------
46 ----------------------------------------------------------------------
47 configure:18204: checking for Python
48 configure:18208: result: yes
49 configure:18219: checking for python
50 configure:18237: found /usr/bin/python
51 configure:18250: result: /usr/bin/python
52 configure:18287: tcc -o conftest ... -rdynamic conftest.c -Xlinker -export-dynamic ... -lpython2.3 ... >&5
53 tcc: invalid option -- '-Xlinker'
54 configure:18293: $? = 1
55 ----------------------------------------------------------------------
57 The `-Xlinker -export-dynamic` options come from this command:
59 ----------------------------------------------------------------------
60 python -c 'from distutils import sysconfig; print sysconfig.get_config_var("LINKFORSHARED")'
61 ----------------------------------------------------------------------
63 TCC 0.9.23 does not support `-Xlinker`, so ELinks builds without
66 Ruby uses unsupported -Wl,-export-dynamic
67 -----------------------------------------
69 ----------------------------------------------------------------------
70 checking for Ruby... yes
71 checking for ruby... /usr/bin/ruby
72 checking Ruby version... 1.8.3
73 checking for Ruby header files... /usr/lib/ruby/1.8/i486-linux
74 configure: error: Ruby not found
75 ----------------------------------------------------------------------
79 ----------------------------------------------------------------------
80 configure:18617: checking for Ruby
81 configure:18641: result: yes
82 configure:18653: checking for ruby
83 configure:18671: found /usr/bin/ruby
84 configure:18684: result: /usr/bin/ruby
85 configure:18694: checking Ruby version
86 configure:18698: result: 1.8.3
87 configure:18701: checking for Ruby header files
88 configure:18706: result: /usr/lib/ruby/1.8/i486-linux
89 configure:18765: tcc -o conftest ... -rdynamic -Wl,-export-dynamic ... conftest.c -lruby1.8 ... >&5
90 tcc: unsupported linker option '-export-dynamic'
91 configure:18771: $? = 1
92 configure:18808: error: Ruby not found
93 ----------------------------------------------------------------------
95 The `-rdynamic -Wl,-export-dynamic` options come from this command:
97 ----------------------------------------------------------------------
98 ruby -r rbconfig -e 'print Config::CONFIG["LDFLAGS"]'
99 ----------------------------------------------------------------------
101 TCC 0.9.23 supports the former but not the latter. To work around the
102 error, configure `\--without-ruby`.
104 Stabs entry has invalid string index
105 ------------------------------------
107 ----------------------------------------------------------------------
108 ld -r -o lib.o frames.o parser.o renderer.o tables.o parser/lib.o
109 ld: parser/lib.o(.stab+0x2688): Stabs entry has invalid string index.
110 parser/lib.o: could not read symbols: Bad value
111 ----------------------------------------------------------------------
113 Apparently, GNU ld 2.16.91 does not like the debug information
114 generated by TCC 0.9.23. To work around the error, either set
115 `LD=tcc` or remove `-g` from `CFLAGS`.
120 If you configure ELinks with both `\--with-gnutls` and `\--with-guile`,
121 TCC 0.9.23 crashes when it's trying to link ELinks.
123 http://bugs.debian.org/418360[Debian bug #418360] has a patch that
126 Undefined symbol alloca
127 -----------------------
129 ----------------------------------------------------------------------
131 tcc: undefined symbol 'alloca'
132 ----------------------------------------------------------------------
134 GNU libc 2.3.6 declares `alloca()` in `<alloca.h>` but does not
135 actually define it as a function, perhaps because the definition must
136 be specific to each compiler. TCC 0.9.23 does not define `alloca()`
137 either and fails to generate an executable but stupidly exits with
140 In ELinks, only `intl/gettext/plural.c` uses `alloca()`, so you can
141 avoid the error with `configure --disable-nls`.
143 Unexpanded @HAVE_ALLOCA_H@ in <see/type.h>
144 ------------------------------------------
146 ----------------------------------------------------------------------
147 .../include/see/type.h:180: identifier expected
148 ----------------------------------------------------------------------
151 http://www.adaptive-enterprises.com.au/~d/software/see/[Simple
152 ECMAScript Engine] 2.0.1131 has an unexpanded `@HAVE_ALLOCA_H@` inside
153 `#ifndef __GNUC__`. Of course, TCC 0.9.23 does not define `__GNUC__`,
154 so an error results. To avoid the error, either configure ELinks
155 `\--without-see`, or edit `<see/type.h>`.
158 http://www.adaptive-enterprises.com.au/bugs/show_bug.cgi?id=65[SEE bug 65].
160 Advanced: Compiling SEE with TCC
161 --------------------------------
163 If you want even more problems, try compiling Simple ECMAScript Engine
164 with Tiny C Compiler as well.
166 Wrong precedence of sizeof
167 ~~~~~~~~~~~~~~~~~~~~~~~~~~
169 ----------------------------------------------------------------------
170 .../see-2.0.1131/libsee/unicase.c:86: pointer expected
171 ----------------------------------------------------------------------
173 TCC 0.9.23 misparses `sizeof (a)[0]` used in the `lengthof` macro.
174 To work around the bug, change it to `sizeof ((a)[0])`.
176 Reported as http://bugs.debian.org/419203[Debian bug #419203].
178 Linker option -soname not supported
179 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
181 ----------------------------------------------------------------------
182 tcc: invalid option -- '-soname'
183 ----------------------------------------------------------------------
185 To construct a proper ELF library, the build system of SEE 2.0.1131
186 must specify the shared object name. Unfortunately, TCC 0.9.23 does
187 not appear to support any such option. So, use some other linker.