[PATCH] D54837: [Sanitizer] getentropy interception

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 29 15:52:29 PST 2018


eugenis added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_platform_interceptors.h:522
 #define SANITIZER_INTERCEPT_GETMNTINFO SI_NETBSD
 #define SANITIZER_INTERCEPT_MI_VECTOR_HASH SI_NETBSD
+#define SANITIZER_INTERCEPT_GETENTROPY SANITIZER_USE_GETENTROPY
----------------
vitalybuka wrote:
> I guess you can have interceptor regardless of "check_library_exists(c getentropy"
> So I'd define SANITIZER_INTERCEPT_GETENTROPY as usual, just a platform.
Well, toolchain built with older libc version should produce binaries that run with newer libc. On the other hand, the presence of an interceptor will confuse configuration scripts into thinking that getentropy is supported on the platform. 

There is no good solution here. I guess the best we can do is define the interceptor iff it is present in libc version the runtime library is built with.



================
Comment at: test/sanitizer_common/TestCases/Posix/getentropy.cc:12
+int
+main (int argc, char** argv)
+{
----------------
run
clang-format please


Repository:
  rCRT Compiler Runtime

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

https://reviews.llvm.org/D54837





More information about the llvm-commits mailing list