Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: build/config/compiler/BUILD.gn

Issue 2640923005: GN: Add back -fPIC for a few things (Closed)
Patch Set: GN: Add back -fPIC for a few things Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 # Linux/Android common flags setup. 292 # Linux/Android common flags setup.
293 # --------------------------------- 293 # ---------------------------------
294 if (is_linux || is_android) { 294 if (is_linux || is_android) {
295 ldflags += [ 295 ldflags += [
296 "-Wl,-z,noexecstack", 296 "-Wl,-z,noexecstack",
297 "-Wl,-z,now", 297 "-Wl,-z,now",
298 "-Wl,-z,relro", 298 "-Wl,-z,relro",
299 ] 299 ]
300 } 300 }
301 301
302 # We need -fPIC:
303 # 1. On ARM and MIPS for tcmalloc.
304 # 2. On Android.
305 # 3. When using the sanitizers.
306 # Otherwise there is a performance hit, in particular on ia32.
307 if (is_android || is_asan || is_lsan || is_msan || is_tsan ||
308 (is_linux && (current_cpu == "arm" || current_cpu == "mipsel"))) {
309 cflags += [ "-fPIC" ]
310 ldflags += [ "-fPIC" ]
311 }
312
302 # Linux-specific compiler flags setup. 313 # Linux-specific compiler flags setup.
303 # ------------------------------------ 314 # ------------------------------------
304 if (is_linux) { 315 if (is_linux) {
305 cflags += [ "-pthread" ] 316 cflags += [ "-pthread" ]
306 ldflags += [ "-pthread" ] 317 ldflags += [ "-pthread" ]
307 } 318 }
308 319
309 # Clang-specific compiler flags setup. 320 # Clang-specific compiler flags setup.
310 # ------------------------------------ 321 # ------------------------------------
311 if (is_clang) { 322 if (is_clang) {
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 cflags = [ "/Zi" ] # Produce PDB file, no edit and continue. 771 cflags = [ "/Zi" ] # Produce PDB file, no edit and continue.
761 } 772 }
762 ldflags = [ "/DEBUG" ] 773 ldflags = [ "/DEBUG" ]
763 } else { 774 } else {
764 cflags = [ 775 cflags = [
765 "-g3", 776 "-g3",
766 "-ggdb3", 777 "-ggdb3",
767 ] 778 ]
768 } 779 }
769 } 780 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698