From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) (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 E3B9D41162C for ; Wed, 25 Mar 2026 18:03:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774461816; cv=none; b=rIJEQFIceIDXvjF59kLf517dlxqPyrRZjUR29cRnJoktPSAud5DT/bkHZ90HDoIAYUK6PmEdXBqND9L017uIsuuYJHBh3ePIL0sPy26EnuQ6yrCN9Ws3z3THQdt0WwSE6tarSUBmXwTLbCvbdehs62Dm4xQS5FfKG7ua918JHro= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774461816; c=relaxed/simple; bh=A+jUmXiUjqNgfZWHo7uvi8hZQpP3vPOx34iWFM4RRMo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ONhsFhLUll8svJjFNRpwwwUxnbGm+8wibWI7ZyHBc+WavbaGVDhFfklFBvr8888GzXJI+DUXuQcjTrMJ6IfdKxwR3NL8yewwmEM/ff2k3J1rYfauQ2CZHdkOkRdEE1IZNP9+2ysxYJFTu3fn12JTLsBrelPgDMA9kwQctVc22cs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=iAlisuWp; arc=none smtp.client-ip=209.85.210.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="iAlisuWp" Received: by mail-ot1-f49.google.com with SMTP id 46e09a7af769-7d7d4ebccf7so74756a34.0 for ; Wed, 25 Mar 2026 11:03:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1774461813; x=1775066613; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=s91KuRYxNM++mXxBR/3RAyKkSTkEX4JgZkC++rqVfdE=; b=iAlisuWp68vnkd6erN6uMVElne/aJvj85hZf4QVFundtxyx78307fiUDtxlVRlwVAF dtYB8ORxVeCSacBNT99J5hJd3RhYcUP4Oaf/5r4jkxUmUoGJPeiulQpWyCF/zMx/i4+j rGPLdyxNXMeDqLGPgtVKxgDsLbkrdiDRxClcg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774461813; x=1775066613; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=s91KuRYxNM++mXxBR/3RAyKkSTkEX4JgZkC++rqVfdE=; b=EDNFjPVN5MI37A22EPscg3K4I6hHiqR7ZNTR6sXduQSMC/FsAaDL0uFZaFyVcOIkKr VbNGE6quAm3uIXKCIjfMPataIyRDXIaEAbYRVIQDlwJz012UAeKXHbaaka9ELDK+AvxO qYvD6K/nM1lpGPNl4PsV1KBX17CkGbZwhpMHVAr6I3/3eup3BNbQODnyrbXYGdSG93q8 OTwtqTPebA/XivyLcOzjHGLgAaqxbFpdp512Kkhmrn099mm2ZyRxTZn4Xa8+cWmWJ6eE aZEr0WxsAk5ifPws9/FjSGEosjPqDrC5DdmzPJiKULSTvoXmsdB3tCk7LecW97QDvqY9 /8Vg== X-Forwarded-Encrypted: i=1; AJvYcCVF2HQ3+4aAWbsaNT5OPa5c+EwuWjWWtd+y/rQK63vytjhqDbUJ9pyhXsK47k4/48pduMRcL2wjd61n2qk=@vger.kernel.org X-Gm-Message-State: AOJu0YwRAEYrHxoUz2TN3YtGLE2ko0HAnAQNB9wnVjllPvoaIAYqp88/ y96p/mJYr8d0f0PSnVXs0VXF9q7TsajBmww7hmpw1Vwf1miWPJPSFnuGguG/NmqBkHQ= X-Gm-Gg: ATEYQzyK1RJEPy8+gR0wu9+sPGsWtPFpFzbs+KPlgExKWysdRY5GtlsqDU6oi6mtBLO aXIHN7MAj3thwPx2M2h5qfn0PQcL7TbPYJAmHAfIJjVRTEPnSnR6Y9B8NpmD0VNfiAhXqc9rvbN e89NiU4FZmgAR715mPmhwRJorPgWzTO9SNPHgX4JFJ0mAPzdKC64AWOK6zdjTSzllWUCjZOia00 Bv1xmj79hVktTYqgv3p49g3YbhXewePJ9RAR0/5wAoo4JgnkW/OAto0ViyJKvrFjxiDXb0OQxMu 94M3RmnoOg/ZQMBQFoJwFwCd+ctqAwU0G6ImW4L4QQRMXle+lkK4Yjb+cvfBzOCnB9HkPCl2Qdg PcN3+N8aRukeIaBLHNzuMj++G/B/DCF9JeHBwGrRiBj+7e3lLH6DHSkiAdSDCnJq3jHaUKU/W1b MByAdGbH43kbBHJiYvYSkuUZ4SHZl/Ab5hdRk= X-Received: by 2002:a05:6830:3811:b0:7d9:d390:1c35 with SMTP id 46e09a7af769-7d9d687ef23mr2267519a34.31.1774461812521; Wed, 25 Mar 2026 11:03:32 -0700 (PDT) Received: from [192.168.1.14] ([38.175.187.108]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7d9e6fb2ddbsm314756a34.4.2026.03.25.11.03.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Mar 2026 11:03:32 -0700 (PDT) Message-ID: <137f63af-a993-4b1c-a9e9-931718a47343@linuxfoundation.org> Date: Wed, 25 Mar 2026 12:03:31 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] KVM: selftests: Guard execinfo.h inclusion for non-glibc builds To: Hisam Mehboob Cc: kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Aqib Faruqui , shuah@kernel.org, Shuah Khan , pbonzini@redhat.com, seanjc@google.com References: <20260319000842.1213426-2-hisamshar@gmail.com> <091f264f-21f1-464d-913a-1500643728c7@linuxfoundation.org> Content-Language: en-US From: Shuah Khan In-Reply-To: <091f264f-21f1-464d-913a-1500643728c7@linuxfoundation.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 3/24/26 12:02, Shuah Khan wrote: > On 3/18/26 18:08, Hisam Mehboob wrote: >> 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/selftests/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" >> +#ifdef __GLIBC__ >>   #include >> +#endif > > Is __GLIBC__ defined in musl-gcc? Looks like that is the case with the > error? If __GLIBC__ isn't there you shouldn't see this error because the include is in - this error doesn't make sense if __GLIBC__ isn't defined. What am I missing? +#ifdef __GLIBC__ #include +#endif Also check tools/testing/selftests/bpf/test_progs.c - I think backtrace() stub needs be defined only for the !__GLIBC__ case thanks, -- Shuah