* Re: [PATCH] tools: drop nonsensical -O6
2024-09-08 18:46 [PATCH] tools: drop nonsensical -O6 Sam James
@ 2024-09-09 0:29 ` Ian Rogers
2024-09-09 22:16 ` Namhyung Kim
2024-09-11 15:55 ` Jesper Juhl
2 siblings, 0 replies; 5+ messages in thread
From: Ian Rogers @ 2024-09-09 0:29 UTC (permalink / raw)
To: Sam James
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Adrian Hunter, Liang, Kan, Nathan Chancellor, Nick Desaulniers,
Bill Wendling, Justin Stitt, linux-kernel, linux-perf-users, llvm
On Sun, Sep 8, 2024 at 11:47 AM Sam James <sam@gentoo.org> wrote:
>
> -O6 is very much not-a-thing. Really, this should've been dropped
> entirely in 49b3cd306e60b9d889c775cb2ebb709f80dd8ae9 instead of just
> passing it for not-Clang.
>
> Just collapse it down to -O3, instead of "-O6 unless Clang, in which case
> -O3".
>
> GCC interprets > -O3 as -O3. It doesn't even interpret > -O3 as -Ofast,
> which is a good thing, given -Ofast has specific (non-)requirements for
> code built using it. So, this does nothing except look a bit daft.
>
> Remove the silliness and also save a few lines in the Makefiles accordingly.
>
> Signed-off-by: Sam James <sam@gentoo.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Thanks,
Ian
> ---
> I promise I'm not completely humourless, but given it's caused
> actual workarounds to be added for Clang, I don't think this is worth keeping.
>
> Plus it sort of propagates a silly myth that -O6 does anything.
>
> tools/lib/api/Makefile | 4 ----
> tools/lib/subcmd/Makefile | 4 +---
> tools/lib/symbol/Makefile | 4 ----
> tools/perf/Makefile.config | 6 +-----
> 4 files changed, 2 insertions(+), 16 deletions(-)
>
> diff --git a/tools/lib/api/Makefile b/tools/lib/api/Makefile
> index 044860ac1ed1c..7f6396087b467 100644
> --- a/tools/lib/api/Makefile
> +++ b/tools/lib/api/Makefile
> @@ -31,11 +31,7 @@ CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
> CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -U_FORTIFY_SOURCE -fPIC
>
> ifeq ($(DEBUG),0)
> -ifeq ($(CC_NO_CLANG), 0)
> CFLAGS += -O3
> -else
> - CFLAGS += -O6
> -endif
> endif
>
> ifeq ($(DEBUG),0)
> diff --git a/tools/lib/subcmd/Makefile b/tools/lib/subcmd/Makefile
> index b87213263a5e0..6717b82fc5876 100644
> --- a/tools/lib/subcmd/Makefile
> +++ b/tools/lib/subcmd/Makefile
> @@ -38,10 +38,8 @@ endif
>
> ifeq ($(DEBUG),1)
> CFLAGS += -O0
> -else ifeq ($(CC_NO_CLANG), 0)
> - CFLAGS += -O3
> else
> - CFLAGS += -O6
> + CFLAGS += -O3
> endif
>
> # Treat warnings as errors unless directed not to
> diff --git a/tools/lib/symbol/Makefile b/tools/lib/symbol/Makefile
> index 13d43c6f92b4a..426b845edfacc 100644
> --- a/tools/lib/symbol/Makefile
> +++ b/tools/lib/symbol/Makefile
> @@ -31,11 +31,7 @@ CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
> CFLAGS += -ggdb3 -Wall -Wextra -std=gnu11 -U_FORTIFY_SOURCE -fPIC
>
> ifeq ($(DEBUG),0)
> -ifeq ($(CC_NO_CLANG), 0)
> CFLAGS += -O3
> -else
> - CFLAGS += -O6
> -endif
> endif
>
> ifeq ($(DEBUG),0)
> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> index fa679db61f622..5d6b08a896150 100644
> --- a/tools/perf/Makefile.config
> +++ b/tools/perf/Makefile.config
> @@ -238,11 +238,7 @@ endif
>
> ifeq ($(DEBUG),0)
> CORE_CFLAGS += -DNDEBUG=1
> -ifeq ($(CC_NO_CLANG), 0)
> - CORE_CFLAGS += -O3
> -else
> - CORE_CFLAGS += -O6
> -endif
> +CORE_CFLAGS += -O3
> else
> CORE_CFLAGS += -g
> CXXFLAGS += -g
> --
> 2.46.0
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tools: drop nonsensical -O6
2024-09-08 18:46 [PATCH] tools: drop nonsensical -O6 Sam James
2024-09-09 0:29 ` Ian Rogers
@ 2024-09-09 22:16 ` Namhyung Kim
2024-09-11 15:48 ` Arnaldo Carvalho de Melo
2024-09-11 15:55 ` Jesper Juhl
2 siblings, 1 reply; 5+ messages in thread
From: Namhyung Kim @ 2024-09-09 22:16 UTC (permalink / raw)
To: Sam James
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Ian Rogers,
Adrian Hunter, Liang, Kan, Nathan Chancellor, Nick Desaulniers,
Bill Wendling, Justin Stitt, linux-kernel, linux-perf-users, llvm
Hello,
On Sun, Sep 08, 2024 at 07:46:41PM +0100, Sam James wrote:
> -O6 is very much not-a-thing. Really, this should've been dropped
> entirely in 49b3cd306e60b9d889c775cb2ebb709f80dd8ae9 instead of just
> passing it for not-Clang.
>
> Just collapse it down to -O3, instead of "-O6 unless Clang, in which case
> -O3".
>
> GCC interprets > -O3 as -O3. It doesn't even interpret > -O3 as -Ofast,
> which is a good thing, given -Ofast has specific (non-)requirements for
> code built using it. So, this does nothing except look a bit daft.
>
> Remove the silliness and also save a few lines in the Makefiles accordingly.
>
> Signed-off-by: Sam James <sam@gentoo.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Thanks,
Namhyung
> ---
> I promise I'm not completely humourless, but given it's caused
> actual workarounds to be added for Clang, I don't think this is worth keeping.
>
> Plus it sort of propagates a silly myth that -O6 does anything.
>
> tools/lib/api/Makefile | 4 ----
> tools/lib/subcmd/Makefile | 4 +---
> tools/lib/symbol/Makefile | 4 ----
> tools/perf/Makefile.config | 6 +-----
> 4 files changed, 2 insertions(+), 16 deletions(-)
>
> diff --git a/tools/lib/api/Makefile b/tools/lib/api/Makefile
> index 044860ac1ed1c..7f6396087b467 100644
> --- a/tools/lib/api/Makefile
> +++ b/tools/lib/api/Makefile
> @@ -31,11 +31,7 @@ CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
> CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -U_FORTIFY_SOURCE -fPIC
>
> ifeq ($(DEBUG),0)
> -ifeq ($(CC_NO_CLANG), 0)
> CFLAGS += -O3
> -else
> - CFLAGS += -O6
> -endif
> endif
>
> ifeq ($(DEBUG),0)
> diff --git a/tools/lib/subcmd/Makefile b/tools/lib/subcmd/Makefile
> index b87213263a5e0..6717b82fc5876 100644
> --- a/tools/lib/subcmd/Makefile
> +++ b/tools/lib/subcmd/Makefile
> @@ -38,10 +38,8 @@ endif
>
> ifeq ($(DEBUG),1)
> CFLAGS += -O0
> -else ifeq ($(CC_NO_CLANG), 0)
> - CFLAGS += -O3
> else
> - CFLAGS += -O6
> + CFLAGS += -O3
> endif
>
> # Treat warnings as errors unless directed not to
> diff --git a/tools/lib/symbol/Makefile b/tools/lib/symbol/Makefile
> index 13d43c6f92b4a..426b845edfacc 100644
> --- a/tools/lib/symbol/Makefile
> +++ b/tools/lib/symbol/Makefile
> @@ -31,11 +31,7 @@ CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
> CFLAGS += -ggdb3 -Wall -Wextra -std=gnu11 -U_FORTIFY_SOURCE -fPIC
>
> ifeq ($(DEBUG),0)
> -ifeq ($(CC_NO_CLANG), 0)
> CFLAGS += -O3
> -else
> - CFLAGS += -O6
> -endif
> endif
>
> ifeq ($(DEBUG),0)
> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> index fa679db61f622..5d6b08a896150 100644
> --- a/tools/perf/Makefile.config
> +++ b/tools/perf/Makefile.config
> @@ -238,11 +238,7 @@ endif
>
> ifeq ($(DEBUG),0)
> CORE_CFLAGS += -DNDEBUG=1
> -ifeq ($(CC_NO_CLANG), 0)
> - CORE_CFLAGS += -O3
> -else
> - CORE_CFLAGS += -O6
> -endif
> +CORE_CFLAGS += -O3
> else
> CORE_CFLAGS += -g
> CXXFLAGS += -g
> --
> 2.46.0
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tools: drop nonsensical -O6
2024-09-09 22:16 ` Namhyung Kim
@ 2024-09-11 15:48 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-09-11 15:48 UTC (permalink / raw)
To: Namhyung Kim
Cc: Sam James, Peter Zijlstra, Ingo Molnar, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
Liang, Kan, Nathan Chancellor, Nick Desaulniers, Bill Wendling,
Justin Stitt, linux-kernel, linux-perf-users, llvm
On Mon, Sep 09, 2024 at 03:16:01PM -0700, Namhyung Kim wrote:
> Hello,
>
> On Sun, Sep 08, 2024 at 07:46:41PM +0100, Sam James wrote:
> > -O6 is very much not-a-thing. Really, this should've been dropped
> > entirely in 49b3cd306e60b9d889c775cb2ebb709f80dd8ae9 instead of just
> > passing it for not-Clang.
> >
> > Just collapse it down to -O3, instead of "-O6 unless Clang, in which case
> > -O3".
> >
> > GCC interprets > -O3 as -O3. It doesn't even interpret > -O3 as -Ofast,
> > which is a good thing, given -Ofast has specific (non-)requirements for
> > code built using it. So, this does nothing except look a bit daft.
> >
> > Remove the silliness and also save a few lines in the Makefiles accordingly.
> >
> > Signed-off-by: Sam James <sam@gentoo.org>
>
> Acked-by: Namhyung Kim <namhyung@kernel.org>
Thanks, applied to perf-tools-next,
- Arnaldo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tools: drop nonsensical -O6
2024-09-08 18:46 [PATCH] tools: drop nonsensical -O6 Sam James
2024-09-09 0:29 ` Ian Rogers
2024-09-09 22:16 ` Namhyung Kim
@ 2024-09-11 15:55 ` Jesper Juhl
2 siblings, 0 replies; 5+ messages in thread
From: Jesper Juhl @ 2024-09-11 15:55 UTC (permalink / raw)
To: Sam James
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Ian Rogers, Adrian Hunter, Liang, Kan, Nathan Chancellor,
Nick Desaulniers, Bill Wendling, Justin Stitt, linux-kernel,
linux-perf-users, llvm
Looks good to me.
Reviewed-by: Jesper Juhl <jesperjuhl76@gmail.com>
On Sun, 8 Sept 2024 at 20:47, Sam James <sam@gentoo.org> wrote:
>
> -O6 is very much not-a-thing. Really, this should've been dropped
> entirely in 49b3cd306e60b9d889c775cb2ebb709f80dd8ae9 instead of just
> passing it for not-Clang.
>
> Just collapse it down to -O3, instead of "-O6 unless Clang, in which case
> -O3".
>
> GCC interprets > -O3 as -O3. It doesn't even interpret > -O3 as -Ofast,
> which is a good thing, given -Ofast has specific (non-)requirements for
> code built using it. So, this does nothing except look a bit daft.
>
> Remove the silliness and also save a few lines in the Makefiles accordingly.
>
> Signed-off-by: Sam James <sam@gentoo.org>
> ---
> I promise I'm not completely humourless, but given it's caused
> actual workarounds to be added for Clang, I don't think this is worth keeping.
>
> Plus it sort of propagates a silly myth that -O6 does anything.
>
> tools/lib/api/Makefile | 4 ----
> tools/lib/subcmd/Makefile | 4 +---
> tools/lib/symbol/Makefile | 4 ----
> tools/perf/Makefile.config | 6 +-----
> 4 files changed, 2 insertions(+), 16 deletions(-)
>
> diff --git a/tools/lib/api/Makefile b/tools/lib/api/Makefile
> index 044860ac1ed1c..7f6396087b467 100644
> --- a/tools/lib/api/Makefile
> +++ b/tools/lib/api/Makefile
> @@ -31,11 +31,7 @@ CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
> CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -U_FORTIFY_SOURCE -fPIC
>
> ifeq ($(DEBUG),0)
> -ifeq ($(CC_NO_CLANG), 0)
> CFLAGS += -O3
> -else
> - CFLAGS += -O6
> -endif
> endif
>
> ifeq ($(DEBUG),0)
> diff --git a/tools/lib/subcmd/Makefile b/tools/lib/subcmd/Makefile
> index b87213263a5e0..6717b82fc5876 100644
> --- a/tools/lib/subcmd/Makefile
> +++ b/tools/lib/subcmd/Makefile
> @@ -38,10 +38,8 @@ endif
>
> ifeq ($(DEBUG),1)
> CFLAGS += -O0
> -else ifeq ($(CC_NO_CLANG), 0)
> - CFLAGS += -O3
> else
> - CFLAGS += -O6
> + CFLAGS += -O3
> endif
>
> # Treat warnings as errors unless directed not to
> diff --git a/tools/lib/symbol/Makefile b/tools/lib/symbol/Makefile
> index 13d43c6f92b4a..426b845edfacc 100644
> --- a/tools/lib/symbol/Makefile
> +++ b/tools/lib/symbol/Makefile
> @@ -31,11 +31,7 @@ CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
> CFLAGS += -ggdb3 -Wall -Wextra -std=gnu11 -U_FORTIFY_SOURCE -fPIC
>
> ifeq ($(DEBUG),0)
> -ifeq ($(CC_NO_CLANG), 0)
> CFLAGS += -O3
> -else
> - CFLAGS += -O6
> -endif
> endif
>
> ifeq ($(DEBUG),0)
> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> index fa679db61f622..5d6b08a896150 100644
> --- a/tools/perf/Makefile.config
> +++ b/tools/perf/Makefile.config
> @@ -238,11 +238,7 @@ endif
>
> ifeq ($(DEBUG),0)
> CORE_CFLAGS += -DNDEBUG=1
> -ifeq ($(CC_NO_CLANG), 0)
> - CORE_CFLAGS += -O3
> -else
> - CORE_CFLAGS += -O6
> -endif
> +CORE_CFLAGS += -O3
> else
> CORE_CFLAGS += -g
> CXXFLAGS += -g
> --
> 2.46.0
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread