On Sun, Feb 19, 2023 at 06:42:44PM +0000, Klemens Nanni wrote:
> Still waiting for pkg_add and then my build to finish, but the idea is
> 
> - make the existing maros NO-OPs, align with spaces to make it obvious
> - remove includes/defines to break any left-over syscalls
> 
> I didn't see a knob to fix this properly.

Since the presence of __syscall(2) breaks the build of ffmpeg on sparc64
(collect2 notices the missing symbol and refuses to link conftest), I'd
like to fix this. While we will eventually need to sort out the
syscall(2) usage as well, I think this is a distraction right now.

I suggest we go with this diff:

Index: Makefile
===================================================================
RCS file: /cvs/ports/multimedia/libv4l/Makefile,v
retrieving revision 1.29
diff -u -p -r1.29 Makefile
--- Makefile    2 Sep 2022 09:42:27 -0000       1.29
+++ Makefile    3 Mar 2023 04:01:57 -0000
@@ -3,7 +3,7 @@ COMMENT =               libv4l userspace library
 VERSION =              1.20.0
 DISTNAME =             v4l-utils-${VERSION}
 PKGNAME =              libv4l-${VERSION}
-REVISION =             2
+REVISION =             3
 
 SHARED_LIBS += v4l1            0.0 # 0.0
 SHARED_LIBS += v4l2            0.0 # 0.0
Index: patches/patch-lib_libv4lconvert_libv4lsyscall-priv_h
===================================================================
RCS file: patches/patch-lib_libv4lconvert_libv4lsyscall-priv_h
diff -N patches/patch-lib_libv4lconvert_libv4lsyscall-priv_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_libv4lconvert_libv4lsyscall-priv_h        3 Mar 2023 
04:01:48 -0000
@@ -0,0 +1,18 @@
+The redirection of mmap through __syscall(2) is broken in multiple ways.
+Just call mmap directly.
+
+Index: lib/libv4lconvert/libv4lsyscall-priv.h
+--- lib/libv4lconvert/libv4lsyscall-priv.h.orig
++++ lib/libv4lconvert/libv4lsyscall-priv.h
+@@ -107,10 +107,7 @@
+       syscall(SYS_mmap, (void *)(addr), (size_t)(len), \
+                       (int)(prot), (int)(flags), (int)(fd), (off_t)(off))
+ #elif defined(__OpenBSD__)
+-register_t __syscall(quad_t, ...);
+-#define SYS_MMAP(addr, len, prot, flags, fd, offset) \
+-      __syscall((quad_t)SYS_mmap, (void *)(addr), (size_t)(len), \
+-                      (int)(prot), (int)(flags), (int)(fd), 0, 
(off_t)(offset))
++#define SYS_MMAP mmap
+ #else
+ #define SYS_MMAP(addr, len, prot, flags, fd, off) \
+       syscall(SYS_mmap2, (void *)(addr), (size_t)(len), \

Reply via email to