[PATCH, newlib] Allow locking routine to be retargeted

Thomas Preudhomme thomas.preudhomme@foss.arm.com
Thu Nov 10 14:42:00 GMT 2016


At the moment when targeting bare-metal targets or systems without definition 
for the locking primitives, newlib uses dummy empty macros. This has the 
advantage of reduced size and faster implementation but does not allow the 
application to retarget the locking routines. Retargeting is useful for a single 
toolchain to support multiple systems since then it's only at build time that 
you know which system you are targeting.

This patch adds a new configure option --enable-newlib-retargetable-locking to 
use dummy empty weakly defined functions instead of dummy empty macros. The 
default is to keep the current behavior to not have any size or speed impact on 
targets not interested in this feature.

Testing: I've built a simple test program that calls malloc and free with all 
the locking function defined in the same file. Running into a debugger with 
breakpoints on the function shows that they are indeed called.

Is this ok for master branch?

Best regards,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: retargetable_locking_routine.patch
Type: text/x-patch
Size: 21050 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20161110/8788de52/attachment.bin>

More information about the Newlib mailing list