[netbsd] Include memmodel.h in netbsd-d.c

Message ID CABOHX+fcFK4qP++=7qBW-UTc==XQ59HKdz2Q8O_gZHJoUeYDBg@mail.gmail.com
State New
Headers show
Series
  • [netbsd] Include memmodel.h in netbsd-d.c
Related show

Commit Message

Iain Buclaw April 27, 2019, 9:20 a.m.
Hi,

Baseline compiler builds fail on all sparc*-netbsd configurations.

In file included from ./tm_p.h:4,
                 from /runner/crossbuilds/../gcc/gcc/config/netbsd-d.c:27:
/runner/crossbuilds/../gcc/gcc/config/sparc/sparc-protos.h:45:47:
error: use of enum ‘memmodel’ without previous declaration
   45 | extern void sparc_emit_membar_for_model (enum memmodel, int, int);
      |                                               ^~~~~~~~
make[2]: *** [/runner/crossbuilds/../gcc/gcc/config/t-netbsd:24:
netbsd-d.o] Error 1


This patch fixes up the includes so compile succeeds.  Tested using
config-list.mk on all netbsd variants.

OK?

-- 
Iain
---
gcc/ChangeLog:

2019-04-27  Iain Buclaw  <ibuclaw@gdcproject.org>

        * config/netbsd-d.c: Include memmodel.h.  Remove unused tree.h,
        varasm.h, and netbsd-protos.h.

---

Comments

Kamil Rytarowski April 27, 2019, 1:30 p.m. | #1
On 27.04.2019 11:20, Iain Buclaw wrote:
> Hi,

> 

> Baseline compiler builds fail on all sparc*-netbsd configurations.

> 

> In file included from ./tm_p.h:4,

>                  from /runner/crossbuilds/../gcc/gcc/config/netbsd-d.c:27:

> /runner/crossbuilds/../gcc/gcc/config/sparc/sparc-protos.h:45:47:

> error: use of enum ‘memmodel’ without previous declaration

>    45 | extern void sparc_emit_membar_for_model (enum memmodel, int, int);

>       |                                               ^~~~~~~~

> make[2]: *** [/runner/crossbuilds/../gcc/gcc/config/t-netbsd:24:

> netbsd-d.o] Error 1

> 

> 

> This patch fixes up the includes so compile succeeds.  Tested using

> config-list.mk on all netbsd variants.

> 

> OK?

> 


Looks good!
Iain Buclaw April 27, 2019, 7:07 p.m. | #2
On Sat, 27 Apr 2019 at 15:30, Kamil Rytarowski <n54@gmx.com> wrote:
>

> On 27.04.2019 11:20, Iain Buclaw wrote:

> > Hi,

> >

> > Baseline compiler builds fail on all sparc*-netbsd configurations.

> >

> > In file included from ./tm_p.h:4,

> >                  from /runner/crossbuilds/../gcc/gcc/config/netbsd-d.c:27:

> > /runner/crossbuilds/../gcc/gcc/config/sparc/sparc-protos.h:45:47:

> > error: use of enum ‘memmodel’ without previous declaration

> >    45 | extern void sparc_emit_membar_for_model (enum memmodel, int, int);

> >       |                                               ^~~~~~~~

> > make[2]: *** [/runner/crossbuilds/../gcc/gcc/config/t-netbsd:24:

> > netbsd-d.o] Error 1

> >

> >

> > This patch fixes up the includes so compile succeeds.  Tested using

> > config-list.mk on all netbsd variants.

> >

> > OK?

> >

>

> Looks good!

>


Thanks, committed as r270625.

Jakub, would this be OK for the gcc-9-branch as well?

-- 
Iain
Jakub Jelinek April 27, 2019, 8:04 p.m. | #3
On Sat, Apr 27, 2019 at 09:07:34PM +0200, Iain Buclaw wrote:
> On Sat, 27 Apr 2019 at 15:30, Kamil Rytarowski <n54@gmx.com> wrote:

> >

> > On 27.04.2019 11:20, Iain Buclaw wrote:

> > > Hi,

> > >

> > > Baseline compiler builds fail on all sparc*-netbsd configurations.

> > >

> > > In file included from ./tm_p.h:4,

> > >                  from /runner/crossbuilds/../gcc/gcc/config/netbsd-d.c:27:

> > > /runner/crossbuilds/../gcc/gcc/config/sparc/sparc-protos.h:45:47:

> > > error: use of enum ‘memmodel’ without previous declaration

> > >    45 | extern void sparc_emit_membar_for_model (enum memmodel, int, int);

> > >       |                                               ^~~~~~~~

> > > make[2]: *** [/runner/crossbuilds/../gcc/gcc/config/t-netbsd:24:

> > > netbsd-d.o] Error 1

> > >

> > >

> > > This patch fixes up the includes so compile succeeds.  Tested using

> > > config-list.mk on all netbsd variants.

> > >

> > > OK?

> > >

> >

> > Looks good!

> >

> 

> Thanks, committed as r270625.

> 

> Jakub, would this be OK for the gcc-9-branch as well?


Ok, thanks.

	Jakub

Patch

diff --git a/gcc/config/netbsd-d.c b/gcc/config/netbsd-d.c
index 76342aacae3..5957256fa9b 100644
--- a/gcc/config/netbsd-d.c
+++ b/gcc/config/netbsd-d.c
@@ -21,9 +21,7 @@  along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "tm.h"
-#include "tree.h"
-#include "varasm.h"
-#include "netbsd-protos.h"
+#include "memmodel.h"
 #include "tm_p.h"
 #include "d/d-target.h"
 #include "d/d-target-def.h"