Index | Thread | Search

From:
Brad Smith <brad@comstyle.com>
Subject:
Re: Fix multimedia/dav1d on riscv64
To:
ports@openbsd.org
Date:
Sun, 29 Dec 2024 06:03:56 -0500

Download raw body.

Thread
On 2024-12-25 1:40 p.m., Jeremie Courreges-Anglas wrote:
> On Wed, Dec 25, 2024 at 06:48:01PM +0100, Jeremie Courreges-Anglas wrote:
>> Latest dav1d fails to build because llvm-16 doesn't support ".option
>> arch ..." on risc-v.  llvm-17 from ports fixes that problem, but the
>> code in tests/checkasm/checkasm.h then fails because it assumes that
>> CLOKC_MONOTONIC_RAW is available.  That could also be worked around
>> but:
>> 1. we don't have kernel support for the Vector extension anyway, so it
>> currently doesn't bring any value anyway
>> 2. adding another special llvm version requirement means we'll have to
>> handle it one day when updating base-clang and/or dropping
>> devel/llvm/17
>>
>> So the diff below drops asm on riscv64 and lets dav1d build there.
> Updated comment to point out that there's no point in enabling that
> asm code as long as our kernel doesn't support the Vector extension.
> The idea is to avoid pointless testing if we get llvm>=17 in base
> before kernel Vector support.
>
>> ok?

I thought I had pushed a fix for CLOCK_MONOTONIC_RAW. I have done so.

Yes, this is fine. I don't care until the base compiler is updated.


>> Index: Makefile
>> ===================================================================
>> RCS file: /home/cvs/ports/multimedia/dav1d/Makefile,v
>> diff -u -p -r1.40 Makefile
>> --- Makefile	10 Dec 2024 12:14:18 -0000	1.40
>> +++ Makefile	25 Dec 2024 18:35:24 -0000
>> @@ -34,8 +34,12 @@ BUILD_DEPENDS+=	devel/nasm
>>   CONFIGURE_ARGS+=-Ddefault_library=both \
>>   		-Dxxhash_muxer=disabled
>>   
>> -.if ${MACHINE_ARCH} == "arm"
>> +# riscv64 RVV asm code needs llvm>=17
>> +# Revisit when our kernel starts supporting the Vector extension
>> +.if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "riscv64"
>>   CONFIGURE_ARGS+=-Denable_asm=false
>> +.endif
>> +.if ${MACHINE_ARCH} == "arm"
>>   # XXX SIGBUS otherwise
>>   CFLAGS+=	-O1
>>   #CFLAGS+=	-fno-slp-vectorize
>>
>>