Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/build/android/increase_size_for_speed.gypi b/build/android/increase_size_for_speed.gypi
- index c5600b1..95d4e8c 100644
- --- a/build/android/increase_size_for_speed.gypi
- +++ b/build/android/increase_size_for_speed.gypi
- @@ -16,12 +16,12 @@
- 'conditions': [
- ['OS=="android"', {
- 'cflags!': ['-Os'],
- - 'cflags': ['-O2'],
- + 'cflags': ['-Ofast', '-fno-fast-math'],
- }],
- - # Do not merge -Os and -O2 in GCC LTO.
- - # LTO merges all optimization options at link-time. -O2 takes
- + # Do not merge -Os and -Ofast -fno-fast-math in GCC LTO.
- + # LTO merges all optimization options at link-time. -Ofast -fno-fast-math takes
- # precedence over -Os. Avoid using LTO simultaneously
- - # on -Os and -O2 parts for that reason.
- + # on -Os and -Ofast -fno-fast-math parts for that reason.
- ['OS=="android" and clang==0 and use_lto==1', {
- 'cflags!': [
- '-flto',
- diff --git a/build/common.gypi b/build/common.gypi
- index db3d63f..68916b3d 100644
- --- a/build/common.gypi
- +++ b/build/common.gypi
- @@ -623,6 +623,7 @@
- # Clang stuff.
- 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
- + 'host_clang_dir%': 'third_party/llvm-build/host',
- # Set this to true when building with Clang.
- # See https://chromium.googlesource.com/chromium/src/+/master/docs/clang.md for details.
- # If this is set, clang is used as both host and target compiler in
- @@ -690,8 +691,8 @@
- # On Android/GCC, the variables must *not* be enabled at the same time.
- # In this case LTO would 'merge' the optimization flags at link-time
- # which would lead to all code be optimized with -O2. See crbug.com/407544
- - 'use_lto%': 0,
- - 'use_lto_o2%': 0,
- + 'use_lto%': 1,
- + 'use_lto_o2%': 1,
- # Allowed level of identical code folding in the gold linker.
- 'gold_icf_level%': 'all',
- @@ -1374,6 +1375,7 @@
- 'clang%': '<(clang)',
- 'host_clang%': '<(host_clang)',
- 'make_clang_dir%': '<(make_clang_dir)',
- + 'host_clang_dir%': 'third_party/llvm-build/host',
- 'use_lld%': '<(use_lld)',
- # Control which version of clang to use when building for iOS. If set to
- @@ -2321,11 +2323,11 @@
- 'arm_thumb%': 0,
- }],
- ['arm_version==7', {
- - 'arm_arch%': 'armv7-a',
- - 'arm_tune%': 'generic-armv7-a',
- + 'arm_arch%': '',
- + 'arm_tune%': 'krait',
- 'conditions': [
- ['arm_neon==1', {
- - 'arm_fpu%': 'neon',
- + 'arm_fpu%': 'neon-vfpv4',
- }, {
- 'arm_fpu%': 'vfpv3-d16',
- }],
- @@ -2399,8 +2401,8 @@
- }],
- ['host_clang==1', {
- - 'host_cc': '<(make_clang_dir)/bin/clang',
- - 'host_cxx': '<(make_clang_dir)/bin/clang++',
- + 'host_cc': '<(host_clang_dir)/bin/clang',
- + 'host_cxx': '<(host_clang_dir)/bin/clang++',
- }, {
- 'host_cc': '<!(which gcc)',
- 'host_cxx': '<!(which g++)',
- @@ -3050,12 +3052,6 @@
- # third-party code either.
- 'cflags!': [ '-Wall' ],
- }],
- - # TODO: Fix all warnings on chromeos too.
- - [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
- - 'cflags!': [
- - '-Werror',
- - ],
- - }],
- [ 'OS=="win"', {
- 'defines': [
- '_CRT_SECURE_NO_DEPRECATE',
- @@ -3594,7 +3590,7 @@
- # Enable -Werror by default, but put it in a variable so it can
- # be disabled in ~/.gyp/include.gypi on the valgrind builders.
- 'variables': {
- - 'werror%': '-Werror',
- + 'werror%': '',
- 'libraries_for_target%': '',
- 'conditions' : [
- # Enable -Wextra for chromium_code when we control the compiler.
- @@ -3912,6 +3908,7 @@
- ['arm_tune!=""', {
- 'cflags': [
- '-mtune=<(arm_tune)',
- + '-mcpu=<(arm_tune)',
- ],
- 'conditions': [
- ['use_lto==1 or use_lto_o2==1', {
- @@ -5985,8 +5982,8 @@
- 'make_global_settings': [
- ['CC', '<(make_clang_dir)/bin/clang'],
- ['CXX', '<(make_clang_dir)/bin/clang++'],
- - ['CC.host', '$(CC)'],
- - ['CXX.host', '$(CXX)'],
- + ['CC.host', '<(host_clang_dir)/bin/clang'],
- + ['CXX.host', '<(host_clang_dir)/bin/clang++'],
- ],
- }],
- ['clang==1 and OS=="win"', {
- @@ -6108,7 +6105,6 @@
- 'target_conditions': [
- ['_toolset=="target"', {
- 'ldflags': [
- - '-Wl,--plugin-opt,O1',
- # Allows the linker to apply ICF to the LTO object file. Also, when
- # targeting ARM, wWithout this flag, LTO produces a .text section
- # that is larger than the maximum call displacement, preventing the
- diff --git a/build/config/arm.gni b/build/config/arm.gni
- index 6eeca62..cd80dd3 100644
- --- a/build/config/arm.gni
- +++ b/build/config/arm.gni
- @@ -60,7 +60,8 @@ if (current_cpu == "arm" || v8_current_cpu == "arm") {
- } else if (arm_version == 7) {
- arm_arch = "armv7-a"
- if (arm_tune == "") {
- - arm_tune = "generic-armv7-a"
- + arm_tune = "krait"
- + arm_arch = ""
- }
- if (arm_float_abi == "") {
- @@ -75,7 +76,7 @@ if (current_cpu == "arm" || v8_current_cpu == "arm") {
- }
- if (arm_use_neon) {
- - arm_fpu = "neon"
- + arm_fpu = "neon-vfpv4"
- } else {
- arm_fpu = "vfpv3-d16"
- }
- diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
- index 5e6d530..e294558 100644
- --- a/build/config/compiler/BUILD.gn
- +++ b/build/config/compiler/BUILD.gn
- @@ -354,13 +354,17 @@ config("compiler") {
- # Additionally, on cast Android x86, --icf=all causes issues.
- if (is_android && current_cpu == "x86") {
- ldflags += [ "-Wl,--icf=none" ]
- - } else if (is_clang || is_chromeos ||
- - (current_cpu != "x86" && current_cpu != "x64")) {
- - ldflags += [ "-Wl,--icf=all" ]
- } else if (!is_android) {
- ldflags += [ "-Wl,--icf=safe" ]
- }
- }
- + if ((current_cpu != "x86" && current_cpu != "x64")) {
- + ldflags += [ "-fuse-ld=qcld" ]
- + } else {
- + ldflags += [ "-Wl,-O1" ]
- + }
- +
- +# ldflags += [ "-Wl,-O1", "-Wl,--as-needed", "-Wl,--relax", "-Wl,--sort-common", "-Wl,--gc-sections" ]
- if (linux_use_bundled_binutils) {
- cflags += [ "-B$binutils_path" ]
- @@ -441,15 +445,15 @@ config("compiler") {
- ldflags += [ "-flto" ]
- # Apply a lower LTO optimization level as the default is too slow.
- - if (is_linux) {
- - if (use_lld) {
- - ldflags += [ "-Wl,--lto-O1" ]
- - } else {
- - ldflags += [ "-Wl,-plugin-opt,O1" ]
- - }
- - } else if (is_mac) {
- - ldflags += [ "-Wl,-mllvm,-O1" ]
- - }
- +# if (is_linux) {
- +# if (use_lld) {
- +# ldflags += [ "-Wl,--lto-O1" ]
- +# } else {
- +# ldflags += [ "-Wl,-plugin-opt,O1" ]
- +# }
- +# } else if (is_mac) {
- +# ldflags += [ "-Wl,-mllvm,-O1" ]
- +# }
- # Work-around for http://openradar.appspot.com/20356002
- if (is_mac) {
- @@ -464,8 +468,8 @@ config("compiler") {
- ldflags += [ "-Wl,-plugin-opt,-function-sections" ]
- }
- - cflags += [ "-fwhole-program-vtables" ]
- - ldflags += [ "-fwhole-program-vtables" ]
- +# cflags += [ "-fwhole-program-vtables" ]
- +# ldflags += [ "-fwhole-program-vtables" ]
- }
- # Pass the same C/C++ flags to the objective C/C++ compiler.
- @@ -515,10 +519,10 @@ config("compiler_cpu_abi") {
- ldflags += [ "--target=arm-linux-gnueabihf" ]
- }
- if (!is_nacl) {
- - cflags += [
- - "-march=$arm_arch",
- - "-mfloat-abi=$arm_float_abi",
- - ]
- + if (arm_arch != "") {
- + cflags += [ "-march=$arm_arch" ]
- + }
- + cflags += [ "-mfloat-abi=$arm_float_abi" ]
- if (arm_use_thumb) {
- cflags += [ "-mthumb" ]
- if (is_android && !is_clang) {
- @@ -528,7 +532,7 @@ config("compiler_cpu_abi") {
- }
- }
- if (arm_tune != "") {
- - cflags += [ "-mtune=$arm_tune" ]
- + cflags += [ "-mtune=$arm_tune", "-mcpu=$arm_tune" ]
- }
- } else if (current_cpu == "arm64") {
- if (is_clang && !is_android && !is_nacl) {
- @@ -1048,9 +1052,6 @@ config("chromium_code") {
- cflags = [ "/W4" ] # Warning level 4.
- } else {
- cflags = [ "-Wall" ]
- - if (treat_warnings_as_errors) {
- - cflags += [ "-Werror" ]
- - }
- if (is_clang) {
- # Enable -Wextra for chromium_code when we control the compiler.
- cflags += [ "-Wextra" ]
- @@ -1104,11 +1105,6 @@ config("no_chromium_code") {
- "_CRT_NONSTDC_NO_DEPRECATE",
- ]
- } else {
- - # GCC may emit unsuppressible warnings so don't add -Werror for no chromium
- - # code. crbug.com/589724
- - if (treat_warnings_as_errors && is_clang) {
- - cflags += [ "-Werror" ]
- - }
- if (is_clang && !is_nacl) {
- # TODO(thakis): Remove !is_nacl once
- # https://codereview.webrtc.org/1552863002/ made its way into chromium.
- @@ -1290,7 +1286,7 @@ if (is_win) {
- common_optimize_on_ldflags += [
- # Specifically tell the linker to perform optimizations.
- # See http://lwn.net/Articles/192624/ .
- - "-Wl,-O1",
- + # "-Wl,-O1",
- "-Wl,--gc-sections",
- ]
- @@ -1334,7 +1330,7 @@ config("optimize") {
- # Favor size over speed.
- cflags = [ "-Os" ] + common_optimize_on_cflags
- } else {
- - cflags = [ "-O2" ] + common_optimize_on_cflags
- + cflags = [ "-Ofast", "-fno-fast-math" ] + common_optimize_on_cflags
- }
- ldflags = common_optimize_on_ldflags
- }
- @@ -1349,7 +1345,7 @@ config("optimize_no_wpo") {
- # Favor size over speed.
- cflags = [ "-Os" ] + common_optimize_on_cflags
- } else {
- - cflags = [ "-O2" ] + common_optimize_on_cflags
- + cflags = [ "-Ofast", "-fno-fast-math" ] + common_optimize_on_cflags
- }
- ldflags = common_optimize_on_ldflags
- }
- @@ -1420,7 +1416,7 @@ config("optimize_max") {
- ]
- }
- } else {
- - cflags = [ "-O2" ] + common_optimize_on_cflags
- + cflags = [ "-Ofast", "-fno-fast-math" ] + common_optimize_on_cflags
- }
- }
- }
- @@ -1428,7 +1424,7 @@ config("optimize_max") {
- # This config can be used to override the default settings for per-component
- # and whole-program optimization, optimizing the particular target for speed
- # instead of code size. This config is exactly the same as "optimize_max"
- -# except that we use -O3 instead of -O2 on non-win, non-IRT platforms.
- +# except that we use -Ofast -fno-fast-math instead of -Ofast -fno-fast-math on non-win, non-IRT platforms.
- #
- # TODO(crbug.com/621335) - rework how all of these configs are related
- # so that we don't need this disclaimer.
- @@ -1463,7 +1459,7 @@ config("optimize_speed") {
- ]
- }
- } else {
- - cflags = [ "-O3" ] + common_optimize_on_cflags
- + cflags = [ "-Ofast", "-fno-fast-math" ] + common_optimize_on_cflags
- }
- }
- }
- diff --git a/build/nocompile.gni b/build/nocompile.gni
- index 1b292d7..c71caeb 100644
- --- a/build/nocompile.gni
- +++ b/build/nocompile.gni
- @@ -78,7 +78,7 @@ if (enable_nocompile_tests) {
- args = [
- "4", # number of compilers to invoke in parallel.
- "{{source}}",
- - "-Wall -Werror -Wfatal-errors " + "-I" +
- + "-Wall -Wfatal-errors " + "-I" +
- rebase_path("//", root_build_dir),
- "{{output}}",
- ]
- diff --git a/build/nocompile.gypi b/build/nocompile.gypi
- index 4f61add..e9194f9 100644
- --- a/build/nocompile.gypi
- +++ b/build/nocompile.gypi
- @@ -82,7 +82,7 @@
- '<(nocompile_driver)',
- '4', # number of compilers to invoke in parallel.
- '<(RULE_INPUT_PATH)',
- - '-Wall -Werror -Wfatal-errors -I<(DEPTH)',
- + '-Wall -Wfatal-errors -I<(DEPTH)',
- '<(nc_result_path)',
- ],
- 'message': 'Generating no compile results for <(RULE_INPUT_PATH)',
- diff --git a/build/toolchain/linux/BUILD.gn b/build/toolchain/linux/BUILD.gn
- index 548722d..fccc61c 100644
- --- a/build/toolchain/linux/BUILD.gn
- +++ b/build/toolchain/linux/BUILD.gn
- @@ -78,7 +78,16 @@ gcc_toolchain("x86") {
- }
- }
- -clang_toolchain("clang_x64") {
- +# sdclang can't compile for host
- +gcc_toolchain("clang_x64") {
- + cc = "../../third_party/llvm-build/host/bin/clang"
- + cxx = "../../third_party/llvm-build/host/bin/clang++"
- +
- + readelf = "readelf"
- + nm = "nm"
- + ar = "ar"
- + ld = cxx
- +
- toolchain_args = {
- current_cpu = "x64"
- current_os = "linux"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement