[FFmpeg-trac] #11520(avutil:new): Build failure on riscv64/musl due to undefined __NR_riscv_hwprobe

FFmpeg trac at avcodec.org
Wed Mar 19 02:20:38 EET 2025


#11520: Build failure on riscv64/musl due to undefined __NR_riscv_hwprobe
-------------------------------------+-------------------------------------
             Reporter:  Michael      |                     Type:  defect
  Orlitzky                           |
               Status:  new          |                 Priority:  normal
            Component:  avutil       |                  Version:  7.1
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 The build currently fails on riscv/musl because `__NR_riscv_hwprobe` is
 undefined in libavutil/riscv/cpu.c,

 {{{#!C
 #elif HAVE_ASM_HWPROBE_H
 #include <asm/hwprobe.h>
 #include <sys/syscall.h>
 #include <unistd.h>

 static int __riscv_hwprobe(struct riscv_hwprobe *pairs, size_t pair_count,
                            size_t cpu_count, unsigned long *cpus,
                            unsigned int flags)
 {
         return syscall(__NR_riscv_hwprobe, pairs, pair_count, cpu_count,
 cpus,
                        flags);
 }
 #endif
 }}}

 A similar issue was fixed in OpenSSL by
 https://github.com/openssl/openssl/pull/25787

 This is probably a combination of musl and the frankenkernels that are
 still required for most riscv machines. I'm stuck on 6.1.80, for example.

 I was able to hack around it by changing the two tests for
 `HAVE_ASM_HWPROBE_H` in that file to include also a check for
 `defined(__NR_riscv_hwprobe)`.
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/11520>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list