linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gcc-plugins: Fix build for upcoming GCC release
@ 2023-01-13 17:30 Palmer Dabbelt
  2023-01-13 23:17 ` Kees Cook
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Palmer Dabbelt @ 2023-01-13 17:30 UTC (permalink / raw)
  To: keescook; +Cc: linux-hardening, linux-kernel, linux, Palmer Dabbelt

From: Palmer Dabbelt <palmer@rivosinc.com>

The upcoming GCC release has refactored the gimple plugin interface a
bit and unless gimple-iterator.h is included before gimple-fold.h I end
up with a bunch of missing declarations when building the stack
protector plugin.

Link: https://inbox.sourceware.org/gcc-patches/CAFiYyc2q%2Bc-0uZb-zAskmR_U%2BM%2BxQfp-W00ZbLErfjx=j5qHGg@mail.gmail.com/
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
---
 scripts/gcc-plugins/gcc-common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h
index 9a1895747b15..2c3a3079128a 100644
--- a/scripts/gcc-plugins/gcc-common.h
+++ b/scripts/gcc-plugins/gcc-common.h
@@ -72,6 +72,7 @@
 #include "stor-layout.h"
 #include "internal-fn.h"
 #include "gimple-expr.h"
+#include "gimple-iterator.h"
 #include "gimple-fold.h"
 #include "context.h"
 #include "tree-ssa-alias.h"
@@ -88,7 +89,6 @@
 #include "gimple.h"
 #include "tree-phinodes.h"
 #include "tree-cfg.h"
-#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "ssa-iterators.h"
 
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] gcc-plugins: Fix build for upcoming GCC release
  2023-01-13 17:30 [PATCH] gcc-plugins: Fix build for upcoming GCC release Palmer Dabbelt
@ 2023-01-13 23:17 ` Kees Cook
  2023-01-13 23:18 ` Kees Cook
  2023-01-13 23:20 ` Kees Cook
  2 siblings, 0 replies; 4+ messages in thread
From: Kees Cook @ 2023-01-13 23:17 UTC (permalink / raw)
  To: palmer; +Cc: Kees Cook, linux-hardening, linux, linux-kernel

On Fri, 13 Jan 2023 09:30:33 -0800, Palmer Dabbelt wrote:
> From: Palmer Dabbelt <palmer@rivosinc.com>
> 
> The upcoming GCC release has refactored the gimple plugin interface a
> bit and unless gimple-iterator.h is included before gimple-fold.h I end
> up with a bunch of missing declarations when building the stack
> protector plugin.
> 
> [...]

Applied to for-next/hardening, thanks!

[1/1] gcc-plugins: Fix build for upcoming GCC release
      https://git.kernel.org/kees/c/6d778f2045c7

-- 
Kees Cook


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gcc-plugins: Fix build for upcoming GCC release
  2023-01-13 17:30 [PATCH] gcc-plugins: Fix build for upcoming GCC release Palmer Dabbelt
  2023-01-13 23:17 ` Kees Cook
@ 2023-01-13 23:18 ` Kees Cook
  2023-01-13 23:20 ` Kees Cook
  2 siblings, 0 replies; 4+ messages in thread
From: Kees Cook @ 2023-01-13 23:18 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: linux-hardening, linux-kernel, linux

On Fri, Jan 13, 2023 at 09:30:33AM -0800, Palmer Dabbelt wrote:
> From: Palmer Dabbelt <palmer@rivosinc.com>
> 
> The upcoming GCC release has refactored the gimple plugin interface a
> bit and unless gimple-iterator.h is included before gimple-fold.h I end
> up with a bunch of missing declarations when building the stack
> protector plugin.
> 
> Link: https://inbox.sourceware.org/gcc-patches/CAFiYyc2q%2Bc-0uZb-zAskmR_U%2BM%2BxQfp-W00ZbLErfjx=j5qHGg@mail.gmail.com/
> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

Eek, actually, I've unapplied this. It breaks on GCC 12.

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gcc-plugins: Fix build for upcoming GCC release
  2023-01-13 17:30 [PATCH] gcc-plugins: Fix build for upcoming GCC release Palmer Dabbelt
  2023-01-13 23:17 ` Kees Cook
  2023-01-13 23:18 ` Kees Cook
@ 2023-01-13 23:20 ` Kees Cook
  2 siblings, 0 replies; 4+ messages in thread
From: Kees Cook @ 2023-01-13 23:20 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: linux-hardening, linux-kernel, linux

On Fri, Jan 13, 2023 at 09:30:33AM -0800, Palmer Dabbelt wrote:
> From: Palmer Dabbelt <palmer@rivosinc.com>
> 
> The upcoming GCC release has refactored the gimple plugin interface a
> bit and unless gimple-iterator.h is included before gimple-fold.h I end
> up with a bunch of missing declarations when building the stack
> protector plugin.
> 
> Link: https://inbox.sourceware.org/gcc-patches/CAFiYyc2q%2Bc-0uZb-zAskmR_U%2BM%2BxQfp-W00ZbLErfjx=j5qHGg@mail.gmail.com/
> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
> ---
>  scripts/gcc-plugins/gcc-common.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Does this work for you?


diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h
index 9a1895747b15..309b39cee275 100644
--- a/scripts/gcc-plugins/gcc-common.h
+++ b/scripts/gcc-plugins/gcc-common.h
@@ -72,6 +72,9 @@
 #include "stor-layout.h"
 #include "internal-fn.h"
 #include "gimple-expr.h"
+#if BUILDING_GCC_VERSION >= 13000
+#include "gimple-iterator.h"
+#endif
 #include "gimple-fold.h"
 #include "context.h"
 #include "tree-ssa-alias.h"
@@ -88,7 +91,9 @@
 #include "gimple.h"
 #include "tree-phinodes.h"
 #include "tree-cfg.h"
+#if BUILDING_GCC_VERSION < 13000
 #include "gimple-iterator.h"
+#endif
 #include "gimple-ssa.h"
 #include "ssa-iterators.h"
 

> 
> diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h
> index 9a1895747b15..2c3a3079128a 100644
> --- a/scripts/gcc-plugins/gcc-common.h
> +++ b/scripts/gcc-plugins/gcc-common.h
> @@ -72,6 +72,7 @@
>  #include "stor-layout.h"
>  #include "internal-fn.h"
>  #include "gimple-expr.h"
> +#include "gimple-iterator.h"
>  #include "gimple-fold.h"
>  #include "context.h"
>  #include "tree-ssa-alias.h"
> @@ -88,7 +89,6 @@
>  #include "gimple.h"
>  #include "tree-phinodes.h"
>  #include "tree-cfg.h"
> -#include "gimple-iterator.h"
>  #include "gimple-ssa.h"
>  #include "ssa-iterators.h"
>  
> -- 
> 2.39.0
> 

-- 
Kees Cook

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-13 23:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-13 17:30 [PATCH] gcc-plugins: Fix build for upcoming GCC release Palmer Dabbelt
2023-01-13 23:17 ` Kees Cook
2023-01-13 23:18 ` Kees Cook
2023-01-13 23:20 ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).