diff mbox series

[oe,meta-oe,1/2] collectd: Fix build with glibc 2.30

Message ID 20190727200614.5661-1-raj.khem@gmail.com
State New
Headers show
Series [oe,meta-oe,1/2] collectd: Fix build with glibc 2.30 | expand

Commit Message

Khem Raj July 27, 2019, 8:06 p.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 .../0001-Remove-including-sys-sysctl.h.patch  | 81 +++++++++++++++++++
 .../collectd/collectd_5.8.1.bb                |  1 +
 2 files changed, 82 insertions(+)
 create mode 100644 meta-oe/recipes-extended/collectd/collectd/0001-Remove-including-sys-sysctl.h.patch

-- 
2.22.0

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

Comments

Adrian Bunk July 28, 2019, 9:37 a.m. UTC | #1
On Sat, Jul 27, 2019 at 01:06:13PM -0700, Khem Raj wrote:
>...

> +Glibc 2.30 has added deprecation notice and collectd detects it as

> +warning

> +

> +Fixes

> +sys/sysctl.h:21:2: error: "The <sys/sysctl.h> header is deprecated and will be removed." [-Werror,-W#warnings]

>...


This package accumulates patches in OE that could be avoided by 
configuring with --disable-werror instead.

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-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Khem Raj July 28, 2019, 3:26 p.m. UTC | #2
On 7/28/19 2:37 AM, Adrian Bunk wrote:
> On Sat, Jul 27, 2019 at 01:06:13PM -0700, Khem Raj wrote:

>> ...

>> +Glibc 2.30 has added deprecation notice and collectd detects it as

>> +warning

>> +

>> +Fixes

>> +sys/sysctl.h:21:2: error: "The <sys/sysctl.h> header is deprecated and will be removed." [-Werror,-W#warnings]

>> ...

> This package accumulates patches in OE that could be avoided by

> configuring with --disable-werror instead.


thats true but it would mask these issues by disabling werror and we 
wont be doing submissions like 
https://github.com/collectd/collectd/pull/3234, I would like us to fix 
things upstream instead of masking them.

>

> cu

> Adrian

>

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Adrian Bunk July 28, 2019, 4:15 p.m. UTC | #3
On Sun, Jul 28, 2019 at 08:26:18AM -0700, Khem Raj wrote:
> 

> On 7/28/19 2:37 AM, Adrian Bunk wrote:

> > On Sat, Jul 27, 2019 at 01:06:13PM -0700, Khem Raj wrote:

> > > ...

> > > +Glibc 2.30 has added deprecation notice and collectd detects it as

> > > +warning

> > > +

> > > +Fixes

> > > +sys/sysctl.h:21:2: error: "The <sys/sysctl.h> header is deprecated and will be removed." [-Werror,-W#warnings]

> > > ...

> > This package accumulates patches in OE that could be avoided by

> > configuring with --disable-werror instead.

> 

> thats true but it would mask these issues by disabling werror and we wont be

> doing submissions like https://github.com/collectd/collectd/pull/3234,


With what range of glibc versions has this submission been verified?

Putting !defined(__GLIBC__) into source files is usually wrong,
and in this case it is unclear what happens with ancient glibc versions.

Note that --disable-werror would do the right thing will all glibc 
versions past, present and future since the file will no longer be
included without any patch needed once the header is actually gone.

> I would like us to fix things upstream instead of masking them.


Status quo is that people look at harmless issues like this one in the 
tiny subset of packages where -Werror is used, but noone seems to care 
about serious runtime problems like implicit function declarations in 
other packages.

And looking at the huge number of questionable patches in OE I don't 
agree that it would in general be a good idea to apply fixes for random 
issues in OE before they have been applied upstream - there are plenty 
examples in the open source world where downstreams "fixing" issues in 
upstream software caused problems, including major security issues
(I remember Debian/Ubuntu releases shipping a patched openssl generating 
predictable private keys due to a bogus Debian "fix" for a Valgrind warning).

Reality is often more complicated, but in general downstream 
distributions should try to avoid touching the upstream code
and aim at shipping unpatched upstream sources whenever possible.

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-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
diff mbox series

Patch

diff --git a/meta-oe/recipes-extended/collectd/collectd/0001-Remove-including-sys-sysctl.h.patch b/meta-oe/recipes-extended/collectd/collectd/0001-Remove-including-sys-sysctl.h.patch
new file mode 100644
index 0000000000..450cdd0e5f
--- /dev/null
+++ b/meta-oe/recipes-extended/collectd/collectd/0001-Remove-including-sys-sysctl.h.patch
@@ -0,0 +1,81 @@ 
+From e06c1b4259533ef7a396da841cbf950baccd8c11 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 27 Jul 2019 12:20:22 -0700
+Subject: [PATCH] Remove including sys/sysctl.h
+
+Glibc 2.30 has added deprecation notice and collectd detects it as
+warning
+
+Fixes
+sys/sysctl.h:21:2: error: "The <sys/sysctl.h> header is deprecated and will be removed." [-Werror,-W#warnings]
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/contextswitch.c | 4 ----
+ src/memory.c        | 3 ---
+ src/swap.c          | 3 ---
+ src/uuid.c          | 4 ----
+ 4 files changed, 14 deletions(-)
+
+diff --git a/src/contextswitch.c b/src/contextswitch.c
+index 461fb0a..75d42ae 100644
+--- a/src/contextswitch.c
++++ b/src/contextswitch.c
+@@ -26,10 +26,6 @@
+ #include "common.h"
+ #include "plugin.h"
+ 
+-#ifdef HAVE_SYS_SYSCTL_H
+-#include <sys/sysctl.h>
+-#endif
+-
+ #if HAVE_SYSCTLBYNAME
+ /* no global variables */
+ /* #endif HAVE_SYSCTLBYNAME */
+diff --git a/src/memory.c b/src/memory.c
+index e49fe84..41996d5 100644
+--- a/src/memory.c
++++ b/src/memory.c
+@@ -28,9 +28,6 @@
+ #include "common.h"
+ #include "plugin.h"
+ 
+-#ifdef HAVE_SYS_SYSCTL_H
+-#include <sys/sysctl.h>
+-#endif
+ #ifdef HAVE_SYS_VMMETER_H
+ #include <sys/vmmeter.h>
+ #endif
+diff --git a/src/swap.c b/src/swap.c
+index 78f05c5..2488a5b 100644
+--- a/src/swap.c
++++ b/src/swap.c
+@@ -49,9 +49,6 @@
+ #if HAVE_SYS_PARAM_H
+ #include <sys/param.h>
+ #endif
+-#if HAVE_SYS_SYSCTL_H
+-#include <sys/sysctl.h>
+-#endif
+ #if HAVE_SYS_DKSTAT_H
+ #include <sys/dkstat.h>
+ #endif
+diff --git a/src/uuid.c b/src/uuid.c
+index 1cb9027..1c6cdc6 100644
+--- a/src/uuid.c
++++ b/src/uuid.c
+@@ -29,10 +29,6 @@
+ #include "common.h"
+ #include "plugin.h"
+ 
+-#if HAVE_SYS_SYSCTL_H
+-#include <sys/sysctl.h>
+-#endif
+-
+ #define UUID_RAW_LENGTH 16
+ #define UUID_PRINTABLE_COMPACT_LENGTH (UUID_RAW_LENGTH * 2)
+ #define UUID_PRINTABLE_NORMAL_LENGTH (UUID_PRINTABLE_COMPACT_LENGTH + 4)
+-- 
+2.22.0
+
diff --git a/meta-oe/recipes-extended/collectd/collectd_5.8.1.bb b/meta-oe/recipes-extended/collectd/collectd_5.8.1.bb
index 6dff18c16b..ed8b8a5d2b 100644
--- a/meta-oe/recipes-extended/collectd/collectd_5.8.1.bb
+++ b/meta-oe/recipes-extended/collectd/collectd_5.8.1.bb
@@ -14,6 +14,7 @@  SRC_URI = "http://collectd.org/files/collectd-${PV}.tar.bz2 \
            file://0001-configure-Check-for-Wno-error-format-truncation-comp.patch \
            file://0005-Disable-new-gcc8-warnings.patch \
            file://0006-libcollectdclient-Fix-string-overflow-errors.patch \
+           file://0001-Remove-including-sys-sysctl.h.patch \
            "
 SRC_URI[md5sum] = "bfce96c42cede5243028510bcc57c1e6"
 SRC_URI[sha256sum] = "e796fda27ce06377f491ad91aa286962a68c2b54076aa77a29673d53204453da"