]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
liblzma: Use attribute no_profile_instrument_function with ifunc.
authorJia Tan <jiat0218@gmail.com>
Mon, 4 Mar 2024 16:34:46 +0000 (00:34 +0800)
committerJia Tan <jiat0218@gmail.com>
Mon, 4 Mar 2024 17:54:30 +0000 (01:54 +0800)
Thanks to Sam James for determining this was the attribute needed to
workaround the GCC bug and for his version of the patch in Gentoo.

src/liblzma/check/crc32_fast.c
src/liblzma/check/crc64_fast.c

index 5e26914a4d1babb2bb7bfd16aa6503f2e0ea4173..079051f12058978581388283c7507d3feef3c702 100644 (file)
@@ -135,6 +135,11 @@ typedef uint32_t (*crc32_func_type)(
 // This resolver is shared between all three dispatch methods. It serves as
 // the ifunc resolver if ifunc is supported, otherwise it is called as a
 // regular function by the constructor or first call resolution methods.
+// The __no_profile_instrument_function__ attribute support is checked when
+// determining if ifunc can be used, so it is safe to use here.
+#ifdef CRC_USE_IFUNC
+__attribute__((__no_profile_instrument_function__))
+#endif
 static crc32_func_type
 crc32_resolve(void)
 {
index f29fe3d3c5e63b444d4d221212bcce1611cc9696..5728b45ea06ea68d2430cc89acc940064440e1f9 100644 (file)
@@ -98,6 +98,9 @@ typedef uint64_t (*crc64_func_type)(
 #      pragma GCC diagnostic ignored "-Wunused-function"
 #endif
 
+#ifdef CRC_USE_IFUNC
+__attribute__((__no_profile_instrument_function__))
+#endif
 static crc64_func_type
 crc64_resolve(void)
 {