headers and/or preprocessor defines for newlib nano

Asked by Sergei Sharonov

Is there a guide/howto on how to configure toolchain to use newlib nano? Let's say we pass "-specs=nano.spec" to linker. Now we need to make sure our headers match precompiled newlib nano binaries. I figure one way of doing it is do pass some defines to preprocessor. e.g.:
Otherwise library and application will have different notion of struct _reent guts and cause a lots of weird problems.
I am not sure if any others defines are needed. What is the "officially approved" way of configuring this?
Thank you,

Question information

English Edit question
GNU Arm Embedded Toolchain Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Andre Vieira (andre-simoesdiasvieira) said :

Hi Sergei,

This is a known issue and it should be fixed in the 4.9 Q3 release.

Best Regards,

Revision history for this message
Ahmed Ammar (ahmed-a-ammar) said :

It seems that this is fixed with the Q3 release for me, -D_REENT_SMALL -D_REENT_GLOBAL_ATEXIT, now work, it was causing segfaults on clean boots with Q2.

I don't see any mention of this in the release notes, is it related to 'macro mismatch fix'?


Revision history for this message
Sergei Sharonov (sergei-7) said :

Well, -D_REENT_SMALL and -D_REENT_GLOBAL_ATEXIT are working in 2015q1 release for me. The question was if there are any other defines necessary for newlib nano. I found the need for the above defines through debugging several random crashes and it was quite painful. I hate to think there may be some other defines needed that I do not know about.

Revision history for this message
Andre Vieira (andre-simoesdiasvieira) said :

Hi Sergei,

You shouldn't need to manually pass the macro definitions with the q3 release, if you use -specs=nano.specs it will include 'arm-none-eabi/include/newlib-nano/newlib.h' which is the header file that was used to build the nano version of newlib. So with this you need not think about all the other defines .

Hope this eases your mind.

Can you help with this problem?

Provide an answer of your own, or ask Sergei Sharonov for more information if necessary.

To post a message you must log in.