]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: selftests: Guard execinfo.h inclusion for non-glibc builds
authorHisam Mehboob <hisamshar@gmail.com>
Thu, 9 Apr 2026 15:38:47 +0000 (20:38 +0500)
committerSean Christopherson <seanjc@google.com>
Wed, 13 May 2026 17:38:02 +0000 (10:38 -0700)
commit34065a5f3cf94886e59e2a8b5db00515f32d6cf2
treea478f5ca5c26b5495cb1fef918238a1036612629
parent8fe2e698fce4a95a3ac2c25fe59832a3c22534c6
KVM: selftests: Guard execinfo.h inclusion for non-glibc builds

The backtrace() function and execinfo.h are GNU extensions available
in glibc but not in non-glibc C libraries such as musl. Building KVM
selftests with musl-gcc fails with:

  lib/assert.c:9:10: fatal error: execinfo.h: No such file or directory

Fix this by guarding the inclusion of execinfo.h and the stack dumping
logic under #ifdef __GLIBC__. For non-glibc builds, provide a local
stub for test_dump_stack().

Suggested-by: Aqib Faruqui <aqibaf@amazon.com>
Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Hisam Mehboob <hisamshar@gmail.com>
Link: https://patch.msgid.link/20260409153846.1502656-2-hisamshar@gmail.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/lib/assert.c