ffmpeg-build-script
ffmpeg-build-script copied to clipboard
Problem with dav1d on Intel Mac or Rosetta 2
I successfully compiled this script with dav1d on M1 Mac (arm64 build).
It fails when I compile this script in Terminal under Rosetta 2 to create x86-64 build on M1 Mac.
Also it fails to compile on real Intel Mac to create x86-64 build.
I successfully compiled this script with dav1d on M1 Mac (arm64 build).
It fails when I compile this script in Terminal under Rosetta 2 to create x86-64 build on M1 Mac.
Also it fails to compile on real Intel Mac to create x86-64 build.
Build logs would be helpful to fix the situation.
The problem occurs only with compilation under Rosetta 2 emulation for Terminal app (to compile for x86-64). I just checked again on another Intel Mac - no problem.
Logs for Rosetta 2:
https://drive.google.com/file/d/1paQUgei9VTBHD203a8uyTnaZykGzuhcf/view?usp=sharing
`../src/arm/64/itx.S:3267:21: error: unknown token in expression add sp, x5, #16322 ^ ../src/arm/64/itx.S:3268:9: error: invalid instruction mnemonic 'br' br x15 ^~ [70/135] Compiling C object src/libdav1d.a.p/decode.c.o ninja: build stopped: subcommand failed.
Failed to Execute ninja -C build`
I could just gather some facts.
- MacOS Runner in GitHub Actions uses Intel CPU
- Apple Silicon M1 is natively arm64
- On the other hand, Intel on Macs are still x86_64
- Rosetta 2 translates Intel-Apps for Apple Silicon
But,
- Rosetta cannot translate kernel extensions or Virtual Machine apps that virtualize x86_64 computer platforms. Developers should be aware that Rosetta is also unable to translate AVX, AVX2, and AVX512 vector instructions.
So,
- Maybe the translation of those CPU-specific instructions are failing 🤔
- Or maybe the env variable
ARCHis still set toarm64even when the script runs inside Rosetta 2. If building forx86_64, meson should've not build objects fromarm64source folder 🤔
I checked pipeline builds of libdav1d in videolan's repo for all architecture. arm7, arm64, x86_64, - all passed successfully.
I can't debug the process. But maybe others could lend a hand.
Thanks for testing! Probably this issue will be fixed by dav1d team later. I'll use Intel Mac for compilation.