Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

How to enable reduced-footprint C library?

_Reen struct thread-local data is allocated at the top of the task’s stack. Therefore,

you need to make allowance when allocating memory for stacks. In

general, the _reent structure consumes approximately 900 bytes of data

for the normal C library, or 90 bytes for the reduced-footprint C library.

How can I enable reduced-footprint C library??

I have try to check 'Small C Library' in system property setting, but after compiling project, the

sizeof(struct _reent) still equals to 892 bytes.

Anyone help?

Because I'm not familiar with struct _reent.

Another question is on which condition shall I base to decide whether enable 'Thread Safe C Library' or not?

Thanks in advance,

David

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi, danny

    I have tried, but

    sizeof(struct _reent) still equals to 892 bytes.

    Anyone help?

    Thanks in advance

    David
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I cann't recall if there is a "no reentrance" flag for it.

    I am not sure if the default newlib is configured to configure.host.smallc.

    Maybe you should try another lib set, than the default newlib.

    Rebuild newlib with smallc or use uClibc.

    If you are using uC/OSII, you should not use default libs. You should use most of them of of

    the uC/OSII's lib.

    You can use -nostdinc and -nostdlib flags to select the includes and libs on gcc.