public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Include yvals.h for VxWorks < 7 RTPs as well
@ 2021-12-13 13:49 Olivier Hainque
  0 siblings, 0 replies; only message in thread
From: Olivier Hainque @ 2021-12-13 13:49 UTC (permalink / raw)
  To: gcc-patches; +Cc: Olivier Hainque, Rasmus Villemoes

[-- Attachment #1: Type: text/plain, Size: 1059 bytes --]

Hello,

For -mrtp on VxWorks 6.9, at least inttypes.h ends up #including
system headers checking that _BITS_BYTES is 8, which the system yvals.h
defines. We do pre-include _yvals.h ahead of inttypes.h for this kind of
purpose, but it currently assumes that only VxWorks >= 7 provides yvals.h.

This results in unexpected configure checks failures, complaining about
_BITS_BYTES not being 8, spotted while inspecting libstdc++ config.log for
unrelated reasons.

This change relaxes the guard in _yvals.h to include yvals.h for
__RTP__ in addition to version >= 7.

I had good builds and test results with this in-house for gcc-11 based
toolchains for a variety of targets. I checked that a build for vx6.9
passes with mainline sources and verified that the spurious configure
test failures are gone.

Will commit shortly.

I'm not 100% sure about the situation on VxWorks 5. This is easy to
adjust if need be.

Olivier


2021-12-13  Olivier Hainque  <hainque@adacore.com>

        * config/vxworks/_yvals.h: #include yvals.h also if
        defined(__RTP__).


[-- Attachment #2: 0002-Include-yvals.h-for-VxWorks-7-RTPs-as-well.patch --]
[-- Type: application/octet-stream, Size: 1728 bytes --]

From 14a6c4c03dcb59f34b15b24df5e704db5e60f3e1 Mon Sep 17 00:00:00 2001
From: Olivier Hainque <hainque@adacore.com>
Date: Mon, 13 Dec 2021 08:06:46 +0000
Subject: [PATCH] Include yvals.h for VxWorks < 7 RTPs as well

For -mrtp on VxWorks 6.9, at least inttypes.h ends up #including
system headers checking that _BITS_BYTES is 8, which the system yvals.h
defines. We do pre-include _yvals.h ahead of inttypes.h for this kind of
purpose, but it currently assumes that only VxWorks >= 7 provides yvals.h.

This results in unexpected configure checks failures, complaining about
_BITS_BYTES not being 8, spotted while inspecting libstdc++ config.log for
unrelated reasons.

This change relaxes the guard in _yvals.h to include yvals.h for
__RTP__ in addition to version >= 7.

2021-12-13  Olivier Hainque  <hainque@adacore.com>

	* config/vxworks/_yvals.h: #include yvals.h also if
	defined(__RTP__).
---
 gcc/config/vxworks/_yvals.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gcc/config/vxworks/_yvals.h b/gcc/config/vxworks/_yvals.h
index f8b0818185c..0f277e42079 100644
--- a/gcc/config/vxworks/_yvals.h
+++ b/gcc/config/vxworks/_yvals.h
@@ -24,7 +24,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #include <_vxworks-versions.h>
 
-#if _VXWORKS_MAJOR_GE(7)
+/* #include the VxWorks yvals.h in setups we expect it to be available.
+   It is around for both kernel mode and rtps on VxWorks >= 7, only for
+   rtps prior to that.  */
+
+#if _VXWORKS_MAJOR_GE(7) || defined(__RTP__)
 
 /* We need to deactivate the definitions tailored for the Dinkumware
    intrinsics, incompatible with a compilation by G++.  */
-- 
2.25.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-13 13:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-13 13:49 [PATCH] Include yvals.h for VxWorks < 7 RTPs as well 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).