Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 662776 - =sys-apps/systemd-239-r1 fails to build against glibc-2.28: error: redefinition of 'struct statx_timestamp'
Summary: =sys-apps/systemd-239-r1 fails to build against glibc-2.28: error: redefiniti...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo systemd Team
Keywords: PATCH
: 669560 (view as bug list)
Depends on:
Blocks: glibc-2.28
  Show dependency tree
Reported: 2018-08-04 11:37 UTC by Helmut Jarausch
Modified: 2018-11-25 11:11 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---

01-statx-glibc-2.28.patch (01-statx-glibc-2.28.patch,3.46 KB, text/plain)
2018-10-13 10:18 UTC, Sergei Trofimovich (RETIRED)
02-statx-glibc-2.28.patch (02-statx-glibc-2.28.patch,2.49 KB, patch)
2018-10-13 10:18 UTC, Sergei Trofimovich (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Helmut Jarausch 2018-08-04 11:37:55 UTC
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


and not at inux-4.17.12-gentoo/include/linux which should be mirrored by
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2018-08-06 22:43:01 UTC
systemd includes kernel's headers directly via
    #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 <>
  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 <>
  Date:   Sun Jul 15 22:43:35 2018 -0700

    build-sys: Detect whether struct statx is defined in sys/stat.h
Comment 2 milan hodoscek 2018-09-19 08:31:54 UTC
(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
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
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2018-10-13 10:18:21 UTC
Created attachment 550960 [details]
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2018-10-13 10:18:39 UTC
Created attachment 550962 [details, diff]
Comment 5 Larry the Git Cow gentoo-dev 2018-10-28 23:21:14 UTC
The bug has been closed via the following commit(s):

commit 9189edf61c8e135c0cd28be3534d7624cafff239
Author:     Mike Gilbert <>
AuthorDate: 2018-10-28 22:53:46 +0000
Commit:     Mike Gilbert <>
CommitDate: 2018-10-28 23:21:05 +0000

    sys-apps/systemd: backport several patches for 239
    Package-Manager: Portage-2.3.51_p2, Repoman-2.3.11_p27
    Signed-off-by: Mike Gilbert <>

 sys-apps/systemd/Manifest              |   1 +
 sys-apps/systemd/systemd-239-r2.ebuild | 448 +++++++++++++++++++++++++++++++++
 2 files changed, 449 insertions(+)
Comment 6 Mike Gilbert gentoo-dev 2018-10-29 02:53:25 UTC
*** Bug 669560 has been marked as a duplicate of this bug. ***