summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/gwp_asan/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/gwp_asan/CMakeLists.txt')
-rw-r--r--compiler-rt/lib/gwp_asan/CMakeLists.txt3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler-rt/lib/gwp_asan/CMakeLists.txt b/compiler-rt/lib/gwp_asan/CMakeLists.txt
index 53f5152551c..33db1109bf6 100644
--- a/compiler-rt/lib/gwp_asan/CMakeLists.txt
+++ b/compiler-rt/lib/gwp_asan/CMakeLists.txt
@@ -21,7 +21,8 @@ set(GWP_ASAN_HEADERS
# Ensure that GWP-ASan meets the delegated requirements of some supporting
# allocators. Some supporting allocators (e.g. scudo standalone) cannot use any
# parts of the C++ standard library.
-set(GWP_ASAN_CFLAGS -fno-rtti -fno-exceptions -fPIC -nostdinc++ -pthread)
+set(GWP_ASAN_CFLAGS -fno-rtti -fno-exceptions -nostdinc++ -pthread)
+append_list_if(COMPILER_RT_HAS_FPIC_FLAG -fPIC GWP_ASAN_CFLAGS)
# Remove -stdlib= which is unused when passing -nostdinc++.
string(REGEX REPLACE "-stdlib=[a-zA-Z+]*" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
OpenPOWER on IntegriCloud