Created attachment 7131 [details] workaround Building systemd will fail due to a bug in GCC if we're using the buildroot GCC 7.X toolchain and have enable optimization (-O3). That is: BR2_OPTIMIZE_3=y BR2_GCC_VERSION_7_X=y BR2_GCC_VERSION="7.1.0" The problem is with GCC's nonnull detection (there's nothing wrong with the systemd code in question) and it looks like it has been fixed upstream but we don't have the backported fix in Buildroot: https://github.com/systemd/systemd/issues/6119 A quick workaround is to patch systemd with the attached patch but it seems that GCC should have some patches backported.
Thanks for the report! Can you figure out the corresponding gcc PR, and therefore the gcc commit that fixes this ? Thanks!
I'm having trouble tracking it down. From the systemd bug tracker discussion it looks like "7.1.1" addresses this but there's no such release. The Fedora package they mention is assumed to have the fix but I can't find anything in the changelog or referenced bug IDs that seems relevant. I'll keep searching.
Ah, not a systemd bug; I relinquish it...
This is in systemd upstream by commit https://github.com/systemd/systemd/commit/fb1b58820fc4622a3b7f54b4096943e4768505cb, which is in systemd >= 235. We are currently using version 234 of systemd in Buildroot, but we already have a patch in patchwork updating it to version 236. Once this patch gets merged, this bug will be fixed.
(In reply to Thomas Petazzoni from comment #4) > we already have a patch in patchwork updating it to version 236. > Once this patch gets merged, this bug will be fixed. We must also apply https://patchwork.ozlabs.org/patch/856392/ first, otherwise the gitlab-ci infra will not be able to run the runtime tests. Regards, Yann E. MORIN.
Fixed by https://git.buildroot.org/buildroot/commit/?id=db860d7837ca8665524f4046030beaf3d7f5e932.