Skip to content

Centralize _GNU_SOURCE definition into lib.mk

Edward Liaw kvm linux-fsdevel linux-iommu linux-kselftest linux-mm linux-riscv linux-sgx lkml netdev 2 versions – Applied

Status from this message: [merged] selftests-centralize-d_gnu_source=-to-cflags-in-libmk.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest1 patch 2 repliesApplied 1/1
  2. v613 patches 4 repliesSuperseded

Changes in v7 from the cover letter

- Squash patch into a single commit.

Patches in v7 All 1 applied

#Subject and filesSizeRepliesApplied
1/1selftests: Centralize -D_GNU_SOURCE= to CFLAGS in lib.mktools/testing/selftests/exec/Makefile tools/testing/selftests/futex/functional/Makefile tools/testing/selftests/intel_pstate/Makefile +12 more+12 -152 repliesApplied

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchShuah KhanMuhammad Usama Anjum
1/1A-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v7 thread

Cover letter [PATCH v7 0/1] Centralize _GNU_SOURCE definition into lib.mk

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/[email protected]/
v2: https://lore.kernel.org/linux-kselftest/[email protected]/
- 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/[email protected]/
- 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/[email protected]/
- 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/[email protected]/
- 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/[email protected]/
- 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