View | Details | Raw Unified | Return to bug 218320 | Differences between
and this patch

Collapse All | Expand All

(-)devel/llvm39/Makefile (+1 lines)
Lines 326-331 Link Here
326
326
327
post-patch-COMPILER_RT-on:
327
post-patch-COMPILER_RT-on:
328
	cd ${WRKSRC_compiler_rt} && patch < ${PATCHDIR}/compiler-rt-patch-svn-294806
328
	cd ${WRKSRC_compiler_rt} && patch < ${PATCHDIR}/compiler-rt-patch-svn-294806
329
	cd ${WRKSRC_compiler_rt} && patch < ${PATCHDIR}/compiler-rt-patch-ino64
329
330
330
post-build-COMPILER_RT-on:
331
post-build-COMPILER_RT-on:
331
	${MKDIR} ${WRKDIR}/compiler-rt-build
332
	${MKDIR} ${WRKDIR}/compiler-rt-build
(-)devel/llvm39/files/compiler-rt-patch-ino64 (+49 lines)
Line 0 Link Here
1
diff --git lib/sanitizer_common/sanitizer_linux.cc lib/sanitizer_common/sanitizer_linux.cc
2
index 7328a5c0ac1..4b59a39ee27 100644
3
--- lib/sanitizer_common/sanitizer_linux.cc
4
+++ lib/sanitizer_common/sanitizer_linux.cc
5
@@ -223,7 +223,8 @@ static void kernel_stat_to_stat(struct kernel_stat *in, struct stat *out) {
6
 
7
 uptr internal_stat(const char *path, void *buf) {
8
 #if SANITIZER_FREEBSD
9
-  return internal_syscall(SYSCALL(stat), path, buf);
10
+  return internal_syscall(SYSCALL(fstatat), AT_FDCWD, (uptr)path,
11
+                          (uptr)buf, 0);
12
 #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
13
   return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path,
14
                           (uptr)buf, 0);
15
@@ -247,7 +248,8 @@ uptr internal_stat(const char *path, void *buf) {
16
 
17
 uptr internal_lstat(const char *path, void *buf) {
18
 #if SANITIZER_FREEBSD
19
-  return internal_syscall(SYSCALL(lstat), path, buf);
20
+  return internal_syscall(SYSCALL(fstatat), AT_FDCWD, (uptr)path,
21
+                         (uptr)buf, AT_SYMLINK_NOFOLLOW);
22
 #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
23
   return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path,
24
                          (uptr)buf, AT_SYMLINK_NOFOLLOW);
25
@@ -590,7 +592,9 @@ uptr internal_getppid() {
26
 }
27
 
28
 uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count) {
29
-#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
30
+#if SANITIZER_FREEBSD
31
+  return internal_syscall(SYSCALL(getdirentries), fd, (uptr)dirp, count, NULL);
32
+#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
33
   return internal_syscall(SYSCALL(getdents64), fd, (uptr)dirp, count);
34
 #else
35
   return internal_syscall(SYSCALL(getdents), fd, (uptr)dirp, count);
36
diff --git lib/sanitizer_common/sanitizer_platform_limits_posix.h lib/sanitizer_common/sanitizer_platform_limits_posix.h
37
index 5cbd78d3c1b..d7ce7b501f7 100644
38
--- lib/sanitizer_common/sanitizer_platform_limits_posix.h
39
+++ lib/sanitizer_common/sanitizer_platform_limits_posix.h
40
@@ -489,7 +489,8 @@ namespace __sanitizer {
41
   };
42
 #elif SANITIZER_FREEBSD
43
   struct __sanitizer_dirent {
44
-    unsigned int d_fileno;
45
+    unsigned long long d_fileno;
46
+    unsigned long long d_off;
47
     unsigned short d_reclen;
48
     // more fields that we don't care about
49
   };
(-)devel/llvm40/Makefile (+3 lines)
Lines 319-324 Link Here
319
post-extract-OPENMP-on:
319
post-extract-OPENMP-on:
320
	${MV} ${WRKSRC_openmp} ${PATCH_WRKSRC}/tools/openmp
320
	${MV} ${WRKSRC_openmp} ${PATCH_WRKSRC}/tools/openmp
321
321
322
post-patch-COMPILER_RT-on:
323
	cd ${WRKSRC_compiler_rt} && patch < ${PATCHDIR}/compiler-rt-patch-ino64
324
322
post-patch:
325
post-patch:
323
	${REINPLACE_CMD} -e 's|import lit|import lit${LLVM_SUFFIX}|' \
326
	${REINPLACE_CMD} -e 's|import lit|import lit${LLVM_SUFFIX}|' \
324
	    -e 's|from lit|from lit${LLVM_SUFFIX}|' \
327
	    -e 's|from lit|from lit${LLVM_SUFFIX}|' \
(-)devel/llvm40/files/compiler-rt-patch-ino64 (+49 lines)
Line 0 Link Here
1
diff --git lib/sanitizer_common/sanitizer_linux.cc lib/sanitizer_common/sanitizer_linux.cc
2
index 7328a5c0ac1..4b59a39ee27 100644
3
--- lib/sanitizer_common/sanitizer_linux.cc
4
+++ lib/sanitizer_common/sanitizer_linux.cc
5
@@ -223,7 +223,8 @@ static void kernel_stat_to_stat(struct kernel_stat *in, struct stat *out) {
6
 
7
 uptr internal_stat(const char *path, void *buf) {
8
 #if SANITIZER_FREEBSD
9
-  return internal_syscall(SYSCALL(stat), path, buf);
10
+  return internal_syscall(SYSCALL(fstatat), AT_FDCWD, (uptr)path,
11
+                          (uptr)buf, 0);
12
 #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
13
   return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path,
14
                           (uptr)buf, 0);
15
@@ -247,7 +248,8 @@ uptr internal_stat(const char *path, void *buf) {
16
 
17
 uptr internal_lstat(const char *path, void *buf) {
18
 #if SANITIZER_FREEBSD
19
-  return internal_syscall(SYSCALL(lstat), path, buf);
20
+  return internal_syscall(SYSCALL(fstatat), AT_FDCWD, (uptr)path,
21
+                         (uptr)buf, AT_SYMLINK_NOFOLLOW);
22
 #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
23
   return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path,
24
                          (uptr)buf, AT_SYMLINK_NOFOLLOW);
25
@@ -590,7 +592,9 @@ uptr internal_getppid() {
26
 }
27
 
28
 uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count) {
29
-#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
30
+#if SANITIZER_FREEBSD
31
+  return internal_syscall(SYSCALL(getdirentries), fd, (uptr)dirp, count, NULL);
32
+#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
33
   return internal_syscall(SYSCALL(getdents64), fd, (uptr)dirp, count);
34
 #else
35
   return internal_syscall(SYSCALL(getdents), fd, (uptr)dirp, count);
36
diff --git lib/sanitizer_common/sanitizer_platform_limits_posix.h lib/sanitizer_common/sanitizer_platform_limits_posix.h
37
index 5cbd78d3c1b..d7ce7b501f7 100644
38
--- lib/sanitizer_common/sanitizer_platform_limits_posix.h
39
+++ lib/sanitizer_common/sanitizer_platform_limits_posix.h
40
@@ -489,7 +489,8 @@ namespace __sanitizer {
41
   };
42
 #elif SANITIZER_FREEBSD
43
   struct __sanitizer_dirent {
44
-    unsigned int d_fileno;
45
+    unsigned long long d_fileno;
46
+    unsigned long long d_off;
47
     unsigned short d_reclen;
48
     // more fields that we don't care about
49
   };

Return to bug 218320