aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-06-27 19:14:44 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-06-27 19:14:44 +0000
commit70d5b95606b5d716075650ee1806270f3c3e10b7 (patch)
tree818174bcda1e761da2d0e5a37b64e558b6317dee
parent2fb14b72339e21350fc3b98a9fdb684b9e194350 (diff)
downloadsrc-vendor/compiler-rt-60.tar.gz
src-vendor/compiler-rt-60.zip
Vendor import of compiler-rt 6.0.1 release r335540:vendor/compiler-rt/compiler-rt-release_601-r335540vendor/compiler-rt-60
Notes
Notes: svn path=/vendor/compiler-rt/dist-release_60/; revision=335724 svn path=/vendor/compiler-rt/compiler-rt-release_601-r335540/; revision=335725; tag=vendor/compiler-rt/compiler-rt-release_601-r335540
-rw-r--r--lib/sanitizer_common/sanitizer_platform_limits_posix.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
index f12e8206abe6..feb7bad6f347 100644
--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
@@ -159,7 +159,6 @@ typedef struct user_fpregs elf_fpregset_t;
# include <sys/procfs.h>
#endif
#include <sys/user.h>
-#include <sys/ustat.h>
#include <linux/cyclades.h>
#include <linux/if_eql.h>
#include <linux/if_plip.h>
@@ -253,7 +252,19 @@ namespace __sanitizer {
#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
#if SANITIZER_LINUX && !SANITIZER_ANDROID
- unsigned struct_ustat_sz = sizeof(struct ustat);
+ // Use pre-computed size of struct ustat to avoid <sys/ustat.h> which
+ // has been removed from glibc 2.28.
+#if defined(__aarch64__) || defined(__s390x__) || defined (__mips64) \
+ || defined(__powerpc64__) || defined(__arch64__) || defined(__sparcv9) \
+ || defined(__x86_64__)
+#define SIZEOF_STRUCT_USTAT 32
+#elif defined(__arm__) || defined(__i386__) || defined(__mips__) \
+ || defined(__powerpc__) || defined(__s390__)
+#define SIZEOF_STRUCT_USTAT 20
+#else
+#error Unknown size of struct ustat
+#endif
+ unsigned struct_ustat_sz = SIZEOF_STRUCT_USTAT;
unsigned struct_rlimit64_sz = sizeof(struct rlimit64);
unsigned struct_statvfs64_sz = sizeof(struct statvfs64);
#endif // SANITIZER_LINUX && !SANITIZER_ANDROID