]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
libfrog: drop build host crc32 selftest
authorKrzesimir Nowak <qdlacz@gmail.com>
Thu, 28 Sep 2023 11:23:38 +0000 (13:23 +0200)
committerCarlos Maiolino <cem@kernel.org>
Thu, 5 Oct 2023 12:57:25 +0000 (14:57 +0200)
CRC selftests running on a build host were useful long time ago, when
CRC support was added to the on-disk support. Now it's purpose is
replaced by fstests. Also mkfs.xfs and xfs_repair have their own
selftests.

On top of that, it adds a dependency on liburcu on the build host for
no reason - liburcu is not used by the crc32 selftest.

Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
libfrog/Makefile
libfrog/crc32.c

index f292afe381d59b4efae9045a3c5b878c0fd91785..8cde97d418f0a4a185306df089965a7a35119097 100644 (file)
@@ -57,9 +57,9 @@ ifeq ($(HAVE_GETMNTENT),yes)
 LCFLAGS += -DHAVE_GETMNTENT
 endif
 
-LDIRT = gen_crc32table crc32table.h crc32selftest
+LDIRT = gen_crc32table crc32table.h
 
-default: crc32selftest ltdepend $(LTLIBRARY)
+default: ltdepend $(LTLIBRARY)
 
 crc32table.h: gen_crc32table.c crc32defs.h
        @echo "    [CC]     gen_crc32table"
@@ -67,16 +67,6 @@ crc32table.h: gen_crc32table.c crc32defs.h
        @echo "    [GENERATE] $@"
        $(Q) ./gen_crc32table > crc32table.h
 
-# The selftest binary will return an error if it fails. This is made a
-# dependency of the build process so that we refuse to build the tools on broken
-# systems/architectures. Hence we make sure that xfsprogs will never use a
-# busted CRC calculation at build time and hence avoid putting bad CRCs down on
-# disk.
-crc32selftest: gen_crc32table.c crc32table.h crc32.c crc32defs.h randbytes.c
-       @echo "    [TEST]    CRC32"
-       $(Q) $(BUILD_CC) $(BUILD_CFLAGS) -D CRC32_SELFTEST=1 randbytes.c crc32.c -o $@
-       $(Q) ./$@
-
 include $(BUILDRULES)
 
 install install-dev: default
index 2499615df000405ee5bbe5fcca336139ee36f1e3..d07e53712c0ff20eb084b6dd9961096eee31b6d7 100644 (file)
@@ -186,24 +186,3 @@ u32 __pure crc32c_le(u32 crc, unsigned char const *p, size_t len)
                        (const u32 (*)[256])crc32ctable_le, CRC32C_POLY_LE);
 }
 #endif
-
-
-#ifdef CRC32_SELFTEST
-# include "crc32cselftest.h"
-
-/*
- * make sure we always return 0 for a successful test run, and non-zero for a
- * failed run. The build infrastructure is looking for this information to
- * determine whether to allow the build to proceed.
- */
-int main(int argc, char **argv)
-{
-       int errors;
-
-       printf("CRC_LE_BITS = %d\n", CRC_LE_BITS);
-
-       errors = crc32c_test(0);
-
-       return errors != 0;
-}
-#endif /* CRC32_SELFTEST */