]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
liblzma: CRC CLMUL: Omit is_arch_extension_supported() when not needed
authorLasse Collin <lasse.collin@tukaani.org>
Sun, 16 Jun 2024 10:39:37 +0000 (13:39 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Fri, 6 Sep 2024 16:00:30 +0000 (19:00 +0300)
On E2K the function compiles only due to compiler emulation but the
function is never used. It's cleaner to omit the function when it's
not needed even though it's a "static inline" function.

Thanks to Ilya Kurdyukov.

(cherry picked from commit 30a2d5d51006301a3ddab5ef1f5ff0a9d74dce6f)

src/liblzma/check/crc_x86_clmul.h

index 6baf83eb83e4b26751a44b05a420d5f7c7dbd851..50306e49a72aabf1d284dd041c5f014970a76e82 100644 (file)
@@ -385,6 +385,9 @@ crc64_arch_optimized(const uint8_t *buf, size_t size, uint64_t crc)
 #endif // BUILDING_CRC64_CLMUL
 
 
+// Even though this is an inline function, compile it only when needed.
+// This way it won't appear in E2K builds at all.
+#if defined(CRC32_GENERIC) || defined(CRC64_GENERIC)
 // Inlining this function duplicates the function body in crc32_resolve() and
 // crc64_resolve(), but this is acceptable because this is a tiny function.
 static inline bool
@@ -426,3 +429,4 @@ is_arch_extension_supported(void)
        // code as is it only reads a variable set at startup but a few bytes
        // doesn't matter here.
 }
+#endif