From patchwork Mon Jun 24 23:26:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Liaw X-Patchwork-Id: 13710276 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2349BC30653 for ; Mon, 24 Jun 2024 23:29:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A93AB6B0357; Mon, 24 Jun 2024 19:29:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A40F26B0358; Mon, 24 Jun 2024 19:29:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8E2476B0359; Mon, 24 Jun 2024 19:29:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 6D14A6B0357 for ; Mon, 24 Jun 2024 19:29:10 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id DF9501A0C9C for ; Mon, 24 Jun 2024 23:29:09 +0000 (UTC) X-FDA: 82267375218.10.DF7FB0D Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) by imf19.hostedemail.com (Postfix) with ESMTP id 27F751A0017 for ; Mon, 24 Jun 2024 23:29:07 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=i02XZbx+; spf=pass (imf19.hostedemail.com: domain of 3QgF6ZgYKCGcJIQNFbLTTLQJ.HTRQNSZc-RRPaFHP.TWL@flex--edliaw.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=3QgF6ZgYKCGcJIQNFbLTTLQJ.HTRQNSZc-RRPaFHP.TWL@flex--edliaw.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719271734; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Y7F8R5HE+eZyxlB2ebQLwW1FMzverfSOUo2IuXKNmLY=; b=5V5oBvRB9rZJA66ZU13Z200uY6RpdiHtfuaLGEdo3Dc1eRe1qKShyOibRepDrtB02Cu+1Y dN/CoQEHmSgYdsaaFWrDlGDsYzpUUYDJJJRYKfzz+dZ1aFtEeKwVFpmphEsKjRTZIY5VFX vEoGigYNbDr4Nm16VTY6tIekRH10oew= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719271734; a=rsa-sha256; cv=none; b=GYDh9sX7ZBZxqD8WgT8Y0wV9frzWgjAe+TzSF+8+S3GeMRZPFhDyg5cD91nXlbBeq8LTx9 UbXQf2q4S7of0ovHwao3SL/eHlkohK+Kj3d7ed0xvecwSXppBFkZT9AXfFd6tR6pWP3tJ8 Uwiw8g1TnXAMMp9Pk9iedEtnPMTDVjc= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=i02XZbx+; spf=pass (imf19.hostedemail.com: domain of 3QgF6ZgYKCGcJIQNFbLTTLQJ.HTRQNSZc-RRPaFHP.TWL@flex--edliaw.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=3QgF6ZgYKCGcJIQNFbLTTLQJ.HTRQNSZc-RRPaFHP.TWL@flex--edliaw.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-1f998f5e5fdso52764035ad.1 for ; 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=kvack.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=i02XZbx+BY7oVBBv8R4qgxuUzEI1anrPQ8JmZV/J4iCpr5lBznZRaVIlzi4ONWG3H0 0yyIZu/eK7d1Uz0iE9of0SQwnBTzM+QbjDK/KOgBuwveFSWraNTeaMd5LocrqnEQ032V mAT0RdaYOkb2/Hxipq8Yfu3QWPvsueDghjnQG4kBpiWCP1Rpi7FDzwUFQv3PK00biVtq WWU5FWApcdZ1rTjXxm0QAIkZzDgi4vy7HjdCD/Igz+sOGiofQ61HKmpdhZOyLNmlrIp3 JM++w/BVLIrejRgEQo2ab5j2bUZTIiFjNaR602YhrirZrho4QcT7qnivpc/OmxbAgKuw EUgw== 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=KLqMAGlRGBIuv7fJuXUJ2RO+9lNjmheINWqM25Nc3RUW4niM8khdlP34bENfERvbyA AunGYfhbxVhTwNrze+E6JKW/tz0uBfFyPacC6ZHy6BaN10LhJrIHa/j+6c2i7v0XrpNc uFG0xDVqbsrm+CPZK4iYs56z3eDEKqrPoo7fT0fBAv1lOoYson9ghXivPsuxTyrp/gIq qkHT1hJ9IcTofBFiq3iUtbhhzSre6ttIGKfeKYYAHzLTqF3iIlJ3Zzd//+Od8vPz2k0o e789bLQtPkQ/sdQPyrwAqAyjo3OeUmXLcWvCRMfeAWuhuilwxHLkq0Nxfl1P+JWXPmr5 6gDw== X-Forwarded-Encrypted: i=1; AJvYcCXoQzUPS9RLVCNKhDL7zCPFqbObiYMUZcyIUTaqdnwxmhr2YKaXrjAwB9HgsfDzvJjP/S67AyX0Kf9AzgxYCHDMr8c= X-Gm-Message-State: AOJu0YzX/7B6dFiI8vvw78quTPlkhOvJ+1sQahXmxlskpXhtyVoA7Poe fBpnxCZeqEVDyesg88J3Up8QzXhafENOFvaGsB0bAT91DwDU1UXyqvHEahcPVL/O9Z0w2oaekZn GUw== 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> 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 To: linux-kselftest@vger.kernel.org, Eric Biederman , Kees Cook , Shuah Khan , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , Davidlohr Bueso , " =?utf-8?q?Andr=C3=A9_Almeida?= " , Jason Gunthorpe , Kevin Tian , Paolo Bonzini , Andrew Morton , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Fenghua Yu , Reinette Chatre , Paul Walmsley , Palmer Dabbelt , Albert Ou , Jarkko Sakkinen , Dave Hansen Cc: linux-kernel@vger.kernel.org, usama.anjum@collabora.com, seanjc@google.com, kernel-team@android.com, Edward Liaw , 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 X-Rspamd-Queue-Id: 27F751A0017 X-Stat-Signature: kujuroaxy6646n8bqwpzcic8ixis58xq X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1719271747-644348 X-HE-Meta: U2FsdGVkX18N0DtMoq0WzHicW2XcHPKaYf8f4TnSa/XYeN+PLn6sYJUBod/HNzxqEIt9FwULoSFETQsTNLjIx9mgsXGJuUIRlU6yg5U1yaZsHA5ID13NAkayP6M4TRaCTecdcM25r8J0nV6CLdC3DcaaysbfxUDy6PqIa2iO+RGqvQJJnDvMnOk49L5F82EmxjDnDPOYCUK4FNTTadrLKsxN4tub+/RBkfbjr5h92DNsxZtI/cbtTvSZ/Swonx1MMhuRjOHGbLfumRSM04pmse9J+PvY/14Jh8W7Peky8vvJcrw/Lg8EvHdaIHo1ODnhJHjqf/gMBk1r4LT/c1NyZZi3em29orpSLuXyjDveuKY+ynghW8N8TvhOrpQKmD644/6/D/PyO35EjEyPaoktIHr/KD0zj+/R5UGaF8SVn3B9tPXr8tivoHsMB2ZEfqM51yVt00MY3JhLL7Z0elOaKfznojUIdygSP0zyJRKwGKXQqjSjIwvDbSporGfDE5EhO86dnj8NDkwmglQFU/DE+b2VP6drFMD/RKT85+J+1ehpKd2+r1qWoEjbK9m5pj+ND3+Ya8fQjxXES/nsOrVsd/TDF7wcB4pZsS/kc1fIIgHTCQ1YYPerd3usNpY4gzDkwVrV1ufdVBzpREuVEoARbo0aDNg0Dzmj4GgMF589us0Gkdv4oA0zW51T+U75HJpvyD2X2BWCYENl3TAzLLTAyymsM/PJdIjSm5qAmr+alH8opHLes5vzQp2uMSPUL7PRW4nPocUFocgCG5EA/AOInO5pxgKYF2QhJ1d9FdyYrQL3676oP0sQaR7iTN1SPfrKRy0QYiHiAnlFbtlFY9Ua1B4Tv/XYNJ4Z3n27pfj+YXUX5+C2mAxn0nDEsTrQVWNk1hYJq+XaFX+TCBHkGKRWRGGR7ydazR7mxajTL6+8JipxJW3aG5BGbbKzdfByqUVwqLikGpS0DDVUjNnyHQ4 6Ysc+MEs zkKtv3satfNOed+swA/GZdrJ6M7OG1ehEHRGr/LZOaUG2duUmGPldjuCysnCQEuCGbmWsAImbHGCtepgfv/Ry29zASEQfWfn0Hj3P6j9my1BK1/9K2Kc1bVgz0JsSSe5tqK5cdDmXhDLNXaiykTYc5VNBs4L8N5nXoR5PqdWYte3ySrAIaRGct108pXlrn8/6ADBLaBi8oc6RRTa8ywC/xiTSbXyHDXBcPXmyP+8D1bQqvpTqC/tXRt9QcN3S+NR8rugQeHA5Y4mInJDLx9o2yKEjmtywGlQI4hg7TBjuUfP81fxAoDrNz1Q8ADxcPOmrPAiggAZCALoXc6Bo5sDlIRwTpTCD8NwuzL6W+CT3PIs+Q5Pqg4ati1ypNIaSDGztTK5dyEGmAmSQ+ihFutt+Mw45v+kXmURG7RAJt9ZUxzrDKrXBxfKpoS+0bNf3SNs8XeT9EkV8U468ZpAI3epIQp2ag4+gkLxJ50kh6/RRI8aHqxuy4MOHwhavdVwmjpms6lB1RY0PR+KMEJZUcSt0/MneYNGBtPS+BA85BFjjgH4A4/rJ4TmG2S9C/Rti0EnCcdnZOAykppW6NGApfl4mRuI0cg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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 Signed-off-by: Edward Liaw --- tools/testing/selftests/lib.mk | 3 +++ 1 file changed, 3 insertions(+) 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)