patch taken from sabotage linux -- https://github.com/rofl0r/sabotage
diff -aur util-linux-2.23.1.org/fdisks/cfdisk.c util-linux-2.23.1/fdisks/cfdisk.c
--- util-linux-2.23.1.org/fdisks/cfdisk.c	2013-07-01 21:37:58.508000002 +0000
+++ util-linux-2.23.1/fdisks/cfdisk.c	2013-07-01 22:00:23.042000002 +0000
@@ -325,7 +325,7 @@
 int logical = 0;
 long long logical_sectors[MAXIMUM_PARTS];
 
-__sighandler_t old_SIGINT, old_SIGTERM;
+sighandler_t old_SIGINT, old_SIGTERM;
 
 int arrow_cursor = FALSE;
 int display_units = MEGABYTES;
diff -aur util-linux-2.23.1.org/fdisks/fdisksunlabel.c util-linux-2.23.1/fdisks/fdisksunlabel.c
--- util-linux-2.23.1.org/fdisks/fdisksunlabel.c	2013-07-01 21:37:58.508000002 +0000
+++ util-linux-2.23.1/fdisks/fdisksunlabel.c	2013-07-01 21:59:43.721000002 +0000
@@ -383,9 +383,11 @@
 	}
 }
 
-static int verify_sun_cmp(int *a, int *b, void *data)
+static void* cmp_data;
+static int verify_sun_cmp(const void *pa, const void *pb)
 {
-    unsigned int *verify_sun_starts = (unsigned int *) data;
+    const int *a = pa, *b = pb;
+    unsigned int *verify_sun_starts = (unsigned int *) cmp_data;
 
     if (*a == -1)
 	    return 1;
@@ -449,9 +451,8 @@
         else
             array[i] = -1;
     }
-    qsort_r(array,ARRAY_SIZE(array),sizeof(array[0]),
-	  (int (*)(const void *,const void *,void *)) verify_sun_cmp,
-	  verify_sun_starts);
+    cmp_data = verify_sun_starts;
+    qsort(array,ARRAY_SIZE(array),sizeof(array[0]), verify_sun_cmp);
 
     if (array[0] == -1) {
 	fdisk_info(cxt, _("No partitions defined"));
diff -aur util-linux-2.23.1.org/include/ttyutils.h util-linux-2.23.1/include/ttyutils.h
--- util-linux-2.23.1.org/include/ttyutils.h	2013-05-27 10:45:06.000000000 -0300
+++ util-linux-2.23.1/include/ttyutils.h	2013-07-05 12:19:54.000000000 -0300
@@ -10,6 +10,7 @@
 #include <stdlib.h>
 #include <termios.h>
 #include <limits.h>
+#include <sys/ttydefaults.h>
 #ifdef HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
 #endif
diff -aur util-linux-2.23.1.org/term-utils/setterm.c util-linux-2.23.1/term-utils/setterm.c
--- util-linux-2.23.1.org/term-utils/setterm.c	2013-07-01 21:37:58.442000002 +0000
+++ util-linux-2.23.1/term-utils/setterm.c	2013-07-01 22:02:54.244000002 +0000
@@ -123,7 +123,7 @@
 #include "nls.h"
 #include "closestream.h"
 
-#if __GNU_LIBRARY__ < 5
+#if defined(__GLIBC__) && __GNU_LIBRARY__ < 5
 #ifndef __alpha__
 # include <linux/unistd.h>
 #define __NR_klogctl __NR_syslog
diff -aur util-linux-2.23.1.org/term-utils/ttymsg.c util-linux-2.23.1/term-utils/ttymsg.c
--- util-linux-2.23.1.org/term-utils/ttymsg.c	2013-07-01 21:37:58.442000002 +0000
+++ util-linux-2.23.1/term-utils/ttymsg.c	2013-07-01 22:07:02.788000002 +0000
@@ -41,6 +41,7 @@
   */
 
 #include <sys/types.h>
+#include <sys/param.h>
 #include <sys/uio.h>
 #include <signal.h>
 #include <fcntl.h>
diff -aur util-linux-2.23.1.org/text-utils/hexdump.h util-linux-2.23.1/text-utils/hexdump.h
--- util-linux-2.23.1.org/text-utils/hexdump.h	2013-07-01 21:37:58.437000002 +0000
+++ util-linux-2.23.1/text-utils/hexdump.h	2013-07-01 22:01:27.005000002 +0000
@@ -32,7 +32,7 @@
  *
  *	@(#)hexdump.h	5.4 (Berkeley) 6/1/90
  */
-
+#include <sys/types.h>
 typedef struct _pr {
 	struct _pr *nextpr;		/* next print unit */
 #define	F_ADDRESS	0x001		/* print offset */
diff -aur util-linux-2.23.1.org/text-utils/pg.c util-linux-2.23.1/text-utils/pg.c
--- util-linux-2.23.1.org/text-utils/pg.c	2013-07-01 21:37:58.437000002 +0000
+++ util-linux-2.23.1/text-utils/pg.c	2013-07-01 22:01:55.831000002 +0000
@@ -37,7 +37,7 @@
 #ifndef	TIOCGWINSZ
 # include <sys/ioctl.h>
 #endif
-#include <sys/termios.h>
+#include <termios.h>
 #include <fcntl.h>
 #include <regex.h>
 #include <stdio.h>
