From patchwork Tue Jun 25 22:34:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Liaw X-Patchwork-Id: 13712106 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 2DFAEC2BBCA for ; Tue, 25 Jun 2024 22:35:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 949166B0095; Tue, 25 Jun 2024 18:35:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8D1C86B0096; Tue, 25 Jun 2024 18:35:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 74B0F6B0098; Tue, 25 Jun 2024 18:35:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 524806B0095 for ; Tue, 25 Jun 2024 18:35:03 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 0B5A7807EA for ; Tue, 25 Jun 2024 22:35:03 +0000 (UTC) X-FDA: 82270867686.25.EBDBA0A Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.201]) by imf15.hostedemail.com (Postfix) with ESMTP id 4F564A001C for ; Tue, 25 Jun 2024 22:35:01 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b="R0/lDGxH"; spf=pass (imf15.hostedemail.com: domain of 3E0Z7ZgYKCMYqpxum8s00sxq.o0yxuz69-yyw7mow.03s@flex--edliaw.bounces.google.com designates 209.85.210.201 as permitted sender) smtp.mailfrom=3E0Z7ZgYKCMYqpxum8s00sxq.o0yxuz69-yyw7mow.03s@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=1719354881; 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: references:dkim-signature; bh=KACPm6o1sF6MfYdPebomXscoE9qCB1ha0g1j4OaH67g=; b=UYihqAjJMW7n+AuJ2T2grEvxGUX9qH5H+yzgAtijdqr+dPxx5HEkSySl2NgE3oFKHPl+y0 WKDR5hZn67gtkiO+k3ZTdcm9aE0qhnjvv4o+zXJDX0qbVjM3CwORf2OHTzAN4FYuJhPzyx mAxbOjYJXH92wMOItN1i+Kp/FqPRoRk= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b="R0/lDGxH"; spf=pass (imf15.hostedemail.com: domain of 3E0Z7ZgYKCMYqpxum8s00sxq.o0yxuz69-yyw7mow.03s@flex--edliaw.bounces.google.com designates 209.85.210.201 as permitted sender) smtp.mailfrom=3E0Z7ZgYKCMYqpxum8s00sxq.o0yxuz69-yyw7mow.03s@flex--edliaw.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719354881; a=rsa-sha256; cv=none; b=ftJmOYjZ/f19x301IYTH6u9AsO13j5NlKHUoA8kn1jIkDHBVXc+aXmf6Ww1tWvVMpuModx 9LyeAFMbtEkYFQtnQCqY3Sn7kTkzjieRlVx+0vyZB5jtU6FHx3J/tjygW34RGeU7ixDXOo JsrkV270sG3ovD8GtDdxXCjuhVbzPXc= Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-7065ba27265so6979312b3a.0 for ; Tue, 25 Jun 2024 15:35:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1719354900; x=1719959700; darn=kvack.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=KACPm6o1sF6MfYdPebomXscoE9qCB1ha0g1j4OaH67g=; b=R0/lDGxHXcXX4+UxxlbmN3WXqFGr0h4XSVKMa9I9rPY1JDy7mS8QoI8xehnXr7kqw2 CMX3W5jLanTPb5eZuE/HxaWHCeob35tnRwqilWKi+TMUO6msAcGfgAEswNf0kwoCMRPI IKYWN1PVLIG4CJuMwVi2WxDDpZp20et0urhO+ub+7BWBKLGyULYNnPErzRfi3hW0BpxL ACr8z/h58oGfPF0c7ywEMihj5iKLtTvtTcBvd7Hl/82bAJHPUTcajVqKaEtf9T8chkHO ykWbt0HI2BB8Jk/xvbFxPXkFtFtunhI2TvVQCCr3FNrX1fY6GSysgJUht6z842Nqn9Xc xn7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719354900; x=1719959700; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=KACPm6o1sF6MfYdPebomXscoE9qCB1ha0g1j4OaH67g=; b=Ic+lFX+JZf3xTiDIQKWuYo42RLY3J/8BmhE4oWhg+5tHE/U/wO0EHhnCsmBWYVBvgO CWUeNSeQFE6YAxxsM3pZstTwRSX8vxnqPG0Jn4xAazBXrGEQPLInG+HaLADV/NsyfQ4c MzVsWhrn8wJCZCZbhe/O46ccS7Hl37p97sO8O3U4LoB/29s2CCdlga5ciqDsgBv5HlT4 zllfgJMCdihq4vh+UiFtxZCCIsVJckWBGLuNbPDAIsVlH10dUm9ANOu9WzujZNJljgkt FjS1EAslOydzqcjcHIXUwSbMmtb0ohT05nOoR5HavHGlq7gMjVRt7DXpXONNUTOk6pxg qSFg== X-Forwarded-Encrypted: i=1; AJvYcCX9jeYdM5SMxGsaa0IQVll5dVkZPPKx6puMbtCx/oOKu2HQEyaSd+dfiavdoj2YNdGZJp6HBTB0PPD5PdTMBqBvQkk= X-Gm-Message-State: AOJu0YznTMOqRlmIwSVLujyxdjE9aUr0iIotdvDMAUWtKlX4beSCccLw hG9JcYukId6Pb8NVo2CcrxoxZ1a63ZTKBaZzc3bGcFlHD30+mPrgovP9CPN1wV8YVfoakHTwJzx cxQ== X-Google-Smtp-Source: AGHT+IFpOX5CcrzFldMsRz/JodHWPPYjtr1mfNvHUywvuU1/bJCVZhZ6TnspYz+fdShAF0CdfuxKj2ZiUg4= X-Received: from edliaw.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:305d]) (user=edliaw job=sendgmr) by 2002:a05:6a00:3698:b0:706:3f17:ca6 with SMTP id d2e1a72fcca58-706746c2606mr330723b3a.3.1719354899705; Tue, 25 Jun 2024 15:34:59 -0700 (PDT) Date: Tue, 25 Jun 2024 22:34:44 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.45.2.803.g4e1b14247a-goog Message-ID: <20240625223454.1586259-1-edliaw@google.com> Subject: [PATCH v7 0/1] Centralize _GNU_SOURCE definition into 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 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 4F564A001C X-Stat-Signature: gs9d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E7xwbJdIC2EIp+KQzESoQqblJpSXwWEVhJCIoC0DNdSFJMYo0EfMEaw3fkqLBMlFGKXva1j60Ne0qrTH2X6G0pF9xgYuwLSGY9pj8JKxdNjZ68c027VXB/KZRfjwStvF7nhFRAno1eOm5hN+P+he1JfrWJCxa2VvcJ3FxWI079aXknSlc6+U+gpndJaP1N14HJwy/j8w3pvdcIInFamBUhd9qt+BHJn5OX3jlFIXTzzJcp69b2eqUGy1O3hV8e7NDyKxVIR2/Ku5hoF5jOPQ5UE1K3bMX7wauguDciPDfs8izlfQqlvnD4wuXwhhNJGW3YQykiFbh9T5RX+40TR/hcDt/tYaVx6pXuXhiudCIypo7aa6hPUb2VLBMnAqObtBV/dcHM6CaSzP1VYBKFPESLlcMcgu7xKdkczx54vtDjZ0UC/xPhwGP6HUPIWoxd8LfAqo1ceVIz9woGpYdYP5BB/5VUuH1zwNIBz0L9cxNBD9Z0s/34HoWXVVENMnnMiqfNYYKQ+OXaaLLQS+CeLylEfRBiDVLEkpRJKjFyeCgK2TYCQgIeJWwc2LmZmLK5m87lZxqkmyuhxN2msasXd53ug== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000011, 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 definition of _GNU_SOURCE into lib.mk and addresses all resulting macro redefinition warnings. The initial attempt at this patch was abandoned because it affected lines in many source files and caused a large amount of churn. However, from earlier discussions, centralizing _GNU_SOURCE is still desireable. This attempt limits the changes to 1 source file and 14 Makefiles. This is condensed into a single commit to avoid redefinition warnings from partial merges. v1: https://lore.kernel.org/linux-kselftest/20240430235057.1351993-1-edliaw@google.com/ v2: https://lore.kernel.org/linux-kselftest/20240507214254.2787305-1-edliaw@google.com/ - Add -D_GNU_SOURCE to KHDR_INCLUDES so that it is in a single location. - Remove #define _GNU_SOURCE from source code to resolve redefinition warnings. v3: https://lore.kernel.org/linux-kselftest/20240509200022.253089-1-edliaw@google.com/ - Rebase onto linux-next 20240508. - Split patches by directory. - Add -D_GNU_SOURCE directly to CFLAGS in lib.mk. - Delete additional _GNU_SOURCE definitions from source code in linux-next. - Delete additional -D_GNU_SOURCE flags from Makefiles. v4: https://lore.kernel.org/linux-kselftest/20240510000842.410729-1-edliaw@google.com/ - Rebase onto linux-next 20240509. - Remove Fixes tag from patches that drop _GNU_SOURCE definition. - Restore space between comment and includes for selftests/damon. v5: https://lore.kernel.org/linux-kselftest/20240522005913.3540131-1-edliaw@google.com/ - Rebase onto linux-next 20240521 - Drop initial patches that modify KHDR_INCLUDES. - Incorporate Mark Brown's patch to replace static_assert with warning. - Don't drop #define _GNU_SOURCE from nolibc and wireguard. - Change Makefiles for x86 and vDSO to append to CFLAGS. v6: https://lore.kernel.org/linux-kselftest/20240624232718.1154427-1-edliaw@google.com/ - Rewrite patch to use -D_GNU_SOURCE= form in lib.mk. - Reduce the amount of churn significantly by allowing definition to coexist with source code macro defines. v7: - Squash patch into a single commit. Edward Liaw (1): selftests: Centralize -D_GNU_SOURCE= to CFLAGS in lib.mk tools/testing/selftests/exec/Makefile | 1 - tools/testing/selftests/futex/functional/Makefile | 2 +- tools/testing/selftests/intel_pstate/Makefile | 2 +- tools/testing/selftests/iommu/Makefile | 2 -- tools/testing/selftests/kvm/Makefile | 2 +- tools/testing/selftests/lib.mk | 3 +++ tools/testing/selftests/mm/thuge-gen.c | 2 +- tools/testing/selftests/net/Makefile | 2 +- tools/testing/selftests/net/tcp_ao/Makefile | 2 +- tools/testing/selftests/proc/Makefile | 1 - tools/testing/selftests/resctrl/Makefile | 2 +- tools/testing/selftests/ring-buffer/Makefile | 1 - tools/testing/selftests/riscv/mm/Makefile | 2 +- tools/testing/selftests/sgx/Makefile | 2 +- tools/testing/selftests/tmpfs/Makefile | 1 - 15 files changed, 12 insertions(+), 15 deletions(-) --- 2.45.2.803.g4e1b14247a-goog