public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rasmus Villemoes <rv@rasmusvillemoes.dk>
To: gcc-patches@gcc.gnu.org
Cc: bkorb@gnu.org,	Olivier Hainque <hainque@adacore.com>,
	Rasmus Villemoes <rv@rasmusvillemoes.dk>
Subject: [PATCH] fixincludes: vxworks: regs.h: Guard include of vxTypesOld.h by !_ASMLANGUAGE
Date: Wed, 27 Jun 2018 14:27:00 -0000	[thread overview]
Message-ID: <20180627142715.10534-1-rv@rasmusvillemoes.dk> (raw)

VxWorks' regs.h does include some files that need types defined in
vxTypesOld.h, and it does not itself include that header, directly or
indirectly. Moreover, vxTypesOld.h ends up pulling in definitions of
various cpufamily macros (from types/vxCpu.h) that are also needed
directly by regs.h.

However, when compiling some assembly files that #include "regs.h", the
typedefs in vxTypesOld.h break the build:

/tmp/ccPxG4gA.s: Assembler messages:
/tmp/ccPxG4gA.s:1: Error: unrecognized opcode: `typedef'
/tmp/ccPxG4gA.s:2: Error: unrecognized opcode: `typedef'

etc. The simplest fix is to guard the include of vxTypesOld.h by
!defined(_ASMLANGUAGE). This should not affect C code, and existing
assembly files that include regs.h must already have arranged for
including types/vxCpu.h prior to including regs.h.

==changelog==

fixincludes/

	* inclhack.def (AAB_vxworks_regs_vxtypes): Guard include of
	types/vxTypesOld.h by #ifndef _ASMLANGUAGE.
	* fixincl.x: Regenerate.
---
 fixincludes/inclhack.def | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index c1f5a13eda4..bac0079b69f 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -426,7 +426,9 @@ fix = {
     replace     = <<- _EndOfHeader_
 	#ifndef _REGS_H
 	#define _REGS_H
+	#ifndef _ASMLANGUAGE
 	#include <types/vxTypesOld.h>
+	#endif
 	#include_next <arch/../regs.h>
 	#endif
 	_EndOfHeader_;
-- 
2.16.4

             reply	other threads:[~2018-06-27 14:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-27 14:27 Rasmus Villemoes [this message]
2018-09-03 12:11 ` Olivier Hainque
2018-09-03 13:20   ` Rasmus Villemoes
2018-09-05  9:38     ` Olivier Hainque
2018-09-13  0:46       ` Rasmus Villemoes
2018-09-14 13:02         ` Olivier Hainque
2018-10-08 11:59           ` Rasmus Villemoes
2018-10-08 13:14 ` [PATCH v2] fixincludes: vxworks: regs.h: Fix includes in regs.h wrapper Rasmus Villemoes
2018-10-15 15:50   ` Olivier Hainque

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=20180627142715.10534-1-rv@rasmusvillemoes.dk \
    --to=rv@rasmusvillemoes.dk \
    --cc=bkorb@gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hainque@adacore.com \
    /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 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 read-only IMAP folder(s) and NNTP newsgroup(s).