From c2a78ebf4573f70b4d5d9aa6b30a14e242fc03ed Mon Sep 17 00:00:00 2001 From: "fbarchard@google.com" Date: Mon, 25 Aug 2014 18:01:50 +0000 Subject: [PATCH] Add LTO support for Android Chromium. BUG=354 This is to add support for a Link-Time Optimizations experiment in Android Chromium. As it is disabled by default, it won't change anything for most configurations. R=tpsiaki@google.com Review URL: https://webrtc-codereview.appspot.com/21329004 git-svn-id: http://libyuv.googlecode.com/svn/trunk@1061 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- README.chromium | 2 +- include/libyuv/version.h | 2 +- libyuv.gyp | 23 +++++++++++++++++------ 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/README.chromium b/README.chromium index 278688552..d026515bc 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 1059 +Version: 1061 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 73a7f1b01..b4244b248 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 1059 +#define LIBYUV_VERSION 1061 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/libyuv.gyp b/libyuv.gyp index 230ddd446..b51291c00 100644 --- a/libyuv.gyp +++ b/libyuv.gyp @@ -19,9 +19,11 @@ 'variables': { 'use_system_libjpeg%': 0, 'libyuv_disable_jpeg%': 0, + # Link-Time Optimizations. + 'use_lto%': 0, 'build_neon': 0, 'conditions': [ - [ '(target_arch == "armv7" or target_arch == "armv7s" or \ + ['(target_arch == "armv7" or target_arch == "armv7s" or \ (target_arch == "arm" and arm_version >= 7) or target_arch == "arm64")\ and target_subarch != 64 and (arm_neon == 1 or arm_neon_optional == 1)', { @@ -30,7 +32,7 @@ ], }, 'conditions': [ - [ 'build_neon != 0', { + ['build_neon != 0', { 'targets': [ # The NEON-specific components. { @@ -70,6 +72,15 @@ 'source/scale_neon.cc', 'source/scale_neon64.cc', ], + 'conditions': [ + # Disable LTO in libyuv_neon target due to compiler bug + ['use_lto == 1', { + 'cflags!': [ + '-flto', + '-ffat-lto-objects', + ], + }], + ], }, ], }], @@ -82,12 +93,12 @@ # Allows libyuv.a redistributable library without external dependencies. 'standalone_static_library': 1, 'conditions': [ - [ 'OS == "ios" and target_subarch == 64', { + ['OS == "ios" and target_subarch == 64', { 'defines': [ 'LIBYUV_DISABLE_NEON' ], }], - [ 'OS != "ios" and libyuv_disable_jpeg != 1', { + ['OS != "ios" and libyuv_disable_jpeg != 1', { 'defines': [ 'HAVE_JPEG' ], @@ -111,12 +122,12 @@ }], ], }], - [ 'build_neon != 0', { + ['build_neon != 0', { 'dependencies': [ 'libyuv_neon', ], 'conditions': [ - #TODO LIBYUV_NEON is temporary disabled. When all arm64 port has + # TODO LIBYUV_NEON is temporary disabled. When all arm64 port has # been done, enable it. ['target_arch !="arm64"', { 'defines': [