| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 import("//build/config/android/config.gni") | 5 import("//build/config/android/config.gni") |
| 6 if (current_cpu == "arm") { | 6 if (current_cpu == "arm") { |
| 7 import("//build/config/arm.gni") | 7 import("//build/config/arm.gni") |
| 8 } | 8 } |
| 9 if (current_cpu == "mipsel" || current_cpu == "mips64el") { | 9 if (current_cpu == "mipsel" || current_cpu == "mips64el") { |
| 10 import("//build/config/mips.gni") | 10 import("//build/config/mips.gni") |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 # //build/config/gcc:symbol_visibility_hidden. | 71 # //build/config/gcc:symbol_visibility_hidden. |
| 72 "-fvisibility-inlines-hidden", | 72 "-fvisibility-inlines-hidden", |
| 73 | 73 |
| 74 # We need the frame pointer for CPU and heap profiling. | 74 # We need the frame pointer for CPU and heap profiling. |
| 75 "-fno-omit-frame-pointer", | 75 "-fno-omit-frame-pointer", |
| 76 ] | 76 ] |
| 77 cflags_cc += common_flags | 77 cflags_cc += common_flags |
| 78 cflags_objcc += common_flags | 78 cflags_objcc += common_flags |
| 79 | 79 |
| 80 # Linker warnings. | 80 # Linker warnings. |
| 81 if ((current_cpu != "arm") && !is_mac) { | 81 if (current_cpu != "arm" && !is_mac) { |
| 82 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580 | 82 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580 |
| 83 ldflags += [ "-Wl,--fatal-warnings" ] | 83 ldflags += [ "-Wl,--fatal-warnings" ] |
| 84 } | 84 } |
| 85 | 85 |
| 86 # Common options for AddressSanitizer, LeakSanitizer, ThreadSanitizer and | 86 # Common options for AddressSanitizer, LeakSanitizer, ThreadSanitizer and |
| 87 # MemorySanitizer | 87 # MemorySanitizer |
| 88 if (using_sanitizer) { | 88 if (using_sanitizer) { |
| 89 cflags += [ | 89 cflags += [ "-gline-tables-only" ] |
| 90 "-gline-tables-only", | |
| 91 ] | |
| 92 } | 90 } |
| 93 if (is_asan) { | 91 if (is_asan) { |
| 94 cflags += [ "-fsanitize=address" ] | 92 cflags += [ "-fsanitize=address" ] |
| 95 ldflags += [ "-fsanitize=address" ] | 93 ldflags += [ "-fsanitize=address" ] |
| 96 } | 94 } |
| 97 if (is_lsan) { | 95 if (is_lsan) { |
| 98 cflags += [ "-fsanitize=leak" ] | 96 cflags += [ "-fsanitize=leak" ] |
| 99 ldflags += [ "-fsanitize=leak" ] | 97 ldflags += [ "-fsanitize=leak" ] |
| 100 } | 98 } |
| 101 if (is_tsan) { | 99 if (is_tsan) { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 # Else building libyuv gives clang's register allocator issues, | 190 # Else building libyuv gives clang's register allocator issues, |
| 193 # see llvm.org/PR15798 / crbug.com/233709 | 191 # see llvm.org/PR15798 / crbug.com/233709 |
| 194 "-mno-omit-leaf-frame-pointer", | 192 "-mno-omit-leaf-frame-pointer", |
| 195 | 193 |
| 196 # Align the stack on 16-byte boundaries, http://crbug.com/418554. | 194 # Align the stack on 16-byte boundaries, http://crbug.com/418554. |
| 197 "-mstack-alignment=16", | 195 "-mstack-alignment=16", |
| 198 "-mstackrealign", | 196 "-mstackrealign", |
| 199 ] | 197 ] |
| 200 } | 198 } |
| 201 } else if (current_cpu == "arm") { | 199 } else if (current_cpu == "arm") { |
| 202 | |
| 203 cflags += [ | 200 cflags += [ |
| 204 "-march=$arm_arch", | 201 "-march=$arm_arch", |
| 205 "-mfloat-abi=$arm_float_abi", | 202 "-mfloat-abi=$arm_float_abi", |
| 206 ] | 203 ] |
| 207 if (arm_tune != "") { | 204 if (arm_tune != "") { |
| 208 cflags += [ "-mtune=$arm_tune" ] | 205 cflags += [ "-mtune=$arm_tune" ] |
| 209 } | 206 } |
| 210 if (arm_use_thumb) { | 207 if (arm_use_thumb) { |
| 211 cflags += [ "-mthumb" ] | 208 cflags += [ "-mthumb" ] |
| 212 if (is_android && !is_clang) { # Clang doesn't support this option. | 209 if (is_android && !is_clang) { # Clang doesn't support this option. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 227 # size and performance in gcc 4.9. | 224 # size and performance in gcc 4.9. |
| 228 "-fno-caller-saves", | 225 "-fno-caller-saves", |
| 229 ] | 226 ] |
| 230 } | 227 } |
| 231 } else if (current_cpu == "mipsel") { | 228 } else if (current_cpu == "mipsel") { |
| 232 # We have to explicitly request exceptions to get good heap profiles from | 229 # We have to explicitly request exceptions to get good heap profiles from |
| 233 # tcmalloc. | 230 # tcmalloc. |
| 234 if (is_debug || is_release) { | 231 if (is_debug || is_release) { |
| 235 cflags += [ | 232 cflags += [ |
| 236 "-fexceptions", | 233 "-fexceptions", |
| 237 "-funwind-tables" | 234 "-funwind-tables", |
| 238 ] | 235 ] |
| 239 } | 236 } |
| 240 | 237 |
| 241 if (mips_arch_variant == "r6") { | 238 if (mips_arch_variant == "r6") { |
| 242 cflags += [ | 239 cflags += [ |
| 243 "-mips32r6", | 240 "-mips32r6", |
| 244 "-Wa,-mips32r6", | 241 "-Wa,-mips32r6", |
| 245 ] | 242 ] |
| 246 if (is_android) { | 243 if (is_android) { |
| 247 ldflags += [ | 244 ldflags += [ |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 } | 285 } |
| 289 | 286 |
| 290 if (current_cpu != "mipsel") { | 287 if (current_cpu != "mipsel") { |
| 291 cflags += [ "-fno-exceptions" ] | 288 cflags += [ "-fno-exceptions" ] |
| 292 } | 289 } |
| 293 } | 290 } |
| 294 | 291 |
| 295 # Linux/Android common flags setup. | 292 # Linux/Android common flags setup. |
| 296 # --------------------------------- | 293 # --------------------------------- |
| 297 if (is_linux || is_android) { | 294 if (is_linux || is_android) { |
| 298 cflags += [ | 295 cflags += [ "-fPIC" ] |
| 299 "-fPIC", | |
| 300 ] | |
| 301 | 296 |
| 302 ldflags += [ | 297 ldflags += [ |
| 303 "-fPIC", | 298 "-fPIC", |
| 304 "-Wl,-z,noexecstack", | 299 "-Wl,-z,noexecstack", |
| 305 "-Wl,-z,now", | 300 "-Wl,-z,now", |
| 306 "-Wl,-z,relro", | 301 "-Wl,-z,relro", |
| 307 ] | 302 ] |
| 308 } | 303 } |
| 309 | 304 |
| 310 # Linux-specific compiler flags setup. | 305 # Linux-specific compiler flags setup. |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 default_warning_flags = [] | 499 default_warning_flags = [] |
| 505 default_warning_flags_cc = [] | 500 default_warning_flags_cc = [] |
| 506 if (is_win) { | 501 if (is_win) { |
| 507 if (current_cpu != "x86") { | 502 if (current_cpu != "x86") { |
| 508 default_warning_flags += [ "/WX" ] # Treat warnings as errors. | 503 default_warning_flags += [ "/WX" ] # Treat warnings as errors. |
| 509 } | 504 } |
| 510 | 505 |
| 511 default_warning_flags += [ | 506 default_warning_flags += [ |
| 512 # Permanent. | 507 # Permanent. |
| 513 "/wd4091", # typedef warning from dbghelp.h | 508 "/wd4091", # typedef warning from dbghelp.h |
| 509 |
| 514 # Investigate. | 510 # Investigate. |
| 515 "/wd4312", # int to pointer of greater size conversion. | 511 "/wd4312", # int to pointer of greater size conversion. |
| 516 "/wd4838", # Narrowing conversion required. | 512 "/wd4838", # Narrowing conversion required. |
| 517 "/wd4172", # Returning address of local. | 513 "/wd4172", # Returning address of local. |
| 518 "/wd4005", # Redefinition of macros for PRId64 etc. | 514 "/wd4005", # Redefinition of macros for PRId64 etc. |
| 519 "/wd4311", # Pointer truncation from PVOID to DWORD. | 515 "/wd4311", # Pointer truncation from PVOID to DWORD. |
| 520 "/wd4477", # Format string requires wchar_t* | 516 "/wd4477", # Format string requires wchar_t* |
| 521 ] | 517 ] |
| 522 } else { | 518 } else { |
| 523 # Common GCC warning setup. | 519 # Common GCC warning setup. |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 cflags = [ "/Zi" ] # Produce PDB file, no edit and continue. | 763 cflags = [ "/Zi" ] # Produce PDB file, no edit and continue. |
| 768 } | 764 } |
| 769 ldflags = [ "/DEBUG" ] | 765 ldflags = [ "/DEBUG" ] |
| 770 } else { | 766 } else { |
| 771 cflags = [ | 767 cflags = [ |
| 772 "-g3", | 768 "-g3", |
| 773 "-ggdb3", | 769 "-ggdb3", |
| 774 ] | 770 ] |
| 775 } | 771 } |
| 776 } | 772 } |
| OLD | NEW |