From nobody Sun Dec 14 19:12:52 2025 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="h9tgdsDK" 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-Google-Smtp-Source: AGHT+IGtTUZs+3MsCtZfU8WOyARtKSKltxR3na4oeEBppwpGfuKUIqgIQ9le2QPvBBObPpo5IStZo3NSvjc= 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-Transfer-Encoding: quoted-printable 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/Mak= efile 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 :=3D $(realpath $(abs_objtree)) BUILD :=3D $(abs_objtree)/kselftest - KHDR_INCLUDES :=3D -D_GNU_SOURCE -isystem ${abs_objtree}/usr/include + KHDR_INCLUDES :=3D -isystem ${abs_objtree}/usr/include else BUILD :=3D $(CURDIR) abs_srctree :=3D $(shell cd $(top_srcdir) && pwd) - KHDR_INCLUDES :=3D -D_GNU_SOURCE -isystem ${abs_srctree}/usr/include + KHDR_INCLUDES :=3D -isystem ${abs_srctree}/usr/include DEFAULT_INSTALL_HDR_PATH :=3D 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 +=3D --no-print-directory endif ifeq ($(KHDR_INCLUDES),) -KHDR_INCLUDES :=3D -D_GNU_SOURCE -isystem $(top_srcdir)/usr/include +KHDR_INCLUDES :=3D -isystem $(top_srcdir)/usr/include endif # In order to use newer items that haven't yet been added to the user's sy= stem @@ -188,6 +188,9 @@ endef clean: $(if $(TEST_GEN_MODS_DIR),clean_mods_dir) $(CLEAN) +# Build with _GNU_SOURCE by default +CFLAGS +=3D -D_GNU_SOURCE + # Enables to extend CFLAGS and LDFLAGS from command line, e.g. # make USERCFLAGS=3D-Werror USERLDFLAGS=3D-static CFLAGS +=3D $(USERCFLAGS) -- 2.45.0.118.g7fe29c98d7-goog