Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp130416lqo; Tue, 7 May 2024 14:45:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVuLYFG4oI44oUnrsj8Kn+ruVjia8aFbyyTVGsjIDlCe34fP918j6t5lO2wbhkRtxTDbSpxDzd0tnnyvIPhC9G1Crpx5RwhK4t4T8bKQA== X-Google-Smtp-Source: AGHT+IE3TD0kvZvJy5fzf0LBqXGR5Vd/7g1/8uh/ZBMgMMt0z1AblaG1YbUnp3O0ZwZT39jcZ893 X-Received: by 2002:a05:6122:311d:b0:4df:235b:8ba1 with SMTP id 71dfb90a1353d-4df691860b0mr902780e0c.7.1715118324507; Tue, 07 May 2024 14:45:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715118324; cv=pass; d=google.com; s=arc-20160816; b=RnXt8kKvaE1tDM8j/ixRFax7oP/5KtiIEbYoy4gi4SnOOMUOI1dNfCm5QFr8xBOA6y WGiKFbhL9THymVN5k5VqdhEtTvcxN4zSpF6WnkjJFNZbYIRjNaQPTomFXUt2W+tbsTPz 9EFm5L7PeCIifOUFBHLTbw/rXmK16frADC+WKRudiFz50yB2cd28AOF2nLqJFWwP/9Lz 0nS7Nrjtcajv+Kv+ltDN+qTRiMkCSLX48E5mtxS4g0UUjE/v3BqBoNwxCmKn2uLrydij uXtwYcgr9t/8ashfcVAtPOREWefqNNysiJvE12pq+ggS3fhXWI14TsXvNq/M14ZDkToD Jg4A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=FLG6gbZomB6DmPXjYL98l5fNcPQGk+fw1rCWyau0VTc=; fh=sS2kNMR5DTXqsi5j0EHZD3qg0V9IBLjv1/Zugre0oHw=; b=SI2uzOCMK0OPA0XxWtz2A7vnBLE9djmzjelMyQajAJZtY01viCuGQBREmuNQ6Q3wzW qZD6mNpDe9xFZCU+gi9IDdCkfsHiIuM//v/cclnNuZCyEjKRhPhqWv0EDP3hvWsmzD7z 6RHWYgI4Y9NODQmW8FwA3phXFRNyMxo4zh0Rlm1GRpu51ONhrW6HzdcYW/MrK98rzaFq HV7eRk92mBlbQxNUdAqidTI3mdEDd2BVxBfPTNpkewbQCLqsJTj/LBnFZMjqxmYWyvFz ZwfFy/7g7yF3Jmz500/CTmJwGt8n4lhhe4VPAFpCmi7LlPss+In8qi+GoeD9z8hHcd2p 3K8A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=b25Je7L2; arc=pass (i=1 spf=pass spfdomain=flex--edliaw.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-172225-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172225-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id s7-20020a05622a178700b0043ad3872a6fsi13096056qtk.102.2024.05.07.14.45.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 14:45:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172225-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=b25Je7L2; arc=pass (i=1 spf=pass spfdomain=flex--edliaw.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-172225-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172225-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 2CBDA1C23C00 for ; Tue, 7 May 2024 21:45:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 97E7C1635D7; Tue, 7 May 2024 21:44:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="b25Je7L2" Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (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 A739414B966 for ; Tue, 7 May 2024 21:44:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715118298; cv=none; b=WrcNMOMDxW642MOJ3lBoxP7mf5djbQ05fmW6ERDvvksItJbaDJxkL7GE++c8bAJXZvfafDSjEpZ1j/GJg9hQiRI8Wq1EOcCsYhDgDxCFgi1FtnEyVROOQ7KzYGtfwQI1VxwuxOScCY/C/AC023GA7QAtDiOfyqZRzkorFt1X1Ck= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715118298; c=relaxed/simple; bh=uNS5SgTdf5Lqki4ZbkJSsqctuLHtwyYyPdiI8DfFaoc=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ZkW1DnFifz/F9MCplv+scy4jB2uv9jV6gsXIEEi6Qmz7kTO0Ofr1jfWzJJV6FtlfrB1fGVhncGXKf2lM0UrY873RQBm7f58lWwk572drN3PNBqE+0ugkJ7rmwxpYZhJUfMosTeK/uQEaGxLVi3Gn30KCLQtWwAFslt1WAlyl5gU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--edliaw.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=b25Je7L2; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--edliaw.bounces.google.com Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-620308b3684so63920477b3.3 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=vger.kernel.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=b25Je7L2Quzfv3n/I6HkRWZWcA/958eViIpE7eBFiZOQIEdBVFejtYX6J7JOcIj8GQ W32hZpavJhwVOJcxeSFosJx/Ov0MC7KMyzdIV7Ahu3E1dPNZRHIfxOmzzxb2qX4yDXSf g6TzlrTztE7gJwArtUsIdKTACHu5VfSQQ0A6u+D+1SiRNKf08pufhYA0sXNA3/qXedNM TFtW2e+lLCtgIhQMT9C7oWxlGCFN8tpQdWpvapchtmLGdk4HJgZkIzZiWlmAapXiFahC MEP3eSgvRLnClvgynwYzfsSPzqg6hs7iP4WWY4O7v7a+RgETr2XXajQ9RUjo6NWc/nzY 72AQ== 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=fEiEZ7mqoLGzR52m6n73Cfrvo46cctEgomrk48UiTIwNdMrXJUtGQ/CmaT7/A7O6bL qA97s4rouduLXJfZkp6hAWx9+C1ZIbbC41d9pyyP1zrGi3M7brqBAlSDNVp0ycNsAibM yuI8vSAmqieliJwEcftOQWI5/P6ZyhLwR92aKVtby23/LzNh3nwvMOfvRec3d3A81rTR /6oK8DlClcqmYg54RBVPg57uL0hqhvOaJ03aABjSaw4x6TfRnFs9IWjsH6dzwIUNkYkf jRQ0YF49IvuU53iT/0bYooKNwrBXGwBHZxlcsnES+9pdRkMGDwcbzfLFB042v+kqU9T/ za9Q== X-Gm-Message-State: AOJu0Yw4LC21WlepDJdUcKSZXjd1c7nQUTTBHjEcsvgh9esfpYVOfLro aWnYlym9/J4ADJo30/l70lk6VHJQ6iX/SfebXXZxJ8hbpa1Z/z+MmkQfYz7FeXsAHQA0ee8lRAd NQg== 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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=20Almeida?=" , 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=20Sala=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=20F=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 Content-Type: text/plain; charset="UTF-8" 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 --- 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. -- 2.45.0.rc1.225.g2a3ae87e7f-goog