Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(714)

Side by Side Diff: build/common.gypi

Issue 646873004: Add Link-Time Optimizations support for Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comment Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/android/increase_size_for_speed.gypi ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # IMPORTANT: 5 # IMPORTANT:
6 # Please don't directly include this file if you are building via gyp_chromium, 6 # Please don't directly include this file if you are building via gyp_chromium,
7 # since gyp_chromium is automatically forcing its inclusion. 7 # since gyp_chromium is automatically forcing its inclusion.
8 { 8 {
9 # Variables expected to be overriden on the GYP command line (-D) or by 9 # Variables expected to be overriden on the GYP command line (-D) or by
10 # ~/.gyp/include.gypi. 10 # ~/.gyp/include.gypi.
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 'enable_load_completion_hacks%': 1, 630 'enable_load_completion_hacks%': 1,
631 631
632 # Automatically select platforms under ozone. Turn this off to 632 # Automatically select platforms under ozone. Turn this off to
633 # build only explicitly selected platforms. 633 # build only explicitly selected platforms.
634 'ozone_auto_platforms%': 1, 634 'ozone_auto_platforms%': 1,
635 635
636 # If this is set clang is used as host compiler, but not as target 636 # If this is set clang is used as host compiler, but not as target
637 # compiler. Always do this by default. 637 # compiler. Always do this by default.
638 'host_clang%': 1, 638 'host_clang%': 1,
639 639
640 # Variables to control Link-Time Optimizations (LTO).
641 # Note: the variables must *not* be enabled at the same time.
642 # In this case LTO would 'merge' the optimization flags
643 # at link-time which would lead to all code be optimized with -O2.
644 # Enable LTO on the code compiled with -Os.
645 # See crbug.com/407544
646 'use_lto%': 0,
647 # Enable LTO on code compiled with -O2.
648 'use_lto_o2%': 0,
649
640 'conditions': [ 650 'conditions': [
641 # A flag for POSIX platforms 651 # A flag for POSIX platforms
642 ['OS=="win"', { 652 ['OS=="win"', {
643 'os_posix%': 0, 653 'os_posix%': 0,
644 }, { 654 }, {
645 'os_posix%': 1, 655 'os_posix%': 1,
646 }], 656 }],
647 657
648 # A flag for BSD platforms 658 # A flag for BSD platforms
649 ['OS=="freebsd" or OS=="openbsd"', { 659 ['OS=="freebsd" or OS=="openbsd"', {
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
1178 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)', 1188 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1179 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)', 1189 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1180 'enable_mdns%' : '<(enable_mdns)', 1190 'enable_mdns%' : '<(enable_mdns)',
1181 'enable_service_discovery%' : '<(enable_service_discovery)', 1191 'enable_service_discovery%' : '<(enable_service_discovery)',
1182 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)', 1192 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1183 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension) ', 1193 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension) ',
1184 'v8_optimized_debug%': '<(v8_optimized_debug)', 1194 'v8_optimized_debug%': '<(v8_optimized_debug)',
1185 'proprietary_codecs%': '<(proprietary_codecs)', 1195 'proprietary_codecs%': '<(proprietary_codecs)',
1186 'use_goma%': '<(use_goma)', 1196 'use_goma%': '<(use_goma)',
1187 'gomadir%': '<(gomadir)', 1197 'gomadir%': '<(gomadir)',
1198 'use_lto%': '<(use_lto)',
1199 'use_lto_o2%': '<(use_lto_o2)',
1188 'video_hole%': '<(video_hole)', 1200 'video_hole%': '<(video_hole)',
1189 'enable_load_completion_hacks%': '<(enable_load_completion_hacks)', 1201 'enable_load_completion_hacks%': '<(enable_load_completion_hacks)',
1190 'support_pre_M6_history_database%': '<(support_pre_M6_history_database)', 1202 'support_pre_M6_history_database%': '<(support_pre_M6_history_database)',
1191 1203
1192 # Whether or not we are building the Athena shell. 1204 # Whether or not we are building the Athena shell.
1193 'use_athena%': '0', 1205 'use_athena%': '0',
1194 1206
1195 # Use system protobuf instead of bundled one. 1207 # Use system protobuf instead of bundled one.
1196 'use_system_protobuf%': 0, 1208 'use_system_protobuf%': 0,
1197 1209
(...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after
2306 # Do not disable seccomp_bpf anywhere without talking to 2318 # Do not disable seccomp_bpf anywhere without talking to
2307 # security@chromium.org! 2319 # security@chromium.org!
2308 ['((OS=="linux" or OS=="android") and ' 2320 ['((OS=="linux" or OS=="android") and '
2309 '(target_arch=="ia32" or target_arch=="x64" or ' 2321 '(target_arch=="ia32" or target_arch=="x64" or '
2310 'target_arch=="arm" or target_arch=="mipsel" or ' 2322 'target_arch=="arm" or target_arch=="mipsel" or '
2311 'target_arch=="arm64"))', { 2323 'target_arch=="arm64"))', {
2312 'use_seccomp_bpf%': 1, 2324 'use_seccomp_bpf%': 1,
2313 }, { 2325 }, {
2314 'use_seccomp_bpf%': 0, 2326 'use_seccomp_bpf%': 0,
2315 }], 2327 }],
2328 # Set component build with LTO until all tests pass.
2329 # This also reduces link time.
2330 ['use_lto==1', {
2331 'component%': "shared_library",
2332 }],
2316 ], 2333 ],
2317 2334
2318 # older history files use fts2 instead of fts3 2335 # older history files use fts2 instead of fts3
2319 'sqlite_enable_fts2%': '<(support_pre_M6_history_database)', 2336 'sqlite_enable_fts2%': '<(support_pre_M6_history_database)',
2320 2337
2321 # The path to the ANGLE library. 2338 # The path to the ANGLE library.
2322 'angle_path': '<(DEPTH)/third_party/angle', 2339 'angle_path': '<(DEPTH)/third_party/angle',
2323 2340
2324 # List of default apps to install in new profiles. The first list contains 2341 # List of default apps to install in new profiles. The first list contains
2325 # the source files as found in svn. The second list, used only for linux, 2342 # the source files as found in svn. The second list, used only for linux,
(...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after
3748 '-target arm-linux-gnueabihf', 3765 '-target arm-linux-gnueabihf',
3749 ], 3766 ],
3750 'ldflags': [ 3767 'ldflags': [
3751 '-target arm-linux-gnueabihf', 3768 '-target arm-linux-gnueabihf',
3752 ], 3769 ],
3753 }], 3770 }],
3754 ['arm_arch!=""', { 3771 ['arm_arch!=""', {
3755 'cflags': [ 3772 'cflags': [
3756 '-march=<(arm_arch)', 3773 '-march=<(arm_arch)',
3757 ], 3774 ],
3775 'conditions': [
3776 ['use_lto==1 or use_lto_o2==1', {
3777 'ldflags': [
3778 '-march=<(arm_arch)',
3779 ],
3780 }],
3781 ],
3758 }], 3782 }],
3759 ['clang==1 and OS!="android"', { 3783 ['clang==1 and OS!="android"', {
3760 'cflags': [ 3784 'cflags': [
3761 # We need to disable clang's builtin assembler as it can't 3785 # We need to disable clang's builtin assembler as it can't
3762 # handle several asm files, crbug.com/124610 3786 # handle several asm files, crbug.com/124610
3763 '-no-integrated-as', 3787 '-no-integrated-as',
3764 ], 3788 ],
3765 }], 3789 }],
3766 ['arm_tune!=""', { 3790 ['arm_tune!=""', {
3767 'cflags': [ 3791 'cflags': [
3768 '-mtune=<(arm_tune)', 3792 '-mtune=<(arm_tune)',
3769 ], 3793 ],
3794 'conditions': [
3795 ['use_lto==1 or use_lto_o2==1', {
3796 'ldflags': [
3797 '-mtune=<(arm_tune)',
3798 ],
3799 }],
3800 ],
3770 }], 3801 }],
3771 ['arm_fpu!=""', { 3802 ['arm_fpu!=""', {
3772 'cflags': [ 3803 'cflags': [
3773 '-mfpu=<(arm_fpu)', 3804 '-mfpu=<(arm_fpu)',
3774 ], 3805 ],
3806 'conditions': [
3807 ['use_lto==1 or use_lto_o2==1', {
3808 'ldflags': [
3809 '-mfpu=<(arm_fpu)',
3810 ],
3811 }],
3812 ],
3775 }], 3813 }],
3776 ['arm_float_abi!=""', { 3814 ['arm_float_abi!=""', {
3777 'cflags': [ 3815 'cflags': [
3778 '-mfloat-abi=<(arm_float_abi)', 3816 '-mfloat-abi=<(arm_float_abi)',
3779 ], 3817 ],
3818 'conditions': [
3819 ['use_lto==1 or use_lto_o2==1', {
3820 'ldflags': [
3821 '-mfloat-abi=<(arm_float_abi)',
3822 ],
3823 }],
3824 ],
3780 }], 3825 }],
3781 ['arm_thumb==1', { 3826 ['arm_thumb==1', {
3782 'cflags': [ 3827 'cflags': [
3783 '-mthumb', 3828 '-mthumb',
3784 ], 3829 ],
3830 'conditions': [
3831 ['use_lto==1 or use_lto_o2==1', {
3832 'ldflags': [
3833 '-mthumb',
3834 ],
3835 }],
3836 ],
3785 }], 3837 }],
3786 ['OS=="android"', { 3838 ['OS=="android"', {
3787 # Most of the following flags are derived from what Android 3839 # Most of the following flags are derived from what Android
3788 # uses by default when building for arm, reference for which 3840 # uses by default when building for arm, reference for which
3789 # can be found in the following file in the Android NDK: 3841 # can be found in the following file in the Android NDK:
3790 # toolchains/arm-linux-androideabi-4.9/setup.mk 3842 # toolchains/arm-linux-androideabi-4.9/setup.mk
3791 'cflags': [ 3843 'cflags': [
3792 # The tree-sra optimization (scalar replacement for 3844 # The tree-sra optimization (scalar replacement for
3793 # aggregates enabling subsequent optimizations) leads to 3845 # aggregates enabling subsequent optimizations) leads to
3794 # invalid code generation when using the Android NDK's 3846 # invalid code generation when using the Android NDK's
(...skipping 1883 matching lines...) Expand 10 before | Expand all | Expand 10 after
5678 # make generator doesn't support CC_wrapper without CC 5730 # make generator doesn't support CC_wrapper without CC
5679 # in make_global_settings yet. 5731 # in make_global_settings yet.
5680 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', { 5732 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5681 'make_global_settings': [ 5733 'make_global_settings': [
5682 ['CC_wrapper', '<(gomadir)/gomacc'], 5734 ['CC_wrapper', '<(gomadir)/gomacc'],
5683 ['CXX_wrapper', '<(gomadir)/gomacc'], 5735 ['CXX_wrapper', '<(gomadir)/gomacc'],
5684 ['CC.host_wrapper', '<(gomadir)/gomacc'], 5736 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5685 ['CXX.host_wrapper', '<(gomadir)/gomacc'], 5737 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5686 ], 5738 ],
5687 }], 5739 }],
5740 ['use_lto==1', {
5741 'target_defaults': {
5742 'target_conditions': [
5743 ['_toolset=="target"', {
5744 'cflags': [
5745 '-flto',
5746 '-ffat-lto-objects',
5747 ],
5748 }],
5749 ],
5750 },
5751 }],
5752 ['use_lto==1 or use_lto_o2==1', {
5753 'target_defaults': {
5754 'target_conditions': [
5755 ['_toolset=="target"', {
5756 'ldflags': [
5757 '-flto=32',
5758 ],
5759 }],
5760 ],
5761 },
5762 }],
5688 ], 5763 ],
5689 'xcode_settings': { 5764 'xcode_settings': {
5690 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT! 5765 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
5691 # This block adds *project-wide* configuration settings to each project 5766 # This block adds *project-wide* configuration settings to each project
5692 # file. It's almost always wrong to put things here. Specify your 5767 # file. It's almost always wrong to put things here. Specify your
5693 # custom xcode_settings in target_defaults to add them to targets instead. 5768 # custom xcode_settings in target_defaults to add them to targets instead.
5694 5769
5695 'conditions': [ 5770 'conditions': [
5696 # In an Xcode Project Info window, the "Base SDK for All Configurations" 5771 # In an Xcode Project Info window, the "Base SDK for All Configurations"
5697 # setting sets the SDK on a project-wide basis. In order to get the 5772 # setting sets the SDK on a project-wide basis. In order to get the
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
5748 # settings in target dicts. SYMROOT is a special case, because many other 5823 # settings in target dicts. SYMROOT is a special case, because many other
5749 # Xcode variables depend on it, including variables such as 5824 # Xcode variables depend on it, including variables such as
5750 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something 5825 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5751 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the 5826 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5752 # files to appear (when present) in the UI as actual files and not red 5827 # files to appear (when present) in the UI as actual files and not red
5753 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR, 5828 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5754 # and therefore SYMROOT, needs to be set at the project level. 5829 # and therefore SYMROOT, needs to be set at the project level.
5755 'SYMROOT': '<(DEPTH)/xcodebuild', 5830 'SYMROOT': '<(DEPTH)/xcodebuild',
5756 }, 5831 },
5757 } 5832 }
OLDNEW
« no previous file with comments | « build/android/increase_size_for_speed.gypi ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698