diff options
author | Tim Newsome <tim@sifive.com> | 2020-03-05 12:13:33 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-05 12:13:33 -0800 |
commit | 54e5d2533c21dd84818d3a275ba80850f81650c3 (patch) | |
tree | 997b4c2eeb962589597ea1f2ae9250aaae6eab9a /src | |
parent | 1ae21b387482f09dacebb9f4a267df85868657d9 (diff) | |
download | riscv-openocd-54e5d2533c21dd84818d3a275ba80850f81650c3.zip riscv-openocd-54e5d2533c21dd84818d3a275ba80850f81650c3.tar.gz riscv-openocd-54e5d2533c21dd84818d3a275ba80850f81650c3.tar.bz2 |
helper: skip including sys/sysctl.h on Linux (#450)
Starting from glibc 2.30, the header file sys/sysctl.h gets
deprecated on Linux, after the commit 744e82963716 ("Linux:
Deprecate <sys/sysctl.h> and sysctl")
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=744e82963716
The associated NEWS reports
The Linux-specific <sys/sysctl.h> 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 <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5317
Tested-by: jenkins
Reviewed-by: Moritz Fischer <moritz.fischer.private@gmail.com>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Co-authored-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/helper/options.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/helper/options.c b/src/helper/options.c index b60d58d..6622ece 100644 --- a/src/helper/options.c +++ b/src/helper/options.c @@ -34,9 +34,12 @@ #if IS_DARWIN #include <libproc.h> #endif +/* sys/sysctl.h is deprecated on Linux from glibc 2.30 */ +#ifndef __linux__ #ifdef HAVE_SYS_SYSCTL_H #include <sys/sysctl.h> #endif +#endif #if IS_WIN32 && !IS_CYGWIN #include <windows.h> #endif |