Message ID | 20240624232718.1154427-3-edliaw@google.com (mailing list archive) |
---|---|
State | New |
Headers | show
Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.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 8610C1A2C1F for <linux-fsdevel@vger.kernel.org>; Mon, 24 Jun 2024 23:29:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719271750; cv=none; b=DruSs6UahKi2fqhpgG441DkLV+PAPhDCQH0y59JQKHrE3yG4T2tj6pKuduwJRIQkrY9MesGecBfnuPElnsv5Q+KACHU84PxTmGzxoV5arTrHoC8yEyFxY9kv/kQ3lPUqb+/7s3GxyNjOgkeBOWrlEiA1v7aQwJ3eIMRyt0vzeRY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719271750; c=relaxed/simple; bh=xwftBfRu5G8w7ol9IF7MUG9BSiGvoLKlVTWAOAeO/Is=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ael4w5QRxFB+hI9qR+JLsUIu6WY6LQNkaZvuluDXrvz+5OBF4na1jLCy5wjXqfxf0TvgHrc5CTDRxmiO0QR2KhGopMCYJRcRarBS+qJZ++A/4xgw2FIncdOTPYBf1Dp0ssFeWHh+nVZxGjYK5AIxQb0PsfrLHC5x6rSdvz8eAm0= 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=upDGTY+V; arc=none smtp.client-ip=209.85.215.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="upDGTY+V" Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-6e3341c8865so6340399a12.1 for <linux-fsdevel@vger.kernel.org>; Mon, 24 Jun 2024 16:29:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1719271747; x=1719876547; 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=Y7F8R5HE+eZyxlB2ebQLwW1FMzverfSOUo2IuXKNmLY=; b=upDGTY+VAWxjOiGt1aN8qq/MXQcXxCGhECKCR+u/ehZUHokbQYBzXGPPb67Ib14AYJ WS+Icm1jnUp19BMdXpFSNeL98mC+XEUCbkDJQQdWPHozIzclQDGsE2NnJ/l/XJ+h7O1m BssvmwEpWtykYwfNxyQEQFmdtvyoEdRIcIsrBkQADycUJB0CmlZmdQklWhhB6zAEHG/I qmHXlzQINVs+7F8iOa8zPeFNnGQXynyT4+QVgszv5DndlHQ29J5RjVYvVlGrSXxJBBls 8ZRfhzFO9fvFPh6hFHx772LXsRysy4ieIYujQB+oSWpQi4Cn3AKoENJq6O/tqt0a8G82 yRAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719271747; x=1719876547; 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=Y7F8R5HE+eZyxlB2ebQLwW1FMzverfSOUo2IuXKNmLY=; b=VES8usLm7Da9aoCByvd++kToH6zyWjKAQJ7Ic7xrXGiJW2TqBRpxDGSyFYKkWxr5P4 8r3JnQnKVBjiwkPBwkeIJr9ZOJjJWsO/hKA0IG3kSVUvCHNIlIGjdludvrqo3VSLTROZ E+Hc8ymAc4wkgYztDWozUGDjMWljSlstiIr4amEV7Q2/D95igG40Eh6cxXdKoL8R6iI5 HdNnh5rWAwWVq3yk4QSabOrirn35Pfl1T3oY3KQ6SuGy00WVt6/3sdh3ueHyOtV+npKa S9E92ml1ZAO38vCx+1WbN38ODlw4mh0xRL5lpzszfOcD//nVg+TcaHyjZJ3IphGa1H07 KX6g== X-Forwarded-Encrypted: i=1; AJvYcCXf3etq0b7jmE91/dUGMVUnK3Yh1xhtZ5vu//SbAyldDQk393/JEUw1+HJg/hnSn4rOl8JQmGb5gFhUnizJK7BsjelvdR4V0U1iVOYs2Q== X-Gm-Message-State: AOJu0YxljD1mS6vT7vCf3oh+33dQTgJNDKcpVENjtj3q7UQvmT7ZkgmU uoXchHa+4p6tznLjc9gtJ7SLPaWepj+eDi9yPn8G9qhrwbTnPJmesFDgPV8mNgnMxmZdhp30tml ggQ== X-Google-Smtp-Source: AGHT+IFY6zwuM+fBRs+r7yFjUxfbkM+X5No4nRI5eUjSYyy4xzwRR2NKqiye6S+BJr7Hl1+KVMRcw6AW1Us= X-Received: from edliaw.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:305d]) (user=edliaw job=sendgmr) by 2002:a17:902:f693:b0:1f7:3763:5ff0 with SMTP id d9443c01a7336-1fa158d034emr7382275ad.1.1719271746792; Mon, 24 Jun 2024 16:29:06 -0700 (PDT) Date: Mon, 24 Jun 2024 23:26:11 +0000 In-Reply-To: <20240624232718.1154427-1-edliaw@google.com> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: <linux-fsdevel.vger.kernel.org> List-Subscribe: <mailto:linux-fsdevel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-fsdevel+unsubscribe@vger.kernel.org> Mime-Version: 1.0 References: <20240624232718.1154427-1-edliaw@google.com> X-Mailer: git-send-email 2.45.2.741.gdbec12cfda-goog Message-ID: <20240624232718.1154427-3-edliaw@google.com> Subject: [PATCH v6 02/13] selftests: Add -D_GNU_SOURCE= to CFLAGS in lib.mk From: Edward Liaw <edliaw@google.com> To: linux-kselftest@vger.kernel.org, Eric Biederman <ebiederm@xmission.com>, Kees Cook <kees@kernel.org>, Shuah Khan <shuah@kernel.org>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Peter Zijlstra <peterz@infradead.org>, Darren Hart <dvhart@infradead.org>, Davidlohr Bueso <dave@stgolabs.net>, " =?utf-8?q?Andr=C3=A9_Almeida?= " <andrealmeid@igalia.com>, Jason Gunthorpe <jgg@ziepe.ca>, Kevin Tian <kevin.tian@intel.com>, Paolo Bonzini <pbonzini@redhat.com>, Andrew Morton <akpm@linux-foundation.org>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Fenghua Yu <fenghua.yu@intel.com>, Reinette Chatre <reinette.chatre@intel.com>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Jarkko Sakkinen <jarkko@kernel.org>, Dave Hansen <dave.hansen@linux.intel.com> Cc: linux-kernel@vger.kernel.org, usama.anjum@collabora.com, seanjc@google.com, kernel-team@android.com, Edward Liaw <edliaw@google.com>, linux-mm@kvack.org, iommu@lists.linux.dev, kvm@vger.kernel.org, netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-sgx@vger.kernel.org, John Hubbard <jhubbard@nvidia.com> Content-Type: text/plain; charset="UTF-8" |
Series |
Centralize _GNU_SOURCE definition into lib.mk
|
expand
|
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 7b299ed5ff45..d6edcfcb5be8 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -196,6 +196,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)
Centralizes the _GNU_SOURCE definition to CFLAGS in lib.mk. This uses the form "-D_GNU_SOURCE=", which is equivalent to "#define _GNU_SOURCE". Otherwise using "-D_GNU_SOURCE" is equivalent to "-D_GNU_SOURCE=1" and "#define _GNU_SOURCE 1", which is less commonly seen in source code and would require many changes in selftests to avoid redefinition warnings. Suggested-by: John Hubbard <jhubbard@nvidia.com> Signed-off-by: Edward Liaw <edliaw@google.com> --- tools/testing/selftests/lib.mk | 3 +++ 1 file changed, 3 insertions(+)