Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1427232lqd; Thu, 25 Apr 2024 15:41:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUZea9nouGeeDn5Ci+4LbBOxgObeMrBtobZRoViu6a5Ihb8gCdSi0cG2VDAAPq/qVSPnT48TCkuSedcMySrg02UVDLH9+5NdzO6qzRPuQ== X-Google-Smtp-Source: AGHT+IGLaRWp40SCiEywLlw4ObYGDU8TPzlo2jr90flJPJwjBb2Wqq5q1omEUFp7NKNWH6c/X5QJ X-Received: by 2002:a05:600c:34c7:b0:418:f991:713f with SMTP id d7-20020a05600c34c700b00418f991713fmr532143wmq.23.1714084911835; Thu, 25 Apr 2024 15:41:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714084911; cv=pass; d=google.com; s=arc-20160816; b=M0HNsqhRQoDBhUrn1BzcxsCQDPjxUaCMiFtXNHCGpDYCSogMxn4sEWVd+dfvZ5cD7H Z0EZRuKk98NpFf0dgiFdmxgVj/AqJMq0EGKYT4Kz1IY5gwCSNhD+288mEQygmwdrR8XN LcID894D4gBFiTLpwg0Br6j7Z6iUQwuOukhOic7yOn97vzltXb4YmlVUpHEbk209+kiL dgS7U8MHjV+4EKn1Rmd+nn/GfdKWh+90IYA5JHXjlLyzUrjrgEeXXYuCz/Ww1PDvq5Di luh2cP27mpysoYSesemS/bs8EyCCPcB1nIaOFvoXtk4jfRwZFLWUJM6v7YJBELTOC0h8 K9Cw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=GCaJfAPaJTJk4qPysJNwA1mMKwjvwJd7/RjWgxHGHyY=; fh=Fe+SSsTZQ/3lnnkpKJA0ZUcePtNTBemrwoJMNJU4nQ8=; b=etOemJSFieSsqn3jK8ym+QAmVIpxy+qQ9mvzEUVbdnA7eB7nn4QQF6qHQRisFKcnDx AEHFQEHVcDo6UjGu/QggwRsgD7xKOmuGuZzL0crJB8lGf+S0MDC37iznlAZ8uy/DB9cY IqzdbAehGxJSot58RkXUOzg3pet05uVXsZ0xL/5wVccLkk007X2x1zRktftQwJCyHXf1 KBvgQGv6/3BxYcg9hTTNDuZcYu4eijXKTaBD4ly7Nzoy3bsv2CR7LUWB6D7ZNU0s6vvY 7MkDcwVQUy7IWcXrh0BGRzeK7Pfal58vtlq4epoI5QwgFln7ahYU1mocIEZg30Aaa4Lb yctg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=flIG79Ky; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-159329-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159329-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id z91-20020a509e64000000b00570242da2c2si10465151ede.535.2024.04.25.15.41.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 15:41:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159329-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=flIG79Ky; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-159329-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159329-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B01481F21DCE for ; Thu, 25 Apr 2024 22:41:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7110484D0D; Thu, 25 Apr 2024 22:41:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="flIG79Ky" Received: from out-177.mta1.migadu.com (out-177.mta1.migadu.com [95.215.58.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58E8C6CDC1 for ; Thu, 25 Apr 2024 22:41:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714084903; cv=none; b=N845FFYh93LmLKOIQAXZzGHNjWpYJmlrIFOegEI4QAG3/bLoUODFrn6AqdOrzr9Kc5sIPZw5vOD/hE0OSTwnPJNlntIF/z0l5Fm4qkScmCHeaJdcEFiR2vofUITLCapPT4TRm9bGMhyCWRjYHa3tLou6lHK4ADty1wpkEL5b9bU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714084903; c=relaxed/simple; bh=oIbf+AzJRKngb2p73mGFU+CuiAIWLnjaDZekQY9OMek=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=s4hXumr1abnf+XSj/Op9E/PnNyJWg8bGZfsxcaUFMjF0qELXxwYkUK8MrOvyMrX7zc/Tw21oFRbsiCb11vBeysIGwalJIHkyeHmAb+4a6V78YznQPOk7BsCVxffn5sf3SFy2O0LodleNIYcYDhjTTTLabMl6cuSsjlBtF3EhYm4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=flIG79Ky; arc=none smtp.client-ip=95.215.58.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Thu, 25 Apr 2024 22:41:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1714084898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GCaJfAPaJTJk4qPysJNwA1mMKwjvwJd7/RjWgxHGHyY=; b=flIG79Ky9avijT6lxv6ruTzaWrjTez3ao65sse6mEFWL42L71Fy+HwoaFDVgbhqSQc8Plc 2zVls0Jn+yPxfrWHmLf2RsKd04+qj9yHIh5kAk1zeFvGngWMAknB7HIf4j1elRNjy/VQeD 3uDkbrZxw2MMlKn7IbsrZ3Do8tWuOuc= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Sean Christopherson Cc: Paolo Bonzini , Marc Zyngier , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Muhammad Usama Anjum Subject: Re: [PATCH] KVM: selftest: Define _GNU_SOURCE for all selftests code Message-ID: References: <20240423190308.2883084-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240423190308.2883084-1-seanjc@google.com> X-Migadu-Flow: FLOW_OUT On Tue, Apr 23, 2024 at 12:03:08PM -0700, Sean Christopherson wrote: > Define _GNU_SOURCE is the base CFLAGS instead of relying on selftests to > manually #define _GNU_SOURCE, which is repetitive and error prone. E.g. > kselftest_harness.h requires _GNU_SOURCE for asprintf(), but if a selftest > includes kvm_test_harness.h after stdio.h, the include guards result in > the effective version of stdio.h consumed by kvm_test_harness.h not > defining asprintf(): > > In file included from x86_64/fix_hypercall_test.c:12: > In file included from include/kvm_test_harness.h:11: > ../kselftest_harness.h:1169:2: error: call to undeclared function > 'asprintf'; ISO C99 and later do not support implicit function declarations > [-Wimplicit-function-declaration] > 1169 | asprintf(&test_name, "%s%s%s.%s", f->name, > | ^ > > When including the rseq selftest's "library" code, #undef _GNU_SOURCE so > that rseq.c controls whether or not it wants to build with _GNU_SOURCE. > > Reported-by: Muhammad Usama Anjum > Signed-off-by: Sean Christopherson Acked-by: Oliver Upton -- Thanks, Oliver