Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 685090 - sys-apps/systemd-242 needs a patch for gcc-9.1
Summary: sys-apps/systemd-242 needs a patch for gcc-9.1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo systemd Team
URL:
Whiteboard:
Keywords: PATCH
: 685104 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-05-05 10:23 UTC by Helmut Jarausch
Modified: 2019-07-28 20:59 UTC (History)
11 users (show)

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


Attachments
patch to compile with gcc-9.1 (systemd-242-gcc9.patch,851 bytes, patch)
2019-05-05 10:23 UTC, Helmut Jarausch
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Helmut Jarausch 2019-05-05 10:23:46 UTC
Created attachment 575284 [details, diff]
patch to compile with gcc-9.1

gcc-9.1 doesn't allow NULL arguments to printf.
This causes trouble in some packages.
The attached patch first checks for a NULL argument.

The error message was

x86_64-pc-linux-gnu-gcc -Isrc/network/70b1c79@@networkd-core@sta -Isrc/network -I../systemd-242/src/network -Isrc/basic -I../systemd-242/src/basic -Isrc/shared -I../systemd-242/src/shared -Isrc/systemd -I../systemd-242/src/systemd -Isrc/journal -I../systemd-242/src/journal -Isrc/journal-remote -I../systemd-242/src/journal-remote -Isrc/nspawn -I../systemd-242/src/nspawn -Isrc/resolve -I../systemd-242/src/resolve -Isrc/timesync -I../systemd-242/src/timesync -I../systemd-242/src/time-wait-sync -Isrc/login -I../systemd-242/src/login -Isrc/udev -I../systemd-242/src/udev -Isrc/libudev -I../systemd-242/src/libudev -Isrc/core -I../systemd-242/src/core -Isrc/shutdown -I../systemd-242/src/shutdown -I../systemd-242/src/libsystemd/sd-bus -I../systemd-242/src/libsystemd/sd-device -I../systemd-242/src/libsystemd/sd-event -I../systemd-242/src/libsystemd/sd-hwdb -I../systemd-242/src/libsystemd/sd-id128 -I../systemd-242/src/libsystemd/sd-netlink -I../systemd-242/src/libsystemd/sd-network -I../systemd-242/src/libsystemd/sd-resolve -Isrc/libsystemd-network -I../systemd-242/src/libsystemd-network -I. -I../systemd-242/ -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -std=gnu99 -Wextra -Werror=undef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wimplicit-fallthrough=5 -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Werror=overflow -Werror=shift-count-overflow -Werror=shift-overflow=2 -Wdate-time -Wnested-externs -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Wno-error=nonnull -Wno-maybe-uninitialized -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong --param=ssp-buffer-size=4 -ffunction-sections -fdata-sections -Werror=shadow -include config.h -march=native -O2 -maes -mavx -mavx2 -mf16c -mfma -mmmx -mpclmul -mpopcnt -msse -msse2 -msse3 -msse4.1 -msse4.2 -msse4a -mssse3 -fPIC -MD -MQ 'src/network/70b1c79@@networkd-core@sta/networkd-link.c.o' -MF 'src/network/70b1c79@@networkd-core@sta/networkd-link.c.o.d' -o 'src/network/70b1c79@@networkd-core@sta/networkd-link.c.o' -c ../systemd-242/src/network/networkd-link.c
In file included from ../systemd-242/src/basic/macro.h:549,
                 from ../systemd-242/src/basic/alloc-util.h:9,
                 from ../systemd-242/src/network/networkd-link.c:9:
In function âlink_enable_ipv6â,
    inlined from âlink_set_mtuâ at ../systemd-242/src/network/networkd-link.c:1483:16:
../systemd-242/src/basic/log.h:104:9: error: â%sâ directive argument is null [-Werror=format-overflow=]
  104 |         log_internal_realm(LOG_REALM_PLUS_LEVEL(LOG_REALM, (level)), __VA_ARGS__)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../systemd-242/src/shared/log-link.h:21:25: note: in expansion of macro âlog_internalâ
   21 |                         log_internal(level, error, __FILE__, __LINE__, __func__, ##__VA_ARGS__); \
      |                         ^~~~~~~~~~~~
../systemd-242/src/shared/log-link.h:33:50: note: in expansion of macro âlog_link_fullâ
   33 | #define log_link_warning_errno(link, error, ...) log_link_full(link, LOG_WARNING, error, ##__VA_ARGS__)
      |                                                  ^~~~~~~~~~~~~
../systemd-242/src/network/networkd-link.c:324:17: note: in expansion of macro âlog_link_warning_errnoâ
  324 |                 log_link_warning_errno(link, r, "Cannot %s IPv6 for interface %s: %m",
      |                 ^~~~~~~~~~~~~~~~~~~~~~
../systemd-242/src/network/networkd-link.c: In function âlink_set_mtuâ:
../systemd-242/src/network/networkd-link.c:324:79: note: format string is defined here
  324 |                 log_link_warning_errno(link, r, "Cannot %s IPv6 for interface %s: %m",
      |                                                                               ^~
cc1: some warnings being treated as errors
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-05-05 11:03:22 UTC
Was this fixed/sent upstream?
Comment 2 Helmut Jarausch 2019-05-05 11:54:36 UTC
(In reply to Michał Górny from comment #1)
> Was this fixed/sent upstream?

No
Comment 3 Andreas Sturmlechner gentoo-dev 2019-05-05 14:13:49 UTC
*** Bug 685104 has been marked as a duplicate of this bug. ***
Comment 4 Cyril 2019-05-05 16:40:29 UTC
referenced here https://github.com/systemd/systemd/issues/12454
Comment 5 Kobboi 2019-05-05 21:00:44 UTC
Same here
Comment 6 Craig Andrews gentoo-dev 2019-05-08 15:45:07 UTC
systemd now has a commit fixing this issue: https://github.com/systemd/systemd/commit/c98b3545008d8e984ab456dcf79787418fcbfe13

We should revbump systemd and include this patch :)
Comment 7 Mike Gilbert gentoo-dev 2019-05-08 16:20:12 UTC
(In reply to Craig Andrews from comment #6)
> We should revbump systemd and include this patch :)

Yes, we can backport it, but we don't revbump for build fixes.
Comment 8 Larry the Git Cow gentoo-dev 2019-05-08 17:29:08 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b2c1cefa829dd2cfd7fbc88c323e96a8749f2188

commit b2c1cefa829dd2cfd7fbc88c323e96a8749f2188
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2019-05-08 17:28:45 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2019-05-08 17:29:04 +0000

    sys-apps/systemd: fix build with GCC 9
    
    Closes: https://bugs.gentoo.org/685090
    Package-Manager: Portage-2.3.66_p2, Repoman-2.3.12_p111
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 sys-apps/systemd/files/242-gcc-9.patch | 35 ++++++++++++++++++++++++++++++++++
 sys-apps/systemd/systemd-241-r1.ebuild |  1 +
 sys-apps/systemd/systemd-242.ebuild    |  1 +
 3 files changed, 37 insertions(+)