Been trying for a couple hours hunting down where a particular define gets introduced that is forcing a preprocessor conditional to immediately halt the build as as failure. I'll try to keep this brief.
Currently, with no modification to source code or Makefile, building openocd errors out with:
In file included from src/helper/options.c:38:
/usr/include/x86_64-linux-gnu/sys/sysctl.h:21:2: error: #warning "The <sys/sysctl.h> header is deprecated and will be removed." [-Werror=cpp]
21 | #warning "The <sys/sysctl.h> header is deprecated and will be removed."
| ^~~~~~~
cc1: all warnings being treated as errors
That particular line it mentions causing the error is because we have #include <sys/sysctl.h>, which is where the deprecation warning ultimately appears..
Doing some cursory Google research, I've found others with similar problems. They conditionally #include <sys/sysctl,h> only if HAVE_SYSCONF is NOT true,
The problem is, at least for Ubuntu, probably others in the very near future, the openocd project isn't including the necessary files that would export that HAVE_SYSCONF macro. And I am not familiar enough with the project to understand the requirements for using sys/sysctl.h, or what it would take to replace it.
In any case, the obvious workaround for now is to disable -Werror, and pray
Been trying for a couple hours hunting down where a particular define gets introduced that is forcing a preprocessor conditional to immediately halt the build as as failure. I'll try to keep this brief.
Currently, with no modification to source code or
Makefile, buildingopenocderrors out with:That particular line it mentions causing the error is because we have
#include <sys/sysctl.h>, which is where the deprecation warning ultimately appears..Doing some cursory Google research, I've found others with similar problems. They conditionally
#include <sys/sysctl,h>only ifHAVE_SYSCONFis NOT true,The problem is, at least for Ubuntu, probably others in the very near future, the
openocdproject isn't including the necessary files that would export thatHAVE_SYSCONFmacro. And I am not familiar enough with the project to understand the requirements for usingsys/sysctl.h, or what it would take to replace it.In any case, the obvious workaround for now is to disable
-Werror, and pray