When re-compiling sys-apps/systemd-239-r1 with sys-kernel/linux-headers-4.17 and glibc-2.28, it fails with a redefinition error: In file included from ../systemd-239/src/basic/missing.h:18, from ../systemd-239/src/basic/util.h:28, from ../systemd-239/src/basic/architecture.h:7, from ../systemd-239/src/libsystemd/sd-path/sd-path.c:8: /usr/include/linux/stat.h:18:8: error: redefinition of âstruct statx_timestampâ struct statx_timestamp { ^~~~~~~~~~~~~~~ In file included from /usr/include/sys/stat.h:446, from ../systemd-239/src/basic/util.h:19, from ../systemd-239/src/basic/architecture.h:7, from ../systemd-239/src/libsystemd/sd-path/sd-path.c:8: /usr/include/bits/statx.h:25:8: note: originally defined here struct statx_timestamp The kernel itself defines it at linux-4.17.12-gentoo/include/uapi/linux/stat.h and not at inux-4.17.12-gentoo/include/linux which should be mirrored by sys-kernel/linux-headers
systemd includes kernel's headers directly via systemd-239/src/basic/missing.h:18 #include <linux/stat.h> Normally only libc should do it and libc might define slightly different ABI for structs (they might adhere to a POSIX standard or older kernel ABI). I believe these two upstream systemd commits should fix it: commit 9c869d08d82c73f62ab3527567858ce4b0cf1257 Author: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> Date: Wed Jul 18 17:26:17 2018 +0200 meson: unify linux/stat.h check with other checks and use _GNU_SOURCE commit 75720bff62a84896e9a0654afc7cf9408cf89a38 Author: Filipe Brandenburger <filbranden@google.com> Date: Sun Jul 15 22:43:35 2018 -0700 build-sys: Detect whether struct statx is defined in sys/stat.h
(In reply to Sergei Trofimovich from comment #1) Got stuck with glibc-2.28 :-( It is possible to downgrade to 2.27 but it is painful so going forward... For me systemd is one of the 2 critical packages that don't compile/work with glibc-2.28. The other is qtcore Applied both patches mentioned here and it seems to work so far with systemd-239-r1 did the following for people not so familiar with git/patches/etc.. Assuming logged in as $USER 0. cd ~$USER/Downloads 1. git clone https://github.com/systemd/systemd.git 2. cd systemd 3. git format-patch 75720bff62a84896e9a0654afc7cf9408cf89a38~1..75720bff62a84896e9a0654afc7cf9408cf89a38 4. git format-patch 9c869d08d82c73f62ab3527567858ce4b0cf1257~1..9c869d08d82c73f62ab3527567858ce4b0cf1257 5. su 6. mkdir -p /etc/portage/patches/sys-apps/systemd-239-r1 7. cp ~$USER/Downloads/systemd/0001-* /etc/portage/patches/sys-apps/systemd-239-r1 8. emerge -v1 systemd
Created attachment 550960 [details] 01-statx-glibc-2.28.patch
Created attachment 550962 [details, diff] 02-statx-glibc-2.28.patch
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9189edf61c8e135c0cd28be3534d7624cafff239 commit 9189edf61c8e135c0cd28be3534d7624cafff239 Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2018-10-28 22:53:46 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2018-10-28 23:21:05 +0000 sys-apps/systemd: backport several patches for 239 Closes: https://bugs.gentoo.org/662776 Bug: https://bugs.gentoo.org/669664 Bug: https://bugs.gentoo.org/669716 Package-Manager: Portage-2.3.51_p2, Repoman-2.3.11_p27 Signed-off-by: Mike Gilbert <floppym@gentoo.org> sys-apps/systemd/Manifest | 1 + sys-apps/systemd/systemd-239-r2.ebuild | 448 +++++++++++++++++++++++++++++++++ 2 files changed, 449 insertions(+)
*** Bug 669560 has been marked as a duplicate of this bug. ***