[compiler-rt] r373367 - Revert "compiler-rt: use __GLIBC_PREREQ for SANITIZER_INTERCEPT_GETRANDOM"

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 1 11:03:12 PDT 2019


Author: vitalybuka
Date: Tue Oct  1 11:03:11 2019
New Revision: 373367

URL: http://llvm.org/viewvc/llvm-project?rev=373367&view=rev
Log:
Revert "compiler-rt: use __GLIBC_PREREQ for SANITIZER_INTERCEPT_GETRANDOM"
Revert "compiler-rt: move all __GLIBC_PREREQ into own header file"

"move all __GLIBC_PREREQ" breaks build on some bots

This reverts commit 2d75ee937397c209dbd95aefc88da6301fed07da.
This reverts commit 7a6461fcc2ed8e28c43993c561721af0bbe97f3a.

Removed:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_glibc_version.h
Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_getauxval.h
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_getauxval.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_getauxval.h?rev=373367&r1=373366&r2=373367&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_getauxval.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_getauxval.h Tue Oct  1 11:03:11 2019
@@ -17,10 +17,15 @@
 #define SANITIZER_GETAUXVAL_H
 
 #include "sanitizer_platform.h"
-#include "sanitizer_glibc_version.h"
 
 #if SANITIZER_LINUX || SANITIZER_FUCHSIA
 
+# include <features.h>
+
+# ifndef __GLIBC_PREREQ
+#  define __GLIBC_PREREQ(x, y) 0
+# endif
+
 # if __GLIBC_PREREQ(2, 16) || (SANITIZER_ANDROID && __ANDROID_API__ >= 21) || \
      SANITIZER_FUCHSIA
 #  define SANITIZER_USE_GETAUXVAL 1

Removed: compiler-rt/trunk/lib/sanitizer_common/sanitizer_glibc_version.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_glibc_version.h?rev=373366&view=auto
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_glibc_version.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_glibc_version.h (removed)
@@ -1,26 +0,0 @@
-//===-- sanitizer_glibc_version.h -----------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// This file is a part of Sanitizer common code.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SANITIZER_GLIBC_VERSION_H
-#define SANITIZER_GLIBC_VERSION_H
-
-#include "sanitizer_platform.h"
-
-#if (SANITIZER_POSIX && !SANITIZER_MAC) || SANITIZER_FUCHSIA
-#include <features.h>
-#endif
-
-#ifndef __GLIBC_PREREQ
-#define __GLIBC_PREREQ(x, y) 0
-#endif
-
-#endif

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cpp?rev=373367&r1=373366&r2=373367&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cpp (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cpp Tue Oct  1 11:03:11 2019
@@ -23,7 +23,6 @@
 #include "sanitizer_flags.h"
 #include "sanitizer_freebsd.h"
 #include "sanitizer_getauxval.h"
-#include "sanitizer_glibc_version.h"
 #include "sanitizer_linux.h"
 #include "sanitizer_placement_new.h"
 #include "sanitizer_procmaps.h"
@@ -189,7 +188,11 @@ __attribute__((unused)) static bool GetL
 static uptr g_tls_size;
 
 #ifdef __i386__
-# define CHECK_GET_TLS_STATIC_INFO_VERSION (!__GLIBC_PREREQ(2, 27))
+# ifndef __GLIBC_PREREQ
+#  define CHECK_GET_TLS_STATIC_INFO_VERSION 1
+# else
+#  define CHECK_GET_TLS_STATIC_INFO_VERSION (!__GLIBC_PREREQ(2, 27))
+# endif
 #else
 # define CHECK_GET_TLS_STATIC_INFO_VERSION 0
 #endif

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h?rev=373367&r1=373366&r2=373367&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h Tue Oct  1 11:03:11 2019
@@ -13,7 +13,6 @@
 #ifndef SANITIZER_PLATFORM_INTERCEPTORS_H
 #define SANITIZER_PLATFORM_INTERCEPTORS_H
 
-#include "sanitizer_glibc_version.h"
 #include "sanitizer_internal_defs.h"
 
 #if SANITIZER_POSIX
@@ -567,9 +566,10 @@
 #define SANITIZER_INTERCEPT_GETUSERSHELL (SI_POSIX && !SI_ANDROID)
 #define SANITIZER_INTERCEPT_SL_INIT (SI_FREEBSD || SI_NETBSD)
 
-#define SANITIZER_INTERCEPT_GETRANDOM (SI_LINUX && __GLIBC_PREREQ(2, 25))
+#define SANITIZER_INTERCEPT_GETRANDOM SI_LINUX
 #define SANITIZER_INTERCEPT___CXA_ATEXIT SI_NETBSD
 #define SANITIZER_INTERCEPT_ATEXIT SI_NETBSD
 #define SANITIZER_INTERCEPT_PTHREAD_ATFORK SI_NETBSD
 
+
 #endif  // #ifndef SANITIZER_PLATFORM_INTERCEPTORS_H

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp?rev=373367&r1=373366&r2=373367&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp Tue Oct  1 11:03:11 2019
@@ -12,7 +12,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "sanitizer_platform.h"
-#include "sanitizer_glibc_version.h"
 
 #if SANITIZER_LINUX || SANITIZER_MAC
 // Tests in this file assume that off_t-dependent data structures match the
@@ -1006,6 +1005,10 @@ CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_len)
 CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_level);
 CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_type);
 
+#ifndef __GLIBC_PREREQ
+#define __GLIBC_PREREQ(x, y) 0
+#endif
+
 #if SANITIZER_LINUX && (__ANDROID_API__ >= 21 || __GLIBC_PREREQ (2, 14))
 CHECK_TYPE_SIZE(mmsghdr);
 CHECK_SIZE_AND_OFFSET(mmsghdr, msg_hdr);

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h?rev=373367&r1=373366&r2=373367&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h Tue Oct  1 11:03:11 2019
@@ -19,13 +19,12 @@
 #include "sanitizer_internal_defs.h"
 #include "sanitizer_platform.h"
 
-#if defined(__sparc__)
-// FIXME: This can't be included from tsan which does not support sparc yet.
-#include "sanitizer_glibc_version.h"
-#endif
-
 # define GET_LINK_MAP_BY_DLOPEN_HANDLE(handle) ((link_map*)(handle))
 
+#ifndef __GLIBC_PREREQ
+#define __GLIBC_PREREQ(x, y) 0
+#endif
+
 namespace __sanitizer {
 extern unsigned struct_utsname_sz;
 extern unsigned struct_stat_sz;




More information about the llvm-commits mailing list