aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKostya Kortchinsky <kostyak@google.com>2019-02-07 15:44:36 +0000
committerKostya Kortchinsky <kostyak@google.com>2019-02-07 15:44:36 +0000
commitf5bbf7a905c949c8af171c3d8a7462a47671ceed (patch)
tree6e5bad216f80b317d64f6b301cbff9dcd71d11f2
parent8b6ad630bdc770f858bd9636d5a309b73e7012fd (diff)
downloadcompiler-rt-f5bbf7a905c949c8af171c3d8a7462a47671ceed.tar.gz
[scudo][standalone] Do not error out on spurious C(XX) flags
Summary: The standalone Scudo version is being built with `-Werror` which can be tripped by extraneous command line arguments. We have little control over those as they can be passed down to us by `CMAKE_C(XX)_FLAGS`, the reported scenario involving `-stdlib=libc++` (see https://reviews.llvm.org/D57412#1384504). To work around this, disable `-Wunused-command-line-argument`. Reviewers: eugenis, vitalybuka, Eugene.Zelenko Reviewed By: eugenis Subscribers: mgorny, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D57757 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353418 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/scudo/standalone/CMakeLists.txt4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/scudo/standalone/CMakeLists.txt b/lib/scudo/standalone/CMakeLists.txt
index 82d0840da..3b45d3fc6 100644
--- a/lib/scudo/standalone/CMakeLists.txt
+++ b/lib/scudo/standalone/CMakeLists.txt
@@ -6,9 +6,11 @@ set(SCUDO_CFLAGS)
list(APPEND SCUDO_CFLAGS
-Wall
- -Werror
-nostdinc++)
+# Remove -stdlib= which is unused when passing -nostdinc++.
+string(REGEX REPLACE "-stdlib=[a-zA-Z+]*" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+
append_list_if(COMPILER_RT_HAS_FFREESTANDING_FLAG -ffreestanding SCUDO_CFLAGS)
append_list_if(COMPILER_RT_HAS_FVISIBILITY_HIDDEN_FLAG -fvisibility=hidden SCUDO_CFLAGS)