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 | 9 |
10 # compiler --------------------------------------------------------------------- | 10 # compiler --------------------------------------------------------------------- |
(...skipping 25 matching lines...) Expand all Loading... |
36 "/GS", # Enable buffer security checking. | 36 "/GS", # Enable buffer security checking. |
37 "/EHsc", # Assume C functions can't throw exceptions and don't catch | 37 "/EHsc", # Assume C functions can't throw exceptions and don't catch |
38 # structured exceptions (only C++ ones). | 38 # structured exceptions (only C++ ones). |
39 "/FS", # Preserve previous PDB behavior. | 39 "/FS", # Preserve previous PDB behavior. |
40 ] | 40 ] |
41 } else { | 41 } else { |
42 # Common GCC compiler flags setup. | 42 # Common GCC compiler flags setup. |
43 # -------------------------------- | 43 # -------------------------------- |
44 cflags += [ | 44 cflags += [ |
45 "-fno-strict-aliasing", # See http://crbug.com/32204 | 45 "-fno-strict-aliasing", # See http://crbug.com/32204 |
46 "-fvisibility=hidden", | |
47 ] | 46 ] |
48 cflags_cc += [ | 47 cflags_cc += [ |
49 "-fno-exceptions", | 48 "-fno-exceptions", |
50 "-fno-threadsafe-statics", | 49 "-fno-threadsafe-statics", |
| 50 # Not exporting C++ inline functions can generally be applied anywhere |
| 51 # so we do so here. Normal function visibility is controlled by |
| 52 # //build/config/gcc:symbol_visibility_hidden. |
51 "-fvisibility-inlines-hidden", | 53 "-fvisibility-inlines-hidden", |
52 ] | 54 ] |
53 | 55 |
54 # Stack protection. | 56 # Stack protection. |
55 if (is_mac) { | 57 if (is_mac) { |
56 cflags += [ "-fstack-protector-all" ] | 58 cflags += [ "-fstack-protector-all" ] |
57 } else if (is_linux) { | 59 } else if (is_linux) { |
58 cflags += [ "-fstack-protector", "--param=ssp-buffer-size=4" ] | 60 cflags += [ "-fstack-protector", "--param=ssp-buffer-size=4" ] |
59 } | 61 } |
60 } | 62 } |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 } | 295 } |
294 | 296 |
295 if (is_win) { | 297 if (is_win) { |
296 defines += [ | 298 defines += [ |
297 "__STD_C", | 299 "__STD_C", |
298 "__STDC_CONSTANT_MACROS", | 300 "__STDC_CONSTANT_MACROS", |
299 "__STDC_FORMAT_MACROS", | 301 "__STDC_FORMAT_MACROS", |
300 "_CRT_RAND_S", | 302 "_CRT_RAND_S", |
301 "_CRT_SECURE_NO_DEPRECATE", | 303 "_CRT_SECURE_NO_DEPRECATE", |
302 "_SCL_SECURE_NO_DEPRECATE", | 304 "_SCL_SECURE_NO_DEPRECATE", |
303 "_UNICODE", | |
304 "UNICODE", | |
305 ] | 305 ] |
306 } | 306 } |
307 | 307 |
308 # Stlport setup. Android uses a different (smaller) version of the STL. | 308 # Stlport setup. Android uses a different (smaller) version of the STL. |
309 if (is_android) { | 309 if (is_android) { |
310 if (is_clang) { | 310 if (is_clang) { |
311 # Work around incompatibilities between bionic and clang headers. | 311 # Work around incompatibilities between bionic and clang headers. |
312 defines += [ | 312 defines += [ |
313 "__compiler_offsetof=__builtin_offsetof", | 313 "__compiler_offsetof=__builtin_offsetof", |
314 "nan=__builtin_nan", | 314 "nan=__builtin_nan", |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 cflags = [ "-g1" ] | 673 cflags = [ "-g1" ] |
674 } | 674 } |
675 } | 675 } |
676 | 676 |
677 config("no_symbols") { | 677 config("no_symbols") { |
678 if (!is_win) { | 678 if (!is_win) { |
679 cflags = [ "-g0" ] | 679 cflags = [ "-g0" ] |
680 } | 680 } |
681 } | 681 } |
682 | 682 |
OLD | NEW |