On Thu, 23 Oct 2025, Rémi Denis-Courmont via ffmpeg-devel wrote:



Le 23 octobre 2025 00:01:55 GMT+03:00, "Martin Storsjö" <[email protected]> a 
écrit :
On Wed, 22 Oct 2025, Rémi Denis-Courmont via ffmpeg-devel wrote:

If you want to compile AArch64 FFmpeg for use in emulated x86 processes, then 
you need a FFmpeg that exposes the same ABI as the x86 FFmpeg. That's going to 
require a lot of changes throughout the code base (and I doubt people here will 
agree to them overall).

Can you elaborate on what changes you think would be needed?

You're supposed to expose the same binary interface as x86. This is obviously not working correctly for CPU flags, which *are* part of the public libavutil interface, AFAIK.

Yes - although most users of the DLLs won't touch these, so as long as all the libav* DLLs are built in the same form, this won't matter.

I don't know what else won't work and I'm not going to audit the code.

In arm64ec mode, the compiler defines __x86_64__ (or _M_X64) and does not define __aarch64__ (or _M_ARM64). It does define __arm64ec__ (or _M_ARM64EC) to distinguish it from regular x86_64 though.

Yes, and it seems extremely unlikely that that would just work. Any inline x86 assembler could break. And even if that did work, it would lack all Arm assembler optimisation so it would likely be worst than just using x86 FFmpeg and passing it through the JIT.

I guess that the code is instead compiled as normal AArch64 just with a different ABI, but then that doesn't work either as noted above.

Yes, it's built with ARCH_AARCH64 within ffmpeg, so it doesn't see the inline x86 assembler - and uses the aarch64 assembly.

Anyway, you're right that there are potential subtle ABI inconsistencies in this build mode. But it also practically seems to work fine. It's not a setup that I would go out and vouch support for - but for people willing to build it, it seems to practically be usable - without any further patches.

Offhand, I don't foresee any more patches being needed here (and Harish can maybe chime in if you had any more patches in your pipeline for this build mode?), other than potential minor build system tweaks. (The patch for makedef being discussed here seems ok to me, and I'll merge it soon.)

If other patches were to be suggested, that would be more invasive and affect maintainability, I agree that we should push back against including it. But these build system fixes seem fine.

// Martin
_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to