| 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 import("//build/config/sysroot.gni") | |
| 7 if (cpu_arch == "arm") { | 6 if (cpu_arch == "arm") { |
| 8 import("//build/config/arm.gni") | 7 import("//build/config/arm.gni") |
| 9 } | 8 } |
| 10 | 9 |
| 11 # compiler --------------------------------------------------------------------- | 10 # compiler --------------------------------------------------------------------- |
| 12 # | 11 # |
| 13 # Base compiler configuration. | 12 # Base compiler configuration. |
| 14 # | 13 # |
| 15 # See also "runtime_library" below for related stuff and a discusison about | 14 # See also "runtime_library" below for related stuff and a discusison about |
| 16 # where stuff should go. Put warning related stuff in the "warnings" config. | 15 # where stuff should go. Put warning related stuff in the "warnings" config. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 cflags += [ "-fstack-protector-all" ] | 55 cflags += [ "-fstack-protector-all" ] |
| 57 } else if (is_linux) { | 56 } else if (is_linux) { |
| 58 cflags += [ "-fstack-protector", "--param=ssp-buffer-size=4" ] | 57 cflags += [ "-fstack-protector", "--param=ssp-buffer-size=4" ] |
| 59 } | 58 } |
| 60 } | 59 } |
| 61 | 60 |
| 62 # Mac-specific compiler flags setup. | 61 # Mac-specific compiler flags setup. |
| 63 # ---------------------------------- | 62 # ---------------------------------- |
| 64 if (is_mac || is_ios) { | 63 if (is_mac || is_ios) { |
| 65 # These flags are shared between the C compiler and linker. | 64 # These flags are shared between the C compiler and linker. |
| 66 common_mac_flags = [ "-isysroot", sysroot ] | 65 common_mac_flags = [] |
| 67 if (is_mac) { | |
| 68 common_mac_flags += [ "-mmacosx-version-min=10.6" ] | |
| 69 } else { | |
| 70 cflags += [ "-mios-simulator-version-min=6.0" ] | |
| 71 } | |
| 72 | 66 |
| 73 # CPU architecture. | 67 # CPU architecture. |
| 74 if (cpu_arch == "x64") { | 68 if (cpu_arch == "x64") { |
| 75 common_mac_flags += [ "-arch x86_64" ] | 69 common_mac_flags += [ "-arch x86_64" ] |
| 76 } else if (cpu_arch == "x86") { | 70 } else if (cpu_arch == "x86") { |
| 77 common_mac_flags += [ "-arch i386" ] | 71 common_mac_flags += [ "-arch i386" ] |
| 78 } | 72 } |
| 79 | 73 |
| 80 cflags += common_mac_flags + [ | 74 cflags += common_mac_flags + [ |
| 81 # Without this, the constructors and destructors of a C++ object inside | 75 # Without this, the constructors and destructors of a C++ object inside |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 # Experimentation found that using four linking threads | 162 # Experimentation found that using four linking threads |
| 169 # saved ~20% of link time. | 163 # saved ~20% of link time. |
| 170 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thr
ead/thread/281527606915bb36 | 164 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thr
ead/thread/281527606915bb36 |
| 171 # Only apply this to the target linker, since the host | 165 # Only apply this to the target linker, since the host |
| 172 # linker might not be gold, but isn't used much anyway. | 166 # linker might not be gold, but isn't used much anyway. |
| 173 "-Wl,--threads", | 167 "-Wl,--threads", |
| 174 "-Wl,--thread-count=4", | 168 "-Wl,--thread-count=4", |
| 175 ] | 169 ] |
| 176 } | 170 } |
| 177 | 171 |
| 178 if (sysroot != "") { | |
| 179 cflags += [ "--sysroot=" + sysroot ] | |
| 180 ldflags += [ "--sysroot=" + sysroot ] | |
| 181 | |
| 182 # Need to get some linker flags out of the sysroot. | |
| 183 ldflags += [ exec_script("../linux/sysroot_ld_path.py", | |
| 184 [rebase_path("../../linux/sysroot_ld_path.sh", ".", root_build_dir), | |
| 185 sysroot], | |
| 186 "value") ] | |
| 187 } | |
| 188 | |
| 189 ldflags += [ | 172 ldflags += [ |
| 190 "-fPIC", | 173 "-fPIC", |
| 191 "-pthread", | 174 "-pthread", |
| 192 "-Wl,-z,noexecstack", | 175 "-Wl,-z,noexecstack", |
| 193 "-Wl,-z,now", | 176 "-Wl,-z,now", |
| 194 "-Wl,-z,relro", | 177 "-Wl,-z,relro", |
| 195 ] | 178 ] |
| 196 } | 179 } |
| 197 | 180 |
| 198 # Clang-specific compiler flags setup. | 181 # Clang-specific compiler flags setup. |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 cflags = [ "-g1" ] | 664 cflags = [ "-g1" ] |
| 682 } | 665 } |
| 683 } | 666 } |
| 684 | 667 |
| 685 config("no_symbols") { | 668 config("no_symbols") { |
| 686 if (!is_win) { | 669 if (!is_win) { |
| 687 cflags = [ "-g0" ] | 670 cflags = [ "-g0" ] |
| 688 } | 671 } |
| 689 } | 672 } |
| 690 | 673 |
| OLD | NEW |