[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Building pcc

From: Marc Andre Tanner
Subject: Re: [Tinycc-devel] Building pcc
Date: Fri, 26 Oct 2007 23:36:38 +0200
User-agent: Mutt/1.5.16 (2007-06-11)

On Fri, Oct 26, 2007 at 03:35:12PM +0900, Sanghyeon Seo wrote:
> I tried to build pcc (Portable C Compiler) with tcc, which should be a
> good test.
> pcc is available from:
> http://pcc.ludd.ltu.se/downloads/
> $ export CC=/opt/tcc/bin/tcc
> $ ./configure --prefix=/opt/pcc
> $ make
> This fails with:
> cd cpp; make all -w
> make[2]: Entering directory `/home/tinuviel/cvs/pcc/cc/cpp'
> bison -y -d  cpy.y
> /opt/tcc/bin/tcc  -I../../arch/i386 -g -DCPP_DEBUG -Wall
> -Wmissing-prototypes -Wstrict-prototypes -Werror -c -o cpy.o y.tab.c
> /opt/tcc/bin/tcc  -I../../arch/i386 -g -DCPP_DEBUG -Wall
> -Wmissing-prototypes -Wstrict-prototypes -Werror -c cpp.c
> flex  scanner.l
> /opt/tcc/bin/tcc  -I../../arch/i386 -g -DCPP_DEBUG -Wall
> -Wmissing-prototypes -Wstrict-prototypes -Werror -c -o scanner.o
> lex.yy.c
> /opt/tcc/bin/tcc  -I../../arch/i386 -g -DCPP_DEBUG -Wall
> -Wmissing-prototypes -Wstrict-prototypes -Werror -c -o compat.o
> ../../mip/compat.c
> /opt/tcc/bin/tcc -g -DCPP_DEBUG -Wall -Wmissing-prototypes
> -Wstrict-prototypes -Werror  cpp.o cpy.o scanner.o compat.o -o cpp
> cpy.o: 'ifiles' defined twice
> cpy.o: 'slow' defined twice
> scanner.o: 'ifiles' defined twice
> scanner.o: 'slow' defined twice
> tcc: undefined symbol 'alloca'
> So something is defined twice... Have anyone seen a similar error?

The message about symbols which are defined twice are actually just
warnings not errors. The problem here is that tcc can't find alloca.
It's builtin function is called _alloca_tcc so you need something like
that in /usr/include/alloca.h:

--- alloca.h.orig       2007-10-26 22:59:08.000000000 +0200
+++ alloca.h    2007-10-26 23:06:54.000000000 +0200
@@ -34,6 +34,9 @@
 #ifdef __GNUC__
 # define alloca(size)  __builtin_alloca (size)
+#elif __TINYC__
+  extern void *_alloca_tcc (size_t __size) __THROW;
+# define alloca(size)  _alloca_tcc (size)
 #endif /* GCC.  */

The extern line doesn't look right, tcc should probably know about it
internally. Anyway it works and pcc can be compiled without a problem.


 Marc Andre Tanner >< http://www.brain-dump.org/ >< GPG key: CF7D56C0

reply via email to

[Prev in Thread] Current Thread [Next in Thread]