aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2021-11-14 11:30:13 -0800
committerVitaly Buka <vitalybuka@google.com>2021-11-14 11:30:50 -0800
commitdd63c6e6b97b83487e6549ce4f86d031e37a6f92 (patch)
tree2e971df25ad2e7f8981b18c00bd6d13ca7a2dc18
parent3e0f3041cc1abe977edd288525c62da8c28219e5 (diff)
downloadllvm-dd63c6e6b97b83487e6549ce4f86d031e37a6f92.zip
llvm-dd63c6e6b97b83487e6549ce4f86d031e37a6f92.tar.gz
llvm-dd63c6e6b97b83487e6549ce4f86d031e37a6f92.tar.bz2
[sanitizer] Fix test with GLIBC 2.34
-rw-r--r--compiler-rt/test/sanitizer_common/TestCases/Linux/sysconf_interceptor_bypass_test.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/sysconf_interceptor_bypass_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/sysconf_interceptor_bypass_test.cpp
index 027aca5..5e6bbad 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/sysconf_interceptor_bypass_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/sysconf_interceptor_bypass_test.cpp
@@ -1,6 +1,7 @@
// RUN: %clangxx -O2 %s -o %t && %run %t 2>&1 | FileCheck %s
#include <stdio.h>
+#include <unistd.h>
#if !defined(__GLIBC_PREREQ)
#define __GLIBC_PREREQ(a, b) 0
@@ -10,10 +11,11 @@
// glbc version 2.16.
#if __GLIBC_PREREQ(2, 16)
extern "C" long sysconf(int name) {
- if (name == 158 /*_SC_SIGSTKSZ */) {
- // Asan calls it during initialization but late enough to succeed.
+# ifdef _SC_SIGSTKSZ
+ // Asan needs this one during initialization but late enough to succeed.
+ if (name == _SC_SIGSTKSZ)
return 0x10000;
- }
+# endif
fprintf(stderr, "sysconf wrapper called: %d\n", name);
return 0;
}