From 91eb66a629bbc9e3fe5a7afd10fb7b3d028588f2 Mon Sep 17 00:00:00 2001 From: Zhenqiang Chen Date: Tue, 22 Nov 2011 14:18:14 +0800 Subject: 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 --git a/config/libc/newlib.in.2 b/config/libc/newlib.in.2 index 3708384..ef5d076 100644 --- a/config/libc/newlib.in.2 +++ b/config/libc/newlib.in.2 @@ -35,6 +35,15 @@ config LIBC_NEWLIB_DISABLE_SUPPLIED_SYSCALLS _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 --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh index 70a970c..d987477 100644 --- a/scripts/build/libc/newlib.sh +++ b/scripts/build/libc/newlib.sh @@ -85,6 +85,8 @@ do_libc_start_files() { 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 -- cgit v0.10.2-6-g49f6