summaryrefslogtreecommitdiff
path: root/scripts/build/libc/eglibc.sh
diff options
context:
space:
mode:
authorRichard Strand <richard.strand@icomera.com>2010-02-01 12:56:28 (GMT)
committerRichard Strand <richard.strand@icomera.com>2010-02-01 12:56:28 (GMT)
commit22fca0106eceb10e1c1666d680be29f978ec8908 (patch)
treed970b5163f80223667b08b54dff8d8365fb9e5c8 /scripts/build/libc/eglibc.sh
parent8d01c33fd10e031bbe29779ff93403180b84971e (diff)
libc/eglibc: Add option to optimize for size
Add an option to eglibc to optimize for size using -Os. Signed-off-by: Richard Strand <richard.strand@icomera.com>
Diffstat (limited to 'scripts/build/libc/eglibc.sh')
-rw-r--r--scripts/build/libc/eglibc.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/build/libc/eglibc.sh b/scripts/build/libc/eglibc.sh
index b36201c..1875a23 100644
--- a/scripts/build/libc/eglibc.sh
+++ b/scripts/build/libc/eglibc.sh
@@ -259,6 +259,12 @@ do_libc() {
CT_DoExecLog ALL cp "${CT_CONFIG_DIR}/eglibc.config" option-groups.config
fi
+ if [ "${CT_EGLIBC_OPT_SIZE}" = "y" ]; then
+ OPTIMIZE=-Os
+ else
+ OPTIMIZE=-O2
+ fi
+
# Add some default glibc config options if not given by user.
# We don't need to be conditional on wether the user did set different
# values, as they CT_LIBC_GLIBC_EXTRA_CONFIG is passed after extra_config
@@ -301,7 +307,7 @@ do_libc() {
CT_DoLog DEBUG "Extra CC args passed : '${extra_cc_args}'"
BUILD_CC="${CT_BUILD}-gcc" \
- CFLAGS="${CT_TARGET_CFLAGS} ${CT_LIBC_GLIBC_EXTRA_CFLAGS} -O2" \
+ CFLAGS="${CT_TARGET_CFLAGS} ${CT_LIBC_GLIBC_EXTRA_CFLAGS} ${OPTIMIZE}" \
CC="${CT_TARGET}-gcc ${CT_LIBC_EXTRA_CC_ARGS} ${extra_cc_args}" \
AR=${CT_TARGET}-ar \
RANLIB=${CT_TARGET}-ranlib \