Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp72397lqo; Thu, 9 May 2024 13:01:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXh2dMOKB5bFN7BKXl0YiTD7xZ17Hkd0tS5OCpQ2bKijgrozqvCvow2PcpvomsVetSl21VXVI5Xm17wak53efmOWJ7Upi8hcaC+3zsf7g== X-Google-Smtp-Source: AGHT+IEBVWIJ6gKe5a3qflutO+QySA4Af7ZKdGZQN9SdKRqhFiQitDbYH1r7tzSy7aWbfgf1ERkf X-Received: by 2002:a05:6a20:7350:b0:1af:d043:8714 with SMTP id adf61e73a8af0-1afddeef6eamr1190998637.0.1715284871981; Thu, 09 May 2024 13:01:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715284871; cv=pass; d=google.com; s=arc-20160816; b=XxCOZ8qcb+yIaJY5Ni4ZevQ0Jy3tRpjSQLBsIgz1XsJGrp1kgOf9+VvNmL/SZ80M6r R2qa+iQ6+CGyiIr+YbxO99wekjXUIaU+l+70fa5St5Yczv9PNJp/Wg7f6hNBIyUILhiW Q/bnLBBSWuGHPCEVGb1EFreip89+ujAl6i1f3toTvtUrhGA32HB/E37zyu1HNvSinuLy F26D4Y82mO/vYQj3MyMsVL2Yf8me8QjKnURsJ4ZcjH7vz0X1BjN4SRmgFx46+pF05D0S L63EoIPevgio4XnOJ/HDur7lvwCWw+YwClrxUd1s4G3nbYNoeunuoRDnFc0/x4OTgtsN A14g== 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=Ba6gtNWy+5dDG4FkE5cayyoNwuE5iBhkuWvzvH75i1U=; fh=7C+gklebss8pCgeO6gvr/acSxmKasIh5HaFURKWsg0Y=; b=Koj/yuShvFIqBTZ74voyTVBmRQLcUp+N/LZICWQqAdwe5C+GJos93YaK2QDC72vzgy y/rfc/ztRLH69oOnzMX41Ig67oVBDeynFJpQPifbB9Ofj5Ma6NN1VPOr0c0psAvrzCPk nhhgUdVX3aWcDB/9sEvrPEX50A/9t1apYc0bT7JL0hkaUbPUoMxs66+9V+snGVFiEp9X WzZnWwBrt0sBauLBc9GNDzcHo3UGLC5g5c11Yz3XIj2aDcUxUjVOlvsM/tKGJ6l125NS sLX3lrhcQaAspRqA+zlAvl57tXFm6GWni3ydd1MifAT6hOldK4S9TNsbFJTsuzgPlmqe XZAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=AzV9vP4R; 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-174846-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174846-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 41be03b00d2f7-6341020c753si1962429a12.277.2024.05.09.13.01.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 13:01:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174846-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=@google.com header.s=20230601 header.b=AzV9vP4R; 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-174846-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174846-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 628122855CE for ; Thu, 9 May 2024 20:01:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2328282D66; Thu, 9 May 2024 20:00:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="AzV9vP4R" Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (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 667A680043 for ; Thu, 9 May 2024 20:00:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715284847; cv=none; b=c/qg884ZbVoiyYQSMW+uF2mKX8wNncfSVSdEp+s7h4VKohssEKTax68IXuvb5uiYNk5PAf7kfTSk3R6R6GFfpvzoqAKVHu8P4Zj0j+PECkUV3cIfJfQoMb2C9we9yCCDmARbngKyYkSdngeXlWN50i+zI05Aw6J1C7aBWTmqkPY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715284847; c=relaxed/simple; bh=sKq0NyNZnefL7KfhQ+DAvF2g31FUow+Jz6znTC7Z/lA=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Ir0tbuLZgGGrh7enE1Bx1DWroGjfpQ8zhLRd6IqVMqpBVUfzHWvFM63gY6VB2o2VRZDiyofjn4txCjjXgA9yyYsofLazVaGS/DQGQQvNAh/2cg2n6Bz/9MwCcAVdtSB33jPeo8FjS7gobzR2qQU21j8L8KfQkZf/jcpJPIVTpRY= 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=AzV9vP4R; arc=none smtp.client-ip=209.85.128.201 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-f201.google.com with SMTP id 00721157ae682-61510f72bb3so22861577b3.0 for ; Thu, 09 May 2024 13:00:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715284843; x=1715889643; 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=Ba6gtNWy+5dDG4FkE5cayyoNwuE5iBhkuWvzvH75i1U=; b=AzV9vP4RFDGU1uUxjqqw7b3BqsAIciN7KQ3ACP51Q+AArDopRVxg2J0VdRFRX5E3p1 24SY6BYj7LbLKr6MFJLZ2EitoLeQFP6Gbhm7M/ohJ3MLeqLMJeaFPdB9sfkxFfPh+s/R f8ehKyF43eMmWe7GnZLUTNLmpRYnWXI+OlixQqqOwDTwksPvYnTTPInP2u0BFZZTQSYT BejFhTdrtHSlPmizKArskq3EoFrxJBAUfYsPYNeiFrvWKP8toUJOyQMUmw/AOwZPfGmD Vjtov6gWtz44WDRdwsvCeueFiEySmA3aWBnDIPjbApuucpi0qoU7rr57MoxTcirStOuo swlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715284843; x=1715889643; 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=Ba6gtNWy+5dDG4FkE5cayyoNwuE5iBhkuWvzvH75i1U=; b=tgPt7bSKSREl2taJoQphkrWKWPyr207ohffd+liOZ0GiK5zwfnKhbu+OHK3cVWeHnG Llu0MAKEc6j9KQr7cAHwCX3mKokkVC2rlnAxymxW4MBjJ/VSyEcHfNVP2AYUExkOj4uH zmoBHZn6tVJVJiTzL+4wYc05KnHETl7IXsdfh8Yj3mcmQwKQR15Fm8TcI0q4ke6c/cEc 3or/3WsM0aK/rWyvon8ihbgzMQMiLlds1FFjnh25AXUk8WLzg2benzhnql6dvAEX4pD4 kL2Cg2uOsUr8gyvoKeBgF+IBr/zFkC2aLGFlYebimXXfxS/AYqjnM2+jFhn7tpER+PkC GNww== X-Gm-Message-State: AOJu0YxxDhJoo/xtObfoag471Ew3tNLAO4h0sz1rZVTpPPBt3Bv5mAE6 mMpRL8FkFKibpjCzao3okxscgEjAeazc0+m2QdQbZ264CoOLOAQemhA9AluszJavylZVOeXgFMb BCA== X-Received: from edliaw.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:305d]) (user=edliaw job=sendgmr) by 2002:a05:690c:6f08:b0:61b:e39f:143b with SMTP id 00721157ae682-622afd84a02mr1771287b3.0.1715284843538; Thu, 09 May 2024 13:00:43 -0700 (PDT) Date: Thu, 9 May 2024 19:57:53 +0000 In-Reply-To: <20240509200022.253089-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: <20240509200022.253089-1-edliaw@google.com> X-Mailer: git-send-email 2.45.0.118.g7fe29c98d7-goog Message-ID: <20240509200022.253089-2-edliaw@google.com> Subject: [PATCH v3 01/68] selftests: Compile kselftest headers with -D_GNU_SOURCE From: Edward Liaw To: shuah@kernel.org, "=?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?=" , "=?UTF-8?q?G=C3=BCnther=20Noack?=" , Christian Brauner , Richard Cochran , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexei Starovoitov , Daniel Borkmann , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , John Fastabend , Kees Cook , Andy Lutomirski , Will Drewry , Muhammad Usama Anjum , Edward Liaw , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@android.com, linux-security-module@vger.kernel.org, netdev@vger.kernel.org, linux-riscv@lists.infradead.org, bpf@vger.kernel.org, kernel test robot , Mark Brown , John Hubbard 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 Reviewed-by: Muhammad Usama Anjum Reviewed-by: Mark Brown Reviewed-by: John Hubbard 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 9039f3709aff..f0431e6cb67e 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -170,11 +170,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 7612bf09c5f8..31b2c70a2be2 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 429535816dbd..3023e0e2f58f 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -67,7 +67,7 @@ MAKEFLAGS += --no-print-directory endif ifeq ($(KHDR_INCLUDES),) -KHDR_INCLUDES := -isystem $(top_srcdir)/usr/include +KHDR_INCLUDES := -D_GNU_SOURCE -isystem $(top_srcdir)/usr/include endif # In order to use newer items that haven't yet been added to the user's system -- 2.45.0.118.g7fe29c98d7-goog