--- /dev/null
+++ b/squashfs-tools/lzma_xz_options.h
-@@ -0,0 +1,112 @@
+@@ -0,0 +1,115 @@
+#ifndef LZMA_XZ_OPTIONS_H
+#define LZMA_XZ_OPTIONS_H
+/*
+#include <stdint.h>
+
+#ifndef linux
++#ifdef __FreeBSD__
++#include <machine/endian.h>
++#endif
+#define __BYTE_ORDER BYTE_ORDER
+#define __BIG_ENDIAN BIG_ENDIAN
+#define __LITTLE_ENDIAN LITTLE_ENDIAN
+ if (size != sizeof(struct lzma_opts))
+ goto failed;
+
-+ SQUASHFS_INSWAP_LZMA_COMP_OPTS(&comp_opts);
++ SQUASHFS_INSWAP_LZMA_COMP_OPTS(comp_opts);
+
+ options.flags = comp_opts->flags & LZMA_OPT_FLT_MASK;
+ options.preset = (comp_opts->flags & LZMA_OPT_PRE_MASK) >> LZMA_OPT_PRE_OFF;