Summary: | multimedia/v4l-utils: fails to build with libepoll-shim 0.0.20220703 | ||
---|---|---|---|
Product: | Ports & Packages | Reporter: | Jan Beich <jbeich> |
Component: | Individual Port(s) | Assignee: | Hans Petter Selasky <hselasky> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | CC: | alexis.praga, hselasky, jan.kokemueller |
Priority: | --- | Keywords: | needs-patch |
Version: | Latest | Flags: | bugzilla:
maintainer-feedback?
(multimedia) |
Hardware: | Any | ||
OS: | Any | ||
See Also: | https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265021 | ||
Bug Depends on: | |||
Bug Blocks: | 265017 |
Description
Jan Beich
![]() ![]() Hi Jan, I think it is not a good idea to have a macro duped close(). Can you ask someone to replace all these macros open/close/read/write .... with static inline functions instead, in upstream? /usr/local/include/libepoll-shim/epoll-shim/detail/common.h:18:20: note: expanded from macro 'close' #define close(...) epoll_shim_close(__VA_ARGS__) --HPS If my suggestion is not possible, I will make a patch for the rshim, to avoid use of a function pointer named "close". --HPS Hi, Can epollshim do like this, for "close" and all other similar functions: #define close(...) close(__VA_ARGS__) static inline int close(int fd) { epoll_shim_close(fd); } #undef close Maybe you need a similar hack before including the global definition of close and friends too: #define close(...) close_not_used(__VA_ARGS__) #include <unistd.h> #undef close --HPS Would this also work? This replaces "f->close(f)" with "(f->close)(f)" similar to <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265021#c2>. diff --git a/multimedia/libv4l/Makefile b/multimedia/libv4l/Makefile index ff1a2d757e7..186f61d12ae 100644 --- a/multimedia/libv4l/Makefile +++ b/multimedia/libv4l/Makefile @@ -78,6 +78,11 @@ post-patch: # Don't build translation files for now @${REINPLACE_CMD} -e 's|v4l-utils-po libdvbv5-po||g' ${WRKSRC}/Makefile.am .endif +.if ${PORTNAME} == v4l-utils + @${REINPLACE_CMD} -e 's|\([^[:space:]]*\->close\)(|(\1)(|g' \ + ${WRKSRC}/utils/common/cv4l-helpers.h \ + ${WRKSRC}/utils/common/v4l-helpers.h +.endif # Remove old FreeBSD include files (to be removed upstream) @${RM} -r ${WRKSRC}/contrib/freebsd/include/* # Create symbolic link for Linux sources This will be fixed in libepoll-shim. Working on upstream patch! I see epoll-shim already has interpose support. So I guess that's what we need to use. Let me just set a build environment to test. (In reply to Hans Petter Selasky from comment #6) Hi, Did you manage to fix this issue ? We may have a similar problem in : https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265393. Thanks (In reply to Alexis Praga from comment #7) Hi, Have a look at the diffs in this change: https://cgit.freebsd.org/ports/commit/?id=04db4ece5bdc66c75c8c4ff557e20a06c99e8bf0 Basically the epoll shim now has two interfaces, one which uses the macros and one which use the interpose support (correct way). --HPS |