[compiler-rt] r353418 - [scudo][standalone] Do not error out on spurious C(XX) flags

Kostya Kortchinsky via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 7 07:44:36 PST 2019


Author: cryptoad
Date: Thu Feb  7 07:44:36 2019
New Revision: 353418

URL: http://llvm.org/viewvc/llvm-project?rev=353418&view=rev
Log:
[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

Modified:
    compiler-rt/trunk/lib/scudo/standalone/CMakeLists.txt

Modified: compiler-rt/trunk/lib/scudo/standalone/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/scudo/standalone/CMakeLists.txt?rev=353418&r1=353417&r2=353418&view=diff
==============================================================================
--- compiler-rt/trunk/lib/scudo/standalone/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/scudo/standalone/CMakeLists.txt Thu Feb  7 07:44:36 2019
@@ -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)




More information about the llvm-commits mailing list