Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Certain modern Linux hosts will fail to build due to sys/sysctl.h deprecation #2

Open
ardnew opened this issue Jul 31, 2020 · 2 comments

Comments

@ardnew
Copy link

ardnew commented Jul 31, 2020

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

@jpieper
Copy link
Member

jpieper commented Jul 31, 2020

For what it is worth, there is probably not much need to use this repository any more, as upstream openocd has finally integrated stm32g4 support. I just need to verify that it works before I change instructions in things like moteus.

@ardnew
Copy link
Author

ardnew commented Jul 31, 2020

Ah, good to hear. I noticed in the docs for my distro's (Ubuntu 20.04) openocd package that the stm32l4x driver supports the G4 and the G0, which seemed weird, since those chips have some very different IPs (e.g. USB PD isn't supported by the L4, but is by G0/G4).

Is G0/G4 support realized through the stm32l4x driver in your patched fork too? Guess I just need to check whats in upstream

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants