From: Michael Ellerman <mpe@ellerman.id.au>
To: "Edward Liaw" <edliaw@google.com>,
shuah@kernel.org, "Mickaël Salaün" <mic@digikod.net>,
"Günther Noack" <gnoack@google.com>,
"Christian Brauner" <brauner@kernel.org>,
"Richard Cochran" <richardcochran@gmail.com>,
"Paul Walmsley" <paul.walmsley@sifive.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"David S. Miller" <davem@davemloft.net>,
"Jakub Kicinski" <kuba@kernel.org>,
"Jesper Dangaard Brouer" <hawk@kernel.org>,
"John Fastabend" <john.fastabend@gmail.com>,
"Nicholas Piggin" <npiggin@gmail.com>,
"Christophe Leroy" <christophe.leroy@csgroup.eu>,
"Naveen N. Rao" <naveen.n.rao@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
kernel-team@android.com, Edward Liaw <edliaw@google.com>,
linux-security-module@vger.kernel.org, netdev@vger.kernel.org,
linux-riscv@lists.infradead.org, bpf@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v5 44/68] selftests/powerpc: Drop define _GNU_SOURCE
Date: Wed, 22 May 2024 21:39:01 +1000 [thread overview]
Message-ID: <87r0du2i0a.fsf@mail.lhotse> (raw)
In-Reply-To: <20240522005913.3540131-45-edliaw@google.com>
Edward Liaw <edliaw@google.com> writes:
> _GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent
> redefinition warnings.
Most of these tests build with -Werror, so the duplicate define is
actually a hard error. Can you put this patch earlier in the series at
least?
cheers
> Signed-off-by: Edward Liaw <edliaw@google.com>
> ---
> tools/testing/selftests/powerpc/benchmarks/context_switch.c | 2 --
> tools/testing/selftests/powerpc/benchmarks/exec_target.c | 2 --
> tools/testing/selftests/powerpc/benchmarks/fork.c | 2 --
> tools/testing/selftests/powerpc/benchmarks/futex_bench.c | 3 ---
> tools/testing/selftests/powerpc/dexcr/hashchk_test.c | 3 ---
> tools/testing/selftests/powerpc/dscr/dscr_default_test.c | 3 ---
> tools/testing/selftests/powerpc/dscr/dscr_explicit_test.c | 3 ---
> tools/testing/selftests/powerpc/dscr/dscr_sysfs_thread_test.c | 1 -
> tools/testing/selftests/powerpc/mm/exec_prot.c | 2 --
> tools/testing/selftests/powerpc/mm/pkey_exec_prot.c | 2 --
> tools/testing/selftests/powerpc/mm/pkey_siginfo.c | 2 --
> tools/testing/selftests/powerpc/mm/tlbie_test.c | 2 --
> tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c | 1 -
> tools/testing/selftests/powerpc/pmu/count_instructions.c | 3 ---
> tools/testing/selftests/powerpc/pmu/count_stcx_fail.c | 3 ---
> tools/testing/selftests/powerpc/pmu/ebb/ebb.c | 3 ---
> .../testing/selftests/powerpc/pmu/ebb/instruction_count_test.c | 3 ---
> tools/testing/selftests/powerpc/pmu/event.c | 2 --
> tools/testing/selftests/powerpc/pmu/lib.c | 3 ---
> tools/testing/selftests/powerpc/pmu/per_event_excludes.c | 3 ---
> tools/testing/selftests/powerpc/ptrace/perf-hwbreak.c | 3 ---
> tools/testing/selftests/powerpc/ptrace/ptrace-syscall.c | 2 --
> tools/testing/selftests/powerpc/signal/sig_sc_double_restart.c | 1 -
> tools/testing/selftests/powerpc/signal/sigreturn_kernel.c | 3 ---
> tools/testing/selftests/powerpc/signal/sigreturn_vdso.c | 3 ---
> tools/testing/selftests/powerpc/syscalls/ipc_unmuxed.c | 2 --
> tools/testing/selftests/powerpc/tm/tm-exec.c | 2 --
> tools/testing/selftests/powerpc/tm/tm-poison.c | 2 --
> .../testing/selftests/powerpc/tm/tm-signal-context-force-tm.c | 2 --
> tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c | 2 --
> tools/testing/selftests/powerpc/tm/tm-tmspr.c | 2 --
> tools/testing/selftests/powerpc/tm/tm-trap.c | 2 --
> tools/testing/selftests/powerpc/tm/tm-unavailable.c | 2 --
> tools/testing/selftests/powerpc/utils.c | 3 ---
> 34 files changed, 79 deletions(-)
>
> diff --git a/tools/testing/selftests/powerpc/benchmarks/context_switch.c b/tools/testing/selftests/powerpc/benchmarks/context_switch.c
> index 96554e2794d1..0b245572bd45 100644
> --- a/tools/testing/selftests/powerpc/benchmarks/context_switch.c
> +++ b/tools/testing/selftests/powerpc/benchmarks/context_switch.c
> @@ -4,8 +4,6 @@
> *
> * Copyright (C) 2015 Anton Blanchard <anton@au.ibm.com>, IBM
> */
> -
> -#define _GNU_SOURCE
> #include <errno.h>
> #include <sched.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/benchmarks/exec_target.c b/tools/testing/selftests/powerpc/benchmarks/exec_target.c
> index c14b0fc1edde..8646540037d8 100644
> --- a/tools/testing/selftests/powerpc/benchmarks/exec_target.c
> +++ b/tools/testing/selftests/powerpc/benchmarks/exec_target.c
> @@ -5,8 +5,6 @@
> *
> * Copyright 2018, Anton Blanchard, IBM Corp.
> */
> -
> -#define _GNU_SOURCE
> #include <unistd.h>
> #include <sys/syscall.h>
>
> diff --git a/tools/testing/selftests/powerpc/benchmarks/fork.c b/tools/testing/selftests/powerpc/benchmarks/fork.c
> index d312e638cb37..327231646a2a 100644
> --- a/tools/testing/selftests/powerpc/benchmarks/fork.c
> +++ b/tools/testing/selftests/powerpc/benchmarks/fork.c
> @@ -5,8 +5,6 @@
> *
> * Copyright 2018, Anton Blanchard, IBM Corp.
> */
> -
> -#define _GNU_SOURCE
> #include <assert.h>
> #include <errno.h>
> #include <getopt.h>
> diff --git a/tools/testing/selftests/powerpc/benchmarks/futex_bench.c b/tools/testing/selftests/powerpc/benchmarks/futex_bench.c
> index 017057090490..0483a13c88f9 100644
> --- a/tools/testing/selftests/powerpc/benchmarks/futex_bench.c
> +++ b/tools/testing/selftests/powerpc/benchmarks/futex_bench.c
> @@ -2,9 +2,6 @@
> /*
> * Copyright 2016, Anton Blanchard, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE
> -
> #include <stdio.h>
> #include <sys/syscall.h>
> #include <time.h>
> diff --git a/tools/testing/selftests/powerpc/dexcr/hashchk_test.c b/tools/testing/selftests/powerpc/dexcr/hashchk_test.c
> index 645224bdc142..2499ab7fe563 100644
> --- a/tools/testing/selftests/powerpc/dexcr/hashchk_test.c
> +++ b/tools/testing/selftests/powerpc/dexcr/hashchk_test.c
> @@ -1,7 +1,4 @@
> // SPDX-License-Identifier: GPL-2.0+
> -
> -#define _GNU_SOURCE
> -
> #include <errno.h>
> #include <fcntl.h>
> #include <limits.h>
> diff --git a/tools/testing/selftests/powerpc/dscr/dscr_default_test.c b/tools/testing/selftests/powerpc/dscr/dscr_default_test.c
> index 60ab02525b79..fe6aff1e5dad 100644
> --- a/tools/testing/selftests/powerpc/dscr/dscr_default_test.c
> +++ b/tools/testing/selftests/powerpc/dscr/dscr_default_test.c
> @@ -9,9 +9,6 @@
> * Copyright 2012, Anton Blanchard, IBM Corporation.
> * Copyright 2015, Anshuman Khandual, IBM Corporation.
> */
> -
> -#define _GNU_SOURCE
> -
> #include "dscr.h"
>
> #include <pthread.h>
> diff --git a/tools/testing/selftests/powerpc/dscr/dscr_explicit_test.c b/tools/testing/selftests/powerpc/dscr/dscr_explicit_test.c
> index e2268e9183a8..93b6efdc2eef 100644
> --- a/tools/testing/selftests/powerpc/dscr/dscr_explicit_test.c
> +++ b/tools/testing/selftests/powerpc/dscr/dscr_explicit_test.c
> @@ -15,9 +15,6 @@
> * Copyright 2012, Anton Blanchard, IBM Corporation.
> * Copyright 2015, Anshuman Khandual, IBM Corporation.
> */
> -
> -#define _GNU_SOURCE
> -
> #include "dscr.h"
> #include "utils.h"
>
> diff --git a/tools/testing/selftests/powerpc/dscr/dscr_sysfs_thread_test.c b/tools/testing/selftests/powerpc/dscr/dscr_sysfs_thread_test.c
> index 191ed126f118..ace7d23492c1 100644
> --- a/tools/testing/selftests/powerpc/dscr/dscr_sysfs_thread_test.c
> +++ b/tools/testing/selftests/powerpc/dscr/dscr_sysfs_thread_test.c
> @@ -9,7 +9,6 @@
> *
> * Copyright 2015, Anshuman Khandual, IBM Corporation.
> */
> -#define _GNU_SOURCE
> #include "dscr.h"
>
> static int test_thread_dscr(unsigned long val)
> diff --git a/tools/testing/selftests/powerpc/mm/exec_prot.c b/tools/testing/selftests/powerpc/mm/exec_prot.c
> index db75b2225de1..65712597cc68 100644
> --- a/tools/testing/selftests/powerpc/mm/exec_prot.c
> +++ b/tools/testing/selftests/powerpc/mm/exec_prot.c
> @@ -6,8 +6,6 @@
> *
> * Test if applying execute protection on pages works as expected.
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/mm/pkey_exec_prot.c b/tools/testing/selftests/powerpc/mm/pkey_exec_prot.c
> index 0af4f02669a1..5cf72cd9694d 100644
> --- a/tools/testing/selftests/powerpc/mm/pkey_exec_prot.c
> +++ b/tools/testing/selftests/powerpc/mm/pkey_exec_prot.c
> @@ -6,8 +6,6 @@
> * Test if applying execute protection on pages using memory
> * protection keys works as expected.
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/mm/pkey_siginfo.c b/tools/testing/selftests/powerpc/mm/pkey_siginfo.c
> index 2db76e56d4cb..fcaa591abf88 100644
> --- a/tools/testing/selftests/powerpc/mm/pkey_siginfo.c
> +++ b/tools/testing/selftests/powerpc/mm/pkey_siginfo.c
> @@ -8,8 +8,6 @@
> * attempted to be protected by two different keys from two competing
> * threads at the same time.
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/mm/tlbie_test.c b/tools/testing/selftests/powerpc/mm/tlbie_test.c
> index 48344a74b212..512cd405de92 100644
> --- a/tools/testing/selftests/powerpc/mm/tlbie_test.c
> +++ b/tools/testing/selftests/powerpc/mm/tlbie_test.c
> @@ -14,8 +14,6 @@
> * and copy it back to the original area. This helps us to detect if any
> * store continued to happen after we marked the memory PROT_READ.
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <sys/mman.h>
> #include <sys/types.h>
> diff --git a/tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c b/tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c
> index d6f99eb9be65..0b9b20668fa4 100644
> --- a/tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c
> +++ b/tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c
> @@ -1,5 +1,4 @@
> // SPDX-License-Identifier: GPL-2.0-only
> -#define _GNU_SOURCE
> #include <errno.h>
> #include <fcntl.h>
> #include <stdlib.h>
> diff --git a/tools/testing/selftests/powerpc/pmu/count_instructions.c b/tools/testing/selftests/powerpc/pmu/count_instructions.c
> index a3984ef1e96a..57d63ff75397 100644
> --- a/tools/testing/selftests/powerpc/pmu/count_instructions.c
> +++ b/tools/testing/selftests/powerpc/pmu/count_instructions.c
> @@ -2,9 +2,6 @@
> /*
> * Copyright 2013, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE
> -
> #include <stdio.h>
> #include <stdbool.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/pmu/count_stcx_fail.c b/tools/testing/selftests/powerpc/pmu/count_stcx_fail.c
> index 2070a1e2b3a5..5d3bbd38528d 100644
> --- a/tools/testing/selftests/powerpc/pmu/count_stcx_fail.c
> +++ b/tools/testing/selftests/powerpc/pmu/count_stcx_fail.c
> @@ -2,9 +2,6 @@
> * Copyright 2013, Michael Ellerman, IBM Corp.
> * Licensed under GPLv2.
> */
> -
> -#define _GNU_SOURCE
> -
> #include <stdio.h>
> #include <stdbool.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/pmu/ebb/ebb.c b/tools/testing/selftests/powerpc/pmu/ebb/ebb.c
> index 21537d6eb6b7..e99a455e8c2e 100644
> --- a/tools/testing/selftests/powerpc/pmu/ebb/ebb.c
> +++ b/tools/testing/selftests/powerpc/pmu/ebb/ebb.c
> @@ -2,9 +2,6 @@
> /*
> * Copyright 2014, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE /* For CPU_ZERO etc. */
> -
> #include <sched.h>
> #include <sys/wait.h>
> #include <setjmp.h>
> diff --git a/tools/testing/selftests/powerpc/pmu/ebb/instruction_count_test.c b/tools/testing/selftests/powerpc/pmu/ebb/instruction_count_test.c
> index eed338b18e11..ab3f888922d6 100644
> --- a/tools/testing/selftests/powerpc/pmu/ebb/instruction_count_test.c
> +++ b/tools/testing/selftests/powerpc/pmu/ebb/instruction_count_test.c
> @@ -2,9 +2,6 @@
> /*
> * Copyright 2014, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE
> -
> #include <stdio.h>
> #include <stdbool.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/pmu/event.c b/tools/testing/selftests/powerpc/pmu/event.c
> index 0c1c1bdba081..5468bd2c3c5b 100644
> --- a/tools/testing/selftests/powerpc/pmu/event.c
> +++ b/tools/testing/selftests/powerpc/pmu/event.c
> @@ -2,8 +2,6 @@
> /*
> * Copyright 2013, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE
> #include <unistd.h>
> #include <sys/syscall.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/pmu/lib.c b/tools/testing/selftests/powerpc/pmu/lib.c
> index 321357987408..fa208701dbdc 100644
> --- a/tools/testing/selftests/powerpc/pmu/lib.c
> +++ b/tools/testing/selftests/powerpc/pmu/lib.c
> @@ -2,9 +2,6 @@
> /*
> * Copyright 2014, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE /* For CPU_ZERO etc. */
> -
> #include <errno.h>
> #include <sched.h>
> #include <setjmp.h>
> diff --git a/tools/testing/selftests/powerpc/pmu/per_event_excludes.c b/tools/testing/selftests/powerpc/pmu/per_event_excludes.c
> index ad32a09a6540..066e0c4799fd 100644
> --- a/tools/testing/selftests/powerpc/pmu/per_event_excludes.c
> +++ b/tools/testing/selftests/powerpc/pmu/per_event_excludes.c
> @@ -2,9 +2,6 @@
> /*
> * Copyright 2014, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE
> -
> #include <elf.h>
> #include <limits.h>
> #include <stdio.h>
> diff --git a/tools/testing/selftests/powerpc/ptrace/perf-hwbreak.c b/tools/testing/selftests/powerpc/ptrace/perf-hwbreak.c
> index e374c6b7ace6..1f7e3c63742d 100644
> --- a/tools/testing/selftests/powerpc/ptrace/perf-hwbreak.c
> +++ b/tools/testing/selftests/powerpc/ptrace/perf-hwbreak.c
> @@ -16,9 +16,6 @@
> *
> * Copyright (C) 2018 Michael Neuling, IBM Corporation.
> */
> -
> -#define _GNU_SOURCE
> -
> #include <unistd.h>
> #include <assert.h>
> #include <sched.h>
> diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-syscall.c b/tools/testing/selftests/powerpc/ptrace/ptrace-syscall.c
> index 3353210dcdbd..6e5294c1b60b 100644
> --- a/tools/testing/selftests/powerpc/ptrace/ptrace-syscall.c
> +++ b/tools/testing/selftests/powerpc/ptrace/ptrace-syscall.c
> @@ -8,8 +8,6 @@
> * test, and it was adapted to run on Powerpc by
> * Breno Leitao <leitao@debian.org>
> */
> -#define _GNU_SOURCE
> -
> #include <sys/ptrace.h>
> #include <sys/types.h>
> #include <sys/wait.h>
> diff --git a/tools/testing/selftests/powerpc/signal/sig_sc_double_restart.c b/tools/testing/selftests/powerpc/signal/sig_sc_double_restart.c
> index e3972264615b..8bad5e65bbb7 100644
> --- a/tools/testing/selftests/powerpc/signal/sig_sc_double_restart.c
> +++ b/tools/testing/selftests/powerpc/signal/sig_sc_double_restart.c
> @@ -18,7 +18,6 @@
> * that sucker at the same time. Same for multiple signals of any kind
> * interrupting that sucker on 64bit...
> */
> -#define _GNU_SOURCE
> #include <sys/types.h>
> #include <sys/wait.h>
> #include <sys/syscall.h>
> diff --git a/tools/testing/selftests/powerpc/signal/sigreturn_kernel.c b/tools/testing/selftests/powerpc/signal/sigreturn_kernel.c
> index 0a1b6e591eee..772c3373560f 100644
> --- a/tools/testing/selftests/powerpc/signal/sigreturn_kernel.c
> +++ b/tools/testing/selftests/powerpc/signal/sigreturn_kernel.c
> @@ -2,9 +2,6 @@
> /*
> * Test that we can't sigreturn to kernel addresses, or to kernel mode.
> */
> -
> -#define _GNU_SOURCE
> -
> #include <stdio.h>
> #include <signal.h>
> #include <stdlib.h>
> diff --git a/tools/testing/selftests/powerpc/signal/sigreturn_vdso.c b/tools/testing/selftests/powerpc/signal/sigreturn_vdso.c
> index e282fff0fe25..d5aecd2c4b95 100644
> --- a/tools/testing/selftests/powerpc/signal/sigreturn_vdso.c
> +++ b/tools/testing/selftests/powerpc/signal/sigreturn_vdso.c
> @@ -5,9 +5,6 @@
> *
> * See handle_rt_signal64() and setup_trampoline() in signal_64.c
> */
> -
> -#define _GNU_SOURCE
> -
> #include <errno.h>
> #include <stdio.h>
> #include <signal.h>
> diff --git a/tools/testing/selftests/powerpc/syscalls/ipc_unmuxed.c b/tools/testing/selftests/powerpc/syscalls/ipc_unmuxed.c
> index 4c582524aeb3..a49c699d86d4 100644
> --- a/tools/testing/selftests/powerpc/syscalls/ipc_unmuxed.c
> +++ b/tools/testing/selftests/powerpc/syscalls/ipc_unmuxed.c
> @@ -5,8 +5,6 @@
> * This test simply tests that certain syscalls are implemented. It doesn't
> * actually exercise their logic in any way.
> */
> -
> -#define _GNU_SOURCE
> #include <errno.h>
> #include <stdio.h>
> #include <unistd.h>
> diff --git a/tools/testing/selftests/powerpc/tm/tm-exec.c b/tools/testing/selftests/powerpc/tm/tm-exec.c
> index c59919d6710d..8cfc859dcf37 100644
> --- a/tools/testing/selftests/powerpc/tm/tm-exec.c
> +++ b/tools/testing/selftests/powerpc/tm/tm-exec.c
> @@ -8,8 +8,6 @@
> * It makes little sense for after an exec() call for the previously
> * suspended transaction to still exist.
> */
> -
> -#define _GNU_SOURCE
> #include <errno.h>
> #include <inttypes.h>
> #include <libgen.h>
> diff --git a/tools/testing/selftests/powerpc/tm/tm-poison.c b/tools/testing/selftests/powerpc/tm/tm-poison.c
> index a7bbf034b5bb..1b3a596a6a51 100644
> --- a/tools/testing/selftests/powerpc/tm/tm-poison.c
> +++ b/tools/testing/selftests/powerpc/tm/tm-poison.c
> @@ -11,8 +11,6 @@
> * present child's poison will leak into parent's f31 or vr31 registers,
> * otherwise, poison will never leak into parent's f31 and vr31 registers.
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <stdlib.h>
> #include <unistd.h>
> diff --git a/tools/testing/selftests/powerpc/tm/tm-signal-context-force-tm.c b/tools/testing/selftests/powerpc/tm/tm-signal-context-force-tm.c
> index 421cb082f6be..f28ba2828df6 100644
> --- a/tools/testing/selftests/powerpc/tm/tm-signal-context-force-tm.c
> +++ b/tools/testing/selftests/powerpc/tm/tm-signal-context-force-tm.c
> @@ -15,8 +15,6 @@
> * This test never fails (as returning EXIT_FAILURE). It either succeeds,
> * or crash the kernel (on a buggy kernel).
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <stdlib.h>
> #include <signal.h>
> diff --git a/tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c b/tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c
> index 06b801906f27..73f8e7dd5a1a 100644
> --- a/tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c
> +++ b/tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c
> @@ -8,8 +8,6 @@
> * It returns from the signal handler with the CPU at suspended state, but
> * without setting usercontext MSR Transaction State (TS) fields.
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <stdlib.h>
> #include <signal.h>
> diff --git a/tools/testing/selftests/powerpc/tm/tm-tmspr.c b/tools/testing/selftests/powerpc/tm/tm-tmspr.c
> index dd5ddffa28b7..01118f7db1b2 100644
> --- a/tools/testing/selftests/powerpc/tm/tm-tmspr.c
> +++ b/tools/testing/selftests/powerpc/tm/tm-tmspr.c
> @@ -22,8 +22,6 @@
> * (b) abort transaction
> * (c) check TEXASR to see if FS has been corrupted
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <stdlib.h>
> #include <unistd.h>
> diff --git a/tools/testing/selftests/powerpc/tm/tm-trap.c b/tools/testing/selftests/powerpc/tm/tm-trap.c
> index 97cb74768e30..164b345b5bd3 100644
> --- a/tools/testing/selftests/powerpc/tm/tm-trap.c
> +++ b/tools/testing/selftests/powerpc/tm/tm-trap.c
> @@ -26,8 +26,6 @@
> * the endianness is verified on subsequent traps to determine if the
> * endianness "flipped back" to the native endianness (BE).
> */
> -
> -#define _GNU_SOURCE
> #include <error.h>
> #include <stdio.h>
> #include <stdlib.h>
> diff --git a/tools/testing/selftests/powerpc/tm/tm-unavailable.c b/tools/testing/selftests/powerpc/tm/tm-unavailable.c
> index 6bf1b65b020d..712267831112 100644
> --- a/tools/testing/selftests/powerpc/tm/tm-unavailable.c
> +++ b/tools/testing/selftests/powerpc/tm/tm-unavailable.c
> @@ -13,8 +13,6 @@
> * corruption, but only for registers vs0 and vs32, which are respectively
> * representatives of FP and VEC/Altivec reg sets.
> */
> -
> -#define _GNU_SOURCE
> #include <error.h>
> #include <stdio.h>
> #include <stdlib.h>
> diff --git a/tools/testing/selftests/powerpc/utils.c b/tools/testing/selftests/powerpc/utils.c
> index e5f2d8735c64..664722a01636 100644
> --- a/tools/testing/selftests/powerpc/utils.c
> +++ b/tools/testing/selftests/powerpc/utils.c
> @@ -2,9 +2,6 @@
> /*
> * Copyright 2013-2015, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE /* For CPU_ZERO etc. */
> -
> #include <elf.h>
> #include <errno.h>
> #include <fcntl.h>
> --
> 2.45.1.288.g0e0cd299f1-goog
WARNING: multiple messages have this Message-ID (diff)
From: Michael Ellerman <mpe@ellerman.id.au>
To: "Edward Liaw" <edliaw@google.com>,
shuah@kernel.org, "Mickaël Salaün" <mic@digikod.net>,
"Günther Noack" <gnoack@google.com>,
"Christian Brauner" <brauner@kernel.org>,
"Richard Cochran" <richardcochran@gmail.com>,
"Paul Walmsley" <paul.walmsley@sifive.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"David S. Miller" <davem@davemloft.net>,
"Jakub Kicinski" <kuba@kernel.org>,
"Jesper Dangaard Brouer" <hawk@kernel.org>,
"John Fastabend" <john.fastabend@gmail.com>,
"Nicholas Piggin" <npiggin@gmail.com>,
"Christophe Leroy" <christophe.leroy@csgroup.eu>,
"Naveen N. Rao" <naveen.n.rao@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
kernel-team@android.com, Edward Liaw <edliaw@google.com>,
linux-security-module@vger.kernel.org, netdev@vger.kernel.org,
linux-riscv@lists.infradead.org, bpf@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v5 44/68] selftests/powerpc: Drop define _GNU_SOURCE
Date: Wed, 22 May 2024 21:39:01 +1000 [thread overview]
Message-ID: <87r0du2i0a.fsf@mail.lhotse> (raw)
In-Reply-To: <20240522005913.3540131-45-edliaw@google.com>
Edward Liaw <edliaw@google.com> writes:
> _GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent
> redefinition warnings.
Most of these tests build with -Werror, so the duplicate define is
actually a hard error. Can you put this patch earlier in the series at
least?
cheers
> Signed-off-by: Edward Liaw <edliaw@google.com>
> ---
> tools/testing/selftests/powerpc/benchmarks/context_switch.c | 2 --
> tools/testing/selftests/powerpc/benchmarks/exec_target.c | 2 --
> tools/testing/selftests/powerpc/benchmarks/fork.c | 2 --
> tools/testing/selftests/powerpc/benchmarks/futex_bench.c | 3 ---
> tools/testing/selftests/powerpc/dexcr/hashchk_test.c | 3 ---
> tools/testing/selftests/powerpc/dscr/dscr_default_test.c | 3 ---
> tools/testing/selftests/powerpc/dscr/dscr_explicit_test.c | 3 ---
> tools/testing/selftests/powerpc/dscr/dscr_sysfs_thread_test.c | 1 -
> tools/testing/selftests/powerpc/mm/exec_prot.c | 2 --
> tools/testing/selftests/powerpc/mm/pkey_exec_prot.c | 2 --
> tools/testing/selftests/powerpc/mm/pkey_siginfo.c | 2 --
> tools/testing/selftests/powerpc/mm/tlbie_test.c | 2 --
> tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c | 1 -
> tools/testing/selftests/powerpc/pmu/count_instructions.c | 3 ---
> tools/testing/selftests/powerpc/pmu/count_stcx_fail.c | 3 ---
> tools/testing/selftests/powerpc/pmu/ebb/ebb.c | 3 ---
> .../testing/selftests/powerpc/pmu/ebb/instruction_count_test.c | 3 ---
> tools/testing/selftests/powerpc/pmu/event.c | 2 --
> tools/testing/selftests/powerpc/pmu/lib.c | 3 ---
> tools/testing/selftests/powerpc/pmu/per_event_excludes.c | 3 ---
> tools/testing/selftests/powerpc/ptrace/perf-hwbreak.c | 3 ---
> tools/testing/selftests/powerpc/ptrace/ptrace-syscall.c | 2 --
> tools/testing/selftests/powerpc/signal/sig_sc_double_restart.c | 1 -
> tools/testing/selftests/powerpc/signal/sigreturn_kernel.c | 3 ---
> tools/testing/selftests/powerpc/signal/sigreturn_vdso.c | 3 ---
> tools/testing/selftests/powerpc/syscalls/ipc_unmuxed.c | 2 --
> tools/testing/selftests/powerpc/tm/tm-exec.c | 2 --
> tools/testing/selftests/powerpc/tm/tm-poison.c | 2 --
> .../testing/selftests/powerpc/tm/tm-signal-context-force-tm.c | 2 --
> tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c | 2 --
> tools/testing/selftests/powerpc/tm/tm-tmspr.c | 2 --
> tools/testing/selftests/powerpc/tm/tm-trap.c | 2 --
> tools/testing/selftests/powerpc/tm/tm-unavailable.c | 2 --
> tools/testing/selftests/powerpc/utils.c | 3 ---
> 34 files changed, 79 deletions(-)
>
> diff --git a/tools/testing/selftests/powerpc/benchmarks/context_switch.c b/tools/testing/selftests/powerpc/benchmarks/context_switch.c
> index 96554e2794d1..0b245572bd45 100644
> --- a/tools/testing/selftests/powerpc/benchmarks/context_switch.c
> +++ b/tools/testing/selftests/powerpc/benchmarks/context_switch.c
> @@ -4,8 +4,6 @@
> *
> * Copyright (C) 2015 Anton Blanchard <anton@au.ibm.com>, IBM
> */
> -
> -#define _GNU_SOURCE
> #include <errno.h>
> #include <sched.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/benchmarks/exec_target.c b/tools/testing/selftests/powerpc/benchmarks/exec_target.c
> index c14b0fc1edde..8646540037d8 100644
> --- a/tools/testing/selftests/powerpc/benchmarks/exec_target.c
> +++ b/tools/testing/selftests/powerpc/benchmarks/exec_target.c
> @@ -5,8 +5,6 @@
> *
> * Copyright 2018, Anton Blanchard, IBM Corp.
> */
> -
> -#define _GNU_SOURCE
> #include <unistd.h>
> #include <sys/syscall.h>
>
> diff --git a/tools/testing/selftests/powerpc/benchmarks/fork.c b/tools/testing/selftests/powerpc/benchmarks/fork.c
> index d312e638cb37..327231646a2a 100644
> --- a/tools/testing/selftests/powerpc/benchmarks/fork.c
> +++ b/tools/testing/selftests/powerpc/benchmarks/fork.c
> @@ -5,8 +5,6 @@
> *
> * Copyright 2018, Anton Blanchard, IBM Corp.
> */
> -
> -#define _GNU_SOURCE
> #include <assert.h>
> #include <errno.h>
> #include <getopt.h>
> diff --git a/tools/testing/selftests/powerpc/benchmarks/futex_bench.c b/tools/testing/selftests/powerpc/benchmarks/futex_bench.c
> index 017057090490..0483a13c88f9 100644
> --- a/tools/testing/selftests/powerpc/benchmarks/futex_bench.c
> +++ b/tools/testing/selftests/powerpc/benchmarks/futex_bench.c
> @@ -2,9 +2,6 @@
> /*
> * Copyright 2016, Anton Blanchard, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE
> -
> #include <stdio.h>
> #include <sys/syscall.h>
> #include <time.h>
> diff --git a/tools/testing/selftests/powerpc/dexcr/hashchk_test.c b/tools/testing/selftests/powerpc/dexcr/hashchk_test.c
> index 645224bdc142..2499ab7fe563 100644
> --- a/tools/testing/selftests/powerpc/dexcr/hashchk_test.c
> +++ b/tools/testing/selftests/powerpc/dexcr/hashchk_test.c
> @@ -1,7 +1,4 @@
> // SPDX-License-Identifier: GPL-2.0+
> -
> -#define _GNU_SOURCE
> -
> #include <errno.h>
> #include <fcntl.h>
> #include <limits.h>
> diff --git a/tools/testing/selftests/powerpc/dscr/dscr_default_test.c b/tools/testing/selftests/powerpc/dscr/dscr_default_test.c
> index 60ab02525b79..fe6aff1e5dad 100644
> --- a/tools/testing/selftests/powerpc/dscr/dscr_default_test.c
> +++ b/tools/testing/selftests/powerpc/dscr/dscr_default_test.c
> @@ -9,9 +9,6 @@
> * Copyright 2012, Anton Blanchard, IBM Corporation.
> * Copyright 2015, Anshuman Khandual, IBM Corporation.
> */
> -
> -#define _GNU_SOURCE
> -
> #include "dscr.h"
>
> #include <pthread.h>
> diff --git a/tools/testing/selftests/powerpc/dscr/dscr_explicit_test.c b/tools/testing/selftests/powerpc/dscr/dscr_explicit_test.c
> index e2268e9183a8..93b6efdc2eef 100644
> --- a/tools/testing/selftests/powerpc/dscr/dscr_explicit_test.c
> +++ b/tools/testing/selftests/powerpc/dscr/dscr_explicit_test.c
> @@ -15,9 +15,6 @@
> * Copyright 2012, Anton Blanchard, IBM Corporation.
> * Copyright 2015, Anshuman Khandual, IBM Corporation.
> */
> -
> -#define _GNU_SOURCE
> -
> #include "dscr.h"
> #include "utils.h"
>
> diff --git a/tools/testing/selftests/powerpc/dscr/dscr_sysfs_thread_test.c b/tools/testing/selftests/powerpc/dscr/dscr_sysfs_thread_test.c
> index 191ed126f118..ace7d23492c1 100644
> --- a/tools/testing/selftests/powerpc/dscr/dscr_sysfs_thread_test.c
> +++ b/tools/testing/selftests/powerpc/dscr/dscr_sysfs_thread_test.c
> @@ -9,7 +9,6 @@
> *
> * Copyright 2015, Anshuman Khandual, IBM Corporation.
> */
> -#define _GNU_SOURCE
> #include "dscr.h"
>
> static int test_thread_dscr(unsigned long val)
> diff --git a/tools/testing/selftests/powerpc/mm/exec_prot.c b/tools/testing/selftests/powerpc/mm/exec_prot.c
> index db75b2225de1..65712597cc68 100644
> --- a/tools/testing/selftests/powerpc/mm/exec_prot.c
> +++ b/tools/testing/selftests/powerpc/mm/exec_prot.c
> @@ -6,8 +6,6 @@
> *
> * Test if applying execute protection on pages works as expected.
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/mm/pkey_exec_prot.c b/tools/testing/selftests/powerpc/mm/pkey_exec_prot.c
> index 0af4f02669a1..5cf72cd9694d 100644
> --- a/tools/testing/selftests/powerpc/mm/pkey_exec_prot.c
> +++ b/tools/testing/selftests/powerpc/mm/pkey_exec_prot.c
> @@ -6,8 +6,6 @@
> * Test if applying execute protection on pages using memory
> * protection keys works as expected.
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/mm/pkey_siginfo.c b/tools/testing/selftests/powerpc/mm/pkey_siginfo.c
> index 2db76e56d4cb..fcaa591abf88 100644
> --- a/tools/testing/selftests/powerpc/mm/pkey_siginfo.c
> +++ b/tools/testing/selftests/powerpc/mm/pkey_siginfo.c
> @@ -8,8 +8,6 @@
> * attempted to be protected by two different keys from two competing
> * threads at the same time.
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/mm/tlbie_test.c b/tools/testing/selftests/powerpc/mm/tlbie_test.c
> index 48344a74b212..512cd405de92 100644
> --- a/tools/testing/selftests/powerpc/mm/tlbie_test.c
> +++ b/tools/testing/selftests/powerpc/mm/tlbie_test.c
> @@ -14,8 +14,6 @@
> * and copy it back to the original area. This helps us to detect if any
> * store continued to happen after we marked the memory PROT_READ.
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <sys/mman.h>
> #include <sys/types.h>
> diff --git a/tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c b/tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c
> index d6f99eb9be65..0b9b20668fa4 100644
> --- a/tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c
> +++ b/tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c
> @@ -1,5 +1,4 @@
> // SPDX-License-Identifier: GPL-2.0-only
> -#define _GNU_SOURCE
> #include <errno.h>
> #include <fcntl.h>
> #include <stdlib.h>
> diff --git a/tools/testing/selftests/powerpc/pmu/count_instructions.c b/tools/testing/selftests/powerpc/pmu/count_instructions.c
> index a3984ef1e96a..57d63ff75397 100644
> --- a/tools/testing/selftests/powerpc/pmu/count_instructions.c
> +++ b/tools/testing/selftests/powerpc/pmu/count_instructions.c
> @@ -2,9 +2,6 @@
> /*
> * Copyright 2013, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE
> -
> #include <stdio.h>
> #include <stdbool.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/pmu/count_stcx_fail.c b/tools/testing/selftests/powerpc/pmu/count_stcx_fail.c
> index 2070a1e2b3a5..5d3bbd38528d 100644
> --- a/tools/testing/selftests/powerpc/pmu/count_stcx_fail.c
> +++ b/tools/testing/selftests/powerpc/pmu/count_stcx_fail.c
> @@ -2,9 +2,6 @@
> * Copyright 2013, Michael Ellerman, IBM Corp.
> * Licensed under GPLv2.
> */
> -
> -#define _GNU_SOURCE
> -
> #include <stdio.h>
> #include <stdbool.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/pmu/ebb/ebb.c b/tools/testing/selftests/powerpc/pmu/ebb/ebb.c
> index 21537d6eb6b7..e99a455e8c2e 100644
> --- a/tools/testing/selftests/powerpc/pmu/ebb/ebb.c
> +++ b/tools/testing/selftests/powerpc/pmu/ebb/ebb.c
> @@ -2,9 +2,6 @@
> /*
> * Copyright 2014, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE /* For CPU_ZERO etc. */
> -
> #include <sched.h>
> #include <sys/wait.h>
> #include <setjmp.h>
> diff --git a/tools/testing/selftests/powerpc/pmu/ebb/instruction_count_test.c b/tools/testing/selftests/powerpc/pmu/ebb/instruction_count_test.c
> index eed338b18e11..ab3f888922d6 100644
> --- a/tools/testing/selftests/powerpc/pmu/ebb/instruction_count_test.c
> +++ b/tools/testing/selftests/powerpc/pmu/ebb/instruction_count_test.c
> @@ -2,9 +2,6 @@
> /*
> * Copyright 2014, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE
> -
> #include <stdio.h>
> #include <stdbool.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/pmu/event.c b/tools/testing/selftests/powerpc/pmu/event.c
> index 0c1c1bdba081..5468bd2c3c5b 100644
> --- a/tools/testing/selftests/powerpc/pmu/event.c
> +++ b/tools/testing/selftests/powerpc/pmu/event.c
> @@ -2,8 +2,6 @@
> /*
> * Copyright 2013, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE
> #include <unistd.h>
> #include <sys/syscall.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/pmu/lib.c b/tools/testing/selftests/powerpc/pmu/lib.c
> index 321357987408..fa208701dbdc 100644
> --- a/tools/testing/selftests/powerpc/pmu/lib.c
> +++ b/tools/testing/selftests/powerpc/pmu/lib.c
> @@ -2,9 +2,6 @@
> /*
> * Copyright 2014, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE /* For CPU_ZERO etc. */
> -
> #include <errno.h>
> #include <sched.h>
> #include <setjmp.h>
> diff --git a/tools/testing/selftests/powerpc/pmu/per_event_excludes.c b/tools/testing/selftests/powerpc/pmu/per_event_excludes.c
> index ad32a09a6540..066e0c4799fd 100644
> --- a/tools/testing/selftests/powerpc/pmu/per_event_excludes.c
> +++ b/tools/testing/selftests/powerpc/pmu/per_event_excludes.c
> @@ -2,9 +2,6 @@
> /*
> * Copyright 2014, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE
> -
> #include <elf.h>
> #include <limits.h>
> #include <stdio.h>
> diff --git a/tools/testing/selftests/powerpc/ptrace/perf-hwbreak.c b/tools/testing/selftests/powerpc/ptrace/perf-hwbreak.c
> index e374c6b7ace6..1f7e3c63742d 100644
> --- a/tools/testing/selftests/powerpc/ptrace/perf-hwbreak.c
> +++ b/tools/testing/selftests/powerpc/ptrace/perf-hwbreak.c
> @@ -16,9 +16,6 @@
> *
> * Copyright (C) 2018 Michael Neuling, IBM Corporation.
> */
> -
> -#define _GNU_SOURCE
> -
> #include <unistd.h>
> #include <assert.h>
> #include <sched.h>
> diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-syscall.c b/tools/testing/selftests/powerpc/ptrace/ptrace-syscall.c
> index 3353210dcdbd..6e5294c1b60b 100644
> --- a/tools/testing/selftests/powerpc/ptrace/ptrace-syscall.c
> +++ b/tools/testing/selftests/powerpc/ptrace/ptrace-syscall.c
> @@ -8,8 +8,6 @@
> * test, and it was adapted to run on Powerpc by
> * Breno Leitao <leitao@debian.org>
> */
> -#define _GNU_SOURCE
> -
> #include <sys/ptrace.h>
> #include <sys/types.h>
> #include <sys/wait.h>
> diff --git a/tools/testing/selftests/powerpc/signal/sig_sc_double_restart.c b/tools/testing/selftests/powerpc/signal/sig_sc_double_restart.c
> index e3972264615b..8bad5e65bbb7 100644
> --- a/tools/testing/selftests/powerpc/signal/sig_sc_double_restart.c
> +++ b/tools/testing/selftests/powerpc/signal/sig_sc_double_restart.c
> @@ -18,7 +18,6 @@
> * that sucker at the same time. Same for multiple signals of any kind
> * interrupting that sucker on 64bit...
> */
> -#define _GNU_SOURCE
> #include <sys/types.h>
> #include <sys/wait.h>
> #include <sys/syscall.h>
> diff --git a/tools/testing/selftests/powerpc/signal/sigreturn_kernel.c b/tools/testing/selftests/powerpc/signal/sigreturn_kernel.c
> index 0a1b6e591eee..772c3373560f 100644
> --- a/tools/testing/selftests/powerpc/signal/sigreturn_kernel.c
> +++ b/tools/testing/selftests/powerpc/signal/sigreturn_kernel.c
> @@ -2,9 +2,6 @@
> /*
> * Test that we can't sigreturn to kernel addresses, or to kernel mode.
> */
> -
> -#define _GNU_SOURCE
> -
> #include <stdio.h>
> #include <signal.h>
> #include <stdlib.h>
> diff --git a/tools/testing/selftests/powerpc/signal/sigreturn_vdso.c b/tools/testing/selftests/powerpc/signal/sigreturn_vdso.c
> index e282fff0fe25..d5aecd2c4b95 100644
> --- a/tools/testing/selftests/powerpc/signal/sigreturn_vdso.c
> +++ b/tools/testing/selftests/powerpc/signal/sigreturn_vdso.c
> @@ -5,9 +5,6 @@
> *
> * See handle_rt_signal64() and setup_trampoline() in signal_64.c
> */
> -
> -#define _GNU_SOURCE
> -
> #include <errno.h>
> #include <stdio.h>
> #include <signal.h>
> diff --git a/tools/testing/selftests/powerpc/syscalls/ipc_unmuxed.c b/tools/testing/selftests/powerpc/syscalls/ipc_unmuxed.c
> index 4c582524aeb3..a49c699d86d4 100644
> --- a/tools/testing/selftests/powerpc/syscalls/ipc_unmuxed.c
> +++ b/tools/testing/selftests/powerpc/syscalls/ipc_unmuxed.c
> @@ -5,8 +5,6 @@
> * This test simply tests that certain syscalls are implemented. It doesn't
> * actually exercise their logic in any way.
> */
> -
> -#define _GNU_SOURCE
> #include <errno.h>
> #include <stdio.h>
> #include <unistd.h>
> diff --git a/tools/testing/selftests/powerpc/tm/tm-exec.c b/tools/testing/selftests/powerpc/tm/tm-exec.c
> index c59919d6710d..8cfc859dcf37 100644
> --- a/tools/testing/selftests/powerpc/tm/tm-exec.c
> +++ b/tools/testing/selftests/powerpc/tm/tm-exec.c
> @@ -8,8 +8,6 @@
> * It makes little sense for after an exec() call for the previously
> * suspended transaction to still exist.
> */
> -
> -#define _GNU_SOURCE
> #include <errno.h>
> #include <inttypes.h>
> #include <libgen.h>
> diff --git a/tools/testing/selftests/powerpc/tm/tm-poison.c b/tools/testing/selftests/powerpc/tm/tm-poison.c
> index a7bbf034b5bb..1b3a596a6a51 100644
> --- a/tools/testing/selftests/powerpc/tm/tm-poison.c
> +++ b/tools/testing/selftests/powerpc/tm/tm-poison.c
> @@ -11,8 +11,6 @@
> * present child's poison will leak into parent's f31 or vr31 registers,
> * otherwise, poison will never leak into parent's f31 and vr31 registers.
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <stdlib.h>
> #include <unistd.h>
> diff --git a/tools/testing/selftests/powerpc/tm/tm-signal-context-force-tm.c b/tools/testing/selftests/powerpc/tm/tm-signal-context-force-tm.c
> index 421cb082f6be..f28ba2828df6 100644
> --- a/tools/testing/selftests/powerpc/tm/tm-signal-context-force-tm.c
> +++ b/tools/testing/selftests/powerpc/tm/tm-signal-context-force-tm.c
> @@ -15,8 +15,6 @@
> * This test never fails (as returning EXIT_FAILURE). It either succeeds,
> * or crash the kernel (on a buggy kernel).
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <stdlib.h>
> #include <signal.h>
> diff --git a/tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c b/tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c
> index 06b801906f27..73f8e7dd5a1a 100644
> --- a/tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c
> +++ b/tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c
> @@ -8,8 +8,6 @@
> * It returns from the signal handler with the CPU at suspended state, but
> * without setting usercontext MSR Transaction State (TS) fields.
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <stdlib.h>
> #include <signal.h>
> diff --git a/tools/testing/selftests/powerpc/tm/tm-tmspr.c b/tools/testing/selftests/powerpc/tm/tm-tmspr.c
> index dd5ddffa28b7..01118f7db1b2 100644
> --- a/tools/testing/selftests/powerpc/tm/tm-tmspr.c
> +++ b/tools/testing/selftests/powerpc/tm/tm-tmspr.c
> @@ -22,8 +22,6 @@
> * (b) abort transaction
> * (c) check TEXASR to see if FS has been corrupted
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <stdlib.h>
> #include <unistd.h>
> diff --git a/tools/testing/selftests/powerpc/tm/tm-trap.c b/tools/testing/selftests/powerpc/tm/tm-trap.c
> index 97cb74768e30..164b345b5bd3 100644
> --- a/tools/testing/selftests/powerpc/tm/tm-trap.c
> +++ b/tools/testing/selftests/powerpc/tm/tm-trap.c
> @@ -26,8 +26,6 @@
> * the endianness is verified on subsequent traps to determine if the
> * endianness "flipped back" to the native endianness (BE).
> */
> -
> -#define _GNU_SOURCE
> #include <error.h>
> #include <stdio.h>
> #include <stdlib.h>
> diff --git a/tools/testing/selftests/powerpc/tm/tm-unavailable.c b/tools/testing/selftests/powerpc/tm/tm-unavailable.c
> index 6bf1b65b020d..712267831112 100644
> --- a/tools/testing/selftests/powerpc/tm/tm-unavailable.c
> +++ b/tools/testing/selftests/powerpc/tm/tm-unavailable.c
> @@ -13,8 +13,6 @@
> * corruption, but only for registers vs0 and vs32, which are respectively
> * representatives of FP and VEC/Altivec reg sets.
> */
> -
> -#define _GNU_SOURCE
> #include <error.h>
> #include <stdio.h>
> #include <stdlib.h>
> diff --git a/tools/testing/selftests/powerpc/utils.c b/tools/testing/selftests/powerpc/utils.c
> index e5f2d8735c64..664722a01636 100644
> --- a/tools/testing/selftests/powerpc/utils.c
> +++ b/tools/testing/selftests/powerpc/utils.c
> @@ -2,9 +2,6 @@
> /*
> * Copyright 2013-2015, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE /* For CPU_ZERO etc. */
> -
> #include <elf.h>
> #include <errno.h>
> #include <fcntl.h>
> --
> 2.45.1.288.g0e0cd299f1-goog
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
WARNING: multiple messages have this Message-ID (diff)
From: Michael Ellerman <mpe@ellerman.id.au>
To: "Edward Liaw" <edliaw@google.com>,
shuah@kernel.org, "Mickaël Salaün" <mic@digikod.net>,
"Günther Noack" <gnoack@google.com>,
"Christian Brauner" <brauner@kernel.org>,
"Richard Cochran" <richardcochran@gmail.com>,
"Paul Walmsley" <paul.walmsley@sifive.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"David S. Miller" <davem@davemloft.net>,
"Jakub Kicinski" <kuba@kernel.org>,
"Jesper Dangaard Brouer" <hawk@kernel.org>,
"John Fastabend" <john.fastabend@gmail.com>,
"Nicholas Piggin" <npiggin@gmail.com>,
"Christophe Leroy" <christophe.leroy@csgroup.eu>,
"Naveen N. Rao" <naveen.n.rao@linux.ibm.com>
Cc: netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org,
linux-security-module@vger.kernel.org,
linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org,
kernel-team@android.com, bpf@vger.kernel.org,
Edward Liaw <edliaw@google.com>
Subject: Re: [PATCH v5 44/68] selftests/powerpc: Drop define _GNU_SOURCE
Date: Wed, 22 May 2024 21:39:01 +1000 [thread overview]
Message-ID: <87r0du2i0a.fsf@mail.lhotse> (raw)
In-Reply-To: <20240522005913.3540131-45-edliaw@google.com>
Edward Liaw <edliaw@google.com> writes:
> _GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent
> redefinition warnings.
Most of these tests build with -Werror, so the duplicate define is
actually a hard error. Can you put this patch earlier in the series at
least?
cheers
> Signed-off-by: Edward Liaw <edliaw@google.com>
> ---
> tools/testing/selftests/powerpc/benchmarks/context_switch.c | 2 --
> tools/testing/selftests/powerpc/benchmarks/exec_target.c | 2 --
> tools/testing/selftests/powerpc/benchmarks/fork.c | 2 --
> tools/testing/selftests/powerpc/benchmarks/futex_bench.c | 3 ---
> tools/testing/selftests/powerpc/dexcr/hashchk_test.c | 3 ---
> tools/testing/selftests/powerpc/dscr/dscr_default_test.c | 3 ---
> tools/testing/selftests/powerpc/dscr/dscr_explicit_test.c | 3 ---
> tools/testing/selftests/powerpc/dscr/dscr_sysfs_thread_test.c | 1 -
> tools/testing/selftests/powerpc/mm/exec_prot.c | 2 --
> tools/testing/selftests/powerpc/mm/pkey_exec_prot.c | 2 --
> tools/testing/selftests/powerpc/mm/pkey_siginfo.c | 2 --
> tools/testing/selftests/powerpc/mm/tlbie_test.c | 2 --
> tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c | 1 -
> tools/testing/selftests/powerpc/pmu/count_instructions.c | 3 ---
> tools/testing/selftests/powerpc/pmu/count_stcx_fail.c | 3 ---
> tools/testing/selftests/powerpc/pmu/ebb/ebb.c | 3 ---
> .../testing/selftests/powerpc/pmu/ebb/instruction_count_test.c | 3 ---
> tools/testing/selftests/powerpc/pmu/event.c | 2 --
> tools/testing/selftests/powerpc/pmu/lib.c | 3 ---
> tools/testing/selftests/powerpc/pmu/per_event_excludes.c | 3 ---
> tools/testing/selftests/powerpc/ptrace/perf-hwbreak.c | 3 ---
> tools/testing/selftests/powerpc/ptrace/ptrace-syscall.c | 2 --
> tools/testing/selftests/powerpc/signal/sig_sc_double_restart.c | 1 -
> tools/testing/selftests/powerpc/signal/sigreturn_kernel.c | 3 ---
> tools/testing/selftests/powerpc/signal/sigreturn_vdso.c | 3 ---
> tools/testing/selftests/powerpc/syscalls/ipc_unmuxed.c | 2 --
> tools/testing/selftests/powerpc/tm/tm-exec.c | 2 --
> tools/testing/selftests/powerpc/tm/tm-poison.c | 2 --
> .../testing/selftests/powerpc/tm/tm-signal-context-force-tm.c | 2 --
> tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c | 2 --
> tools/testing/selftests/powerpc/tm/tm-tmspr.c | 2 --
> tools/testing/selftests/powerpc/tm/tm-trap.c | 2 --
> tools/testing/selftests/powerpc/tm/tm-unavailable.c | 2 --
> tools/testing/selftests/powerpc/utils.c | 3 ---
> 34 files changed, 79 deletions(-)
>
> diff --git a/tools/testing/selftests/powerpc/benchmarks/context_switch.c b/tools/testing/selftests/powerpc/benchmarks/context_switch.c
> index 96554e2794d1..0b245572bd45 100644
> --- a/tools/testing/selftests/powerpc/benchmarks/context_switch.c
> +++ b/tools/testing/selftests/powerpc/benchmarks/context_switch.c
> @@ -4,8 +4,6 @@
> *
> * Copyright (C) 2015 Anton Blanchard <anton@au.ibm.com>, IBM
> */
> -
> -#define _GNU_SOURCE
> #include <errno.h>
> #include <sched.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/benchmarks/exec_target.c b/tools/testing/selftests/powerpc/benchmarks/exec_target.c
> index c14b0fc1edde..8646540037d8 100644
> --- a/tools/testing/selftests/powerpc/benchmarks/exec_target.c
> +++ b/tools/testing/selftests/powerpc/benchmarks/exec_target.c
> @@ -5,8 +5,6 @@
> *
> * Copyright 2018, Anton Blanchard, IBM Corp.
> */
> -
> -#define _GNU_SOURCE
> #include <unistd.h>
> #include <sys/syscall.h>
>
> diff --git a/tools/testing/selftests/powerpc/benchmarks/fork.c b/tools/testing/selftests/powerpc/benchmarks/fork.c
> index d312e638cb37..327231646a2a 100644
> --- a/tools/testing/selftests/powerpc/benchmarks/fork.c
> +++ b/tools/testing/selftests/powerpc/benchmarks/fork.c
> @@ -5,8 +5,6 @@
> *
> * Copyright 2018, Anton Blanchard, IBM Corp.
> */
> -
> -#define _GNU_SOURCE
> #include <assert.h>
> #include <errno.h>
> #include <getopt.h>
> diff --git a/tools/testing/selftests/powerpc/benchmarks/futex_bench.c b/tools/testing/selftests/powerpc/benchmarks/futex_bench.c
> index 017057090490..0483a13c88f9 100644
> --- a/tools/testing/selftests/powerpc/benchmarks/futex_bench.c
> +++ b/tools/testing/selftests/powerpc/benchmarks/futex_bench.c
> @@ -2,9 +2,6 @@
> /*
> * Copyright 2016, Anton Blanchard, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE
> -
> #include <stdio.h>
> #include <sys/syscall.h>
> #include <time.h>
> diff --git a/tools/testing/selftests/powerpc/dexcr/hashchk_test.c b/tools/testing/selftests/powerpc/dexcr/hashchk_test.c
> index 645224bdc142..2499ab7fe563 100644
> --- a/tools/testing/selftests/powerpc/dexcr/hashchk_test.c
> +++ b/tools/testing/selftests/powerpc/dexcr/hashchk_test.c
> @@ -1,7 +1,4 @@
> // SPDX-License-Identifier: GPL-2.0+
> -
> -#define _GNU_SOURCE
> -
> #include <errno.h>
> #include <fcntl.h>
> #include <limits.h>
> diff --git a/tools/testing/selftests/powerpc/dscr/dscr_default_test.c b/tools/testing/selftests/powerpc/dscr/dscr_default_test.c
> index 60ab02525b79..fe6aff1e5dad 100644
> --- a/tools/testing/selftests/powerpc/dscr/dscr_default_test.c
> +++ b/tools/testing/selftests/powerpc/dscr/dscr_default_test.c
> @@ -9,9 +9,6 @@
> * Copyright 2012, Anton Blanchard, IBM Corporation.
> * Copyright 2015, Anshuman Khandual, IBM Corporation.
> */
> -
> -#define _GNU_SOURCE
> -
> #include "dscr.h"
>
> #include <pthread.h>
> diff --git a/tools/testing/selftests/powerpc/dscr/dscr_explicit_test.c b/tools/testing/selftests/powerpc/dscr/dscr_explicit_test.c
> index e2268e9183a8..93b6efdc2eef 100644
> --- a/tools/testing/selftests/powerpc/dscr/dscr_explicit_test.c
> +++ b/tools/testing/selftests/powerpc/dscr/dscr_explicit_test.c
> @@ -15,9 +15,6 @@
> * Copyright 2012, Anton Blanchard, IBM Corporation.
> * Copyright 2015, Anshuman Khandual, IBM Corporation.
> */
> -
> -#define _GNU_SOURCE
> -
> #include "dscr.h"
> #include "utils.h"
>
> diff --git a/tools/testing/selftests/powerpc/dscr/dscr_sysfs_thread_test.c b/tools/testing/selftests/powerpc/dscr/dscr_sysfs_thread_test.c
> index 191ed126f118..ace7d23492c1 100644
> --- a/tools/testing/selftests/powerpc/dscr/dscr_sysfs_thread_test.c
> +++ b/tools/testing/selftests/powerpc/dscr/dscr_sysfs_thread_test.c
> @@ -9,7 +9,6 @@
> *
> * Copyright 2015, Anshuman Khandual, IBM Corporation.
> */
> -#define _GNU_SOURCE
> #include "dscr.h"
>
> static int test_thread_dscr(unsigned long val)
> diff --git a/tools/testing/selftests/powerpc/mm/exec_prot.c b/tools/testing/selftests/powerpc/mm/exec_prot.c
> index db75b2225de1..65712597cc68 100644
> --- a/tools/testing/selftests/powerpc/mm/exec_prot.c
> +++ b/tools/testing/selftests/powerpc/mm/exec_prot.c
> @@ -6,8 +6,6 @@
> *
> * Test if applying execute protection on pages works as expected.
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/mm/pkey_exec_prot.c b/tools/testing/selftests/powerpc/mm/pkey_exec_prot.c
> index 0af4f02669a1..5cf72cd9694d 100644
> --- a/tools/testing/selftests/powerpc/mm/pkey_exec_prot.c
> +++ b/tools/testing/selftests/powerpc/mm/pkey_exec_prot.c
> @@ -6,8 +6,6 @@
> * Test if applying execute protection on pages using memory
> * protection keys works as expected.
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/mm/pkey_siginfo.c b/tools/testing/selftests/powerpc/mm/pkey_siginfo.c
> index 2db76e56d4cb..fcaa591abf88 100644
> --- a/tools/testing/selftests/powerpc/mm/pkey_siginfo.c
> +++ b/tools/testing/selftests/powerpc/mm/pkey_siginfo.c
> @@ -8,8 +8,6 @@
> * attempted to be protected by two different keys from two competing
> * threads at the same time.
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/mm/tlbie_test.c b/tools/testing/selftests/powerpc/mm/tlbie_test.c
> index 48344a74b212..512cd405de92 100644
> --- a/tools/testing/selftests/powerpc/mm/tlbie_test.c
> +++ b/tools/testing/selftests/powerpc/mm/tlbie_test.c
> @@ -14,8 +14,6 @@
> * and copy it back to the original area. This helps us to detect if any
> * store continued to happen after we marked the memory PROT_READ.
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <sys/mman.h>
> #include <sys/types.h>
> diff --git a/tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c b/tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c
> index d6f99eb9be65..0b9b20668fa4 100644
> --- a/tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c
> +++ b/tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c
> @@ -1,5 +1,4 @@
> // SPDX-License-Identifier: GPL-2.0-only
> -#define _GNU_SOURCE
> #include <errno.h>
> #include <fcntl.h>
> #include <stdlib.h>
> diff --git a/tools/testing/selftests/powerpc/pmu/count_instructions.c b/tools/testing/selftests/powerpc/pmu/count_instructions.c
> index a3984ef1e96a..57d63ff75397 100644
> --- a/tools/testing/selftests/powerpc/pmu/count_instructions.c
> +++ b/tools/testing/selftests/powerpc/pmu/count_instructions.c
> @@ -2,9 +2,6 @@
> /*
> * Copyright 2013, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE
> -
> #include <stdio.h>
> #include <stdbool.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/pmu/count_stcx_fail.c b/tools/testing/selftests/powerpc/pmu/count_stcx_fail.c
> index 2070a1e2b3a5..5d3bbd38528d 100644
> --- a/tools/testing/selftests/powerpc/pmu/count_stcx_fail.c
> +++ b/tools/testing/selftests/powerpc/pmu/count_stcx_fail.c
> @@ -2,9 +2,6 @@
> * Copyright 2013, Michael Ellerman, IBM Corp.
> * Licensed under GPLv2.
> */
> -
> -#define _GNU_SOURCE
> -
> #include <stdio.h>
> #include <stdbool.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/pmu/ebb/ebb.c b/tools/testing/selftests/powerpc/pmu/ebb/ebb.c
> index 21537d6eb6b7..e99a455e8c2e 100644
> --- a/tools/testing/selftests/powerpc/pmu/ebb/ebb.c
> +++ b/tools/testing/selftests/powerpc/pmu/ebb/ebb.c
> @@ -2,9 +2,6 @@
> /*
> * Copyright 2014, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE /* For CPU_ZERO etc. */
> -
> #include <sched.h>
> #include <sys/wait.h>
> #include <setjmp.h>
> diff --git a/tools/testing/selftests/powerpc/pmu/ebb/instruction_count_test.c b/tools/testing/selftests/powerpc/pmu/ebb/instruction_count_test.c
> index eed338b18e11..ab3f888922d6 100644
> --- a/tools/testing/selftests/powerpc/pmu/ebb/instruction_count_test.c
> +++ b/tools/testing/selftests/powerpc/pmu/ebb/instruction_count_test.c
> @@ -2,9 +2,6 @@
> /*
> * Copyright 2014, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE
> -
> #include <stdio.h>
> #include <stdbool.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/pmu/event.c b/tools/testing/selftests/powerpc/pmu/event.c
> index 0c1c1bdba081..5468bd2c3c5b 100644
> --- a/tools/testing/selftests/powerpc/pmu/event.c
> +++ b/tools/testing/selftests/powerpc/pmu/event.c
> @@ -2,8 +2,6 @@
> /*
> * Copyright 2013, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE
> #include <unistd.h>
> #include <sys/syscall.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/powerpc/pmu/lib.c b/tools/testing/selftests/powerpc/pmu/lib.c
> index 321357987408..fa208701dbdc 100644
> --- a/tools/testing/selftests/powerpc/pmu/lib.c
> +++ b/tools/testing/selftests/powerpc/pmu/lib.c
> @@ -2,9 +2,6 @@
> /*
> * Copyright 2014, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE /* For CPU_ZERO etc. */
> -
> #include <errno.h>
> #include <sched.h>
> #include <setjmp.h>
> diff --git a/tools/testing/selftests/powerpc/pmu/per_event_excludes.c b/tools/testing/selftests/powerpc/pmu/per_event_excludes.c
> index ad32a09a6540..066e0c4799fd 100644
> --- a/tools/testing/selftests/powerpc/pmu/per_event_excludes.c
> +++ b/tools/testing/selftests/powerpc/pmu/per_event_excludes.c
> @@ -2,9 +2,6 @@
> /*
> * Copyright 2014, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE
> -
> #include <elf.h>
> #include <limits.h>
> #include <stdio.h>
> diff --git a/tools/testing/selftests/powerpc/ptrace/perf-hwbreak.c b/tools/testing/selftests/powerpc/ptrace/perf-hwbreak.c
> index e374c6b7ace6..1f7e3c63742d 100644
> --- a/tools/testing/selftests/powerpc/ptrace/perf-hwbreak.c
> +++ b/tools/testing/selftests/powerpc/ptrace/perf-hwbreak.c
> @@ -16,9 +16,6 @@
> *
> * Copyright (C) 2018 Michael Neuling, IBM Corporation.
> */
> -
> -#define _GNU_SOURCE
> -
> #include <unistd.h>
> #include <assert.h>
> #include <sched.h>
> diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-syscall.c b/tools/testing/selftests/powerpc/ptrace/ptrace-syscall.c
> index 3353210dcdbd..6e5294c1b60b 100644
> --- a/tools/testing/selftests/powerpc/ptrace/ptrace-syscall.c
> +++ b/tools/testing/selftests/powerpc/ptrace/ptrace-syscall.c
> @@ -8,8 +8,6 @@
> * test, and it was adapted to run on Powerpc by
> * Breno Leitao <leitao@debian.org>
> */
> -#define _GNU_SOURCE
> -
> #include <sys/ptrace.h>
> #include <sys/types.h>
> #include <sys/wait.h>
> diff --git a/tools/testing/selftests/powerpc/signal/sig_sc_double_restart.c b/tools/testing/selftests/powerpc/signal/sig_sc_double_restart.c
> index e3972264615b..8bad5e65bbb7 100644
> --- a/tools/testing/selftests/powerpc/signal/sig_sc_double_restart.c
> +++ b/tools/testing/selftests/powerpc/signal/sig_sc_double_restart.c
> @@ -18,7 +18,6 @@
> * that sucker at the same time. Same for multiple signals of any kind
> * interrupting that sucker on 64bit...
> */
> -#define _GNU_SOURCE
> #include <sys/types.h>
> #include <sys/wait.h>
> #include <sys/syscall.h>
> diff --git a/tools/testing/selftests/powerpc/signal/sigreturn_kernel.c b/tools/testing/selftests/powerpc/signal/sigreturn_kernel.c
> index 0a1b6e591eee..772c3373560f 100644
> --- a/tools/testing/selftests/powerpc/signal/sigreturn_kernel.c
> +++ b/tools/testing/selftests/powerpc/signal/sigreturn_kernel.c
> @@ -2,9 +2,6 @@
> /*
> * Test that we can't sigreturn to kernel addresses, or to kernel mode.
> */
> -
> -#define _GNU_SOURCE
> -
> #include <stdio.h>
> #include <signal.h>
> #include <stdlib.h>
> diff --git a/tools/testing/selftests/powerpc/signal/sigreturn_vdso.c b/tools/testing/selftests/powerpc/signal/sigreturn_vdso.c
> index e282fff0fe25..d5aecd2c4b95 100644
> --- a/tools/testing/selftests/powerpc/signal/sigreturn_vdso.c
> +++ b/tools/testing/selftests/powerpc/signal/sigreturn_vdso.c
> @@ -5,9 +5,6 @@
> *
> * See handle_rt_signal64() and setup_trampoline() in signal_64.c
> */
> -
> -#define _GNU_SOURCE
> -
> #include <errno.h>
> #include <stdio.h>
> #include <signal.h>
> diff --git a/tools/testing/selftests/powerpc/syscalls/ipc_unmuxed.c b/tools/testing/selftests/powerpc/syscalls/ipc_unmuxed.c
> index 4c582524aeb3..a49c699d86d4 100644
> --- a/tools/testing/selftests/powerpc/syscalls/ipc_unmuxed.c
> +++ b/tools/testing/selftests/powerpc/syscalls/ipc_unmuxed.c
> @@ -5,8 +5,6 @@
> * This test simply tests that certain syscalls are implemented. It doesn't
> * actually exercise their logic in any way.
> */
> -
> -#define _GNU_SOURCE
> #include <errno.h>
> #include <stdio.h>
> #include <unistd.h>
> diff --git a/tools/testing/selftests/powerpc/tm/tm-exec.c b/tools/testing/selftests/powerpc/tm/tm-exec.c
> index c59919d6710d..8cfc859dcf37 100644
> --- a/tools/testing/selftests/powerpc/tm/tm-exec.c
> +++ b/tools/testing/selftests/powerpc/tm/tm-exec.c
> @@ -8,8 +8,6 @@
> * It makes little sense for after an exec() call for the previously
> * suspended transaction to still exist.
> */
> -
> -#define _GNU_SOURCE
> #include <errno.h>
> #include <inttypes.h>
> #include <libgen.h>
> diff --git a/tools/testing/selftests/powerpc/tm/tm-poison.c b/tools/testing/selftests/powerpc/tm/tm-poison.c
> index a7bbf034b5bb..1b3a596a6a51 100644
> --- a/tools/testing/selftests/powerpc/tm/tm-poison.c
> +++ b/tools/testing/selftests/powerpc/tm/tm-poison.c
> @@ -11,8 +11,6 @@
> * present child's poison will leak into parent's f31 or vr31 registers,
> * otherwise, poison will never leak into parent's f31 and vr31 registers.
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <stdlib.h>
> #include <unistd.h>
> diff --git a/tools/testing/selftests/powerpc/tm/tm-signal-context-force-tm.c b/tools/testing/selftests/powerpc/tm/tm-signal-context-force-tm.c
> index 421cb082f6be..f28ba2828df6 100644
> --- a/tools/testing/selftests/powerpc/tm/tm-signal-context-force-tm.c
> +++ b/tools/testing/selftests/powerpc/tm/tm-signal-context-force-tm.c
> @@ -15,8 +15,6 @@
> * This test never fails (as returning EXIT_FAILURE). It either succeeds,
> * or crash the kernel (on a buggy kernel).
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <stdlib.h>
> #include <signal.h>
> diff --git a/tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c b/tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c
> index 06b801906f27..73f8e7dd5a1a 100644
> --- a/tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c
> +++ b/tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c
> @@ -8,8 +8,6 @@
> * It returns from the signal handler with the CPU at suspended state, but
> * without setting usercontext MSR Transaction State (TS) fields.
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <stdlib.h>
> #include <signal.h>
> diff --git a/tools/testing/selftests/powerpc/tm/tm-tmspr.c b/tools/testing/selftests/powerpc/tm/tm-tmspr.c
> index dd5ddffa28b7..01118f7db1b2 100644
> --- a/tools/testing/selftests/powerpc/tm/tm-tmspr.c
> +++ b/tools/testing/selftests/powerpc/tm/tm-tmspr.c
> @@ -22,8 +22,6 @@
> * (b) abort transaction
> * (c) check TEXASR to see if FS has been corrupted
> */
> -
> -#define _GNU_SOURCE
> #include <stdio.h>
> #include <stdlib.h>
> #include <unistd.h>
> diff --git a/tools/testing/selftests/powerpc/tm/tm-trap.c b/tools/testing/selftests/powerpc/tm/tm-trap.c
> index 97cb74768e30..164b345b5bd3 100644
> --- a/tools/testing/selftests/powerpc/tm/tm-trap.c
> +++ b/tools/testing/selftests/powerpc/tm/tm-trap.c
> @@ -26,8 +26,6 @@
> * the endianness is verified on subsequent traps to determine if the
> * endianness "flipped back" to the native endianness (BE).
> */
> -
> -#define _GNU_SOURCE
> #include <error.h>
> #include <stdio.h>
> #include <stdlib.h>
> diff --git a/tools/testing/selftests/powerpc/tm/tm-unavailable.c b/tools/testing/selftests/powerpc/tm/tm-unavailable.c
> index 6bf1b65b020d..712267831112 100644
> --- a/tools/testing/selftests/powerpc/tm/tm-unavailable.c
> +++ b/tools/testing/selftests/powerpc/tm/tm-unavailable.c
> @@ -13,8 +13,6 @@
> * corruption, but only for registers vs0 and vs32, which are respectively
> * representatives of FP and VEC/Altivec reg sets.
> */
> -
> -#define _GNU_SOURCE
> #include <error.h>
> #include <stdio.h>
> #include <stdlib.h>
> diff --git a/tools/testing/selftests/powerpc/utils.c b/tools/testing/selftests/powerpc/utils.c
> index e5f2d8735c64..664722a01636 100644
> --- a/tools/testing/selftests/powerpc/utils.c
> +++ b/tools/testing/selftests/powerpc/utils.c
> @@ -2,9 +2,6 @@
> /*
> * Copyright 2013-2015, Michael Ellerman, IBM Corp.
> */
> -
> -#define _GNU_SOURCE /* For CPU_ZERO etc. */
> -
> #include <elf.h>
> #include <errno.h>
> #include <fcntl.h>
> --
> 2.45.1.288.g0e0cd299f1-goog
next prev parent reply other threads:[~2024-05-22 11:39 UTC|newest]
Thread overview: 183+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-22 0:56 [PATCH v5 00/68] Define _GNU_SOURCE for sources using Edward Liaw
2024-05-22 0:56 ` Edward Liaw
2024-05-22 0:56 ` [PATCH v5 01/68] selftests: Compile with -D_GNU_SOURCE when including lib.mk Edward Liaw
2024-05-22 0:56 ` Edward Liaw
2024-05-22 0:56 ` [PATCH v5 02/68] kselftest: Desecalate reporting of missing _GNU_SOURCE Edward Liaw
2024-05-22 0:56 ` Edward Liaw
2024-05-22 1:10 ` Vitaly Chikunov
2024-05-22 1:10 ` Vitaly Chikunov
2024-05-22 11:21 ` Mark Brown
2024-05-22 11:21 ` Mark Brown
2024-05-22 17:46 ` Edward Liaw
2024-05-22 17:46 ` Edward Liaw
2024-05-23 2:28 ` John Hubbard
2024-05-23 2:28 ` John Hubbard
2024-05-23 18:01 ` Shuah Khan
2024-05-23 18:01 ` Shuah Khan
2024-05-23 18:12 ` Edward Liaw
2024-05-23 18:12 ` Edward Liaw
2024-05-23 19:11 ` Shuah Khan
2024-05-23 19:11 ` Shuah Khan
2024-05-22 0:56 ` [PATCH v5 03/68] selftests/arm64: Drop define _GNU_SOURCE Edward Liaw
2024-05-22 0:56 ` Edward Liaw
2024-05-22 0:56 ` Edward Liaw
2024-05-22 0:56 ` [PATCH v5 04/68] selftests/arm64: Drop duplicate -D_GNU_SOURCE Edward Liaw
2024-05-22 0:56 ` Edward Liaw
2024-05-22 0:56 ` Edward Liaw
2024-05-22 0:56 ` [PATCH v5 05/68] selftests/bpf: Drop define _GNU_SOURCE Edward Liaw
2024-05-22 0:56 ` Edward Liaw
2024-05-22 0:56 ` [PATCH v5 06/68] selftests/breakpoints: " Edward Liaw
2024-05-22 0:56 ` Edward Liaw
2024-05-22 0:56 ` [PATCH v5 07/68] selftests/cachestat: " Edward Liaw
2024-05-22 0:56 ` Edward Liaw
2024-05-22 0:56 ` [PATCH v5 08/68] selftests/capabilities: " Edward Liaw
2024-05-22 0:56 ` Edward Liaw
2024-05-22 0:56 ` [PATCH v5 09/68] selftests/cgroup: " Edward Liaw
2024-05-22 0:56 ` Edward Liaw
2024-05-22 0:56 ` [PATCH v5 10/68] selftests/clone3: " Edward Liaw
2024-05-22 0:56 ` Edward Liaw
2024-05-22 0:56 ` [PATCH v5 11/68] selftests/core: " Edward Liaw
2024-05-22 0:56 ` Edward Liaw
2024-05-22 0:56 ` [PATCH v5 12/68] selftests/damon: " Edward Liaw
2024-05-22 0:56 ` Edward Liaw
2024-05-22 0:56 ` [PATCH v5 13/68] selftests/drivers: " Edward Liaw
2024-05-22 0:56 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 14/68] selftests/exec: Drop duplicate -D_GNU_SOURCE Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 15/68] selftests/fchmodat2: Drop define _GNU_SOURCE Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 16/68] selftests/filelock: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 17/68] selftests/filesystems: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 18/68] selftests/firmware: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 19/68] selftests/fpu: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 20/68] selftests/futex: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 21/68] selftests/futex: Drop duplicate -D_GNU_SOURCE Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 22/68] selftests/intel_pstate: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 23/68] selftests/iommu: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 12:45 ` Jason Gunthorpe
2024-05-22 12:45 ` Jason Gunthorpe
2024-05-22 0:57 ` [PATCH v5 24/68] selftests/ipc: Drop define _GNU_SOURCE Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 25/68] selftests/kcmp: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 26/68] selftests/landlock: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 27/68] selftests/lsm: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 1:37 ` Casey Schaufler
2024-05-22 1:37 ` Casey Schaufler
2024-05-22 0:57 ` [PATCH v5 28/68] selftests/membarrier: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 29/68] selftests/memfd: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 30/68] selftests/mincore: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 31/68] selftests/mm: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 32/68] selftests/mount: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 33/68] selftests/mount_setattr: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 34/68] selftests/move_mount_set_group: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 35/68] selftests/mqueue: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 36/68] selftests/net: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 37/68] selftests/net: Drop duplicate -D_GNU_SOURCE Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 38/68] selftests/nsfs: Drop define _GNU_SOURCE Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 39/68] selftests/openat2: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 40/68] selftests/perf_events: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 41/68] selftests/pid_namespace: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 42/68] selftests/pidfd: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 43/68] selftests/ptrace: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 44/68] selftests/powerpc: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 11:39 ` Michael Ellerman [this message]
2024-05-22 11:39 ` Michael Ellerman
2024-05-22 11:39 ` Michael Ellerman
2024-05-22 0:57 ` [PATCH v5 45/68] selftests/proc: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 46/68] selftests/proc: Drop duplicate -D_GNU_SOURCE Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 47/68] selftests/ptp: Drop define _GNU_SOURCE Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 48/68] selftests/resctrl: Drop duplicate -D_GNU_SOURCE Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 49/68] selftests/riscv: Drop define _GNU_SOURCE Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 50/68] selftests/riscv: Drop duplicate -D_GNU_SOURCE Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 51/68] selftests/rlimits: Drop define _GNU_SOURCE Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 52/68] selftests/rseq: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 53/68] selftests/safesetid: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 54/68] selftests/sched: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 55/68] selftests/seccomp: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 56/68] selftests/sigaltstack: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 57/68] selftests/sgx: Compile with -D_GNU_SOURCE Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 12:02 ` Jarkko Sakkinen
2024-05-22 12:02 ` Jarkko Sakkinen
2024-05-22 0:57 ` [PATCH v5 58/68] selftests/splice: Drop define _GNU_SOURCE Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 59/68] selftests/syscall_user_dispatch: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 60/68] selftests/thermal: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 61/68] selftests/timens: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 62/68] selftests/tmpfs: Drop duplicate -D_GNU_SOURCE Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 63/68] selftests/uevent: Drop define _GNU_SOURCE Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 64/68] selftests/user_events: " Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 65/68] selftests/vDSO: Append to CFLAGS in Makefile Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 66/68] selftests/vDSO: Drop define _GNU_SOURCE Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 67/68] selftests/x86: Append to CFLAGS in Makefile Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 0:57 ` [PATCH v5 68/68] selftests/x86: Drop define _GNU_SOURCE Edward Liaw
2024-05-22 0:57 ` Edward Liaw
2024-05-22 7:42 ` [PATCH v5 00/68] Define _GNU_SOURCE for sources using Paolo Abeni
2024-05-22 7:42 ` Paolo Abeni
2024-05-22 16:35 ` Shuah Khan
2024-05-22 16:35 ` Shuah Khan
2024-05-22 16:19 ` Shuah Khan
2024-05-22 16:19 ` Shuah Khan
2024-05-22 17:13 ` Jakub Kicinski
2024-05-22 17:13 ` Jakub Kicinski
2024-05-22 17:44 ` Edward Liaw
2024-05-22 17:44 ` Edward Liaw
2024-05-22 18:40 ` Shuah Khan
2024-05-22 18:40 ` Shuah Khan
2024-05-22 23:32 ` patchwork-bot+linux-riscv
2024-05-22 23:32 ` patchwork-bot+linux-riscv
2024-05-22 23:36 ` Shuah Khan
2024-05-22 23:36 ` Shuah Khan
2024-05-23 18:08 ` Shuah Khan
2024-05-23 18:08 ` Shuah Khan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r0du2i0a.fsf@mail.lhotse \
--to=mpe@ellerman.id.au \
--cc=aou@eecs.berkeley.edu \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=brauner@kernel.org \
--cc=christophe.leroy@csgroup.eu \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edliaw@google.com \
--cc=gnoack@google.com \
--cc=hawk@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kernel-team@android.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-security-module@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mic@digikod.net \
--cc=naveen.n.rao@linux.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=npiggin@gmail.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=richardcochran@gmail.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.