[vlc-commits] Remove code size optimization

Rémi Denis-Courmont git at videolan.org
Mon May 2 10:57:48 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun May  1 19:01:02 2011 +0300| [13e78d81057d30c75fdce84c485f1e0f4b72d0e2] | committer: Rémi Denis-Courmont

Remove code size optimization

Optimizing VLC code for size is probably not such a great idea,
considering that media playback is performance critical. There are
better ways to reduce code size than -Os, e.g. Thumb(2) code on ARM.

And of course, removing unneeded plugins and feature is the best way
to reduce code size.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=13e78d81057d30c75fdce84c485f1e0f4b72d0e2
---

 configure.ac     |   24 +-----------------------
 m4/vlc.m4        |    1 -
 vlc-config.in.in |   12 +-----------
 3 files changed, 2 insertions(+), 35 deletions(-)

diff --git a/configure.ac b/configure.ac
index 829a5df..3af9ed3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -986,24 +986,6 @@ RDC_PROG_CC_WFLAGS([all extra sign-compare undef pointer-arith bad-function-cast
 RDC_PROG_CC_FLAGS([-pipe])
 
 dnl Check for various optimization flags
-AC_CACHE_CHECK([if \$CC accepts -Os],
-    [ac_cv_c_os],
-    [CFLAGS="${CFLAGS_save} -Os"
-     AC_TRY_COMPILE([],,ac_cv_c_os=yes, ac_cv_c_os=no)])
-if test "${ac_cv_c_os}" != "no"; then
-    CFLAGS_OPTIM_SIZE="${CFLAGS_OPTIM_SIZE} -Os"
-else
-    AC_CACHE_CHECK([if \$CC accepts -O],
-        [ac_cv_c_o],
-        [CFLAGS="${CFLAGS_save} -O"
-         AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
-    if test "${ac_cv_c_o}" != "no"; then
-        if test "${ac_cv_c_o3}" = "no"; then
-            CFLAGS_OPTIM_SIZE="${CFLAGS_OPTIM_SIZE} -O"
-        fi
-    fi
-fi
-
 AC_CACHE_CHECK([if \$CC accepts -O4],
     [ac_cv_c_o4],
     [CFLAGS="${CFLAGS_save} -O4"
@@ -1549,11 +1531,7 @@ AC_ARG_ENABLE(optimizations,
   [AS_HELP_STRING([--disable-optimizations],
     [disable compiler optimizations (default enabled)])])
 if test "${enable_optimizations}" != "no"; then
-   if test "${enable_optimize_memory}" = "yes"; then
-      enable_optimizations="size"
-   else
-      enable_optimizations="speed"
-   fi
+  enable_optimizations="speed"
 fi
 
 dnl
diff --git a/m4/vlc.m4 b/m4/vlc.m4
index 5ac09bc..f4e8778 100644
--- a/m4/vlc.m4
+++ b/m4/vlc.m4
@@ -99,7 +99,6 @@ AC_DEFUN([VLC_OUTPUT_VLC_CONFIG_IN], [
           -e "s/@PLUGINS@/${PLUGINS}/" \
           -e "s/@BUILTINS@/${BUILTINS}/" \
           -e "s/@CFLAGS_TUNING@/${CFLAGS_TUNING}/" \
-          -e "s/@CFLAGS_OPTIM_SIZE@/${CFLAGS_OPTIM_SIZE}/" \
           -e "s/@CFLAGS_OPTIM_SPEED@/${CFLAGS_OPTIM_SPEED}/" \
           -e "s/@CFLAGS_OPTIM_NODEBUG@/${CFLAGS_OPTIM_NODEBUG}/" \
           -e "s/@CFLAGS_NOOPTIM@/${CFLAGS_NOOPTIM}/" \
diff --git a/vlc-config.in.in b/vlc-config.in.in
index 605c634..c0316bd 100644
--- a/vlc-config.in.in
+++ b/vlc-config.in.in
@@ -21,7 +21,6 @@ ldflags=""
 libs=""
 
 cflags_tuning="@CFLAGS_TUNING@"
-cflags_optim_size="@CFLAGS_OPTIM_SIZE@"
 cflags_optim_speed="@CFLAGS_OPTIM_SPEED@"
 cflags_optim_nodebug="@CFLAGS_OPTIM_NODEBUG@"
 cflags_nooptim="@CFLAGS_NOOPTIM@"
@@ -102,16 +101,7 @@ if [ "${gprof}" = yes ]; then
   objcflags="${objcflags} -pg"
   ldflags="${ldflags} -pg"
 fi
-if [ "${optim}" = size ]; then
-  cflags="${cflags} ${cflags_optim_size} ${cflags_tuning}"
-  cxxflags="${cxxflags} ${cflags_optim_size} ${cflags_tuning}"
-  objcflags="${objcflags} ${cflags_optim_size} ${cflags_tuning}"
-  if [ "${debug}" != yes -a "${gprof}" != yes -a "${cprof}" != yes ]; then
-    cflags="${cflags} ${cflags_optim_nodebug}"
-    cxxflags="${cxxflags} ${cflags_optim_nodebug}"
-    objcflags="${objcflags} ${cflags_optim_nodebug}"
-  fi
-elif [ "${optim}" = speed ]; then
+if [ "${optim}" = speed ]; then
   cflags="${cflags} ${cflags_optim_speed} ${cflags_tuning}"
   cxxflags="${cxxflags} ${cflags_optim_speed} ${cflags_tuning}"
   objcflags="${objcflags} ${cflags_optim_speed} ${cflags_tuning}"



More information about the vlc-commits mailing list