ports

morpheus ports
git clone git://git.2f30.org/ports
Log | Files | Refs | LICENSE

strace-musl.patch (4997B)


      1 diff -ru strace-4.8.orig/defs.h strace-4.8/defs.h
      2 --- strace-4.8.orig/defs.h	2013-05-14 14:10:42.000000000 +0000
      3 +++ strace-4.8/defs.h	2013-09-20 14:30:38.785856744 +0000
      4 @@ -155,7 +155,7 @@
      5      || defined(METAG) \
      6      || defined(TILE) \
      7      || defined(XTENSA) \
      8 -    ) && defined(__GLIBC__)
      9 +    ) && defined(__linux__)
     10  # include <sys/ptrace.h>
     11  #else
     12  /* Work around awkward prototype in ptrace.h. */
     13 @@ -222,7 +222,7 @@
     14  # define PTRACE_EVENT_EXIT	6
     15  #endif
     16  
     17 -#if !defined(__GLIBC__)
     18 +#if !defined(__GLIBC__) && !defined(PTRACE_PEEKUSER)
     19  # define PTRACE_PEEKUSER PTRACE_PEEKUSR
     20  # define PTRACE_POKEUSER PTRACE_POKEUSR
     21  #endif
     22 diff -ru strace-4.8.orig/desc.c strace-4.8/desc.c
     23 --- strace-4.8.orig/desc.c	2013-05-01 22:39:10.000000000 +0000
     24 +++ strace-4.8/desc.c	2013-09-20 14:30:38.795856744 +0000
     25 @@ -299,7 +299,7 @@
     26  #ifdef X32
     27  	tprintf(", start=%lld, len=%lld", fl.l_start, fl.l_len);
     28  #else
     29 -	tprintf(", start=%ld, len=%ld", fl.l_start, fl.l_len);
     30 +	tprintf(", start=%ld, len=%ld", (long) fl.l_start, (long) fl.l_len);
     31  #endif
     32  	if (getlk)
     33  		tprintf(", pid=%lu}", (unsigned long) fl.l_pid);
     34 diff -ru strace-4.8.orig/file.c strace-4.8/file.c
     35 --- strace-4.8.orig/file.c	2013-05-06 18:23:01.000000000 +0000
     36 +++ strace-4.8/file.c	2013-09-20 14:30:38.795856744 +0000
     37 @@ -632,7 +632,7 @@
     38  	return 0;
     39  }
     40  
     41 -#if _LFS64_LARGEFILE
     42 +#if defined _LFS64_LARGEFILE || defined HAVE_LONG_LONG_OFF_T
     43  int
     44  sys_truncate64(struct tcb *tcp)
     45  {
     46 @@ -654,7 +654,7 @@
     47  	return 0;
     48  }
     49  
     50 -#if _LFS64_LARGEFILE
     51 +#if defined _LFS64_LARGEFILE || defined HAVE_LONG_LONG_OFF_T
     52  int
     53  sys_ftruncate64(struct tcb *tcp)
     54  {
     55 @@ -2322,7 +2322,7 @@
     56  	return 0;
     57  }
     58  
     59 -#if _LFS64_LARGEFILE
     60 +#if defined _LFS64_LARGEFILE || defined HAVE_LONG_LONG_OFF_T
     61  int
     62  sys_getdents64(struct tcb *tcp)
     63  {
     64 diff -ru strace-4.8.orig/net.c strace-4.8/net.c
     65 --- strace-4.8.orig/net.c	2013-05-17 22:20:02.000000000 +0000
     66 +++ strace-4.8/net.c	2013-09-20 14:30:38.805856744 +0000
     67 @@ -95,12 +95,14 @@
     68  #endif
     69  
     70  /* Under Linux these are enums so we can't test for them with ifdef. */
     71 +#if !defined(IPPROTO_MAX)
     72  #define IPPROTO_EGP IPPROTO_EGP
     73  #define IPPROTO_PUP IPPROTO_PUP
     74  #define IPPROTO_IDP IPPROTO_IDP
     75  #define IPPROTO_IGMP IPPROTO_IGMP
     76  #define IPPROTO_RAW IPPROTO_RAW
     77  #define IPPROTO_MAX IPPROTO_MAX
     78 +#endif
     79  
     80  static const struct xlat domains[] = {
     81  #ifdef PF_UNSPEC
     82 diff -ru strace-4.8.orig/process.c strace-4.8/process.c
     83 --- strace-4.8.orig/process.c	2013-05-17 22:22:19.000000000 +0000
     84 +++ strace-4.8/process.c	2013-09-20 14:30:38.805856744 +0000
     85 @@ -2857,7 +2857,7 @@
     86  		if (umove(tcp, tcp->u_arg[2], &p) < 0)
     87  			tprintf(", %#lx", tcp->u_arg[2]);
     88  		else
     89 -			tprintf(", { %d }", p.__sched_priority);
     90 +			tprintf(", { %d }", p.sched_priority);
     91  	}
     92  	return 0;
     93  }
     94 @@ -2872,7 +2872,7 @@
     95  		if (umove(tcp, tcp->u_arg[1], &p) < 0)
     96  			tprintf("%#lx", tcp->u_arg[1]);
     97  		else
     98 -			tprintf("{ %d }", p.__sched_priority);
     99 +			tprintf("{ %d }", p.sched_priority);
    100  	}
    101  	return 0;
    102  }
    103 @@ -2885,7 +2885,7 @@
    104  		if (umove(tcp, tcp->u_arg[1], &p) < 0)
    105  			tprintf("%d, %#lx", (int) tcp->u_arg[0], tcp->u_arg[1]);
    106  		else
    107 -			tprintf("%d, { %d }", (int) tcp->u_arg[0], p.__sched_priority);
    108 +			tprintf("%d, { %d }", (int) tcp->u_arg[0], p.sched_priority);
    109  	}
    110  	return 0;
    111  }
    112 diff -ru strace-4.8.orig/signal.c strace-4.8/signal.c
    113 --- strace-4.8.orig/signal.c	2013-05-23 13:41:23.000000000 +0000
    114 +++ strace-4.8/signal.c	2013-09-20 14:30:38.815856744 +0000
    115 @@ -59,6 +59,7 @@
    116  #ifdef IA64
    117  # include <asm/ptrace_offsets.h>
    118  #endif
    119 +#include <asm/ptrace.h>
    120  
    121  #if defined(SPARC) || defined(SPARC64) || defined(MIPS)
    122  typedef struct {
    123 diff -ru strace-4.8.orig/strace.c strace-4.8/strace.c
    124 --- strace-4.8.orig/strace.c	2013-05-28 21:49:16.000000000 +0000
    125 +++ strace-4.8/strace.c	2013-09-20 14:30:38.815856744 +0000
    126 @@ -506,7 +506,7 @@
    127  				perror_msg_and_die("dup2");
    128  			close(fds[0]);
    129  		}
    130 -		execl(_PATH_BSHELL, "sh", "-c", command, NULL);
    131 +		execl(_PATH_BSHELL, "sh", "-c", command, (void*) 0);
    132  		perror_msg_and_die("Can't execute '%s'", _PATH_BSHELL);
    133  	}
    134  
    135 diff -ru strace-4.8.orig/syscall.c strace-4.8/syscall.c
    136 --- strace-4.8.orig/syscall.c	2013-05-14 14:10:42.000000000 +0000
    137 +++ strace-4.8/syscall.c	2013-09-20 14:30:38.825856744 +0000
    138 @@ -72,13 +72,7 @@
    139  # include <elf.h>
    140  #endif
    141  
    142 -#if defined(AARCH64)
    143 -# include <asm/ptrace.h>
    144 -#endif
    145 -
    146 -#if defined(XTENSA)
    147 -# include <asm/ptrace.h>
    148 -#endif
    149 +#include <asm/ptrace.h>
    150  
    151  #ifndef ERESTARTSYS
    152  # define ERESTARTSYS	512
    153 diff -ru strace-4.8.orig/time.c strace-4.8/time.c
    154 --- strace-4.8.orig/time.c	2012-05-01 21:17:51.000000000 +0000
    155 +++ strace-4.8/time.c	2013-09-20 14:32:49.165856719 +0000
    156 @@ -774,7 +774,11 @@
    157  			/* _pad[0] is the _tid field which might not be
    158  			   present in the userlevel definition of the
    159  			   struct.  */
    160 +#if defined(__GLIBC__)
    161  			tprintf("{%d}", sev._sigev_un._pad[0]);
    162 +#else
    163 +			tprintf("{%d}", (int) sev.__pad[0]);
    164 +#endif
    165  		else if (sev.sigev_notify == SIGEV_THREAD)
    166  			tprintf("{%p, %p}", sev.sigev_notify_function,
    167  				sev.sigev_notify_attributes);