# HG changeset patch # User Kévin PETIT # Date 1314555146 -7200 # Node ID cb0f31fe253544349e72be36c0d4a4017e99d1dc # Parent e5078db4bd2c612dfd4d43b7a12dd35bf6ae0fbc libc/newlib: add a config option allowing to disable builtin syscalls Allows to choose if one wants to keep or not the syscalls that are provided with newlib. It passes the --disable-newlib-supplied-syscalls or --enable-newlib-supplied-syscalls to the configure script. If one chooses to disable the builtin syscalls, he/she will have to write his/her own. This can be usefull to port newlib to a new platform/board. Signed-off-by: Kévin PETIT diff -r e5078db4bd2c -r cb0f31fe2535 config/libc/newlib.in.2 --- a/config/libc/newlib.in.2 Fri Aug 26 00:07:51 2011 +0200 +++ b/config/libc/newlib.in.2 Sun Aug 28 20:12:26 2011 +0200 @@ -25,3 +25,13 @@ depends on LIBC_NEWLIB_IO_FLOAT help Enable support for IOs on long doubles. + +config LIBC_NEWLIB_DISABLE_SUPPLIED_SYSCALLS + bool + prompt "Disable the syscalls supplied with newlib" + help + Disable the syscalls that come with newlib. You + will have to implement your own _sbrk, _read, + _write... If you plan to port newlib to a new + platform/board, say Yes. + diff -r e5078db4bd2c -r cb0f31fe2535 scripts/build/libc/newlib.sh --- a/scripts/build/libc/newlib.sh Fri Aug 26 00:07:51 2011 +0200 +++ b/scripts/build/libc/newlib.sh Sun Aug 28 20:12:26 2011 +0200 @@ -79,6 +79,11 @@ newlib_opts+=( "--disable-newlib-io-float" ) newlib_opts+=( "--disable-newlib-io-long-double" ) fi + if [ "${CT_LIBC_NEWLIB_DISABLE_SUPPLIED_SYSCALLS}" = "y" ]; then + newlib_opts+=( "--disable-newlib-supplied-syscalls" ) + else + newlib_opts+=( "--enable-newlib-supplied-syscalls" ) + fi # Note: newlib handles the build/host/target a little bit differently # than one would expect: