Forum Discussion
Altera_Forum
Honored Contributor
20 years agoHow 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, David3 Replies
- Altera_Forum
Honored Contributor
Hi David,
in your IDE click right mouse button and properties --> c/c++ build, tool settings --> general --> optimise size good luck Cheers and merry x-mass http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/biggrin.gif Danny - Altera_Forum
Honored Contributor
Hi, danny
I have tried, but sizeof(struct _reent) still equals to 892 bytes. Anyone help? Thanks in advance David - Altera_Forum
Honored 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.