Index: build/config/sanitizers/BUILD.gn |
diff --git a/build/config/sanitizers/BUILD.gn b/build/config/sanitizers/BUILD.gn |
index eb7ba4ab93b47bee7fe3b0157a4880b7b4d329de..6479b4b35de73fe4fddbcbc70322d5c741456b07 100644 |
--- a/build/config/sanitizers/BUILD.gn |
+++ b/build/config/sanitizers/BUILD.gn |
@@ -35,7 +35,10 @@ config("sanitizer_options_link_helper") { |
ldflags += [ "-fsanitize=thread" ] |
} |
if (is_msan) { |
- ldflags += [ "-fsanitize=memory" ] |
+ ldflags += [ |
+ "-fsanitize=memory", |
+ "-pie", |
+ ] |
} |
if (is_ubsan) { |
ldflags += [ "-fsanitize=undefined" ] |
@@ -125,6 +128,7 @@ config("default_sanitizer_flags") { |
"-fsanitize=memory", |
"-fsanitize-memory-track-origins=$msan_track_origins", |
"-fsanitize-blacklist=$msan_blacklist_path", |
+ "-fPIC", |
] |
} |
if (is_ubsan) { |