Fails to build on ppc64 In file included from /var/tmp/portage/sys-apps/file-5.39/work/file-5.39/src/seccomp.c:34: /var/tmp/portage/sys-apps/file-5.39/work/file-5.39/src/seccomp.c: In function 'enable_sandbox_full': /var/tmp/portage/sys-apps/file-5.39/work/file-5.39/src/seccomp.c:194:19: error: invalid application of 'sizeof' to incomplete type 'struct termios' 194 | ALLOW_IOCTL_RULE(TCGETS); | ^~~~~~ /var/tmp/portage/sys-apps/file-5.39/work/file-5.39/src/seccomp.c:194:2: note: in expansion of macro 'ALLOW_IOCTL_RULE' 194 | ALLOW_IOCTL_RULE(TCGETS); | ^~~~~~~~~~~~~~~~ make[3]: *** [Makefile:558: seccomp.o] Error 1 make[3]: *** Waiting for unfinished jobs... seems to be related to https://bugs.astron.com/view.php?id=130
On PPC64, TCGETS is defined in terms of struct termios, so it must include termios.h adding #ifdef __powerpc64__ #include <termios.h> #endif to src/seccomp.c fixes the build.
Created attachment 644934 [details, diff] file-5.39-add-missing-termios.patch after speaking to some folks we figured it's ok to include unconditionally. on ppc, TCGETS relies on struct termios being complete, on other architectures it does not. so termios.h should be included before ioctl.h patch attached. it may need autoconf file changes to check for header probably.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3d32972fa6671b911726d7a2abd4128afd35a36b commit 3d32972fa6671b911726d7a2abd4128afd35a36b Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2020-06-28 02:07:30 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2020-06-28 02:08:13 +0000 sys-apps/file: revbump 5.39, add include termios.h patch Closes: https://bugs.gentoo.org/728416 Package-Manager: Portage-2.3.103, Repoman-2.3.23 Acked-by: Lars Wendler <polynomial-c@gentoo.org> Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> sys-apps/file/file-5.39-r2.ebuild | 141 +++++++++++++++++++++ .../file/files/file-5.39-add-missing-termios.patch | 27 ++++ 2 files changed, 168 insertions(+)