Apply bug 265017 then try to build. See also 265021 comment 1. $ make [...] In file included from v4l2-ctl.cpp:31: In file included from ./v4l2-ctl.h:26: In file included from ../../utils/common/cv4l-helpers.h:13: ../../utils/common/v4l-helpers.h:248:15: error: no member named 'epoll_shim_close' in 'v4l_fd' int res = f->close(f); ~ ^ /usr/local/include/libepoll-shim/epoll-shim/detail/common.h:18:20: note: expanded from macro 'close' #define close(...) epoll_shim_close(__VA_ARGS__) ^ In file included from v4l2-ctl.cpp:31: In file included from ./v4l2-ctl.h:26: In file included from ../../utils/common/cv4l-helpers.h:13: ../../utils/common/v4l-helpers.h:462:6: error: no member named 'epoll_shim_close' in 'v4l_fd' f->close(f); ~ ^ /usr/local/include/libepoll-shim/epoll-shim/detail/common.h:18:20: note: expanded from macro 'close' #define close(...) epoll_shim_close(__VA_ARGS__) ^ In file included from v4l2-ctl.cpp:31: In file included from ./v4l2-ctl.h:26: In file included from ../../utils/common/cv4l-helpers.h:13: ../../utils/common/v4l-helpers.h:511:6: error: no member named 'epoll_shim_close' in 'v4l_fd' f->close(f); ~ ^ /usr/local/include/libepoll-shim/epoll-shim/detail/common.h:18:20: note: expanded from macro 'close' #define close(...) epoll_shim_close(__VA_ARGS__) ^ In file included from v4l2-ctl.cpp:31: In file included from ./v4l2-ctl.h:26: In file included from ../../utils/common/cv4l-helpers.h:13: ../../utils/common/v4l-helpers.h:544:6: error: no member named 'epoll_shim_close' in 'v4l_fd' f->close(f); ~ ^ /usr/local/include/libepoll-shim/epoll-shim/detail/common.h:18:20: note: expanded from macro 'close' #define close(...) epoll_shim_close(__VA_ARGS__) ^ In file included from v4l2-ctl.cpp:31: In file included from ./v4l2-ctl.h:26: In file included from ../../utils/common/cv4l-helpers.h:13: ../../utils/common/v4l-helpers.h:576:5: error: no member named 'epoll_shim_close' in 'v4l_fd' f->close(f); ~ ^ /usr/local/include/libepoll-shim/epoll-shim/detail/common.h:18:20: note: expanded from macro 'close' #define close(...) epoll_shim_close(__VA_ARGS__) ^
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