pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

compiler-rt-netbsd: Fix build and test issues



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Tue Oct 3 17:15:51 2017 +0200
Changeset:	926458dab316641a888e161c9a6fd3f49f828bea

Modified Files:
	compiler-rt-netbsd/distinfo
	compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__linux.cc

Log Message:
compiler-rt-netbsd: Fix build and test issues

__ps_strings must not be in the __sanitizer namespace.
Remove trailing whitespace.

Sponsored by <The NetBSD Foundation>

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=926458dab316641a888e161c9a6fd3f49f828bea

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 compiler-rt-netbsd/distinfo                        |  2 +-
 ...patch-lib_sanitizer__common_sanitizer__linux.cc | 52 +++++++++++-----------
 2 files changed, 28 insertions(+), 26 deletions(-)

diffs:
diff --git a/compiler-rt-netbsd/distinfo b/compiler-rt-netbsd/distinfo
index 2cd28a795a..48517e73a9 100644
--- a/compiler-rt-netbsd/distinfo
+++ b/compiler-rt-netbsd/distinfo
@@ -2,7 +2,7 @@ $NetBSD: distinfo,v 1.35 2015/09/11 01:21:57 tnn Exp $
 
 SHA1 (patch-cmake_config-ix.cmake) = 5b1842f08cc8c2b96e0529b552b09c7adf2065dc
 SHA1 (patch-lib_fuzzer_tests_CMakeLists.txt) = eaffd9f8f2621ad465b5c734a764bdff0243af3d
-SHA1 (patch-lib_sanitizer__common_sanitizer__linux.cc) = bda4dd8aa55d761a6aa9d5b7718d334c06e5672d
+SHA1 (patch-lib_sanitizer__common_sanitizer__linux.cc) = 1dcbe26288f790cba58b27eb33bd0871d9f0e738
 SHA1 (patch-lib_tsan_go_buildgo.sh) = fe64b3389bbf6ae2ddf187df3e0600b2f817f51d
 SHA1 (patch-lib_tsan_rtl_tsan__platform__linux.cc) = 21424d5506d02887a15183285ecb564d9560f215
 SHA1 (patch-lib_tsan_rtl_tsan__rtl__amd64.S) = 95591667c23372ceb72334b2ceae800d32574ac6
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__linux.cc b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__linux.cc
index fe89d925f9..ce789b9a8e 100644
--- a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__linux.cc
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__linux.cc
@@ -2,7 +2,16 @@ $NetBSD$
 
 --- lib/sanitizer_common/sanitizer_linux.cc.orig	2017-10-02 13:17:02.000000000 +0000
 +++ lib/sanitizer_common/sanitizer_linux.cc
-@@ -186,7 +186,9 @@ uptr internal_close(fd_t fd) {
+@@ -87,6 +87,8 @@ extern char **environ;  // provided by c
+ #include <limits.h>  // For NAME_MAX
+ #include <sys/sysctl.h>
+ extern char **environ;  // provided by crt1
++#include <sys/exec.h>
++extern struct ps_strings *__ps_strings;
+ #endif                  // SANITIZER_NETBSD
+ 
+ #if !SANITIZER_ANDROID
+@@ -186,7 +188,9 @@ uptr internal_close(fd_t fd) {
  }
  
  uptr internal_open(const char *filename, int flags) {
@@ -13,7 +22,7 @@ $NetBSD$
    return internal_syscall(SYSCALL(openat), AT_FDCWD, (uptr)filename, flags);
  #else
    return internal_syscall(SYSCALL(open), (uptr)filename, flags);
-@@ -194,7 +196,9 @@ uptr internal_open(const char *filename,
+@@ -194,7 +198,9 @@ uptr internal_open(const char *filename,
  }
  
  uptr internal_open(const char *filename, int flags, u32 mode) {
@@ -24,7 +33,7 @@ $NetBSD$
    return internal_syscall(SYSCALL(openat), AT_FDCWD, (uptr)filename, flags,
                            mode);
  #else
-@@ -227,7 +231,7 @@ uptr internal_write(fd_t fd, const void 
+@@ -227,7 +233,7 @@ uptr internal_write(fd_t fd, const void 
  uptr internal_ftruncate(fd_t fd, uptr size) {
    sptr res;
  #if SANITIZER_NETBSD
@@ -33,7 +42,7 @@ $NetBSD$
  #else
    HANDLE_EINTR(res, (sptr)internal_syscall(SYSCALL(ftruncate), fd,
                 (OFF_T)size));
-@@ -303,9 +307,12 @@ static void kernel_stat_to_stat(struct k
+@@ -303,9 +309,12 @@ static void kernel_stat_to_stat(struct k
  #endif
  
  uptr internal_stat(const char *path, void *buf) {
@@ -47,7 +56,7 @@ $NetBSD$
  #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
    return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path,
                            (uptr)buf, 0);
-@@ -329,7 +336,7 @@ uptr internal_stat(const char *path, voi
+@@ -329,7 +338,7 @@ uptr internal_stat(const char *path, voi
  
  uptr internal_lstat(const char *path, void *buf) {
  #if SANITIZER_NETBSD
@@ -56,7 +65,7 @@ $NetBSD$
  #elif SANITIZER_FREEBSD
    return internal_syscall(SYSCALL(fstatat), AT_FDCWD, (uptr)path,
                            (uptr)buf, AT_SYMLINK_NOFOLLOW);
-@@ -355,7 +362,9 @@ uptr internal_lstat(const char *path, vo
+@@ -355,7 +364,9 @@ uptr internal_lstat(const char *path, vo
  }
  
  uptr internal_fstat(fd_t fd, void *buf) {
@@ -67,7 +76,7 @@ $NetBSD$
  # if SANITIZER_MIPS64
    // For mips64, fstat syscall fills buffer in the format of kernel_stat
    struct kernel_stat kbuf;
-@@ -400,7 +409,9 @@ uptr internal_readlink(const char *path,
+@@ -400,7 +411,9 @@ uptr internal_readlink(const char *path,
  }
  
  uptr internal_unlink(const char *path) {
@@ -78,7 +87,7 @@ $NetBSD$
    return internal_syscall(SYSCALL(unlinkat), AT_FDCWD, (uptr)path, 0);
  #else
    return internal_syscall(SYSCALL(unlink), (uptr)path);
-@@ -408,7 +419,9 @@ uptr internal_unlink(const char *path) {
+@@ -408,7 +421,9 @@ uptr internal_unlink(const char *path) {
  }
  
  uptr internal_rename(const char *oldpath, const char *newpath) {
@@ -89,7 +98,7 @@ $NetBSD$
    return internal_syscall(SYSCALL(renameat), AT_FDCWD, (uptr)oldpath, AT_FDCWD,
                            (uptr)newpath);
  #else
-@@ -433,15 +446,24 @@ unsigned int internal_sleep(unsigned int
+@@ -433,15 +448,24 @@ unsigned int internal_sleep(unsigned int
    struct timespec ts;
    ts.tv_sec = 1;
    ts.tv_nsec = 0;
@@ -114,7 +123,7 @@ $NetBSD$
  }
  
  // ----------------- sanitizer_common.h
-@@ -524,13 +546,13 @@ const char *GetEnv(const char *name) {
+@@ -524,13 +548,13 @@ const char *GetEnv(const char *name) {
  #endif
  }
  
@@ -130,16 +139,9 @@ $NetBSD$
  static void ReadNullSepFileToArray(const char *path, char ***arr,
                                     int arr_size) {
    char *buff;
-@@ -555,8 +577,29 @@ static void ReadNullSepFileToArray(const
- }
+@@ -556,7 +580,22 @@ static void ReadNullSepFileToArray(const
  #endif
  
-+#if SANITIZER_NETBSD
-+#include <sys/exec.h>
-+
-+extern struct ps_strings *__ps_strings;
-+#endif
-+
  static void GetArgsAndEnv(char ***argv, char ***envp) {
 -#if !SANITIZER_FREEBSD
 +#if SANITIZER_FREEBSD
@@ -161,7 +163,7 @@ $NetBSD$
  #if !SANITIZER_GO
    if (&__libc_stack_end) {
  #endif
-@@ -571,18 +614,6 @@ static void GetArgsAndEnv(char ***argv, 
+@@ -571,18 +610,6 @@ static void GetArgsAndEnv(char ***argv, 
      ReadNullSepFileToArray("/proc/self/environ", envp, kMaxEnvp);
    }
  #endif
@@ -180,7 +182,7 @@ $NetBSD$
  #endif
  }
  
-@@ -594,8 +625,22 @@ char **GetArgv() {
+@@ -594,8 +621,22 @@ char **GetArgv() {
  
  void ReExec() {
    char **argv, **envp;
@@ -204,7 +206,7 @@ $NetBSD$
    int rverrno;
    CHECK_EQ(internal_iserror(rv, &rverrno), true);
    Printf("execve failed, errno %d\n", rverrno);
-@@ -699,7 +744,7 @@ uptr internal_ptrace(int request, int pi
+@@ -699,7 +740,7 @@ uptr internal_ptrace(int request, int pi
  
  uptr internal_waitpid(int pid, int *status, int options) {
  #if SANITIZER_NETBSD
@@ -213,7 +215,7 @@ $NetBSD$
                            NULL /* rusage */);
  #else
    return internal_syscall(SYSCALL(wait4), pid, (uptr)status, options,
-@@ -717,7 +762,7 @@ uptr internal_getppid() {
+@@ -717,7 +758,7 @@ uptr internal_getppid() {
  
  uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count) {
  #if SANITIZER_NETBSD
@@ -222,7 +224,7 @@ $NetBSD$
  #elif SANITIZER_FREEBSD
    return internal_syscall(SYSCALL(getdirentries), fd, (uptr)dirp, count, NULL);
  #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
-@@ -742,7 +787,11 @@ uptr internal_prctl(int option, uptr arg
+@@ -742,7 +783,11 @@ uptr internal_prctl(int option, uptr arg
  #endif
  
  uptr internal_sigaltstack(const void *ss, void *oss) {
@@ -234,12 +236,12 @@ $NetBSD$
  }
  
  int internal_fork() {
-@@ -823,8 +872,10 @@ int internal_sigaction_syscall(int signu
+@@ -823,8 +868,10 @@ int internal_sigaction_syscall(int signu
  
  uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set,
      __sanitizer_sigset_t *oldset) {
 -#if SANITIZER_FREEBSD || SANITIZER_NETBSD
-+#if SANITIZER_FREEBSD 
++#if SANITIZER_FREEBSD
    return internal_syscall(SYSCALL(sigprocmask), how, set, oldset);
 +#elif SANITIZER_NETBSD
 +  return internal_syscall_ptr(SYSCALL(sigprocmask), how, set, oldset);


Home | Main Index | Thread Index | Old Index