From 7b8916a6fd098546e4e53e53b37a5153664ba17f Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Mon, 20 Feb 2023 11:40:24 +0100 Subject: [PATCH] rust: Fix rust-tree.cc compilation on SPARC This patch commit 27a89f84c458ae938bc3eb92ad0d594c06fc3b42 Author: Thomas Schwinge Date: Fri Feb 17 23:36:20 2023 +0100 '#include "tm_p.h"' in 'gcc/rust/backend/rust-tree.cc' broke rust bootstrap on SPARC: In file included from ./tm_p.h:4, from /vol/gcc/src/hg/master/local/gcc/rust/backend/rust-tree.cc:38: /vol/gcc/src/hg/master/local/gcc/config/sparc/sparc-protos.h:46:47: error: use of enum 'memmodel' without previous declaration 46 | extern void sparc_emit_membar_for_model (enum memmodel, int, int); | ^~~~~~~~ Fixed by including memmodel.h. Tested on sparc-sun-solaris2.11 and i386-pc-solaris2.11. 2023-02-20 Rainer Orth gcc/rust: * backend/rust-tree.cc: Include memmodel.h. --- gcc/rust/backend/rust-tree.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/rust/backend/rust-tree.cc b/gcc/rust/backend/rust-tree.cc index e2595b59aa80..d2d170c23f19 100644 --- a/gcc/rust/backend/rust-tree.cc +++ b/gcc/rust/backend/rust-tree.cc @@ -35,6 +35,7 @@ #include "file-prefix-map.h" #include "cgraph.h" #include "output.h" +#include "memmodel.h" #include "tm_p.h" // forked from gcc/c-family/c-common.cc c_global_trees -- 2.47.2