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 (cpu_arch == "arm") { | 6 if (cpu_arch == "arm") { |
7 import("//build/config/arm.gni") | 7 import("//build/config/arm.gni") |
8 } | 8 } |
| 9 if (cpu_arch == "mipsel" || cpu_arch == "mips64el") { |
| 10 import("//build/config/mips.gni") |
| 11 } |
9 if (is_posix) { | 12 if (is_posix) { |
10 import("//build/config/gcc/gcc_version.gni") | 13 import("//build/config/gcc/gcc_version.gni") |
11 } | 14 } |
12 | 15 |
13 import("//build/toolchain/ccache.gni") | 16 import("//build/toolchain/ccache.gni") |
14 | 17 |
15 declare_args() { | 18 declare_args() { |
16 # Normally, Android builds are lightly optimized, even for debug builds, to | 19 # Normally, Android builds are lightly optimized, even for debug builds, to |
17 # keep binary size down. Setting this flag to true disables such optimization | 20 # keep binary size down. Setting this flag to true disables such optimization |
18 android_full_debug = false | 21 android_full_debug = false |
(...skipping 246 matching lines...) Loading... |
265 # compiler (r5-r7). This can be verified using | 268 # compiler (r5-r7). This can be verified using |
266 # webkit_unit_tests' WTF.Checked_int8_t test. | 269 # webkit_unit_tests' WTF.Checked_int8_t test. |
267 "-fno-tree-sra", | 270 "-fno-tree-sra", |
268 | 271 |
269 # The following option is disabled to improve binary | 272 # The following option is disabled to improve binary |
270 # size and performance in gcc 4.9. | 273 # size and performance in gcc 4.9. |
271 "-fno-caller-saves", | 274 "-fno-caller-saves", |
272 ] | 275 ] |
273 } | 276 } |
274 } | 277 } |
| 278 } else if (cpu_arch == "mipsel") { |
| 279 # Don't set the compiler flags for the WebView build. These will come |
| 280 # from the Android build system. |
| 281 if (!is_android_webview_build) { |
| 282 if (mips_arch_variant == "r6") { |
| 283 cflags += [ |
| 284 "-mips32r6", |
| 285 "-Wa,-mips32r6", |
| 286 ] |
| 287 if (is_android) { |
| 288 ldflags += [ |
| 289 "-mips32r6", |
| 290 "-Wl,-melf32ltsmip", |
| 291 ] |
| 292 } |
| 293 } else if (mips_arch_variant == "r2") { |
| 294 cflags += [ |
| 295 "-mips32r2", |
| 296 "-Wa,-mips32r2", |
| 297 ] |
| 298 } else if (mips_arch_variant == "r1") { |
| 299 cflags += [ |
| 300 "-mips32", |
| 301 "-Wa,-mips32", |
| 302 ] |
| 303 } |
| 304 } |
| 305 } else if (cpu_arch == "mips64el") { |
| 306 # Don't set the compiler flags for the WebView build. These will come |
| 307 # from the Android build system. |
| 308 if (!is_android_webview_build) { |
| 309 if (mips_arch_variant == "r6") { |
| 310 cflags += [ |
| 311 "-mips64r6", |
| 312 "-Wa,-mips64r6", |
| 313 ] |
| 314 ldflags += [ "-mips64r6" ] |
| 315 } else if (mips_arch_variant == "r2") { |
| 316 cflags += [ |
| 317 "-mips64r2", |
| 318 "-Wa,-mips64r2", |
| 319 ] |
| 320 ldflags += [ "-mips64r2" ] |
| 321 } |
| 322 } |
275 } | 323 } |
276 | 324 |
277 defines += [ "_FILE_OFFSET_BITS=64" ] | 325 defines += [ "_FILE_OFFSET_BITS=64" ] |
278 | 326 |
279 # Omit unwind support in official builds to save space. We can use breakpad | 327 # Omit unwind support in official builds to save space. We can use breakpad |
280 # for these builds. | 328 # for these builds. |
281 if (is_chrome_branded && is_official_build) { | 329 if (is_chrome_branded && is_official_build) { |
282 cflags += [ | 330 cflags += [ |
283 "-fno-unwind-tables", | 331 "-fno-unwind-tables", |
284 "-fno-asynchronous-unwind-tables", | 332 "-fno-asynchronous-unwind-tables", |
285 ] | 333 ] |
286 } else { | 334 } else { |
287 cflags += [ "-funwind-tables" ] | 335 cflags += [ "-funwind-tables" ] |
288 } | 336 } |
289 } | 337 } |
290 | 338 |
291 # Linux/Android common flags setup. | 339 # Linux/Android common flags setup. |
292 # --------------------------------- | 340 # --------------------------------- |
293 if (is_linux || is_android) { | 341 if (is_linux || is_android) { |
294 cflags += [ | 342 cflags += [ |
295 "-fPIC", | 343 "-fPIC", |
296 "-pipe", # Use pipes for communicating between sub-processes. Faster. | 344 "-pipe", # Use pipes for communicating between sub-processes. Faster. |
297 ] | 345 ] |
298 | 346 |
299 ldflags += [ | 347 ldflags += [ |
300 "-fPIC", | 348 "-fPIC", |
301 "-Wl,-z,noexecstack", | 349 "-Wl,-z,noexecstack", |
302 "-Wl,-z,now", | 350 "-Wl,-z,now", |
303 "-Wl,-z,relro", | 351 "-Wl,-z,relro", |
304 "-Wl,-z,defs", | |
305 ] | 352 ] |
| 353 |
| 354 # TODO(zork): The mipsel build is broken in ffmpeg, guard this flag for now |
| 355 # to hide the breakage. https://crbug.com/450771 |
| 356 if (!using_sanitizer && cpu_arch != "mipsel") { |
| 357 ldflags += [ "-Wl,-z,defs" ] |
| 358 } |
306 } | 359 } |
307 | 360 |
308 # Linux-specific compiler flags setup. | 361 # Linux-specific compiler flags setup. |
309 # ------------------------------------ | 362 # ------------------------------------ |
310 if (is_linux) { | 363 if (is_linux) { |
311 cflags += [ "-pthread" ] | 364 cflags += [ "-pthread" ] |
312 ldflags += [ "-pthread" ] | 365 ldflags += [ "-pthread" ] |
313 } | 366 } |
314 if (use_gold) { | 367 if (use_gold) { |
315 gold_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", | 368 gold_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", |
(...skipping 671 matching lines...) Loading... |
987 cflags += [ "-gsplit-dwarf" ] | 1040 cflags += [ "-gsplit-dwarf" ] |
988 } | 1041 } |
989 } | 1042 } |
990 } | 1043 } |
991 | 1044 |
992 config("no_symbols") { | 1045 config("no_symbols") { |
993 if (!is_win) { | 1046 if (!is_win) { |
994 cflags = [ "-g0" ] | 1047 cflags = [ "-g0" ] |
995 } | 1048 } |
996 } | 1049 } |
OLD | NEW |