[PATCH] D44499: [Scudo] Avoid accidental references of C++ library

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 14 15:52:44 PDT 2018


phosek created this revision.
phosek added a reviewer: cryptoad.
Herald added subscribers: Sanitizers, llvm-commits, mgorny.

Scudo uses C++ but doesn't use C++ library. Set -nostdinc++ and
-nostdlib++ flags to enforce this and avoid accidental references.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D44499

Files:
  compiler-rt/lib/scudo/CMakeLists.txt


Index: compiler-rt/lib/scudo/CMakeLists.txt
===================================================================
--- compiler-rt/lib/scudo/CMakeLists.txt
+++ compiler-rt/lib/scudo/CMakeLists.txt
@@ -10,8 +10,8 @@
 set(SCUDO_DYNAMIC_LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS})
 
 # Use gc-sections by default to avoid unused code being pulled in.
-list(APPEND SCUDO_CFLAGS -ffunction-sections -fdata-sections)
-list(APPEND SCUDO_DYNAMIC_LINK_FLAGS -Wl,--gc-sections)
+list(APPEND SCUDO_CFLAGS -nostdinc++ -ffunction-sections -fdata-sections)
+list(APPEND SCUDO_DYNAMIC_LINK_FLAGS -nostdlib++ -Wl,--gc-sections)
 
 set(SCUDO_SOURCES
   scudo_allocator.cpp


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44499.138469.patch
Type: text/x-patch
Size: 652 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180314/2d129d09/attachment.bin>


More information about the llvm-commits mailing list