Skip to content

ffmpeg on riscv64#168

Open
samuelmarinsoto wants to merge 7 commits into
oasislinux:masterfrom
samuelmarinsoto:riscv64
Open

ffmpeg on riscv64#168
samuelmarinsoto wants to merge 7 commits into
oasislinux:masterfrom
samuelmarinsoto:riscv64

Conversation

@samuelmarinsoto
Copy link
Copy Markdown
Contributor

I was able to build ffmpeg, mpv, and dav1d on a riscv64 toolchain on an x86_64 alpine host. I believe these are the last packages. All sets now build with a riscv64 cross toolchain!

dav1d won't build without the x86 defs defined and set to 0 on riscv64
Gated x86-only features in config.h, and used paths[[]] to select source files for each architecture
@samuelmarinsoto
Copy link
Copy Markdown
Contributor Author

There are regressions with x86 builds, mainly due to redefinitions. I think its because awk is writing multiple defines into config.asm in dav1d and ffmpeg, but I'm not sure yet.

unifdef is needed to generate temporary header files that awk/sed/etc. can modify without producing redefines. This adds unifdef as a build dependency
the awk expression would make redefined macros due to the new arch guards in config.h. Pass config.h through unifdef first
the awk expression would make redefined macros due to the new arch guards in config.h. Pass config.h throughunifdef first.
@samuelmarinsoto
Copy link
Copy Markdown
Contributor Author

samuelmarinsoto commented May 27, 2026

Ok, I fixed the issue by using unifdef to evaluate the config.h's into a temporary header file without redefines. All packages build on x86_64 and riscv64. This does add unifdef as a build dependency. I think its minimal enough for oasis, but perhaps we could use the cpp ninja rule instead, if you prefer it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant