--- src/oper_save.c.orig	2016-01-03 09:53:44.423852948 +0100
+++ src/oper_save.c	2016-01-03 09:54:05.128058867 +0100
@@ -58,6 +58,10 @@
 #include "error.h"
 #include "queue.h"
 
+#ifndef S_BLKSIZE
+# define S_BLKSIZE	512
+#endif
+
 typedef struct s_savear
 {   carchwriter ai;
     cregmulti   regmulti;
--- src/common.c.orig	2016-01-03 09:58:04.217414394 +0100
+++ src/common.c	2016-01-03 10:00:09.017648286 +0100
@@ -19,17 +19,21 @@
 #  include "config.h"
 #endif
 
+#include <stdlib.h>
 #include <stdarg.h>
 #include <errno.h>
 #include <string.h>
 #include <unistd.h>
 #include <dirent.h>
+#include <limits.h>
 #include <sys/time.h>
 #include <sys/wait.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <stdlib.h>
+#ifdef HAVE_EXECINFO_H
 #include <execinfo.h>
+#endif
 #include <wordexp.h>
 #include <fnmatch.h>
 #include <time.h>
@@ -557,6 +561,8 @@ int format_stacktrace(char *buffer, int
     
     // format the backtrace (advanced error info)
     memset(buffer, 0, bufsize);
+
+#ifdef HAVE_EXECINFO_H
     nptrs=backtrace(temp, stack_depth);
     strings=backtrace_symbols(temp, nptrs);
     if (strings!=NULL)
@@ -565,6 +571,7 @@ int format_stacktrace(char *buffer, int
             strlcatf(buffer, bufsize, "%s\n", strings[i]);
         free(strings);
     }
+#endif
     
     return 0;
 }
--- src/fs_xfs.h.orig	2016-01-03 10:00:37.705922353 +0100
+++ src/fs_xfs.h	2016-01-03 10:00:58.961125410 +0100
@@ -64,34 +64,34 @@ typedef int32_t __s32;
 typedef uint64_t __u64;
 typedef int64_t __s64;
 
-typedef __uint32_t      xfs_agblock_t;  /* blockno in alloc. group */
-typedef __uint32_t      xfs_extlen_t;   /* extent length in blocks */
-typedef __uint32_t      xfs_agnumber_t; /* allocation group number */
-typedef __int32_t       xfs_extnum_t;   /* # of extents in a file */
-typedef __int16_t       xfs_aextnum_t;  /* # extents in an attribute fork */
-typedef __int64_t       xfs_fsize_t;    /* bytes in a file */
-typedef __uint64_t      xfs_ufsize_t;   /* unsigned bytes in a file */
-
-typedef __int32_t       xfs_suminfo_t;  /* type of bitmap summary info */
-typedef __int32_t       xfs_rtword_t;   /* word type for bitmap manipulations */
+typedef uint32_t      xfs_agblock_t;  /* blockno in alloc. group */
+typedef uint32_t      xfs_extlen_t;   /* extent length in blocks */
+typedef uint32_t      xfs_agnumber_t; /* allocation group number */
+typedef int32_t       xfs_extnum_t;   /* # of extents in a file */
+typedef int16_t       xfs_aextnum_t;  /* # extents in an attribute fork */
+typedef int64_t       xfs_fsize_t;    /* bytes in a file */
+typedef uint64_t      xfs_ufsize_t;   /* unsigned bytes in a file */
+
+typedef int32_t       xfs_suminfo_t;  /* type of bitmap summary info */
+typedef int32_t       xfs_rtword_t;   /* word type for bitmap manipulations */
  
-typedef __int64_t       xfs_lsn_t;      /* log sequence number */
-typedef __int32_t       xfs_tid_t;      /* transaction identifier */
+typedef int64_t       xfs_lsn_t;      /* log sequence number */
+typedef int32_t       xfs_tid_t;      /* transaction identifier */
 
-typedef __uint32_t      xfs_dablk_t;    /* dir/attr block number (in file) */
-typedef __uint32_t      xfs_dahash_t;   /* dir/attr hash value */
+typedef uint32_t      xfs_dablk_t;    /* dir/attr block number (in file) */
+typedef uint32_t      xfs_dahash_t;   /* dir/attr hash value */
 
-typedef __uint16_t      xfs_prid_t;     /* prid_t truncated to 16bits in XFS */
+typedef uint16_t      xfs_prid_t;     /* prid_t truncated to 16bits in XFS */
 
 /*
  * These types are 64 bits on disk but are either 32 or 64 bits in memory.
  * Disk based types:
  */
-typedef __uint64_t      xfs_fsblock_t;  /* blockno in filesystem (agno|agbno) */
-typedef __uint64_t      xfs_rfsblock_t; /* blockno in filesystem (raw) */
-typedef __uint64_t      xfs_rtblock_t;  /* extent (block) in realtime area */
-typedef __uint64_t      xfs_dfiloff_t;  /* block number in a file */
-typedef __uint64_t      xfs_dfilblks_t; /* number of blocks in a file */
+typedef uint64_t      xfs_fsblock_t;  /* blockno in filesystem (agno|agbno) */
+typedef uint64_t      xfs_rfsblock_t; /* blockno in filesystem (raw) */
+typedef uint64_t      xfs_rtblock_t;  /* extent (block) in realtime area */
+typedef uint64_t      xfs_dfiloff_t;  /* block number in a file */
+typedef uint64_t      xfs_dfilblks_t; /* number of blocks in a file */
 
 typedef __s64           xfs_off_t;      /* <file offset> type */
 typedef __u64           xfs_ino_t;      /* <inode> type */
@@ -106,8 +106,8 @@ typedef __u32           xfs_nlink_t;
  */
 struct xfs_sb
 {
-        __uint32_t      sb_magicnum;    /* magic number == XFS_SB_MAGIC */
-        __uint32_t      sb_blocksize;   /* logical block size, bytes */
+        uint32_t      sb_magicnum;    /* magic number == XFS_SB_MAGIC */
+        uint32_t      sb_blocksize;   /* logical block size, bytes */
         xfs_rfsblock_t  sb_dblocks;     /* number of data blocks */
         xfs_rfsblock_t  sb_rblocks;     /* number of realtime blocks */
         xfs_rtblock_t   sb_rextents;    /* number of realtime extents */
@@ -121,45 +121,45 @@ struct xfs_sb
         xfs_agnumber_t  sb_agcount;     /* number of allocation groups */
         xfs_extlen_t    sb_rbmblocks;   /* number of rt bitmap blocks */
         xfs_extlen_t    sb_logblocks;   /* number of log blocks */
-        __uint16_t      sb_versionnum;  /* header version == XFS_SB_VERSION */
-        __uint16_t      sb_sectsize;    /* volume sector size, bytes */
-        __uint16_t      sb_inodesize;   /* inode size, bytes */
-        __uint16_t      sb_inopblock;   /* inodes per block */
+        uint16_t      sb_versionnum;  /* header version == XFS_SB_VERSION */
+        uint16_t      sb_sectsize;    /* volume sector size, bytes */
+        uint16_t      sb_inodesize;   /* inode size, bytes */
+        uint16_t      sb_inopblock;   /* inodes per block */
         char            sb_fname[12];   /* file system name */
-        __uint8_t       sb_blocklog;    /* log2 of sb_blocksize */
-        __uint8_t       sb_sectlog;     /* log2 of sb_sectsize */
-        __uint8_t       sb_inodelog;    /* log2 of sb_inodesize */
-        __uint8_t       sb_inopblog;    /* log2 of sb_inopblock */
-        __uint8_t       sb_agblklog;    /* log2 of sb_agblocks (rounded up) */
-        __uint8_t       sb_rextslog;    /* log2 of sb_rextents */
-        __uint8_t       sb_inprogress;  /* mkfs is in progress, don't mount */
-        __uint8_t       sb_imax_pct;    /* max % of fs for inode space */
+        uint8_t       sb_blocklog;    /* log2 of sb_blocksize */
+        uint8_t       sb_sectlog;     /* log2 of sb_sectsize */
+        uint8_t       sb_inodelog;    /* log2 of sb_inodesize */
+        uint8_t       sb_inopblog;    /* log2 of sb_inopblock */
+        uint8_t       sb_agblklog;    /* log2 of sb_agblocks (rounded up) */
+        uint8_t       sb_rextslog;    /* log2 of sb_rextents */
+        uint8_t       sb_inprogress;  /* mkfs is in progress, don't mount */
+        uint8_t       sb_imax_pct;    /* max % of fs for inode space */
                                         /* statistics */
         /*
          * These fields must remain contiguous.  If you really
          * want to change their layout, make sure you fix the
          * code in xfs_trans_apply_sb_deltas().
          */
-        __uint64_t      sb_icount;      /* allocated inodes */
-        __uint64_t      sb_ifree;       /* free inodes */
-        __uint64_t      sb_fdblocks;    /* free data blocks */
-        __uint64_t      sb_frextents;   /* free realtime extents */
+        uint64_t      sb_icount;      /* allocated inodes */
+        uint64_t      sb_ifree;       /* free inodes */
+        uint64_t      sb_fdblocks;    /* free data blocks */
+        uint64_t      sb_frextents;   /* free realtime extents */
         /*
          * End contiguous fields.
          */
         xfs_ino_t       sb_uquotino;    /* user quota inode */
         xfs_ino_t       sb_gquotino;    /* group quota inode */
-        __uint16_t      sb_qflags;      /* quota flags */
-        __uint8_t       sb_flags;       /* misc. flags */
-        __uint8_t       sb_shared_vn;   /* shared version number */
+        uint16_t      sb_qflags;      /* quota flags */
+        uint8_t       sb_flags;       /* misc. flags */
+        uint8_t       sb_shared_vn;   /* shared version number */
         xfs_extlen_t    sb_inoalignmt;  /* inode chunk alignment, fsblocks */
-        __uint32_t      sb_unit;        /* stripe or raid unit */
-        __uint32_t      sb_width;       /* stripe or raid width */
-        __uint8_t       sb_dirblklog;   /* log2 of dir block size (fsbs) */
-        __uint8_t       sb_logsectlog;  /* log2 of the log sector size */
-        __uint16_t      sb_logsectsize; /* sector size for the log, bytes */
-        __uint32_t      sb_logsunit;    /* stripe unit size for the log */
-        __uint32_t      sb_features2;   /* additional feature bits */
+        uint32_t      sb_unit;        /* stripe or raid unit */
+        uint32_t      sb_width;       /* stripe or raid width */
+        uint8_t       sb_dirblklog;   /* log2 of dir block size (fsbs) */
+        uint8_t       sb_logsectlog;  /* log2 of the log sector size */
+        uint16_t      sb_logsectsize; /* sector size for the log, bytes */
+        uint32_t      sb_logsunit;    /* stripe unit size for the log */
+        uint32_t      sb_features2;   /* additional feature bits */
 
         /*
          * bad features2 field as a result of failing to pad the sb structure to
@@ -170,17 +170,17 @@ struct xfs_sb
          * the value in sb_features2 when formatting the incore superblock to
          * the disk buffer.
          */
-        __uint32_t      sb_bad_features2;
+        uint32_t      sb_bad_features2;
 
         /* version 5 superblock fields start here */
 
         /* feature masks */
-        __uint32_t      sb_features_compat;
-        __uint32_t      sb_features_ro_compat;
-        __uint32_t      sb_features_incompat;
-        __uint32_t      sb_features_log_incompat;
+        uint32_t      sb_features_compat;
+        uint32_t      sb_features_ro_compat;
+        uint32_t      sb_features_incompat;
+        uint32_t      sb_features_log_incompat;
 
-        __uint32_t      sb_crc;         /* superblock crc */
+        uint32_t      sb_crc;         /* superblock crc */
         xfs_extlen_t    sb_spino_align; /* sparse inode chunk alignment */
 
         xfs_ino_t       sb_pquotino;    /* project quota inode */
--- src/devinfo.c.orig	2016-01-03 10:01:52.090632971 +0100
+++ src/devinfo.c	2016-01-03 10:02:02.953737725 +0100
@@ -21,6 +21,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <limits.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
