Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp336098lqo; Wed, 8 May 2024 00:49:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUtDkpqfwYFgWxkX0rAVAHDHbg2d9CampcTlwzq6PR7J6pxLinAa5/zTwYu+Bnxc4EkFAfcIITrysCX/pihU1oKAVPDZH6TRr0j8P/vJw== X-Google-Smtp-Source: AGHT+IEmofXYpdtYyODdhPeDyMz3YH9despfRZ1uXDms/IgLzujjnA73Mm8lq93mDFFVXCVo+Aog X-Received: by 2002:a17:902:c947:b0:1e8:682b:7f67 with SMTP id d9443c01a7336-1eeabfa1b44mr29867175ad.29.1715154592077; Wed, 08 May 2024 00:49:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715154592; cv=pass; d=google.com; s=arc-20160816; b=zNmhjsaNqCNrqCO1o69tt0vntID+k+fvffayvcQAsHfPS4mnpiVFIAX9NKggqHfUKb YrgxSnOg8hfNP9+04W/v5/A1UcgKH8CNNGwtmqoVmZWuYC7wtZhQ4uUBZWGKcVXUew47 DSktZk2zteK7eJ0peZhU7j+KO1E1/zcjs0cmZua4iEtp026j/G72kBCGTfWL4gCQA4it tPPmMU1rFqqdIOnJ64KOy06ORn3R5yO0BQH4GZ3Rupk+84JFXeoe1nln77xkOqcg29mw aexYe8dGRUnPjP/55oSScnHtO6z/yrEoVQ7mU/Gsgg3O0pYN3ZR5+2vJVXQN2sSLGLUK zTRg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:cc:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=j3dy4HI7f8Gt9w8DyqZ6Q2Y2Mgigf0cwtxl/Oe/lEUw=; fh=L75ITwoTus2w/61pHzuQmassTXU6itvzvfOEGxtmhPM=; b=A2zbvEiruEsjJAZtJodyVgFrNxNWvMnpaUsYhih8kI7f4oKXerDyUu1aycIwVMCFnW u1zeeCQb0r8YT9dxjHGGK2BXJVBgMGjhy/rmMmDElpuH1/dCuGgVOJQi0ioSuQKArYxG 7MVgSlQKoPwnJ8xZSzEI2ESZbKDRZ4y+k9F+FHC84ss4VTG27+qa/0A2mBUH9LEDaOru meBHfobp3++kvkqIvJjxzFRqRZlZPjaS8q2gP9Y4+ilDJhrktiK4bKPlK4z4HW0vtIhY 3GzxRXg2A2utlNb+P2RVCnw46Y+M4TbaCEjfyVsuxYeK91OTn82tr1AuxSHALLGOrJ2/ 6bfg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="MbV/DHwt"; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-172856-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172856-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id mf4-20020a170902fc8400b001eb79a23da8si9897889plb.238.2024.05.08.00.49.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 00:49:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172856-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="MbV/DHwt"; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-172856-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172856-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E920B28380D for ; Wed, 8 May 2024 07:49:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ECE8A3FBB1; Wed, 8 May 2024 07:49:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="MbV/DHwt" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (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 29C3B2C85F; Wed, 8 May 2024 07:49:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715154553; cv=none; b=J31IriaSeFLm5YglO/En/6o/Kg7umjTRc7M3sqoqT95r70J36X44spsu8teu+k0qVbQBRdcZgIrMExhJojM8SL4YR9MlfWgTSxcFGBcYxJZHZ5oHje/stggxeh/htEqJNjouBgWMDxUgSceNafHrmoERaELAXA4mahx2QjLFX1Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715154553; c=relaxed/simple; bh=MofcZIwCP6uQfQVp6EE9HurxL3czn6diXGm18p/OF50=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=QP8r7FGCEIG9RIPEHrCJr201UpOq8fxdk2dGIGtH485FSZl0SCLcbFaQsRohnC5mV9vR2V+jJTIMKpfb4h9Jv8+Z4lR+4Ho9xY5yp8IEbhuQi1OZpX5aaJnvhz+jvpc1dwlZrJM7qKEpQjKP4MX2Nc7TE8804Qx1YrSNGjMmO1A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=MbV/DHwt; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1715154544; bh=MofcZIwCP6uQfQVp6EE9HurxL3czn6diXGm18p/OF50=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=MbV/DHwtYAujOpXoDCW0s0KB5riHG/p4OMQuvDB00Pz7/gzHkZrQVMbWFe8RMvmKa E7/eZm+J0KkW6WdglkC3NhaZhrrqLwrLM/rN6pAvFjHBThsazg6zRLYCYBJKWtjUwR eLafdjBQjRl8tFVMXaPf7ETS5Spz1U0TN2/pXHhbkRMUKnerr3EUzBLw1LELesDSjx ww1UwcyShSZE5MdiI2h1EXPosoRI0u6sJbDL1yLfBCglfBakx0ihDdtGsu1uPdwGRy epZ0TaGCSSjrbxIQaccEYwAzomyOHcnd+TiIXNmGJ4FavJjakZ9om8hZy1/HJ08OvK /vO//iWp1Vbsw== Received: from [10.193.1.1] (broslavsky.collaboradmins.com [68.183.210.73]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madrid.collaboradmins.com (Postfix) with ESMTPSA id C668C378107C; Wed, 8 May 2024 07:48:36 +0000 (UTC) Message-ID: <546aaaa7-d796-46af-8805-1612759aaaa5@collabora.com> Date: Wed, 8 May 2024 12:48:57 +0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: Muhammad Usama Anjum , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@android.com, linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-input@vger.kernel.org, iommu@lists.linux.dev, kvmarm@lists.linux.dev, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org, linux-actions@lists.infradead.org, mptcp@lists.linux.dev, linux-rtc@vger.kernel.org, linux-sgx@vger.kernel.org, bpf@vger.kernel.org, kernel test robot Subject: Re: [PATCH v2 1/5] selftests: Compile kselftest headers with -D_GNU_SOURCE To: Edward Liaw , shuah@kernel.org, Mark Brown , Jaroslav Kysela , Takashi Iwai , Catalin Marinas , Will Deacon , Nhat Pham , Johannes Weiner , Christian Brauner , Eric Biederman , Kees Cook , OGAWA Hirofumi , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , Davidlohr Bueso , =?UTF-8?Q?Andr=C3=A9_Almeida?= , Jiri Kosina , Benjamin Tissoires , Jason Gunthorpe , Kevin Tian , Andy Lutomirski , Will Drewry , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Paolo Bonzini , Sean Christopherson , Anup Patel , Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , David Hildenbrand , =?UTF-8?Q?Micka=C3=ABl_Sala=C3=BCn?= , Paul Moore , James Morris , "Serge E. Hallyn" , Andrew Morton , Seth Forshee , Bongsu Jeon , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Steffen Klassert , Herbert Xu , =?UTF-8?Q?Andreas_F=C3=A4rber?= , Manivannan Sadhasivam , Matthieu Baerts , Mat Martineau , Geliang Tang , Willem de Bruijn , Fenghua Yu , Reinette Chatre , Mathieu Desnoyers , "Paul E. McKenney" , Boqun Feng , Alexandre Belloni , Jarkko Sakkinen , Dave Hansen References: <20240507214254.2787305-1-edliaw@google.com> <20240507214254.2787305-2-edliaw@google.com> Content-Language: en-US From: Muhammad Usama Anjum In-Reply-To: <20240507214254.2787305-2-edliaw@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Thanks for patches On 5/8/24 2:38 AM, Edward Liaw wrote: > Add the -D_GNU_SOURCE flag to KHDR_INCLUDES so that it is defined in a > central location. > > 809216233555 ("selftests/harness: remove use of LINE_MAX") introduced > asprintf into kselftest_harness.h, which is a GNU extension and needs > _GNU_SOURCE to either be defined prior to including headers or with the > -D_GNU_SOURCE flag passed to the compiler. > > Fixes: 809216233555 ("selftests/harness: remove use of LINE_MAX") > Reported-by: kernel test robot > Closes: https://lore.kernel.org/oe-lkp/202404301040.3bea5782-oliver.sang@intel.com > Signed-off-by: Edward Liaw Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/Makefile | 4 ++-- > tools/testing/selftests/kselftest_harness.h | 2 +- > tools/testing/selftests/lib.mk | 2 +- > 3 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile > index e1504833654d..ed012a7f0786 100644 > --- a/tools/testing/selftests/Makefile > +++ b/tools/testing/selftests/Makefile > @@ -161,11 +161,11 @@ ifneq ($(KBUILD_OUTPUT),) > # $(realpath ...) resolves symlinks > abs_objtree := $(realpath $(abs_objtree)) > BUILD := $(abs_objtree)/kselftest > - KHDR_INCLUDES := -isystem ${abs_objtree}/usr/include > + KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_objtree}/usr/include > else > BUILD := $(CURDIR) > abs_srctree := $(shell cd $(top_srcdir) && pwd) > - KHDR_INCLUDES := -isystem ${abs_srctree}/usr/include > + KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_srctree}/usr/include > DEFAULT_INSTALL_HDR_PATH := 1 > endif > > diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h > index d98702b6955d..b2a1b6343896 100644 > --- a/tools/testing/selftests/kselftest_harness.h > +++ b/tools/testing/selftests/kselftest_harness.h > @@ -51,7 +51,7 @@ > #define __KSELFTEST_HARNESS_H > > #ifndef _GNU_SOURCE > -#define _GNU_SOURCE > +static_assert(0, "kselftest harness requires _GNU_SOURCE to be defined"); > #endif > #include > #include > diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk > index da2cade3bab0..2503dc732b4d 100644 > --- a/tools/testing/selftests/lib.mk > +++ b/tools/testing/selftests/lib.mk > @@ -45,7 +45,7 @@ selfdir = $(realpath $(dir $(filter %/lib.mk,$(MAKEFILE_LIST)))) > top_srcdir = $(selfdir)/../../.. > > ifeq ($(KHDR_INCLUDES),) > -KHDR_INCLUDES := -isystem $(top_srcdir)/usr/include > +KHDR_INCLUDES := -D_GNU_SOURCE -isystem $(top_srcdir)/usr/include > endif > > # The following are built by lib.mk common compile rules. -- BR, Muhammad Usama Anjum