Skip to content

cpu/native: Fix make all-valgrind#22046

Merged
maribu merged 1 commit intoRIOT-OS:masterfrom
maribu:valgrind
Feb 19, 2026
Merged

cpu/native: Fix make all-valgrind#22046
maribu merged 1 commit intoRIOT-OS:masterfrom
maribu:valgrind

Conversation

@maribu
Copy link
Member

@maribu maribu commented Feb 5, 2026

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_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.

Testing procedure

Running make BOARD=native64 all-valgrind should work now e.g. on Ubuntu 24.04.

Issues/PRs references

None

@maribu maribu added the Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) label Feb 5, 2026
@maribu maribu requested a review from kaspar030 as a code owner February 5, 2026 09:40
@maribu maribu added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Feb 5, 2026
@github-actions github-actions bot added Platform: native Platform: This PR/issue effects the native platform Area: core Area: RIOT kernel. Handle PRs marked with this with care! Area: build system Area: Build system Area: cpu Area: CPU/MCU ports labels Feb 5, 2026
@riot-ci
Copy link

riot-ci commented Feb 5, 2026

Murdock results

✔️ PASSED

a8232b9 cpu/native: Fix make all-valgrind

Success Failures Total Runtime
11005 0 11005 09m:31s

Artifacts

Copy link
Contributor

@crasbe crasbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]>
@maribu maribu added the Process: needs >1 ACK Integration Process: This PR requires more than one ACK label Feb 5, 2026
@github-actions github-actions bot added the Process: missing approvals Integration Process: PR needs more ACKS (handled by action) label Feb 5, 2026
@maribu maribu requested a review from benpicco February 5, 2026 11:06
@maribu maribu enabled auto-merge February 5, 2026 11:06
@github-actions github-actions bot removed the Process: missing approvals Integration Process: PR needs more ACKS (handled by action) label Feb 19, 2026
@maribu maribu added this pull request to the merge queue Feb 19, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 19, 2026
@maribu maribu added this pull request to the merge queue Feb 19, 2026
Merged via the queue into RIOT-OS:master with commit b16a84d Feb 19, 2026
26 of 28 checks passed
@maribu
Copy link
Member Author

maribu commented Feb 20, 2026

Thx ❤️

@maribu maribu deleted the valgrind branch February 20, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: build system Area: Build system Area: core Area: RIOT kernel. Handle PRs marked with this with care! Area: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: native Platform: This PR/issue effects the native platform Process: needs >1 ACK Integration Process: This PR requires more than one ACK Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants