From: Lasse Collin Date: Sun, 16 Jun 2024 10:39:37 +0000 (+0300) Subject: liblzma: CRC CLMUL: Omit is_arch_extension_supported() when not needed X-Git-Tag: v5.7.1alpha~213 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F127%2Fhead;p=thirdparty%2Fxz.git liblzma: CRC CLMUL: Omit is_arch_extension_supported() when not needed 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. --- diff --git a/src/liblzma/check/crc_x86_clmul.h b/src/liblzma/check/crc_x86_clmul.h index 702cc202..92647654 100644 --- a/src/liblzma/check/crc_x86_clmul.h +++ b/src/liblzma/check/crc_x86_clmul.h @@ -335,6 +335,9 @@ crc64_arch_optimized(const uint8_t *buf, size_t size, uint64_t crc) } +// 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 @@ -376,3 +379,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