We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
1.
As title.
and what time I need to add options ?
I know add --specs=nano.specs thas is mean using newlib-nano when I use arm-none-eabi-gcc.
In readme, rdimon is for semihosting. Nosys is for retarget.
We use bare metal system and printf retarget to AXI port. What option I need to select ?
2. Does newlib support reentrant in arm-none-eabi-gcc?
Newlib provide two version function first is usual name . Second is reentrant version "_xxx_r"
How to choose the function when compile my code? Or I don't need know that.
Ex : _write_r , write
3. Are both of two function target to _write?
I implement _write function will retarget printf.
I not sure printf will call which function. _write_r , write, _write
Hi Joey
Thank for your reply!
About 2 .
I study newlib and found an reentrant usage descriptions.
-----------------------------
Dynamic reentrancy is specified by the __DYNAMIC_REENT__ flag. This flag denotes setting up a macro to replace _REENT with a function call to __getreent().
---------------------------
Have you know arm-none-eabi-gcc defined this when build libraries?
About 1, 3 Like your reply
I summary some result in my study and take notes.
The specs file will change -l option and point to library in arm corss compiler folder. Ex libnosys.a libc_nano.a ...
And nosys library have some default OS interface function if we don't have implenment.
But I don't know rdimon library how to work with semihost.
3.
Retarget is modify _write because newlib porting OS interface have some usage. The descrition is in newlib reent.h.
The usage 2 is porting write -> _write_r -> _write.