[vlc-devel] LTO Support for VLC source code!
xxcv
xxcv07 at gmail.com
Sat Sep 25 08:53:58 CEST 2010
On 25/09/2010 2:41 PM, Rémi Denis-Courmont wrote:
> Hello,
>
> On Friday 24 September 2010, xxcv wrote:
>> Hello All!!
>>
>> Yesterday I succeeded in compilation VLC 1.1 Branch with new GCC 4.5
>> feature LTO -flto.
>> I was overwhelmed !!!
>
> That's great... but what's lto anyway?
>
>
http://en.wikipedia.org/wiki/Interprocedural_optimization
http://en.wikipedia.org/wiki/Link-time_optimization
http://gcc.gnu.org/wiki/LinkTimeOptimization
http://gcc.gnu.org/gcc-4.5/changes.html (A new link-time optimizer has
been added (-flto).)
Also I was trying to put some support in configure like this, which, I
saw how ffast-math was done.
It needed to be put into the env variable ldflags as well.
diff --git a/configure.ac b/configure.ac
index 9ff9b4c..a5ed53a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1046,6 +1046,15 @@ if test "${ac_cv_c_o0}" != "no"; then
CFLAGS_NOOPTIM="${CFLAGS_NOOPTIM} -O0"
fi
+dnl Check for -flto
+AC_CACHE_CHECK([if \$CC accepts -flto],
+ [ac_cv_c_lto],
+ [CFLAGS="${CFLAGS_save} -flto"
+ AC_TRY_COMPILE([],,ac_cv_c_lto=yes, ac_cv_c_lto=no)])
+if test "${ac_cv_c_lto}" != "no"; then
+ CFLAGS_OPTIM_SPEED="${CFLAGS_OPTIM_SPEED} -flto"
+fi
+
dnl Check for -ffast-math
AC_CACHE_CHECK([if \$CC accepts -ffast-math],
[ac_cv_c_fast_math],
Regards,
--
My VLC, My Way, My Style~
| (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination
More information about the vlc-devel
mailing list