* [PATCH v6 01/13] selftests/mm: Define _GNU_SOURCE to an empty string
2024-06-24 23:26 [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk Edward Liaw
@ 2024-06-24 23:26 ` Edward Liaw
2024-06-24 23:26 ` [PATCH v6 02/13] selftests: Add -D_GNU_SOURCE= to CFLAGS in lib.mk Edward Liaw
` (12 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Edward Liaw @ 2024-06-24 23:26 UTC (permalink / raw)
To: linux-kselftest, Eric Biederman, Kees Cook, Shuah Khan,
Thomas Gleixner, Ingo Molnar, Peter Zijlstra, Darren Hart,
Davidlohr Bueso, André 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, usama.anjum, seanjc, kernel-team, Edward Liaw,
linux-mm, iommu, kvm, netdev, linux-fsdevel, linux-riscv,
linux-sgx
Use the more common "#define _GNU_SOURCE" instead of defining it to 1.
This will prevent redefinition warnings when -D_GNU_SOURCE= is set.
Signed-off-by: Edward Liaw <edliaw@google.com>
---
tools/testing/selftests/mm/thuge-gen.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/mm/thuge-gen.c b/tools/testing/selftests/mm/thuge-gen.c
index d50dc71cac32..e4370b79b62f 100644
--- a/tools/testing/selftests/mm/thuge-gen.c
+++ b/tools/testing/selftests/mm/thuge-gen.c
@@ -13,7 +13,7 @@
sudo ipcs | awk '$1 == "0x00000000" {print $2}' | xargs -n1 sudo ipcrm -m
(warning this will remove all if someone else uses them) */
-#define _GNU_SOURCE 1
+#define _GNU_SOURCE
#include <sys/mman.h>
#include <linux/mman.h>
#include <stdlib.h>
--
2.45.2.741.gdbec12cfda-goog
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH v6 02/13] selftests: Add -D_GNU_SOURCE= to CFLAGS in lib.mk
2024-06-24 23:26 [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk Edward Liaw
2024-06-24 23:26 ` [PATCH v6 01/13] selftests/mm: Define _GNU_SOURCE to an empty string Edward Liaw
@ 2024-06-24 23:26 ` Edward Liaw
2024-06-24 23:26 ` [PATCH v6 03/13] selftests/net: Append to lib.mk CFLAGS in Makefile Edward Liaw
` (11 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Edward Liaw @ 2024-06-24 23:26 UTC (permalink / raw)
To: linux-kselftest, Eric Biederman, Kees Cook, Shuah Khan,
Thomas Gleixner, Ingo Molnar, Peter Zijlstra, Darren Hart,
Davidlohr Bueso, André 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, usama.anjum, seanjc, kernel-team, Edward Liaw,
linux-mm, iommu, kvm, netdev, linux-fsdevel, linux-riscv,
linux-sgx, John Hubbard
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(+)
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)
--
2.45.2.741.gdbec12cfda-goog
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH v6 03/13] selftests/net: Append to lib.mk CFLAGS in Makefile
2024-06-24 23:26 [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk Edward Liaw
2024-06-24 23:26 ` [PATCH v6 01/13] selftests/mm: Define _GNU_SOURCE to an empty string Edward Liaw
2024-06-24 23:26 ` [PATCH v6 02/13] selftests: Add -D_GNU_SOURCE= to CFLAGS in lib.mk Edward Liaw
@ 2024-06-24 23:26 ` Edward Liaw
2024-06-24 23:26 ` [PATCH v6 04/13] selftests/exec: Drop redundant -D_GNU_SOURCE " Edward Liaw
` (10 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Edward Liaw @ 2024-06-24 23:26 UTC (permalink / raw)
To: linux-kselftest, Eric Biederman, Kees Cook, Shuah Khan,
Thomas Gleixner, Ingo Molnar, Peter Zijlstra, Darren Hart,
Davidlohr Bueso, André 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, usama.anjum, seanjc, kernel-team, Edward Liaw,
linux-mm, iommu, kvm, netdev, linux-fsdevel, linux-riscv,
linux-sgx
Instead of overwriting the CFLAGS imported from lib.mk, append instead
instead. Also drop -D_GNU_SOURCE from CFLAGS to prevent redefinition
warning.
Signed-off-by: Edward Liaw <edliaw@google.com>
---
tools/testing/selftests/net/Makefile | 2 +-
tools/testing/selftests/net/tcp_ao/Makefile | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
index bc3925200637..8eaffd7a641c 100644
--- a/tools/testing/selftests/net/Makefile
+++ b/tools/testing/selftests/net/Makefile
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
# Makefile for net selftests
-CFLAGS = -Wall -Wl,--no-as-needed -O2 -g
+CFLAGS += -Wall -Wl,--no-as-needed -O2 -g
CFLAGS += -I../../../../usr/include/ $(KHDR_INCLUDES)
# Additional include paths needed by kselftest.h
CFLAGS += -I../
diff --git a/tools/testing/selftests/net/tcp_ao/Makefile b/tools/testing/selftests/net/tcp_ao/Makefile
index 522d991e310e..bd88b90b902b 100644
--- a/tools/testing/selftests/net/tcp_ao/Makefile
+++ b/tools/testing/selftests/net/tcp_ao/Makefile
@@ -26,7 +26,7 @@ LIB := $(LIBDIR)/libaotst.a
LDLIBS += $(LIB) -pthread
LIBDEPS := lib/aolib.h Makefile
-CFLAGS := -Wall -O2 -g -D_GNU_SOURCE -fno-strict-aliasing
+CFLAGS += -Wall -O2 -g -fno-strict-aliasing
CFLAGS += $(KHDR_INCLUDES)
CFLAGS += -iquote ./lib/ -I ../../../../include/
--
2.45.2.741.gdbec12cfda-goog
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH v6 04/13] selftests/exec: Drop redundant -D_GNU_SOURCE CFLAGS in Makefile
2024-06-24 23:26 [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk Edward Liaw
` (2 preceding siblings ...)
2024-06-24 23:26 ` [PATCH v6 03/13] selftests/net: Append to lib.mk CFLAGS in Makefile Edward Liaw
@ 2024-06-24 23:26 ` Edward Liaw
2024-06-24 23:26 ` [PATCH v6 05/13] selftests/futex: " Edward Liaw
` (9 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Edward Liaw @ 2024-06-24 23:26 UTC (permalink / raw)
To: linux-kselftest, Eric Biederman, Kees Cook, Shuah Khan,
Thomas Gleixner, Ingo Molnar, Peter Zijlstra, Darren Hart,
Davidlohr Bueso, André 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, usama.anjum, seanjc, kernel-team, Edward Liaw,
linux-mm, iommu, kvm, netdev, linux-fsdevel, linux-riscv,
linux-sgx
-D_GNU_SOURCE= will be provided by lib.mk CFLAGS, so -D_GNU_SOURCE
should be dropped to prevent redefinition warnings.
Signed-off-by: Edward Liaw <edliaw@google.com>
---
tools/testing/selftests/exec/Makefile | 1 -
1 file changed, 1 deletion(-)
diff --git a/tools/testing/selftests/exec/Makefile b/tools/testing/selftests/exec/Makefile
index ab67d58cfab7..ba012bc5aab9 100644
--- a/tools/testing/selftests/exec/Makefile
+++ b/tools/testing/selftests/exec/Makefile
@@ -1,7 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
CFLAGS = -Wall
CFLAGS += -Wno-nonnull
-CFLAGS += -D_GNU_SOURCE
ALIGNS := 0x1000 0x200000 0x1000000
ALIGN_PIES := $(patsubst %,load_address.%,$(ALIGNS))
--
2.45.2.741.gdbec12cfda-goog
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH v6 05/13] selftests/futex: Drop redundant -D_GNU_SOURCE CFLAGS in Makefile
2024-06-24 23:26 [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk Edward Liaw
` (3 preceding siblings ...)
2024-06-24 23:26 ` [PATCH v6 04/13] selftests/exec: Drop redundant -D_GNU_SOURCE " Edward Liaw
@ 2024-06-24 23:26 ` Edward Liaw
2024-06-24 23:26 ` [PATCH v6 06/13] selftests/intel_pstate: " Edward Liaw
` (8 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Edward Liaw @ 2024-06-24 23:26 UTC (permalink / raw)
To: linux-kselftest, Eric Biederman, Kees Cook, Shuah Khan,
Thomas Gleixner, Ingo Molnar, Peter Zijlstra, Darren Hart,
Davidlohr Bueso, André 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, usama.anjum, seanjc, kernel-team, Edward Liaw,
linux-mm, iommu, kvm, netdev, linux-fsdevel, linux-riscv,
linux-sgx
-D_GNU_SOURCE= will be provided by lib.mk CFLAGS, so -D_GNU_SOURCE
should be dropped to prevent redefinition warnings.
Signed-off-by: Edward Liaw <edliaw@google.com>
---
tools/testing/selftests/futex/functional/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/futex/functional/Makefile b/tools/testing/selftests/futex/functional/Makefile
index 994fa3468f17..f79f9bac7918 100644
--- a/tools/testing/selftests/futex/functional/Makefile
+++ b/tools/testing/selftests/futex/functional/Makefile
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
INCLUDES := -I../include -I../../ $(KHDR_INCLUDES)
-CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE= -pthread $(INCLUDES) $(KHDR_INCLUDES)
+CFLAGS := $(CFLAGS) -g -O2 -Wall -pthread $(INCLUDES) $(KHDR_INCLUDES)
LDLIBS := -lpthread -lrt
LOCAL_HDRS := \
--
2.45.2.741.gdbec12cfda-goog
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH v6 06/13] selftests/intel_pstate: Drop redundant -D_GNU_SOURCE CFLAGS in Makefile
2024-06-24 23:26 [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk Edward Liaw
` (4 preceding siblings ...)
2024-06-24 23:26 ` [PATCH v6 05/13] selftests/futex: " Edward Liaw
@ 2024-06-24 23:26 ` Edward Liaw
2024-06-24 23:26 ` [PATCH v6 07/13] selftests/iommu: " Edward Liaw
` (7 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Edward Liaw @ 2024-06-24 23:26 UTC (permalink / raw)
To: linux-kselftest, Eric Biederman, Kees Cook, Shuah Khan,
Thomas Gleixner, Ingo Molnar, Peter Zijlstra, Darren Hart,
Davidlohr Bueso, André 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, usama.anjum, seanjc, kernel-team, Edward Liaw,
linux-mm, iommu, kvm, netdev, linux-fsdevel, linux-riscv,
linux-sgx
-D_GNU_SOURCE= will be provided by lib.mk CFLAGS, so -D_GNU_SOURCE
should be dropped to prevent redefinition warnings.
Signed-off-by: Edward Liaw <edliaw@google.com>
---
tools/testing/selftests/intel_pstate/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/intel_pstate/Makefile b/tools/testing/selftests/intel_pstate/Makefile
index 05d66ef50c97..f45372cb00fe 100644
--- a/tools/testing/selftests/intel_pstate/Makefile
+++ b/tools/testing/selftests/intel_pstate/Makefile
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0
-CFLAGS := $(CFLAGS) -Wall -D_GNU_SOURCE
+CFLAGS := $(CFLAGS) -Wall
LDLIBS += -lm
ARCH ?= $(shell uname -m 2>/dev/null || echo not)
--
2.45.2.741.gdbec12cfda-goog
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH v6 07/13] selftests/iommu: Drop redundant -D_GNU_SOURCE CFLAGS in Makefile
2024-06-24 23:26 [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk Edward Liaw
` (5 preceding siblings ...)
2024-06-24 23:26 ` [PATCH v6 06/13] selftests/intel_pstate: " Edward Liaw
@ 2024-06-24 23:26 ` Edward Liaw
2024-06-24 23:26 ` [PATCH v6 08/13] selftests/kvm: " Edward Liaw
` (6 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Edward Liaw @ 2024-06-24 23:26 UTC (permalink / raw)
To: linux-kselftest, Eric Biederman, Kees Cook, Shuah Khan,
Thomas Gleixner, Ingo Molnar, Peter Zijlstra, Darren Hart,
Davidlohr Bueso, André 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, usama.anjum, seanjc, kernel-team, Edward Liaw,
linux-mm, iommu, kvm, netdev, linux-fsdevel, linux-riscv,
linux-sgx
-D_GNU_SOURCE= will be provided by lib.mk CFLAGS, so -D_GNU_SOURCE
should be dropped to prevent redefinition warnings.
Signed-off-by: Edward Liaw <edliaw@google.com>
---
tools/testing/selftests/iommu/Makefile | 2 --
1 file changed, 2 deletions(-)
diff --git a/tools/testing/selftests/iommu/Makefile b/tools/testing/selftests/iommu/Makefile
index 32c5fdfd0eef..fd6477911f24 100644
--- a/tools/testing/selftests/iommu/Makefile
+++ b/tools/testing/selftests/iommu/Makefile
@@ -2,8 +2,6 @@
CFLAGS += -Wall -O2 -Wno-unused-function
CFLAGS += $(KHDR_INCLUDES)
-CFLAGS += -D_GNU_SOURCE
-
TEST_GEN_PROGS :=
TEST_GEN_PROGS += iommufd
TEST_GEN_PROGS += iommufd_fail_nth
--
2.45.2.741.gdbec12cfda-goog
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH v6 08/13] selftests/kvm: Drop redundant -D_GNU_SOURCE CFLAGS in Makefile
2024-06-24 23:26 [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk Edward Liaw
` (6 preceding siblings ...)
2024-06-24 23:26 ` [PATCH v6 07/13] selftests/iommu: " Edward Liaw
@ 2024-06-24 23:26 ` Edward Liaw
2024-06-24 23:26 ` [PATCH v6 09/13] selftests/proc: " Edward Liaw
` (5 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Edward Liaw @ 2024-06-24 23:26 UTC (permalink / raw)
To: linux-kselftest, Eric Biederman, Kees Cook, Shuah Khan,
Thomas Gleixner, Ingo Molnar, Peter Zijlstra, Darren Hart,
Davidlohr Bueso, André 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, usama.anjum, seanjc, kernel-team, Edward Liaw,
linux-mm, iommu, kvm, netdev, linux-fsdevel, linux-riscv,
linux-sgx
-D_GNU_SOURCE= will be provided by lib.mk CFLAGS, so -D_GNU_SOURCE
should be dropped to prevent redefinition warnings.
Signed-off-by: Edward Liaw <edliaw@google.com>
---
tools/testing/selftests/kvm/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index ac280dcba996..4ee37abf70ff 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -231,7 +231,7 @@ LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
endif
CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
-Wno-gnu-variable-sized-type-not-at-end -MD -MP -DCONFIG_64BIT \
- -D_GNU_SOURCE -fno-builtin-memcmp -fno-builtin-memcpy \
+ -fno-builtin-memcmp -fno-builtin-memcpy \
-fno-builtin-memset -fno-builtin-strnlen \
-fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \
-I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \
--
2.45.2.741.gdbec12cfda-goog
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH v6 09/13] selftests/proc: Drop redundant -D_GNU_SOURCE CFLAGS in Makefile
2024-06-24 23:26 [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk Edward Liaw
` (7 preceding siblings ...)
2024-06-24 23:26 ` [PATCH v6 08/13] selftests/kvm: " Edward Liaw
@ 2024-06-24 23:26 ` Edward Liaw
2024-06-24 23:26 ` [PATCH v6 10/13] selftests/resctrl: " Edward Liaw
` (4 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Edward Liaw @ 2024-06-24 23:26 UTC (permalink / raw)
To: linux-kselftest, Eric Biederman, Kees Cook, Shuah Khan,
Thomas Gleixner, Ingo Molnar, Peter Zijlstra, Darren Hart,
Davidlohr Bueso, André 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, usama.anjum, seanjc, kernel-team, Edward Liaw,
linux-mm, iommu, kvm, netdev, linux-fsdevel, linux-riscv,
linux-sgx
-D_GNU_SOURCE= will be provided by lib.mk CFLAGS, so -D_GNU_SOURCE
should be dropped to prevent redefinition warnings.
Signed-off-by: Edward Liaw <edliaw@google.com>
---
tools/testing/selftests/proc/Makefile | 1 -
1 file changed, 1 deletion(-)
diff --git a/tools/testing/selftests/proc/Makefile b/tools/testing/selftests/proc/Makefile
index 6066f607f758..ee424a9f075f 100644
--- a/tools/testing/selftests/proc/Makefile
+++ b/tools/testing/selftests/proc/Makefile
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
CFLAGS += -Wall -O2 -Wno-unused-function
-CFLAGS += -D_GNU_SOURCE
LDFLAGS += -pthread
TEST_GEN_PROGS :=
--
2.45.2.741.gdbec12cfda-goog
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH v6 10/13] selftests/resctrl: Drop redundant -D_GNU_SOURCE CFLAGS in Makefile
2024-06-24 23:26 [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk Edward Liaw
` (8 preceding siblings ...)
2024-06-24 23:26 ` [PATCH v6 09/13] selftests/proc: " Edward Liaw
@ 2024-06-24 23:26 ` Edward Liaw
2024-06-24 23:26 ` [PATCH v6 11/13] selftests/ring-buffer: " Edward Liaw
` (3 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Edward Liaw @ 2024-06-24 23:26 UTC (permalink / raw)
To: linux-kselftest, Eric Biederman, Kees Cook, Shuah Khan,
Thomas Gleixner, Ingo Molnar, Peter Zijlstra, Darren Hart,
Davidlohr Bueso, André 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, usama.anjum, seanjc, kernel-team, Edward Liaw,
linux-mm, iommu, kvm, netdev, linux-fsdevel, linux-riscv,
linux-sgx
-D_GNU_SOURCE= will be provided by lib.mk CFLAGS, so -D_GNU_SOURCE
should be dropped to prevent redefinition warnings.
Signed-off-by: Edward Liaw <edliaw@google.com>
---
tools/testing/selftests/resctrl/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/resctrl/Makefile b/tools/testing/selftests/resctrl/Makefile
index 021863f86053..f408bd6bfc3d 100644
--- a/tools/testing/selftests/resctrl/Makefile
+++ b/tools/testing/selftests/resctrl/Makefile
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
-CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE
+CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2
CFLAGS += $(KHDR_INCLUDES)
TEST_GEN_PROGS := resctrl_tests
--
2.45.2.741.gdbec12cfda-goog
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH v6 11/13] selftests/ring-buffer: Drop redundant -D_GNU_SOURCE CFLAGS in Makefile
2024-06-24 23:26 [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk Edward Liaw
` (9 preceding siblings ...)
2024-06-24 23:26 ` [PATCH v6 10/13] selftests/resctrl: " Edward Liaw
@ 2024-06-24 23:26 ` Edward Liaw
2024-06-24 23:26 ` [PATCH v6 12/13] selftests/riscv: " Edward Liaw
` (2 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Edward Liaw @ 2024-06-24 23:26 UTC (permalink / raw)
To: linux-kselftest, Eric Biederman, Kees Cook, Shuah Khan,
Thomas Gleixner, Ingo Molnar, Peter Zijlstra, Darren Hart,
Davidlohr Bueso, André 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, usama.anjum, seanjc, kernel-team, Edward Liaw,
linux-mm, iommu, kvm, netdev, linux-fsdevel, linux-riscv,
linux-sgx
-D_GNU_SOURCE= will be provided by lib.mk CFLAGS, so -D_GNU_SOURCE
should be dropped to prevent redefinition warnings.
Signed-off-by: Edward Liaw <edliaw@google.com>
---
tools/testing/selftests/ring-buffer/Makefile | 1 -
1 file changed, 1 deletion(-)
diff --git a/tools/testing/selftests/ring-buffer/Makefile b/tools/testing/selftests/ring-buffer/Makefile
index 627c5fa6d1ab..23605782639e 100644
--- a/tools/testing/selftests/ring-buffer/Makefile
+++ b/tools/testing/selftests/ring-buffer/Makefile
@@ -1,7 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
CFLAGS += -Wl,-no-as-needed -Wall
CFLAGS += $(KHDR_INCLUDES)
-CFLAGS += -D_GNU_SOURCE
TEST_GEN_PROGS = map_test
--
2.45.2.741.gdbec12cfda-goog
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH v6 12/13] selftests/riscv: Drop redundant -D_GNU_SOURCE CFLAGS in Makefile
2024-06-24 23:26 [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk Edward Liaw
` (10 preceding siblings ...)
2024-06-24 23:26 ` [PATCH v6 11/13] selftests/ring-buffer: " Edward Liaw
@ 2024-06-24 23:26 ` Edward Liaw
2024-06-24 23:26 ` [PATCH v6 13/13] selftests/sgx: Append CFLAGS from lib.mk to HOST_CFLAGS Edward Liaw
2024-06-25 20:52 ` [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk Andrew Morton
13 siblings, 0 replies; 18+ messages in thread
From: Edward Liaw @ 2024-06-24 23:26 UTC (permalink / raw)
To: linux-kselftest, Eric Biederman, Kees Cook, Shuah Khan,
Thomas Gleixner, Ingo Molnar, Peter Zijlstra, Darren Hart,
Davidlohr Bueso, André 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, usama.anjum, seanjc, kernel-team, Edward Liaw,
linux-mm, iommu, kvm, netdev, linux-fsdevel, linux-riscv,
linux-sgx
-D_GNU_SOURCE= will be provided by lib.mk CFLAGS, so -D_GNU_SOURCE
should be dropped to prevent redefinition warnings.
Signed-off-by: Edward Liaw <edliaw@google.com>
---
tools/testing/selftests/riscv/mm/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/riscv/mm/Makefile b/tools/testing/selftests/riscv/mm/Makefile
index c333263f2b27..4664ed79e20b 100644
--- a/tools/testing/selftests/riscv/mm/Makefile
+++ b/tools/testing/selftests/riscv/mm/Makefile
@@ -3,7 +3,7 @@
# Originally tools/testing/arm64/abi/Makefile
# Additional include paths needed by kselftest.h and local headers
-CFLAGS += -D_GNU_SOURCE -std=gnu99 -I.
+CFLAGS += -std=gnu99 -I.
TEST_GEN_FILES := mmap_default mmap_bottomup
--
2.45.2.741.gdbec12cfda-goog
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH v6 13/13] selftests/sgx: Append CFLAGS from lib.mk to HOST_CFLAGS
2024-06-24 23:26 [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk Edward Liaw
` (11 preceding siblings ...)
2024-06-24 23:26 ` [PATCH v6 12/13] selftests/riscv: " Edward Liaw
@ 2024-06-24 23:26 ` Edward Liaw
2024-06-25 20:52 ` [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk Andrew Morton
13 siblings, 0 replies; 18+ messages in thread
From: Edward Liaw @ 2024-06-24 23:26 UTC (permalink / raw)
To: linux-kselftest, Eric Biederman, Kees Cook, Shuah Khan,
Thomas Gleixner, Ingo Molnar, Peter Zijlstra, Darren Hart,
Davidlohr Bueso, André 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, usama.anjum, seanjc, kernel-team, Edward Liaw,
linux-mm, iommu, kvm, netdev, linux-fsdevel, linux-riscv,
linux-sgx
lib.mk CFLAGS provides -D_GNU_SOURCE= which is needed to compile the
host files.
Signed-off-by: Edward Liaw <edliaw@google.com>
---
tools/testing/selftests/sgx/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/sgx/Makefile b/tools/testing/selftests/sgx/Makefile
index 867f88ce2570..03b5e13b872b 100644
--- a/tools/testing/selftests/sgx/Makefile
+++ b/tools/testing/selftests/sgx/Makefile
@@ -12,7 +12,7 @@ OBJCOPY := $(CROSS_COMPILE)objcopy
endif
INCLUDES := -I$(top_srcdir)/tools/include
-HOST_CFLAGS := -Wall -Werror -g $(INCLUDES) -fPIC
+HOST_CFLAGS := -Wall -Werror -g $(INCLUDES) -fPIC $(CFLAGS)
HOST_LDFLAGS := -z noexecstack -lcrypto
ENCL_CFLAGS += -Wall -Werror -static-pie -nostdlib -ffreestanding -fPIE \
-fno-stack-protector -mrdrnd $(INCLUDES)
--
2.45.2.741.gdbec12cfda-goog
^ permalink raw reply [flat|nested] 18+ messages in thread* Re: [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk
2024-06-24 23:26 [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk Edward Liaw
` (12 preceding siblings ...)
2024-06-24 23:26 ` [PATCH v6 13/13] selftests/sgx: Append CFLAGS from lib.mk to HOST_CFLAGS Edward Liaw
@ 2024-06-25 20:52 ` Andrew Morton
2024-06-25 23:34 ` Shuah Khan
13 siblings, 1 reply; 18+ messages in thread
From: Andrew Morton @ 2024-06-25 20:52 UTC (permalink / raw)
To: Edward Liaw
Cc: linux-kselftest, Eric Biederman, Kees Cook, Shuah Khan,
Thomas Gleixner, Ingo Molnar, Peter Zijlstra, Darren Hart,
Davidlohr Bueso, André Almeida ,
Jason Gunthorpe, Kevin Tian, Paolo Bonzini, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Fenghua Yu,
Reinette Chatre, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Jarkko Sakkinen, Dave Hansen, linux-kernel, usama.anjum, seanjc,
kernel-team, linux-mm, iommu, kvm, netdev, linux-fsdevel,
linux-riscv, linux-sgx
On Mon, 24 Jun 2024 23:26:09 +0000 Edward Liaw <edliaw@google.com> wrote:
> Centralizes the definition of _GNU_SOURCE into lib.mk and addresses all
> resulting macro redefinition warnings.
>
> These patches will need to be merged in one shot to avoid redefinition
> warnings.
Yes, please do this as a single patch and resend?
^ permalink raw reply [flat|nested] 18+ messages in thread* Re: [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk
2024-06-25 20:52 ` [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk Andrew Morton
@ 2024-06-25 23:34 ` Shuah Khan
2024-06-26 0:41 ` Edward Liaw
0 siblings, 1 reply; 18+ messages in thread
From: Shuah Khan @ 2024-06-25 23:34 UTC (permalink / raw)
To: Andrew Morton, Edward Liaw
Cc: linux-kselftest, Eric Biederman, Kees Cook, Shuah Khan,
Thomas Gleixner, Ingo Molnar, Peter Zijlstra, Darren Hart,
Davidlohr Bueso, André Almeida, Jason Gunthorpe, Kevin Tian,
Paolo Bonzini, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Fenghua Yu, Reinette Chatre, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Jarkko Sakkinen, Dave Hansen,
linux-kernel, usama.anjum, seanjc, kernel-team, linux-mm, iommu,
kvm, netdev, linux-fsdevel, linux-riscv, linux-sgx, Shuah Khan
On 6/25/24 14:52, Andrew Morton wrote:
> On Mon, 24 Jun 2024 23:26:09 +0000 Edward Liaw <edliaw@google.com> wrote:
>
>> Centralizes the definition of _GNU_SOURCE into lib.mk and addresses all
>> resulting macro redefinition warnings.
>>
>> These patches will need to be merged in one shot to avoid redefinition
>> warnings.
>
> Yes, please do this as a single patch and resend?
Since the change is limited to makefiles and one source file
we can manage it with one patch.
Please send single patch and I will apply to next and we can resolve
conflicts if any before the merge window rolls around.
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk
2024-06-25 23:34 ` Shuah Khan
@ 2024-06-26 0:41 ` Edward Liaw
2024-06-26 1:21 ` Edward Liaw
0 siblings, 1 reply; 18+ messages in thread
From: Edward Liaw @ 2024-06-26 0:41 UTC (permalink / raw)
To: Shuah Khan
Cc: Andrew Morton, linux-kselftest, Eric Biederman, Kees Cook,
Shuah Khan, Thomas Gleixner, Ingo Molnar, Peter Zijlstra,
Darren Hart, Davidlohr Bueso, André Almeida,
Jason Gunthorpe, Kevin Tian, Paolo Bonzini, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Fenghua Yu,
Reinette Chatre, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Jarkko Sakkinen, Dave Hansen, linux-kernel, usama.anjum, seanjc,
kernel-team, linux-mm, iommu, kvm, netdev, linux-fsdevel,
linux-riscv, linux-sgx
On Tue, Jun 25, 2024 at 4:34 PM Shuah Khan <skhan@linuxfoundation.org> wrote:
>
> On 6/25/24 14:52, Andrew Morton wrote:
> > On Mon, 24 Jun 2024 23:26:09 +0000 Edward Liaw <edliaw@google.com> wrote:
> >
> >> Centralizes the definition of _GNU_SOURCE into lib.mk and addresses all
> >> resulting macro redefinition warnings.
> >>
> >> These patches will need to be merged in one shot to avoid redefinition
> >> warnings.
> >
> > Yes, please do this as a single patch and resend?
>
> Since the change is limited to makefiles and one source file
> we can manage it with one patch.
>
> Please send single patch and I will apply to next and we can resolve
> conflicts if any before the merge window rolls around.
Sounds good, I sent:
https://lore.kernel.org/linux-kselftest/20240625223454.1586259-1-edliaw@google.com
>
> thanks,
> -- Shuah
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v6 00/13] Centralize _GNU_SOURCE definition into lib.mk
2024-06-26 0:41 ` Edward Liaw
@ 2024-06-26 1:21 ` Edward Liaw
0 siblings, 0 replies; 18+ messages in thread
From: Edward Liaw @ 2024-06-26 1:21 UTC (permalink / raw)
To: Shuah Khan
Cc: Andrew Morton, linux-kselftest, Eric Biederman, Kees Cook,
Shuah Khan, Thomas Gleixner, Ingo Molnar, Peter Zijlstra,
Darren Hart, Davidlohr Bueso, André Almeida,
Jason Gunthorpe, Kevin Tian, Paolo Bonzini, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Fenghua Yu,
Reinette Chatre, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Jarkko Sakkinen, Dave Hansen, linux-kernel, usama.anjum, seanjc,
kernel-team, linux-mm, iommu, kvm, netdev, linux-fsdevel,
linux-riscv, linux-sgx
On Tue, Jun 25, 2024 at 5:41 PM Edward Liaw <edliaw@google.com> wrote:
>
> On Tue, Jun 25, 2024 at 4:34 PM Shuah Khan <skhan@linuxfoundation.org> wrote:
> >
> > On 6/25/24 14:52, Andrew Morton wrote:
> > > On Mon, 24 Jun 2024 23:26:09 +0000 Edward Liaw <edliaw@google.com> wrote:
> > >
> > >> Centralizes the definition of _GNU_SOURCE into lib.mk and addresses all
> > >> resulting macro redefinition warnings.
> > >>
> > >> These patches will need to be merged in one shot to avoid redefinition
> > >> warnings.
> > >
> > > Yes, please do this as a single patch and resend?
> >
> > Since the change is limited to makefiles and one source file
> > we can manage it with one patch.
> >
> > Please send single patch and I will apply to next and we can resolve
> > conflicts if any before the merge window rolls around.
>
> Sounds good, I sent:
> https://lore.kernel.org/linux-kselftest/20240625223454.1586259-1-edliaw@google.com
I realized that in this v6 patch, I had accidentally sent it in the
middle of a rebase, so it's missing the last change to
selftests/tmpfs. I've fixed it in v7.
>
> >
> > thanks,
> > -- Shuah
^ permalink raw reply [flat|nested] 18+ messages in thread