Skip to content

Commit 161229e

Browse files
committed
compiler-rt: use __GLIBC_PREREQ for SANITIZER_INTERCEPT_GETRANDOM
Summary: Fixes google/oss-fuzz#2836 Reviewers: eugenis Subscribers: dberris, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D68178 llvm-svn: 373681
1 parent ac14695 commit 161229e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#ifndef SANITIZER_PLATFORM_INTERCEPTORS_H
1414
#define SANITIZER_PLATFORM_INTERCEPTORS_H
1515

16+
#include "sanitizer_glibc_version.h"
1617
#include "sanitizer_internal_defs.h"
1718

1819
#if SANITIZER_POSIX
@@ -566,10 +567,9 @@
566567
#define SANITIZER_INTERCEPT_GETUSERSHELL (SI_POSIX && !SI_ANDROID)
567568
#define SANITIZER_INTERCEPT_SL_INIT (SI_FREEBSD || SI_NETBSD)
568569

569-
#define SANITIZER_INTERCEPT_GETRANDOM SI_LINUX
570+
#define SANITIZER_INTERCEPT_GETRANDOM (SI_LINUX && __GLIBC_PREREQ(2, 25))
570571
#define SANITIZER_INTERCEPT___CXA_ATEXIT SI_NETBSD
571572
#define SANITIZER_INTERCEPT_ATEXIT SI_NETBSD
572573
#define SANITIZER_INTERCEPT_PTHREAD_ATFORK SI_NETBSD
573574

574-
575575
#endif // #ifndef SANITIZER_PLATFORM_INTERCEPTORS_H

0 commit comments

Comments
 (0)