From e06f2fbde7d9d8ca3d363035dacbbc4b81e29c9a Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Mon, 7 Oct 2019 15:29:33 -0400 Subject: Allow verifying _REENT_CHECK macros memory allocation - change sys/reent.h to replace _REENT_CHECK_DEBUG with _REENT_CHECK_VERIFY which when set asserts that any memory allocated is non-NULL and calls __assert_func directly - add new --enable-newlib-reent-check-verify configure option - add support for configure.host to specify default for newlib_reent_check_verify - add _REENT_CHECK_VERIFY macro support to acconfig.h and newlib.hin --- newlib/configure.host | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'newlib/configure.host') diff --git a/newlib/configure.host b/newlib/configure.host index 87bf78a3a..fe7d9b7b5 100644 --- a/newlib/configure.host +++ b/newlib/configure.host @@ -29,6 +29,7 @@ # newlib_io_long_double --enable-newlib-io-long-double ("yes", "no", "") # newlib_global_stdio_streams --enable-global-stdio-streams ("yes", "no, "") # newlib_fno_builtin --disable-newlib-fno-builtin ("yes", "no, "") +# newlib_reent_check_verify --enable-newlib-reent-check-verify ("yes", "no, "") # It sets the following shell variables: # newlib_cflags Special CFLAGS to use when building @@ -76,6 +77,7 @@ default_newlib_io_long_double=no default_newlib_io_pos_args=no default_newlib_atexit_dynamic_alloc=yes default_newlib_nano_malloc=no +default_newlib_reent_check_verify=no aext=a oext=o lpfx="lib_a-" @@ -952,6 +954,13 @@ if [ "x${newlib_nano_malloc}" = "x" ]; then fi fi +# Enable _REENT_CHECK macro memory allocation verification. +if [ "x${newlib_reent_check_verify}" = "x" ]; then + if [ ${default_newlib_reent_check_verify} = "yes" ]; then + newlib_reent_check_verify="yes"; + fi +fi + # Remove rpc headers if xdr_dir not specified if [ "x${xdr_dir}" = "x" ]; then noinclude="${noinclude} rpc/types.h rpc/xdr.h" -- cgit v1.2.3