Skip to content
3 changes: 2 additions & 1 deletion pkg/dav1d/gen.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local arch = config.target.platform:match('[^-]*')
cflags{
'-Wall', '-Wno-maybe-uninitialized',
'-D _XOPEN_SOURCE=700',
Expand All @@ -6,7 +7,7 @@ cflags{
'-I $srcdir/tools',
'-I $outdir',
'-I $outdir/include/dav1d',
'-I $dir',
arch == 'riscv64' and '-I $dir/riscv' or '-I $dir',
}
nasmflags{
'-i $srcdir/src/',
Expand Down
17 changes: 17 additions & 0 deletions pkg/dav1d/riscv/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#define ARCH_AARCH64 0
#define ARCH_ARM 0
#define ARCH_PPC64LE 0
#define ARCH_X86 0
#define ARCH_X86_32 0
#define ARCH_X86_64 0
#define CONFIG_16BPC 1
#define CONFIG_8BPC 1
#define CONFIG_LOG 1
#define ENDIANNESS_BIG 0
#define HAVE_ASM 1
Comment thread
michaelforney marked this conversation as resolved.
Outdated
#define HAVE_AVX512ICL 1
#define HAVE_CLOCK_GETTIME 1
#define HAVE_DLSYM 1
#define HAVE_POSIX_MEMALIGN 1
#define HAVE_UNISTD_H 1
#define STACK_ALIGNMENT 32
3 changes: 2 additions & 1 deletion pkg/libffi/gen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ build('sed', '$outdir/include/ffi.h', '$srcdir/include/ffi.h.in', {
})

pkg.hdrs = {
copy('$outdir/include', '$srcdir/src/'..({x86_64='x86', aarch64='aarch64'})[arch], {'ffitarget.h'}),
copy('$outdir/include', '$srcdir/src/'..({x86_64='x86', aarch64='aarch64', riscv64='riscv'})[arch], {'ffitarget.h'}),
'$outdir/include/ffi.h',
install=true,
}
Expand All @@ -31,6 +31,7 @@ lib('libffi.a', [[
prep_cif.c types.c raw_api.c java_raw_api.c closures.c
@aarch64 aarch64/(ffi.c sysv.S)
@x86_64 x86/(ffi64.c unix64.S ffiw64.c win64.S)
@riscv64 riscv/(ffi.c sysv.S)
)
]])
file('lib/libffi.a', '644', '$outdir/libffi.a')
Expand Down
1 change: 1 addition & 0 deletions pkg/linux-headers/gen.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
local arch = ({
aarch64='arm64',
x86_64='x86',
riscv64='riscv',
})[config.target.platform:match('[^-]*')]
sub('tools.ninja', function()
toolchain(config.host)
Expand Down
25 changes: 25 additions & 0 deletions pkg/linux-headers/riscv.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
return {
-- <cd src/arch/riscv/include/uapi && find * -name '*.h' -exec printf "\t'%s',\n" {} + | LC_COLLATE=C sort
'asm/auxvec.h',
'asm/bitsperlong.h',
'asm/bpf_perf_event.h',
'asm/byteorder.h',
'asm/elf.h',
'asm/hwcap.h',
'asm/hwprobe.h',
'asm/kvm.h',
'asm/perf_regs.h',
'asm/ptrace.h',
'asm/setup.h',
'asm/sigcontext.h',
'asm/ucontext.h',
'asm/unistd.h',
'asm/vendor/mips.h',
'asm/vendor/sifive.h',
'asm/vendor/thead.h',
unistd = {},
Comment thread
michaelforney marked this conversation as resolved.
Outdated
generic={
-- <awk '$1 == "generic-y" {printf "\\t\\t'\'%s\'',\\n", $3}' src/arch/riscv/include/uapi/asm/Kbuild
'kvm_para.h',
Comment thread
michaelforney marked this conversation as resolved.
Outdated
},
}