1
0
Fork 0
mirror of https://git.tukaani.org/xz.git synced 2024-04-04 12:36:23 +02:00

liblzma: Use attribute no_profile_instrument_function with ifunc.

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.
This commit is contained in:
Jia Tan 2024-03-05 00:34:46 +08:00
parent ed957d3942
commit 4e1c97052b
2 changed files with 8 additions and 0 deletions

View file

@ -135,6 +135,11 @@ typedef uint32_t (*crc32_func_type)(
// This resolver is shared between all three dispatch methods. It serves as // 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 // the ifunc resolver if ifunc is supported, otherwise it is called as a
// regular function by the constructor or first call resolution methods. // 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 static crc32_func_type
crc32_resolve(void) crc32_resolve(void)
{ {

View file

@ -98,6 +98,9 @@ typedef uint64_t (*crc64_func_type)(
# pragma GCC diagnostic ignored "-Wunused-function" # pragma GCC diagnostic ignored "-Wunused-function"
#endif #endif
#ifdef CRC_USE_IFUNC
__attribute__((__no_profile_instrument_function__))
#endif
static crc64_func_type static crc64_func_type
crc64_resolve(void) crc64_resolve(void)
{ {