# HG changeset patch # User Zhenqiang Chen # Date 1321942694 -28800 # Node ID 2f4e3c312b659422e4a9950f13a0fc507b97c1fd # Parent e3e1c9d45bddfbfb433ee9d583faf42fa31f50c0 libc/newlib: add option to optimise for size Add an option to build with -Os instead of the default -O. Reviewed-by: Michael Hope Signed-off-by: Zhenqiang Chen diff -r e3e1c9d45bdd -r 2f4e3c312b65 config/libc/newlib.in.2 --- a/config/libc/newlib.in.2 Fri Nov 18 11:32:50 2011 +0800 +++ b/config/libc/newlib.in.2 Tue Nov 22 14:18:14 2011 +0800 @@ -35,6 +35,15 @@ _write... If you plan to port newlib to a new platform/board, say Yes. +config LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE + bool + prompt "Optimize newlib for size" + default y + help + Pass --enable-target-optspace to newlib configure. + + This will compile newlib with -Os. + config LIBC_NEWLIB_EXTRA_CONFIG_ARRAY string prompt "Extra config for newlib" diff -r e3e1c9d45bdd -r 2f4e3c312b65 scripts/build/libc/newlib.sh --- a/scripts/build/libc/newlib.sh Fri Nov 18 11:32:50 2011 +0800 +++ b/scripts/build/libc/newlib.sh Tue Nov 22 14:18:14 2011 +0800 @@ -85,6 +85,8 @@ newlib_opts+=( "--enable-newlib-supplied-syscalls" ) fi + [ "${CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE}" = "y" ] && newlib_opts+=("--enable-target-optspace") + # Note: newlib handles the build/host/target a little bit differently # than one would expect: # build : not used