tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] Buiding binutils 2.17 (needs dynamic arrays).


From: Rob Landley
Subject: [Tinycc-devel] Buiding binutils 2.17 (needs dynamic arrays).
Date: Tue, 2 Oct 2007 12:19:18 -0500
User-agent: KMail/1.9.6

So if I do:

> tar xvjf binutils-2.17.tar.bz2
> cd binutils-2.17
> CC=tcc ./configure --disable-nls --disable-shared --disable-multilib \
>     --program-prefix=withtcc- 
> make

So it dies with:

> tcc -c -DHAVE_CONFIG_H -g  -I. -I.././libiberty/../include   -Wc++-compat \
>       .././libiberty/cp-demangle.c -o cp-demangle.o 
> .././libiberty/cp-demangle.c:3825: constant expression expected

And the offending line is:

>   cplus_demangle_init_info (mangled, options, len, &di);
>
>   {
> #ifdef CP_DYNAMIC_ARRAYS
>     __extension__ struct demangle_component comps[di.num_comps];
^^^ that one
>     __extension__ struct demangle_component *subs[di.num_subs];

I.E. it's dying due to lack of "dynamic arrays".

We have alloca() now, so in the compiler can implement this as something 
vaguely like:

struct demangle_component *__hidden_comps_ptr = \
        alloca(sizeof(struct demangle_component)*di.num_comps);
#define comps (*__hidden_comps_ptr);

Except that sizeof(comps) will return sizeof(struct demangle_component *) 
instead of the size passed to alloca().

Any opinions on how to tackle this one?

Rob
-- 
"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.




reply via email to

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