All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] systemd: Fix build with gcc9
@ 2019-05-06 17:51 Khem Raj
  2019-05-06 17:51 ` [PATCH 2/2] gcc-target: Do not set --with-sysroot and gxx-include-dir paths Khem Raj
  2019-05-06 18:23 ` [PATCH 1/2] systemd: Fix build with gcc9 Adrian Bunk
  0 siblings, 2 replies; 6+ messages in thread
From: Khem Raj @ 2019-05-06 17:51 UTC (permalink / raw)
  To: openembedded-core

gcc9 throws additional warnings about format string overflow

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...-format-overflow-warnings-with-gcc-9.patch | 41 +++++++++++++++++++
 meta/recipes-core/systemd/systemd_242.bb      |  1 +
 2 files changed, 42 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd/0006-Fix-format-overflow-warnings-with-gcc-9.patch

diff --git a/meta/recipes-core/systemd/systemd/0006-Fix-format-overflow-warnings-with-gcc-9.patch b/meta/recipes-core/systemd/systemd/0006-Fix-format-overflow-warnings-with-gcc-9.patch
new file mode 100644
index 0000000000..510ac22150
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0006-Fix-format-overflow-warnings-with-gcc-9.patch
@@ -0,0 +1,41 @@
+From c8050da8b7b0e59e4d1d0e15a92b9ecad299dbbb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 May 2019 10:41:15 -0700
+Subject: [PATCH] Fix format-overflow warnings with gcc-9
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+gcc-9 has become a bit stricter and can check all kind of formatted
+input/output functions which causes additional warnings when compiling
+networkd
+
+/src/basic/log.h:104:9: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
+         log_internal_realm(LOG_REALM_PLUS_LEVEL(LOG_REALM, (level)), __VA_ARGS__)
+
+see https://github.com/systemd/systemd/issues/12454
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/network/networkd-link.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
+index 533193ac93..976cbbeaaa 100644
+--- a/src/network/networkd-link.c
++++ b/src/network/networkd-link.c
+@@ -339,7 +339,8 @@ static int link_enable_ipv6(Link *link) {
+         r = sysctl_write_ip_property_boolean(AF_INET6, link->ifname, "disable_ipv6", disabled);
+         if (r < 0)
+                 log_link_warning_errno(link, r, "Cannot %s IPv6 for interface %s: %m",
+-                                       enable_disable(!disabled), link->ifname);
++                                       enable_disable(!disabled),
++                                       (link->ifname) ? link->ifname : "<null>");
+         else
+                 log_link_info(link, "IPv6 successfully %sd", enable_disable(!disabled));
+ 
+-- 
+2.21.0
+
diff --git a/meta/recipes-core/systemd/systemd_242.bb b/meta/recipes-core/systemd/systemd_242.bb
index a6b39d57e8..93c4472bab 100644
--- a/meta/recipes-core/systemd/systemd_242.bb
+++ b/meta/recipes-core/systemd/systemd_242.bb
@@ -22,6 +22,7 @@ SRC_URI += "file://touchscreen.rules \
            file://0003-implment-systemd-sysv-install-for-OE.patch \
            file://0004-rules-whitelist-hd-devices.patch \
            file://0005-rules-watch-metadata-changes-in-ide-devices.patch \
+           file://0006-Fix-format-overflow-warnings-with-gcc-9.patch \
            file://99-default.preset \
            "
 
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] gcc-target: Do not set --with-sysroot and gxx-include-dir paths
  2019-05-06 17:51 [PATCH 1/2] systemd: Fix build with gcc9 Khem Raj
@ 2019-05-06 17:51 ` Khem Raj
  2019-05-06 18:23 ` [PATCH 1/2] systemd: Fix build with gcc9 Adrian Bunk
  1 sibling, 0 replies; 6+ messages in thread
From: Khem Raj @ 2019-05-06 17:51 UTC (permalink / raw)
  To: openembedded-core

These options are not needed on target infact since the defaults would
be good enough for compiler to find the relevant headers and libraries
from compiler runtime

with gcc9 it starts to strip the sysroot from gxx-include-dir which
means it tries to look for gxx headers in localdir

ignoring nonexistent directory "usr/include/c++/9.0.1"
ignoring nonexistent directory "usr/include/c++/9.0.1/arm-yoe-linux-gnueabi"
ignoring nonexistent directory "usr/include/c++/9.0.1/backward"

instead of sysroot

Removing these options make it behave normal

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-devtools/gcc/gcc-target.inc | 2 --
 1 file changed, 2 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc-target.inc b/meta/recipes-devtools/gcc/gcc-target.inc
index 6270059644..bdc6ff658f 100644
--- a/meta/recipes-devtools/gcc/gcc-target.inc
+++ b/meta/recipes-devtools/gcc/gcc-target.inc
@@ -2,9 +2,7 @@ GCCMULTILIB = "--enable-multilib"
 require gcc-configure-common.inc
 
 EXTRA_OECONF_PATHS = "\
-    --with-sysroot=/ \
     --with-build-sysroot=${STAGING_DIR_TARGET} \
-    --with-gxx-include-dir=${includedir}/c++/${BINV} \
 "
 
 EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] systemd: Fix build with gcc9
  2019-05-06 17:51 [PATCH 1/2] systemd: Fix build with gcc9 Khem Raj
  2019-05-06 17:51 ` [PATCH 2/2] gcc-target: Do not set --with-sysroot and gxx-include-dir paths Khem Raj
@ 2019-05-06 18:23 ` Adrian Bunk
  2019-05-13 23:27   ` Burton, Ross
  1 sibling, 1 reply; 6+ messages in thread
From: Adrian Bunk @ 2019-05-06 18:23 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembedded-core

On Mon, May 06, 2019 at 10:51:35AM -0700, Khem Raj wrote:
>...
> +gcc-9 has become a bit stricter and can check all kind of formatted
> +input/output functions which causes additional warnings when compiling
> +networkd
> +
> +/src/basic/log.h:104:9: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
> +         log_internal_realm(LOG_REALM_PLUS_LEVEL(LOG_REALM, (level)), __VA_ARGS__)
>...
> +         if (r < 0)
> +                 log_link_warning_errno(link, r, "Cannot %s IPv6 for interface %s: %m",
> +-                                       enable_disable(!disabled), link->ifname);
> ++                                       enable_disable(!disabled),
> ++                                       (link->ifname) ? link->ifname : "<null>");
>...

The fix doesn't look correct to me:
gcc says it "is null", so checking whether or not it is null doesn't
match the error message.

If it is a compiler bug as was at some point mentioned upstream,
a better temporary workaround would be to stop making this an error
with -Wno-error=format-overflow (untested).

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] systemd: Fix build with gcc9
  2019-05-06 18:23 ` [PATCH 1/2] systemd: Fix build with gcc9 Adrian Bunk
@ 2019-05-13 23:27   ` Burton, Ross
  2019-05-14  3:21     ` Khem Raj
  0 siblings, 1 reply; 6+ messages in thread
From: Burton, Ross @ 2019-05-13 23:27 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: OE-core

https://github.com/systemd/systemd/commit/c98b3545008d8e984ab456dcf79787418fcbfe13
is the upstream fix, so lets use this instead.

Ross

On Mon, 6 May 2019 at 11:24, Adrian Bunk <bunk@stusta.de> wrote:
>
> On Mon, May 06, 2019 at 10:51:35AM -0700, Khem Raj wrote:
> >...
> > +gcc-9 has become a bit stricter and can check all kind of formatted
> > +input/output functions which causes additional warnings when compiling
> > +networkd
> > +
> > +/src/basic/log.h:104:9: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
> > +         log_internal_realm(LOG_REALM_PLUS_LEVEL(LOG_REALM, (level)), __VA_ARGS__)
> >...
> > +         if (r < 0)
> > +                 log_link_warning_errno(link, r, "Cannot %s IPv6 for interface %s: %m",
> > +-                                       enable_disable(!disabled), link->ifname);
> > ++                                       enable_disable(!disabled),
> > ++                                       (link->ifname) ? link->ifname : "<null>");
> >...
>
> The fix doesn't look correct to me:
> gcc says it "is null", so checking whether or not it is null doesn't
> match the error message.
>
> If it is a compiler bug as was at some point mentioned upstream,
> a better temporary workaround would be to stop making this an error
> with -Wno-error=format-overflow (untested).
>
> cu
> Adrian
>
> --
>
>        "Is there not promise of rain?" Ling Tan asked suddenly out
>         of the darkness. There had been need of rain for many days.
>        "Only a promise," Lao Er said.
>                                        Pearl S. Buck - Dragon Seed
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] systemd: Fix build with gcc9
  2019-05-13 23:27   ` Burton, Ross
@ 2019-05-14  3:21     ` Khem Raj
  2019-05-14  3:56       ` Burton, Ross
  0 siblings, 1 reply; 6+ messages in thread
From: Khem Raj @ 2019-05-14  3:21 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core, Adrian Bunk

you are late to party but its already applied see oe-core/d5e999616e

On Mon, May 13, 2019 at 7:27 PM Burton, Ross <ross.burton@intel.com> wrote:
>
> https://github.com/systemd/systemd/commit/c98b3545008d8e984ab456dcf79787418fcbfe13
> is the upstream fix, so lets use this instead.
>
> Ross
>
> On Mon, 6 May 2019 at 11:24, Adrian Bunk <bunk@stusta.de> wrote:
> >
> > On Mon, May 06, 2019 at 10:51:35AM -0700, Khem Raj wrote:
> > >...
> > > +gcc-9 has become a bit stricter and can check all kind of formatted
> > > +input/output functions which causes additional warnings when compiling
> > > +networkd
> > > +
> > > +/src/basic/log.h:104:9: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
> > > +         log_internal_realm(LOG_REALM_PLUS_LEVEL(LOG_REALM, (level)), __VA_ARGS__)
> > >...
> > > +         if (r < 0)
> > > +                 log_link_warning_errno(link, r, "Cannot %s IPv6 for interface %s: %m",
> > > +-                                       enable_disable(!disabled), link->ifname);
> > > ++                                       enable_disable(!disabled),
> > > ++                                       (link->ifname) ? link->ifname : "<null>");
> > >...
> >
> > The fix doesn't look correct to me:
> > gcc says it "is null", so checking whether or not it is null doesn't
> > match the error message.
> >
> > If it is a compiler bug as was at some point mentioned upstream,
> > a better temporary workaround would be to stop making this an error
> > with -Wno-error=format-overflow (untested).
> >
> > cu
> > Adrian
> >
> > --
> >
> >        "Is there not promise of rain?" Ling Tan asked suddenly out
> >         of the darkness. There had been need of rain for many days.
> >        "Only a promise," Lao Er said.
> >                                        Pearl S. Buck - Dragon Seed
> >
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] systemd: Fix build with gcc9
  2019-05-14  3:21     ` Khem Raj
@ 2019-05-14  3:56       ` Burton, Ross
  0 siblings, 0 replies; 6+ messages in thread
From: Burton, Ross @ 2019-05-14  3:56 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE-core, Adrian Bunk

Huh I checked git too.  Obviously not well enough!

On Mon, 13 May 2019 at 20:22, Khem Raj <raj.khem@gmail.com> wrote:
>
> you are late to party but its already applied see oe-core/d5e999616e
>
> On Mon, May 13, 2019 at 7:27 PM Burton, Ross <ross.burton@intel.com> wrote:
> >
> > https://github.com/systemd/systemd/commit/c98b3545008d8e984ab456dcf79787418fcbfe13
> > is the upstream fix, so lets use this instead.
> >
> > Ross
> >
> > On Mon, 6 May 2019 at 11:24, Adrian Bunk <bunk@stusta.de> wrote:
> > >
> > > On Mon, May 06, 2019 at 10:51:35AM -0700, Khem Raj wrote:
> > > >...
> > > > +gcc-9 has become a bit stricter and can check all kind of formatted
> > > > +input/output functions which causes additional warnings when compiling
> > > > +networkd
> > > > +
> > > > +/src/basic/log.h:104:9: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
> > > > +         log_internal_realm(LOG_REALM_PLUS_LEVEL(LOG_REALM, (level)), __VA_ARGS__)
> > > >...
> > > > +         if (r < 0)
> > > > +                 log_link_warning_errno(link, r, "Cannot %s IPv6 for interface %s: %m",
> > > > +-                                       enable_disable(!disabled), link->ifname);
> > > > ++                                       enable_disable(!disabled),
> > > > ++                                       (link->ifname) ? link->ifname : "<null>");
> > > >...
> > >
> > > The fix doesn't look correct to me:
> > > gcc says it "is null", so checking whether or not it is null doesn't
> > > match the error message.
> > >
> > > If it is a compiler bug as was at some point mentioned upstream,
> > > a better temporary workaround would be to stop making this an error
> > > with -Wno-error=format-overflow (untested).
> > >
> > > cu
> > > Adrian
> > >
> > > --
> > >
> > >        "Is there not promise of rain?" Ling Tan asked suddenly out
> > >         of the darkness. There had been need of rain for many days.
> > >        "Only a promise," Lao Er said.
> > >                                        Pearl S. Buck - Dragon Seed
> > >
> > > --
> > > _______________________________________________
> > > Openembedded-core mailing list
> > > Openembedded-core@lists.openembedded.org
> > > http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-05-14  3:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-06 17:51 [PATCH 1/2] systemd: Fix build with gcc9 Khem Raj
2019-05-06 17:51 ` [PATCH 2/2] gcc-target: Do not set --with-sysroot and gxx-include-dir paths Khem Raj
2019-05-06 18:23 ` [PATCH 1/2] systemd: Fix build with gcc9 Adrian Bunk
2019-05-13 23:27   ` Burton, Ross
2019-05-14  3:21     ` Khem Raj
2019-05-14  3:56       ` Burton, Ross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.