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

Discussion in 'C Programming' started by tm, Jul 7, 2011.

  1. tm

    tm Guest

    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.
     
    tm, Jul 7, 2011
    #1
    1. Advertising

  2. tm

    Dirk Zabel Guest

    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
     
    Dirk Zabel, Jul 7, 2011
    #2
    1. Advertising

  3. Roberto Waltman, Jul 7, 2011
    #3
  4. tm

    tm Guest

    On 7 Jul., 22:51, Roberto Waltman <> wrote:
    >  tm <> wrote:
    > >Is there a tcc option to set the stack size of an executable?

    >
    > There is a tinycc mailing list here:http://lists.nongnu.org/mailman/listinfo/tinycc-devel


    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.
     
    tm, Jul 7, 2011
    #4
  5. On Jul 7, 7:51 pm, Dirk Zabel <> wrote:
    >
    > 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.
     
    Malcolm McLean, Jul 9, 2011
    #5
  6. In article <>,
    Malcolm McLean <> wrote:
    >On Jul 7, 7:51 pm, Dirk Zabel <> wrote:
    >>
    >> 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.


    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)
     
    Kenny McCormack, Jul 9, 2011
    #6
  7. tm

    Geoff Guest

    On Thu, 7 Jul 2011 05:53:54 -0700 (PDT), tm <>
    wrote:

    >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)
     
    Geoff, Jul 9, 2011
    #7
  8. [OT] Re: Tiny C compiler option to set the stack size of an executable

    tm wrote:
    >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.)
    --
    Roberto Waltman

    [ Please reply to the group,
    return address is invalid ]
     
    Roberto Waltman, Jul 10, 2011
    #8
  9. tm

    tm Guest

    On 9 Jul., 22:45, Geoff <> wrote:
    > On Thu, 7 Jul 2011 05:53:54 -0700 (PDT), tm <>
    > wrote:
    >
    >
    >
    > >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)


    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.
     
    tm, Jul 10, 2011
    #9
  10. tm

    Dirk Zabel Guest

    Am 09.07.2011 15:29, schrieb Malcolm McLean:
    > On Jul 7, 7:51 pm, Dirk Zabel<> wrote:
    >>
    >> 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.
    >
    >

    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
     
    Dirk Zabel, Jul 13, 2011
    #10
  11. In article <-berlin.de>,
    Dirk Zabel <> wrote:
    ....
    >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.

    --
    They say compassion is a virtue, but I don't have the time!

    - David Byrne -
     
    Kenny McCormack, Jul 13, 2011
    #11
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Werner Nussbaumer

    Tiny C Compiler for Windows Source

    Werner Nussbaumer, Jul 15, 2004, in forum: C Programming
    Replies:
    7
    Views:
    460
    Werner Nussbaumer
    Jul 27, 2004
  2. Surinder Singh
    Replies:
    1
    Views:
    1,230
    Richard Bos
    Dec 20, 2007
  3. Vijay Mathew
    Replies:
    0
    Views:
    704
    Vijay Mathew
    Mar 23, 2010
  4. Stian Haklev
    Replies:
    0
    Views:
    102
    Stian Haklev
    May 13, 2007
  5. Texas Bob
    Replies:
    0
    Views:
    241
    Texas Bob
    Jul 25, 2009
Loading...

Share This Page