Index: squashfs-tools-4.6.1/squashfs-tools/mksquashfs.c
===================================================================
--- squashfs-tools-4.6.1.orig/squashfs-tools/mksquashfs.c
+++ squashfs-tools-4.6.1/squashfs-tools/mksquashfs.c
@@ -49,7 +49,7 @@
 #include <limits.h>
 #include <ctype.h>
 
-#ifdef __linux__
+#if defined(__linux__) || defined(__GNU__)
 #include <sys/sysinfo.h>
 #include <sys/sysmacros.h>
 #include <sched.h>
@@ -5257,6 +5257,8 @@ static void initialise_threads(int readq
 			processors = sysconf(_SC_NPROCESSORS_ONLN);
 		else
 			processors = CPU_COUNT(&cpu_set);
+#elif defined(__GNU__)
+		processors = 1;
 #else
 		int mib[2];
 		size_t len = sizeof(processors);
Index: squashfs-tools-4.6.1/squashfs-tools/unsquashfs.c
===================================================================
--- squashfs-tools-4.6.1.orig/squashfs-tools/unsquashfs.c
+++ squashfs-tools-4.6.1/squashfs-tools/unsquashfs.c
@@ -32,7 +32,7 @@
 #include "stdarg.h"
 #include "fnmatch_compat.h"
 
-#ifdef __linux__
+#if defined(__linux__) || defined(__GNU__)
 #include <sched.h>
 #include <sys/sysinfo.h>
 #include <sys/sysmacros.h>
@@ -2775,6 +2775,8 @@ void initialise_threads(int fragment_buf
 			processors = sysconf(_SC_NPROCESSORS_ONLN);
 		else
 			processors = CPU_COUNT(&cpu_set);
+#elif defined(__GNU__)
+		processors = 1;
 #else
 		int mib[2];
 		size_t len = sizeof(processors);
Index: squashfs-tools-4.6.1/squashfs-tools/endian_compat.h
===================================================================
--- squashfs-tools-4.6.1.orig/squashfs-tools/endian_compat.h
+++ squashfs-tools-4.6.1/squashfs-tools/endian_compat.h
@@ -23,7 +23,7 @@
  *
  * endian_compat.h
  */
-#ifndef linux
+#if !defined(linux) && !defined(__GNU__)
 #define __BYTE_ORDER BYTE_ORDER
 #define __BIG_ENDIAN BIG_ENDIAN
 #define __LITTLE_ENDIAN LITTLE_ENDIAN
