From patchwork Tue May 7 21:38:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Liaw X-Patchwork-Id: 13657830 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2082C10F1A for ; Tue, 7 May 2024 21:44:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4EA6C6B0092; Tue, 7 May 2024 17:44:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 49A906B0093; Tue, 7 May 2024 17:44:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 33B5C6B0095; Tue, 7 May 2024 17:44:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 124A36B0092 for ; Tue, 7 May 2024 17:44:59 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 848C81A0B74 for ; Tue, 7 May 2024 21:44:58 +0000 (UTC) X-FDA: 82092930276.10.D9E0172 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf17.hostedemail.com (Postfix) with ESMTP id B653A40011 for ; Tue, 7 May 2024 21:44:56 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=ENqLhnmp; spf=pass (imf17.hostedemail.com: domain of 316A6ZgYKCDwcbjgYuemmejc.amkjglsv-kkitYai.mpe@flex--edliaw.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=316A6ZgYKCDwcbjgYuemmejc.amkjglsv-kkitYai.mpe@flex--edliaw.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1715118296; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=FLG6gbZomB6DmPXjYL98l5fNcPQGk+fw1rCWyau0VTc=; b=G9YGOen68hKbxMsytmijohlbPzORMk776CzNN5R9VFW1fnMptFlahOUG2p2PD/BzGnlTaA dQc3IwfJ+DZwJozcHxvHn+GAfaul0t9gLqKvI62AXvnvLXBZ3KWY4ZnWtgpJ6v8a0jjO/h yAz7oos1GRtoh/3LhjmPolv5M4KhsnE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1715118296; a=rsa-sha256; cv=none; b=R345vR48TGMQ2v5zpvFqDfL0MFEcqiknnKDY6xGDfjdWDDOoUBXsesen58wH73OFJBqP5K bg40kGhaLCETxyp9sh830zMX58dZRgXF7VkINbh0NbeLZ2Hm48YKD/j5t6HUkDY+a9RgOw hOBBgj5prSlDJteZnrfkDoOOGEeYu/o= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=ENqLhnmp; spf=pass (imf17.hostedemail.com: domain of 316A6ZgYKCDwcbjgYuemmejc.amkjglsv-kkitYai.mpe@flex--edliaw.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=316A6ZgYKCDwcbjgYuemmejc.amkjglsv-kkitYai.mpe@flex--edliaw.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-61bea0ca5e2so66669397b3.2 for ; Tue, 07 May 2024 14:44:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715118296; x=1715723096; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=FLG6gbZomB6DmPXjYL98l5fNcPQGk+fw1rCWyau0VTc=; b=ENqLhnmpAmZbItxgoaN2J2eB3lAE5EjAPsj/s+M/qB1MW4A5FpspN/oqeEkJftE03V fCu+UpxCfPm/iwBYYdYzW9brTA9FHcsrnFHQY6aVZB/wMNWrWpnYUl0vhqHyIcMRteI0 CTOAqK79CM6oIFJoEkaimZYdbuKKLjEN0YkvnhMB4cIF5Zf0+rvfa3UM0vZWNbrZWfF2 aHwG++yGX3egMz/44o2GvG+iMRRtdJJB5lxuLPCJZMFUXt9Gvv2mtAz9A+fV7KHCTieO du4wP2royNpsAME+reGSGVrADo8tLwSb7CoJennmluxGGl32WqhNnuO996/MLK4qS5e8 zXDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715118296; x=1715723096; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FLG6gbZomB6DmPXjYL98l5fNcPQGk+fw1rCWyau0VTc=; b=LMEP7YX2mtePXgWDpM/TfRU7LUHnk5Nbwaf5Yn3XQn3HqBlLLf91dPM1GqbFzI6exj 3xUrorJueFQtRC8K9h743LvMZ3LCppliqTPudvGYa+lQbF9pc0B/YHrFXLtQUs5r0OPE NM2V4+yxdlC1CTCwQPazeRY44nOQ0659VzUtyexMgsSA/XjADuD2Rp3XLq+WH7BsFuun 6Vq2L4J9Dt7duRE250KbDGOtR4ZambFBaIgPI7iuZHbqh84wvdL9H7sY9QKczXnQ4Gck LEsZR/7T7MkzfgYT4pjEfBL9K3XVtGR1hoZcozy1CpWZ3bB4VlfUax1ATW4HamdjOqUO 0xuA== X-Forwarded-Encrypted: i=1; AJvYcCUqmeqaec1Q185nS4ZsKfkC1458nF1VbVVyft1Knw4Adxc3iusAnGFXSC1u+FLHw5UHl1ln3n2SmLIC2jME6F2AiUA= X-Gm-Message-State: AOJu0YxvspI6YNIPnE8VsJpJ+jocAqBZk0HoAKF7Dyt+5PvuwoY+wsKz Z+3lRvGi7s+DFKslrr0iFzmotwYLR+XayckdNIChZZ5MRO7VPRzfodNtIN2pcjh+aEyHgWjAfKf cOg== X-Google-Smtp-Source: AGHT+IFDRufPRd20hhB8IsmwhuIIZ1gDaiY3aRkAgAGU63hP6Y69UhIvyGPjEABNQz9R7M3kyPQJ53ZX+tk= X-Received: from edliaw.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:305d]) (user=edliaw job=sendgmr) by 2002:a81:a189:0:b0:61d:4701:5e65 with SMTP id 00721157ae682-62085c5c5fbmr2405797b3.2.1715118295730; Tue, 07 May 2024 14:44:55 -0700 (PDT) Date: Tue, 7 May 2024 21:38:26 +0000 In-Reply-To: <20240507214254.2787305-1-edliaw@google.com> Mime-Version: 1.0 References: <20240507214254.2787305-1-edliaw@google.com> X-Mailer: git-send-email 2.45.0.rc1.225.g2a3ae87e7f-goog Message-ID: <20240507214254.2787305-2-edliaw@google.com> Subject: [PATCH v2 1/5] selftests: Compile kselftest headers with -D_GNU_SOURCE From: Edward Liaw To: 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 , Muhammad Usama Anjum , Edward Liaw Cc: 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 X-Rspam-User: X-Stat-Signature: 4mbyy4ns84x5kmspcxsmx5dr7ipxfb18 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: B653A40011 X-HE-Tag: 1715118296-874820 X-HE-Meta: U2FsdGVkX1/kPvCQ85/yG9XUFFaB0NWGNc6Wpf386mXyxp5YAFMIvn2RTm20832V9DiixvaeAIX/Hl5thdZ5sOT6m4Fz2Z9O9uKKCm3eYyM3NFUHVpnsqdNEdWnydpFHHo+46MIOXyiqjxcK/Q4GfOuOEqUIkibzYTKybkwoZkUP0dN324Dc66UsW4aHqdFPNaRKwAH6OkmpMQllCz/1bB7Vb9TZf8Sd2MP4lZGIGODHJShSMdkS9aN0rCs/63MoMKCTw0rJqDhrFTQ3eYLyVuV2qduzMWwJKDPwYKUyq1vQJUu2llhVW8tskfhkazpz67O3MM1OFd88CDX7MZ9a7DURGZN0BEx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OTLvBe/jRCQQnrOyFzzGNj/MIOVZtU/yJrg+ivkCJYWQtBXFrVt/BoEY1IfnnjfNRiggdVIi3gQUCKmod/y8XFA2OGIo2Yhs/i/x47VqMrkAbbcivPpL6UwKT/LjIi1gd9prmWanxXP8wpzlg1ei0X+0YejvNKrILMoDZ3qaQ4rbtI9ADlh0EOYjQpJRaA2Ec733L+2LblfmgnEk0rFwPhFICnterhBwiabqPSqkGXuS7qnMoGk10yNJWDf8dIw08FZeYoGnEr4SZ8joknwQlxjdin8xZRIUBrH93122rUD8CZ2hgWkvyx9W4q/E+lHX/kV8a6qmALUosMXs6lSPUYyRsD+4I2xe68eUrLJdR1CFwRtSNLh65gPd/00gwvzq86D8Lag3ni2Jag== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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 Reviewed-by: Mark Brown Reviewed-by: John Hubbard --- 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.