public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] fixincludes: vxworks: regs.h: Guard include of vxTypesOld.h by !_ASMLANGUAGE
@ 2018-06-27 14:27 Rasmus Villemoes
  2018-09-03 12:11 ` Olivier Hainque
  2018-10-08 13:14 ` [PATCH v2] fixincludes: vxworks: regs.h: Fix includes in regs.h wrapper Rasmus Villemoes
  0 siblings, 2 replies; 9+ messages in thread
From: Rasmus Villemoes @ 2018-06-27 14:27 UTC (permalink / raw)
  To: gcc-patches; +Cc: bkorb, Olivier Hainque, Rasmus Villemoes

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

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

end of thread, other threads:[~2018-10-15 15:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-27 14:27 [PATCH] fixincludes: vxworks: regs.h: Guard include of vxTypesOld.h by !_ASMLANGUAGE Rasmus Villemoes
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

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).