From 9bef9f7a1b7b804110a3f3938ece35a1a599c2c5 Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Tue, 30 May 2017 18:14:45 +0000 Subject: [PATCH] Apply ino64 patches. PR: 219601 --- devel/llvm38/Makefile | 2 ++ .../compiler-rt-patch-canonical-syscalls | 35 +++++++++++++++++++ devel/llvm38/files/compiler-rt-patch-ino64 | 15 ++++++++ 3 files changed, 52 insertions(+) create mode 100644 devel/llvm38/files/compiler-rt-patch-canonical-syscalls create mode 100644 devel/llvm38/files/compiler-rt-patch-ino64 diff --git a/devel/llvm38/Makefile b/devel/llvm38/Makefile index 626b2e4dbb2e..df984db339ee 100644 --- a/devel/llvm38/Makefile +++ b/devel/llvm38/Makefile @@ -306,6 +306,8 @@ post-patch: post-patch-COMPILER_RT-on: cd ${WRKSRC_compiler_rt} && patch < ${PATCHDIR}/compiler-rt-patch-svn-261229 cd ${WRKSRC_compiler_rt} && patch < ${PATCHDIR}/compiler-rt-patch-svn-294806 + cd ${WRKSRC_compiler_rt} && patch < ${PATCHDIR}/compiler-rt-patch-canonical-syscalls + cd ${WRKSRC_compiler_rt} && patch < ${PATCHDIR}/compiler-rt-patch-ino64 .if ${ARCH} == "amd64" cd ${WRKSRC_compiler_rt} && patch < ${PATCHDIR}/compiler-rt-patch-no-m32 .endif diff --git a/devel/llvm38/files/compiler-rt-patch-canonical-syscalls b/devel/llvm38/files/compiler-rt-patch-canonical-syscalls new file mode 100644 index 000000000000..f68f299e8a03 --- /dev/null +++ b/devel/llvm38/files/compiler-rt-patch-canonical-syscalls @@ -0,0 +1,35 @@ +diff --git lib/sanitizer_common/sanitizer_linux.cc lib/sanitizer_common/sanitizer_linux.cc +index 7328a5c0ac1..4b59a39ee27 100644 +--- lib/sanitizer_common/sanitizer_linux.cc ++++ lib/sanitizer_common/sanitizer_linux.cc +@@ -223,7 +223,8 @@ static void kernel_stat_to_stat(struct kernel_stat *in, struct stat *out) { + + uptr internal_stat(const char *path, void *buf) { + #if SANITIZER_FREEBSD +- return internal_syscall(SYSCALL(stat), path, buf); ++ return internal_syscall(SYSCALL(fstatat), AT_FDCWD, (uptr)path, ++ (uptr)buf, 0); + #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS + return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path, + (uptr)buf, 0); +@@ -247,7 +248,8 @@ uptr internal_stat(const char *path, void *buf) { + + uptr internal_lstat(const char *path, void *buf) { + #if SANITIZER_FREEBSD +- return internal_syscall(SYSCALL(lstat), path, buf); ++ return internal_syscall(SYSCALL(fstatat), AT_FDCWD, (uptr)path, ++ (uptr)buf, AT_SYMLINK_NOFOLLOW); + #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS + return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path, + (uptr)buf, AT_SYMLINK_NOFOLLOW); +@@ -590,7 +592,9 @@ uptr internal_getppid() { + } + + uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count) { +-#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS ++#if SANITIZER_FREEBSD ++ return internal_syscall(SYSCALL(getdirentries), fd, (uptr)dirp, count, NULL); ++#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS + return internal_syscall(SYSCALL(getdents64), fd, (uptr)dirp, count); + #else + return internal_syscall(SYSCALL(getdents), fd, (uptr)dirp, count); diff --git a/devel/llvm38/files/compiler-rt-patch-ino64 b/devel/llvm38/files/compiler-rt-patch-ino64 new file mode 100644 index 000000000000..1e251f7f515c --- /dev/null +++ b/devel/llvm38/files/compiler-rt-patch-ino64 @@ -0,0 +1,15 @@ +--- lib/sanitizer_common/sanitizer_platform_limits_posix.h.orig 2017-05-24 19:09:24.000000000 +0000 ++++ lib/sanitizer_common/sanitizer_platform_limits_posix.h 2017-05-24 20:12:47.183536000 +0000 +@@ -485,7 +485,12 @@ + }; + #elif SANITIZER_FREEBSD + struct __sanitizer_dirent { ++#if __FreeBSD_version < 1200031 + unsigned int d_fileno; ++#else ++ unsigned long long d_fileno; ++ unsigned long long d_off; ++#endif + unsigned short d_reclen; + // more fields that we don't care about + };