Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp179957lqo; Thu, 9 May 2024 17:09:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUhH3fyXzSMBr3aVw1ZFMReHPfS6QT4mw/DNpE4u9DNmw4mgWBXFr+CCE9wIVjDJJqpOdLZup3Ac+eXAHobhM2hl0DKkAZHlT0WTHqF6g== X-Google-Smtp-Source: AGHT+IG2/NE1J5E3HuOzH7FxZr9YOaGC2jfIzChGDQH1ZiG+R9enpzE5wcqXD3E4xDZGcGlOoOUn X-Received: by 2002:a2e:a170:0:b0:2d8:5fe6:820d with SMTP id 38308e7fff4ca-2e51fc34054mr6144281fa.11.1715299774834; Thu, 09 May 2024 17:09:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715299774; cv=pass; d=google.com; s=arc-20160816; b=DXQufuSZ2Mfqkbm/8ed23oveCpCTmcUEJObx6kYm2kOWwKMX55sTCQY2zgmmNYYU0r lINC82vqv62omo06mYxZeoNKvsFgdwZDp0raxkFiylNIXULuYE0nAE8SlRntSmp9xAwi EiVHd4EEx3wXPnCE1hH89lxIyJ+naw+I9lNfxXzNmjHzw5cVnwf9Pihxyn8F5oCeWyIk FxQ5hV0/0BK3wfoxCa2xIt6Ttw3boJmQTB088v86Tn95enTlCcOBxeBQuRzmRbyIxJ1b T//7k43zbgFaZEHTqQUbWtMSLQYBkzmvwkAFtyUYLE6KLIxv2dXDpgN7Gm1Yk+nNkMJy 3oEg== 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=dNdh0DGLEI6gEofoq5pc03LS982vJLdNlPLV5JPTShI=; fh=Ax1HXQm2KYc9HaqsqRz+i063hVvcWbsER7iSkypzfug=; b=QBXejN0VXZaBmlctTYHC5lbUyDWmSnxYrdMwn8bxkdWybonA8vG6tFwQig6b1dWlSr bsHFTvkUgF0y89ny0sMI1isTmwqq0f5Im6uI9fPhpKm5NZa9+wpIjdZf37r+4sKxqE5V z7SbH8nDrgsXgGjeAHeK8QLA7HsO+uI0GQBKNz8iBEEfsT+gUez8AymWouWr+zYf03rz XYykhBFWZqwDn920UTNCn6GCVcxLBa0bv/Oho6iTgEdgt4gs/H4JtQI63c+LkgMpHmt1 W9GsfnO9Q5UqsXHls0/qxTXRpA8XT6pV7FpYCXc3LR47HBYx7CCUQcogmoKyo3fSZcnN AHPQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=h9tgdsDK; 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-175096-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175096-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a1797bda6si133200066b.230.2024.05.09.17.09.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 17:09:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-175096-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=h9tgdsDK; 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-175096-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175096-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 8E2DA1F223B3 for ; Fri, 10 May 2024 00:09:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C65718F7D; Fri, 10 May 2024 00:09:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="h9tgdsDK" Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.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 72E771391 for ; Fri, 10 May 2024 00:09:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715299743; cv=none; b=LpGTmTwDRQ8oCwYVTzWjaOTlGQ3nFlatYWgeABxgaIst+ns16kCbYg/BQ9M1atw+sXYDVSj+OsXrXEZObnYnutKShkjRy1g6/v+7AL0JqMfixfPqNUR2PGK/N4iI3uO21sLup9OfGHx3Yo5TkVPyiU+CpzMitul+ll8gZ5PoGnw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715299743; c=relaxed/simple; bh=5+QjSJTDZDNs5LVpnFKjIsPkpeAYO79PdZNw5dzhpsw=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=dBFG0qcp2QGqzzHoc8S7To6lAsjQxy5226UTlXAMnSBEAeTKypfVlJQS7eDyG1Zly/qR+XsmjTLt6DpD3snqH7Wzj0Gtuj42kxWQdcB8oElpWY4ptxfJcXUPPSQeDhQkych6/u5t2bmTRAxK451NWsbO4bZucxKqUyHiHRzFQMM= 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=h9tgdsDK; arc=none smtp.client-ip=209.85.210.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-pf1-f202.google.com with SMTP id d2e1a72fcca58-6f47c380709so1117743b3a.3 for ; Thu, 09 May 2024 17:09:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715299742; x=1715904542; 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=dNdh0DGLEI6gEofoq5pc03LS982vJLdNlPLV5JPTShI=; b=h9tgdsDKQonzlutSxCpCwGPMTCbcvMrqZzF0AYdIrIxrWxUrqXprVaPq5cqWJ8MOr3 lgB1BrOO1VUoc1t7uBAH8Spm9+4hydxfZeA/fTwFn4OlH1kA3okrvCYxzmJtmhXOMJvj PfLN0FY7JYKfNcvgmL484uWG9RdvMzHAkWFVaUvtCwg3mIsNc9SGCpCVM7ekCOI5A3UZ lp/818zvDFq2fU3xGgCUz14NpxLekjhfyuoSVkaZZsXJbMroJFeEZ/L38UIhV/Ghn+oS LGwe0l7lagho55QJxjRBItBP+neCI58B3RSBHPG6FT3nVkXcH3aZSOIZZyC3RC9cFXuS LtKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715299742; x=1715904542; 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=dNdh0DGLEI6gEofoq5pc03LS982vJLdNlPLV5JPTShI=; b=h9ktHXFRuDjnLCuDWHNRXrQ3Q/D/UpM7enALVBpdKNde36uXY7U5ZBUEKuAAlFNRsw dyoOH46hpLJr8F/hbIIGxo2k5Qks+dDr91T8zb4BtqSSV7MAqnYobhMlNx4LwqPzOfhj iCK6mfPYxf91HwxVDTC6GdLQKSaixqQTmrsYmRLQLcSJ1Yq03YLn869CYDsIZOdIkgF2 37krDpjFEzo1KXMYuGuaBOlkNLA1yk4zqLGGVzzU76SUVx5daotREHEmuTnvVlRaRamT Nc9p+WluAMI+3UTWebEHgrlDUbbf5NCpN89LUHmLjA1apNyr8NCh/tzUrfi5pVD+UFMW j6iw== X-Gm-Message-State: AOJu0YzzRnaaPDcXMV5IO7s7x9Qb3ENug1dBgXHobYYKXCeiM/wKgvCf iMo2mxzLIEZjx1RYVh1qsEtyVxHDdRovQPCsrAadCH/eLv7GI+lkRVSnwNOWJ+yFLwNPUPHiw5R 6iA== X-Received: from edliaw.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:305d]) (user=edliaw job=sendgmr) by 2002:a05:6a00:3c8a:b0:6f3:f447:57df with SMTP id d2e1a72fcca58-6f4e029a229mr27317b3a.1.1715299741860; Thu, 09 May 2024 17:09:01 -0700 (PDT) Date: Fri, 10 May 2024 00:06:18 +0000 In-Reply-To: <20240510000842.410729-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: <20240510000842.410729-1-edliaw@google.com> X-Mailer: git-send-email 2.45.0.118.g7fe29c98d7-goog Message-ID: <20240510000842.410729-2-edliaw@google.com> Subject: [PATCH v4 01/66] selftests: Compile with -D_GNU_SOURCE when including lib.mk 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 Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@android.com, Edward Liaw , linux-security-module@vger.kernel.org, netdev@vger.kernel.org, linux-riscv@lists.infradead.org, bpf@vger.kernel.org, John Hubbard Content-Type: text/plain; charset="UTF-8" lib.mk will add -D_GNU_SOURCE to CFLAGS by default. This will make it unnecessary to add #define _GNU_SOURCE in the source code. Suggested-by: John Hubbard Signed-off-by: Edward Liaw --- tools/testing/selftests/Makefile | 4 ++-- tools/testing/selftests/lib.mk | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index f0431e6cb67e..9039f3709aff 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 := -D_GNU_SOURCE -isystem ${abs_objtree}/usr/include + KHDR_INCLUDES := -isystem ${abs_objtree}/usr/include else BUILD := $(CURDIR) abs_srctree := $(shell cd $(top_srcdir) && pwd) - KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_srctree}/usr/include + KHDR_INCLUDES := -isystem ${abs_srctree}/usr/include DEFAULT_INSTALL_HDR_PATH := 1 endif diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 3023e0e2f58f..e782f4c96aee 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 := -D_GNU_SOURCE -isystem $(top_srcdir)/usr/include +KHDR_INCLUDES := -isystem $(top_srcdir)/usr/include endif # In order to use newer items that haven't yet been added to the user's system @@ -188,6 +188,9 @@ endef clean: $(if $(TEST_GEN_MODS_DIR),clean_mods_dir) $(CLEAN) +# Build with _GNU_SOURCE by default +CFLAGS += -D_GNU_SOURCE + # Enables to extend CFLAGS and LDFLAGS from command line, e.g. # make USERCFLAGS=-Werror USERLDFLAGS=-static CFLAGS += $(USERCFLAGS) -- 2.45.0.118.g7fe29c98d7-goog