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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/compiler/BUILD.gn
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 07ac124fa239c41aabd04cf726faac77ed7414db..346059763e2ab5072efac0a9156fc4e823dd6dc2 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -299,6 +299,17 @@ config("compiler") {
]
}
+ # We need -fPIC:
+ # 1. On ARM and MIPS for tcmalloc.
+ # 2. On Android.
+ # 3. When using the sanitizers.
+ # Otherwise there is a performance hit, in particular on ia32.
+ if (is_android || is_asan || is_lsan || is_msan || is_tsan ||
+ (is_linux && (current_cpu == "arm" || current_cpu == "mipsel"))) {
+ cflags += [ "-fPIC" ]
+ ldflags += [ "-fPIC" ]
+ }
+
# Linux-specific compiler flags setup.
# ------------------------------------
if (is_linux) {
« 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