avutil/x86/aes: Only assemble iff HAVE_AESNI_EXTERNAL

This avoids relying on DCE and works around a NASM bug [1].

[1]: https://github.com/netwide-assembler/nasm/issues/216

Reviewed-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2026-03-28 10:46:17 +01:00
parent 4c179adeaf
commit 5c88f46c92
3 changed files with 3 additions and 5 deletions

View File

@@ -237,7 +237,7 @@ int av_aes_init(AVAES *a, const uint8_t *key, int key_bits, int decrypt)
a->rounds = rounds;
a->crypt = decrypt ? aes_decrypt : aes_encrypt;
#if ARCH_X86 && HAVE_X86ASM
#if ARCH_X86 && HAVE_X86ASM && HAVE_AESNI_EXTERNAL
ff_init_aes_x86(a, decrypt);
#endif

View File

@@ -2,8 +2,7 @@ OBJS += x86/cpu.o \
EMMS_OBJS_$(HAVE_MMX_INLINE)_$(HAVE_MMX_EXTERNAL)_$(HAVE_MM_EMPTY) = x86/emms.o
X86ASM-OBJS += x86/aes.o x86/aes_init.o \
x86/cpuid.o \
X86ASM-OBJS += x86/cpuid.o \
x86/crc.o \
$(EMMS_OBJS__yes_) \
x86/fixed_dsp.o x86/fixed_dsp_init.o \
@@ -12,4 +11,5 @@ X86ASM-OBJS += x86/aes.o x86/aes_init.o \
x86/lls.o x86/lls_init.o \
x86/tx_float.o x86/tx_float_init.o \
X86ASM-OBJS-$(HAVE_AESNI_EXTERNAL) += x86/aes.o x86/aes_init.o
X86ASM-OBJS-$(CONFIG_PIXELUTILS) += x86/pixelutils.o

View File

@@ -86,7 +86,6 @@ cglobal aes_%1rypt_%2, 5, 5, 2
REP_RET
%endmacro
%if HAVE_AESNI_EXTERNAL
INIT_XMM aesni
AES_CRYPT enc, 10
AES_CRYPT enc, 12
@@ -94,4 +93,3 @@ AES_CRYPT enc, 14
AES_CRYPT dec, 10
AES_CRYPT dec, 12
AES_CRYPT dec, 14
%endif