summaryrefslogtreecommitdiffstats
path: root/package/xfsprogs/0002-libxfs-do-not-try-to-run-the-crc32selftest.patch
diff options
context:
space:
mode:
Diffstat (limited to 'package/xfsprogs/0002-libxfs-do-not-try-to-run-the-crc32selftest.patch')
-rw-r--r--package/xfsprogs/0002-libxfs-do-not-try-to-run-the-crc32selftest.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/package/xfsprogs/0002-libxfs-do-not-try-to-run-the-crc32selftest.patch b/package/xfsprogs/0002-libxfs-do-not-try-to-run-the-crc32selftest.patch
new file mode 100644
index 0000000000..3839713237
--- /dev/null
+++ b/package/xfsprogs/0002-libxfs-do-not-try-to-run-the-crc32selftest.patch
@@ -0,0 +1,42 @@
+From e10089b31afab3ba86904e89c740cd7051dd5066 Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <yann.morin.1998@free.fr>
+Date: Sun, 18 Dec 2016 15:37:27 +0100
+Subject: [PATCH] libxfs: do not try to run the crc32selftest
+
+Even though the crc32selftest is natively compiled (because it is to be
+executed), it fails in cross-compilation as the host may lack the
+required headers, like uuid/uuid.h (e.g. in a minimal environment).
+
+Moreover, running the crc32selftest natively is completely wrong,
+because it passing on the host does not mean it would still pass n the
+target (because endianness or bitness or alignment differences).
+
+So, just disable running the crc32selftest altogether.
+
+Note that there's a remaining bug-in-hiding, because the crc32 table
+generator is natively built, but with the target CFLAGS.
+
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+---
+ libxfs/Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libxfs/Makefile b/libxfs/Makefile
+index 6499731..5a07723 100644
+--- a/libxfs/Makefile
++++ b/libxfs/Makefile
+@@ -118,9 +118,9 @@ LTLIBS = $(LIBPTHREAD) $(LIBRT)
+ # don't try linking xfs_repair with a debug libxfs.
+ DEBUG = -DNDEBUG
+
+-LDIRT = gen_crc32table crc32table.h crc32selftest
++LDIRT = gen_crc32table crc32table.h
+
+-default: crc32selftest ltdepend $(LTLIBRARY)
++default: ltdepend $(LTLIBRARY)
+
+ crc32table.h: gen_crc32table.c
+ @echo " [CC] gen_crc32table"
+--
+2.7.4
+
OpenPOWER on IntegriCloud