cpu/native: Fix make all-valgrind#22046
Merged
maribu merged 1 commit intoRIOT-OS:masterfrom Feb 19, 2026
Merged
Conversation
crasbe
reviewed
Feb 5, 2026
crasbe
approved these changes
Feb 5, 2026
Contributor
crasbe
left a comment
There was a problem hiding this comment.
Looks good. I have not found any references for HAVE_VALGRIND_VALGRIND_H in the documentation, so it's good that it's now automated.
I haven't tested it personally, but changes look reasonable and I trust your testing.
On Ubuntu 24.04 `#include <valgrind.h>` fails and we have to use `#include <valgrind/valgrind.h>`. There has been some custom preprocessor magic in place already (`HAVE_VALGRIND_H` vs `HAVE_VALGRIND_VALGRIND_H`), but there is (no longer?) any code that provides the correct define depending on the system compiled on. This simplifies the code to select the right include name by using the `__has_include()` extension. The use of valgrind is still guarded behind an `#ifdef HAVE_VALGRIND`, so that the `__has_include()` extension is only used on `native64` / `native32` and with valgrind enabled. Hence, we don't need that extension to be present on embedded toolchains. Co-authored-by: crasbe <[email protected]>
benpicco
approved these changes
Feb 19, 2026
Member
Author
|
Thx ❤️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contribution description
On Ubuntu 24.04
#include <valgrind.h>fails and we have to use#include <valgrind/valgrind.h>. There has been some custom preprocessor magic in place already (HAVE_VALGRIND_HvsHAVE_VALGRIND_VALGRIND_H), but there is (no longer?) any code that provides the correct define depending on the system compiled on.This simplifies the code to select the right include name by using the
__has_include()extension. The use of valgrind is still guarded behind an#ifdef HAVE_VALGRIND, so that the__has_include()extension is only used onnative64/native32and with valgrind enabled. Hence, we don't need that extension to be present on embedded toolchains.Testing procedure
Running
make BOARD=native64 all-valgrindshould work now e.g. on Ubuntu 24.04.Issues/PRs references
None