Tiny C compiler option to set the stack size of an executable

T

tm

Hello.

Is there a tcc option to set the stack size of an executable?

I compiled my project (http://seed7.sourceforge.net) with
tcc version 0.9.25 under Windows and Linux. Most things
work, but some programs crash, because the stack is too
small (I am quite sure it is a stack size problem. You can
save the time to tell me about endless recursions, etc. ).
Compilers/linkers usually have a possibility to set the stack
size. For Windows + MinGW gcc I use the option:

-Wl,--stack,4194304

Other compilers have similar options. A solution which
uses gcc as linker would not be helpful, since I want to
provide a makefile for people who just have tcc installed.


Greetings Thomas Mertes

--
Seed7 Homepage: http://seed7.sourceforge.net
Seed7 - The extensible programming language: User defined statements
and operators, abstract data types, templates without special
syntax, OO with interfaces and multiple dispatch, statically typed,
interpreted or compiled, portable, runs under linux/unix/windows.
 
D

Dirk Zabel

Am 07.07.2011 14:53, schrieb tm:
Hello.

Is there a tcc option to set the stack size of an executable?

I compiled my project (http://seed7.sourceforge.net) with
tcc version 0.9.25 under Windows and Linux. Most things
work, but some programs crash, because the stack is too
small (I am quite sure it is a stack size problem. You can
save the time to tell me about endless recursions, etc. ).
Compilers/linkers usually have a possibility to set the stack
size. For Windows + MinGW gcc I use the option:

-Wl,--stack,4194304

Other compilers have similar options. A solution which
uses gcc as linker would not be helpful, since I want to
provide a makefile for people who just have tcc installed.

I think this is a tcc-specific question, so it's OT in this group.
The tcc documentation should cover that question. In general, the stack
size an executable may use depends on target architecture and linker
options, not on the compiler (as long as the compiler does not generate
absolute machine code for exotic tiny platforms).
Regards
Dirk
 
T

tm


First I sent a mail to tinycc-devel, and it was
**automatically rejected**. Then I sent a mail to the
owner of tinycc-devel. I am still waiting for an answer.

Maybe someone with tcc background listens in this group...

Help would be very welcome.


Greetings Thomas Mertes

--
Seed7 Homepage: http://seed7.sourceforge.net
Seed7 - The extensible programming language: User defined statements
and operators, abstract data types, templates without special
syntax, OO with interfaces and multiple dispatch, statically typed,
interpreted or compiled, portable, runs under linux/unix/windows.
 
M

Malcolm McLean

I think this is a tcc-specific question, so it's OT in this group.
Not really. It's a pretty general question, and there are no tcc
newsgroups.

The idea of making platform-specific questions off-topic is to prevent
the newsgroup being flooded with people wanting to know how to make
Windows library calls, not to close down discussion of individual
compilers. A certain amount of sensitivity is required.
 
K

Kenny McCormack

Not really. It's a pretty general question, and there are no tcc
newsgroups.

The idea of making platform-specific questions off-topic is to prevent
the newsgroup being flooded with people wanting to know how to make
Windows library calls, not to close down discussion of individual
compilers. A certain amount of sensitivity is required.

Leader Kiki is not going to like this.

--
But the Bush apologists hope that you won't remember all that. And they
also have a theory, which I've been hearing more and more - namely,
that President Obama, though not yet in office or even elected, caused the
2008 slump. You see, people were worried in advance about his future
policies, and that's what caused the economy to tank. Seriously.

(Paul Krugman - Addicted to Bush)
 
G

Geoff

Hello.

Is there a tcc option to set the stack size of an executable?

I compiled my project (http://seed7.sourceforge.net) with
tcc version 0.9.25 under Windows and Linux. Most things
work, but some programs crash, because the stack is too
small (I am quite sure it is a stack size problem. You can
save the time to tell me about endless recursions, etc. ).
Compilers/linkers usually have a possibility to set the stack
size. For Windows + MinGW gcc I use the option:

-Wl,--stack,4194304

Other compilers have similar options. A solution which
uses gcc as linker would not be helpful, since I want to
provide a makefile for people who just have tcc installed.

TCC's stack size is hard coded at 256. (VSTACK_SIZE)
 
R

Roberto Waltman

tm said:
First I sent a mail to tinycc-devel, and it was
**automatically rejected**. ..

Did you subscribe to the list before sending your message?
Unlike this newsgroup, most mailing lists will allow postings only
from email addresses already registered. Some also put new
subscribers in "moderated" status, until they post 1 or 2 relevant
messages.
(Reasonable measures, to avoid automated spam.)
 
T

tm

TCC's stack size is hard coded at 256. (VSTACK_SIZE)

I guess it is not 256 bytes, but probably 25kB. :)
Tcc seems useable for compiling Seed7 (several tests succeed),
except for the stack size, which is too small (exactly the
same programs fail, that also have problems when other C
compilers/linkers use a small stack size).

So increasing TCC's VSTACK_SIZE is really important,
otherwise TCC cannot be used as backend for Seed7.


Greetings Thomas Mertes

--
Seed7 Homepage: http://seed7.sourceforge.net
Seed7 - The extensible programming language: User defined statements
and operators, abstract data types, templates without special
syntax, OO with interfaces and multiple dispatch, statically typed,
interpreted or compiled, portable, runs under linux/unix/windows.
 
D

Dirk Zabel

Am 09.07.2011 15:29, schrieb Malcolm McLean:
Not really. It's a pretty general question, and there are no tcc
newsgroups.

The idea of making platform-specific questions off-topic is to prevent
the newsgroup being flooded with people wanting to know how to make
Windows library calls, not to close down discussion of individual
compilers. A certain amount of sensitivity is required.
I didn't mean to be rude, but I thought the changes for help are better
if you are looking at the proper place. In fact, the OP did this
successfully:
<http://lists.nongnu.org/archive/html/tinycc-devel/2011-07/msg00021.html>

Regards
Dirk
 
K

Kenny McCormack

Dirk Zabel said:
I didn't mean to be rude, but I thought the changes for help are better

I assume you meant "chances".
if you are looking at the proper place. In fact, the OP did this
successfully:
<http://lists.nongnu.org/archive/html/tinycc-devel/2011-07/msg00021.html>

The problem with this mode of thinking is that it is too much in line with
the often-made (and dead-on spot-accurate) observation that Republicans are
always whining that government can't do anything right - and when they get
themselves elected, they prove it so.

I.e., this sort of question *should* be answerable in a group about C, but
because of the dorks who rule this joint, it isn't. And pointing out that
he *did* get help elsewhere is not exactly a shining justification for not
helping him here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top