From: Antonio Borneo Date: Tue, 8 Oct 2019 09:17:09 +0000 (+0200) Subject: helper: skip including sys/sysctl.h on Linux X-Git-Tag: v0.11.0-rc1~570 X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=commitdiff_plain;h=be365730732231e0733353834b56f405a8219f2a;ds=sidebyside helper: skip including sys/sysctl.h on Linux Starting from glibc 2.30, the header file sys/sysctl.h gets deprecated on Linux, after the commit 744e82963716 ("Linux: Deprecate and sysctl") https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=744e82963716 The associated NEWS reports The Linux-specific header and the sysctl function have been deprecated and will be removed from a future version of glibc. Latest automake 1.16.1 still does not handle this case. Current OpenOCD build fails with warning and requires configure with "--disable-werror" to build. Prevent including sys/sysctl.h on Linux build. Change-Id: I5310976573352a96e5aef123352f73475f0c35fe Signed-off-by: Antonio Borneo Reviewed-on: http://openocd.zylin.com/5317 Tested-by: jenkins Reviewed-by: Moritz Fischer Reviewed-by: Paul Fertser --- diff --git a/src/helper/options.c b/src/helper/options.c index b60d58de8c..6622ece6ca 100644 --- a/src/helper/options.c +++ b/src/helper/options.c @@ -34,9 +34,12 @@ #if IS_DARWIN #include #endif +/* sys/sysctl.h is deprecated on Linux from glibc 2.30 */ +#ifndef __linux__ #ifdef HAVE_SYS_SYSCTL_H #include #endif +#endif #if IS_WIN32 && !IS_CYGWIN #include #endif