Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Preud'homme <thomas.preudhomme@arm.com>2016-10-25 19:38:19 +0300
committerJeff Johnston <jjohnstn@redhat.com>2017-02-14 01:07:11 +0300
commitbd54749095ee45d7136b6e7c8a1e5218749c87b6 (patch)
tree44af0f859a2f5f43d7bf62d92caa2ae27a9eabe2 /newlib/libc/configure.in
parentfa55c610facaae12e38d90d14e44fecd1259b3ab (diff)
Allow locking routine to be retargeted
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 link time that you know which system you are targeting. This patch adds a new configure option --enable-newlib-retargetable-locking to use dummy empty 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. To allow for any size of lock, the _LOCK_T type is changed into pointer to struct _lock and the _init function are tasked with allocating the locks. The platform being targeted must provide the static locks. A dummy implementation of the locking routines and static lock is provided for single-threaded applications to link successfully out of the box. To ensure that the behavior is consistent (either no locking whatsoever or working locking), the dummy implementation is strongly defined such that a partial retargeting will cause a doubly defined link error. Indeed, the linker will only pull in the file providing the dummy implementation if it cannot find an implementation for one of the routine or lock.
Diffstat (limited to 'newlib/libc/configure.in')
-rw-r--r--newlib/libc/configure.in10
1 files changed, 10 insertions, 0 deletions
diff --git a/newlib/libc/configure.in b/newlib/libc/configure.in
index 0a7bb8815..ac25a3933 100644
--- a/newlib/libc/configure.in
+++ b/newlib/libc/configure.in
@@ -36,6 +36,16 @@ AC_ARG_ENABLE(newlib_nano_formatted_io,
esac],[newlib_nano_formatted_io=no])
AM_CONDITIONAL(NEWLIB_NANO_FORMATTED_IO, test x$newlib_nano_formatted_io = xyes)
+dnl Support --enable-retargetable-locking used by libc/sys
+AC_ARG_ENABLE(newlib-retargetable-locking,
+[ --enable-newlib-retargetable-locking Allow locking routines to be retargeted at link time],
+[case "${enableval}" in
+ yes) newlib_retargetable_locking=yes ;;
+ no) newlib_retargetable_lock=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for newlib-retargetable-locking) ;;
+ esac],[newlib_retargetable_locking=no])
+AM_CONDITIONAL(NEWLIB_RETARGETABLE_LOCKING, test x$newlib_retargetable_locking = xyes)
+
NEWLIB_CONFIGURE(..)
AM_CONDITIONAL(NEWLIB_NANO_MALLOC, test x$newlib_nano_malloc = xyes)