This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 1 of 1] libc/eglibc: Add option to optimize for size


# HG changeset patch
# User Richard Strand <richard.strand@icomera.com>
# Date 1265028988 0
# Node ID f1dc942a12c2d84f2b62bc336627f2f540c4bbf7
# Parent  160fc94ed49f0e7697df6427d6a9e772ef94857f
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>

diff -r 160fc94ed49f -r f1dc942a12c2 config/libc/eglibc.in
--- a/config/libc/eglibc.in	Sun Jan 31 23:04:35 2010 +0100
+++ b/config/libc/eglibc.in	Mon Feb 01 12:56:28 2010 +0000
@@ -95,6 +95,13 @@
       Note that crosstool-NG will *not* update your working copy, you will
       have to do that yourself.
 
+config EGLIBC_OPT_SIZE
+    bool
+    prompt "optimize eglibc for size (-Os)"
+    help
+      Optimize eglibc for size using -Os instead of -O2. This will make eglibc
+      smaller but may make it slower.
+
 config EGLIBC_CUSTOM_CONFIG
     bool
     prompt "Use custom configuration file"
diff -r 160fc94ed49f -r f1dc942a12c2 scripts/build/libc/eglibc.sh
--- a/scripts/build/libc/eglibc.sh	Sun Jan 31 23:04:35 2010 +0100
+++ b/scripts/build/libc/eglibc.sh	Mon Feb 01 12:56:28 2010 +0000
@@ -259,6 +259,12 @@
         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 @@
     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                                      \

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]