[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:16:58 PDT 2019
hctim updated this revision to Diff 199968.
hctim added a comment.
- Merge branch 'master' into gwp_asan/fix-c++stdlib
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62048/new/
https://reviews.llvm.org/D62048
Files:
compiler-rt/lib/gwp_asan/CMakeLists.txt
compiler-rt/lib/gwp_asan/random.cpp
compiler-rt/lib/gwp_asan/random.h
Index: compiler-rt/lib/gwp_asan/random.h
===================================================================
--- compiler-rt/lib/gwp_asan/random.h
+++ compiler-rt/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: compiler-rt/lib/gwp_asan/random.cpp
===================================================================
--- compiler-rt/lib/gwp_asan/random.cpp
+++ compiler-rt/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() {
Index: compiler-rt/lib/gwp_asan/CMakeLists.txt
===================================================================
--- compiler-rt/lib/gwp_asan/CMakeLists.txt
+++ compiler-rt/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})
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62048.199968.patch
Type: text/x-patch
Size: 1559 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190517/ced5425e/attachment.bin>
More information about the llvm-commits
mailing list