[PATCH] D62048: [GWP-ASan] Fixed issue with c++ standard library dependency.

Mitch Phillips via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 20:19:33 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rCRT360982: [GWP-ASan] Fixed issue with c++ standard library dependency. (authored by hctim, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D62048?vs=199968&id=199969#toc

Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62048/new/

https://reviews.llvm.org/D62048

Files:
  lib/gwp_asan/CMakeLists.txt
  lib/gwp_asan/random.cpp
  lib/gwp_asan/random.h


Index: lib/gwp_asan/CMakeLists.txt
===================================================================
--- lib/gwp_asan/CMakeLists.txt
+++ lib/gwp_asan/CMakeLists.txt
@@ -10,10 +10,10 @@
   random.h
 )
 
-# Disable RTTI and exception support, as we want these libraries to be
-# C-compatible. Regular C source files can be linked against the generated
-# GwpAsan libraries using the Clang C compiler.
-set(GWP_ASAN_CFLAGS -fno-rtti -fno-exceptions)
+# 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 -nostdinc++)
 
 if (COMPILER_RT_HAS_GWP_ASAN)
   foreach(arch ${GWP_ASAN_SUPPORTED_ARCH})
Index: lib/gwp_asan/random.h
===================================================================
--- lib/gwp_asan/random.h
+++ lib/gwp_asan/random.h
@@ -9,7 +9,7 @@
 #ifndef GWP_ASAN_RANDOM_H_
 #define GWP_ASAN_RANDOM_H_
 
-#include <cstdint>
+#include <stdint.h>
 
 namespace gwp_asan {
 // xorshift (32-bit output), extremely fast PRNG that uses arithmetic operations
Index: lib/gwp_asan/random.cpp
===================================================================
--- lib/gwp_asan/random.cpp
+++ lib/gwp_asan/random.cpp
@@ -8,7 +8,7 @@
 
 #include "gwp_asan/random.h"
 
-#include <ctime>
+#include <time.h>
 
 namespace gwp_asan {
 uint32_t getRandomUnsigned32() {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62048.199969.patch
Type: text/x-patch
Size: 1451 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190517/d54567dc/attachment.bin>


More information about the llvm-commits mailing list