From nobody Mon Apr 6 15:50:39 2026 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 562EBF4FA for ; Thu, 19 Mar 2026 00:13:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773879211; cv=none; b=DZNBdOiwRvaITuY6KKCQmpvpGTYnHo1KzKdgomNTnzv3f5mJ8GOzvQ3g/DKfTN6wHCqNTBP92+AuT0yrLOobBCljRgFyeGk0hK4mBTUugosOMpj28tJvVz/l0WrDU1228bNfych8G5Poqfw5koGYMpuUe4Ly+bEPT534Q38WInc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773879211; c=relaxed/simple; bh=f8uvFrDubU4oOhXNlCQqhnRLfgNBkZw1tWtV4CEa0KM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=YNP38V1UAw72dsWwTmkbz67SdUuMqB5Bb+yszxe7Wa5tW9f8dh3U346tyacchklhYh+QrZLrU7HtW9PKOzbRxBvxqb5OccgmvPYDijsLu96rCkQ6D7vlslmJwcxORR19QRxdepRQXN8vfvbiWZBhW9DR3JMKOEdbaTgv9t/OMYM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HwycfhF4; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HwycfhF4" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-486fb439299so425935e9.0 for ; Wed, 18 Mar 2026 17:13:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773879209; x=1774484009; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=nTjxE3JQqOolAqKstJpX9T/NdJfvt6h9kQqpuq86OH0=; b=HwycfhF4BjwkWgoq0tKiPgH+meH5nr6TL2jwyBk8cK6QefDJxEUph2Cdea620ckA/w WymxbYJlrNfLjraO5fL0rbTFhRucWz/DR98zNUfBfi04TUHXVhOiIcO6ay4UZ+Le0OMM CFunkAC1YOe3PIV+vNHsSJJQC5aC6voHX913WSqq3h+N1+JkuR/QT/x+PPiGpU0oKuxR 84xiOder6ELKqCNUGtWA1wbLQ31tIltp4fwuszo/q6fx5uGvTeasWnlfBb+YvMlAYNaJ J0IdwD39hqNjFADUEdOBq7zvTInCg16M+3C0QLJgnD2G9kwloasNQMRAEU95anwLsm36 yYhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773879209; x=1774484009; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=nTjxE3JQqOolAqKstJpX9T/NdJfvt6h9kQqpuq86OH0=; b=VlvbGRwzNfxVFstVvWrKJt16085P8UeHrQE4PaiDLqHRfQGy7mQVk/+3N4uJxUDXNa r7awX1tiQJBfJ6fGHqxEKmfS39+5INeTX3TM7KiHdZHvXvjVuwqpbA4ZKRC16NBQkuEq IILgcDvzI5p8B2nwcXx3lys01gvqnH3LZt5G7dlsStJldS+duI3w/zBaHdd9y7xnnkFU bTZyBH/84e/rpJPPh8LKyItNcunnCD6X2ULtSIFRLHmgD0fEpcNBq8fC0KJYPVBk8HcW O57IiPBeVPAsYVtu7UeX4E1cLQuegN+/6Tl5XssIHETwEdbIjFJW0xwEUgObmmjMuga6 JBCQ== X-Forwarded-Encrypted: i=1; AJvYcCWk9SWWPFnpFwQ7JOV4tPyq+SWLMsN6IqJThZV6VlcJS2bDDhPIz52rOifwqE1umG+XM/5t8T1nYYNMlVI=@vger.kernel.org X-Gm-Message-State: AOJu0Yyitn/tggHSe2b3SpGGuccJYuwO8hjvKcVB0/Yz91edRQ8cPXw7 IOUjWX8AB0cibcpEbB7D2ZbKgXYyFALKLqNzJ/xO/sX0T1Qe8CjQT6533H33E8jV X-Gm-Gg: ATEYQzzV/LYJKxjAtYwiHpCTl2WC1y3FwnngukKFgqcfGZQru5J2hMjqatzbETErUOF EQXw3dreUlguk93R5kGohlqrB/FBeIVSlc9JEhqkHz9pPKgMH+jZKMUDLexO+w2J2KTSxag/Sps LCfBf4ZPUluQput6bo5aawgHvXnOWnICCX0gzekKhAm2XVRXAOjvsIjZBNBiuqNtZ7RUfNhPQ6J LpY1rbxI/JO2yHimM/ZxgcIzMMMqW8tzpGLzgBc2mIbcy9etn4NXxHIgZtxJHXFtFNVoJxk9rLK ezKN11bljSMGnq6XwxYmw7Iq7T6tQzz4SD2sJr+8IJgoFKlJw7pRWmiEkokoWp2uga0itf9WIsN aVpIhqP8oq0ezv3PiE/ZvDzSz8t63Pi2D+bUULyTwEABKf+wRnY+rI4vmkB6nbr6J2Fj6xpvK9p J7wonkCtCJfnuqAmZDK3UCzMXSBA== X-Received: by 2002:a05:600c:1f10:b0:485:3d3e:1675 with SMTP id 5b1f17b1804b1-486f4429137mr85938665e9.8.1773879208383; Wed, 18 Mar 2026 17:13:28 -0700 (PDT) Received: from hisam ([2402:ad80:86:fe00:bbdd:7f3:b302:5b46]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-486f8c5318dsm24682245e9.14.2026.03.18.17.13.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Mar 2026 17:13:28 -0700 (PDT) From: Hisam Mehboob To: pbonzini@redhat.com, shuah@kernel.org, seanjc@google.com Cc: kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Hisam Mehboob , Aqib Faruqui Subject: [PATCH] KVM: selftests: Guard execinfo.h inclusion for non-glibc builds Date: Thu, 19 Mar 2026 05:08:43 +0500 Message-ID: <20260319000842.1213426-2-hisamshar@gmail.com> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Guard the inclusion of execinfo.h under #ifdef __GLIBC__, and wrap all backtrace() usage under the same guard with a fallback message for non-glibc builds indicating that stack traces are not available. Unlike the approach of adding a weak stub for backtrace(), this explicitly handles the non-glibc case rather than silently providing an empty implementation. Link: https://lore.kernel.org/kvm/20250829142556.72577-7-aqibaf@amazon.com/ Suggested-by: Aqib Faruqui Signed-off-by: Hisam Mehboob --- tools/testing/selftests/kvm/lib/assert.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/testing/selftests/kvm/lib/assert.c b/tools/testing/selft= ests/kvm/lib/assert.c index b49690658c60..3442b80c37c1 100644 --- a/tools/testing/selftests/kvm/lib/assert.c +++ b/tools/testing/selftests/kvm/lib/assert.c @@ -6,7 +6,9 @@ */ #include "test_util.h" =20 +#ifdef __GLIBC__ #include +#endif #include =20 #include "kselftest.h" @@ -15,6 +17,7 @@ static void __attribute__((noinline)) test_dump_stack(void); static void test_dump_stack(void) { +#ifdef __GLIBC__ /* * Build and run this command: * @@ -56,6 +59,10 @@ static void test_dump_stack(void) #pragma GCC diagnostic ignored "-Wunused-result" system(cmd); #pragma GCC diagnostic pop + +#else /* !__GLIBC__ */ + fputs(" (stack trace not available: compiled without glibc)\n", stderr); +#endif } =20 static pid_t _gettid(void) --=20 2.51.0