From: Daniel Salzman Date: Sat, 18 Oct 2025 17:10:10 +0000 (+0200) Subject: kru: fix collision if target architecture/optimization is specified X-Git-Tag: v3.4.9~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3dda7d7ec8aff71897144d797cf9424d6344ea38;p=thirdparty%2Fknot-dns.git kru: fix collision if target architecture/optimization is specified Related to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289611 --- diff --git a/src/knot/modules/rrl/kru-avx2.c b/src/knot/modules/rrl/kru-avx2.c index 4e7a939191..8f484e4213 100644 --- a/src/knot/modules/rrl/kru-avx2.c +++ b/src/knot/modules/rrl/kru-avx2.c @@ -20,8 +20,11 @@ // This file has code for new-ish x86 (2015+ usually, Atom 2021+) - AES + AVX2 #ifdef __clang__ - #pragma clang attribute push (__attribute__((target("arch=x86-64-v3,aes"))), \ - apply_to = function) + // Force using specific instructions only if target architecture/optimization not specified + #if !defined(__AVX2__) + #pragma clang attribute push (__attribute__((target("arch=x86-64-v3,aes"))), \ + apply_to = function) + #endif #else #pragma GCC push_options #if __GNUC__ >= 11 @@ -41,7 +44,9 @@ const struct kru_api KRU_AVX2 = KRU_API_INITIALIZER; #ifdef __clang__ - #pragma clang attribute pop + #if !defined(__AVX2__) + #pragma clang attribute pop + #endif #else #pragma GCC pop_options #endif