Setup system header wrappers for C++ on VxWorks
authorOlivier Hainque <hainque@adacore.com>
Mon, 30 Dec 2019 21:46:21 +0000 (21:46 +0000)
committerOlivier Hainque <hainque@gcc.gnu.org>
Mon, 30 Dec 2019 21:46:21 +0000 (21:46 +0000)
Starting from VxWorks 7, the system comes with a Dinkumware
environment which requires the inclusion of "yvals.h" before other
system headers.  We provide wrapped versions of a few headers to
accommodate such constraints.

2019-12-30  Jerome Lambourg  <lambourg@adaccore.com>
            Olivier Hainque  <hainque@adacore.com>

gcc/
* config/vxworks/_yvals.h: New file.
* config/vxworks/_yvals-wrapper.h: New file.
* gcc/config/vxworks/math.h: Use it to wrap the VxWorks
math.h header.
* gcc/config/vxworks/complex.h: Likewise.
* gcc/config/vxworks/setjmp.h: Likewise.
* gcc/config/vxworks/inttypes.h: Likewise.
* config.gcc (*-*-vxworks*): Add system header wrappers
to extra_headers.
(powerpc-*-vxworks*): Reuse the common extra_headers.

From-SVN: r279784

gcc/ChangeLog
gcc/config.gcc

index ee7346a2a60a0a94b464f9269b944433713e6e52..54f99916ae348af5d9dd8402b0c048e6a4f0f7a8 100644 (file)
@@ -1,3 +1,16 @@
+2019-12-30  Olivier Hainque  <hainque@adacore.com>
+
+       * config/vxworks/_yvals.h: New file.
+       * config/vxworks/_yvals-wrapper.h: New file.
+       * gcc/config/vxworks/math.h: Use it to wrap the VxWorks
+       math.h header.
+       * gcc/config/vxworks/complex.h: Likewise.
+       * gcc/config/vxworks/setjmp.h: Likewise.
+       * gcc/config/vxworks/inttypes.h: Likewise.
+       * config.gcc (*-*-vxworks*): Add system header wrappers
+       to extra_headers.
+       (powerpc-*-vxworks*): Reuse the common extra_headers.
+
 2019-12-30  Olivier Hainque  <hainque@adacore.com>
 
        * config/vxworks/_vxworks-versions.h: New file.
index f4f58d2b185d4afd600313d27cc0f5de3a04233a..42e4251a3a624196a5ff2eccdd4730ec6be715ee 100644 (file)
@@ -953,12 +953,15 @@ case ${target} in
 *-*-vxworks*)
   tmake_file=t-vxworks
   xm_defines=POSIX
+
   extra_options="${extra_options} vxworks.opt"
   extra_objs="$extra_objs vxworks.o"
+
   c_target_objs="${c_target_objs} vxworks-c.o"
   cxx_target_objs="${cxx_target_objs} vxworks-c.o"
   extra_headers="${extra_headers} ../vxworks/vxworks-predef.h"
   target_has_targetcm="yes"
+
   use_gcc_stdint=provide
   tm_file="${tm_file} vxworks-stdint.h"
 
@@ -968,6 +971,17 @@ case ${target} in
 
   extra_headers="${extra_headers} ../vxworks/_vxworks-versions.h"
 
+  # Starting from VxWorks 7, the system comes with a Dinkumware
+  # environment which requires the inclusion of "yvals.h" before other
+  # system headers.  We provide wrapped versions of a few headers to
+  # accomodate such constraints:
+
+  extra_headers="${extra_headers} ../vxworks/_yvals.h"
+  extra_headers="${extra_headers} ../vxworks/_yvals-wrapper.h"
+
+  extra_headers="${extra_headers} ../vxworks/math.h ../vxworks/complex.h"
+  extra_headers="${extra_headers} ../vxworks/inttypes.h ../vxworks/setjmp.h"
+
   case ${enable_threads} in
     no) ;;
     "" | yes | vxworks) thread_file='vxworks' ;;
@@ -2930,7 +2944,7 @@ powerpc-wrs-vxworks*)
        tm_file="${tm_file} elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h"
        tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppccomm rs6000/t-vxworks"
        extra_options="${extra_options} rs6000/sysv4.opt"
-       extra_headers=ppc-asm.h
+       extra_headers="${extra_headers} ppc-asm.h"
        case ${target} in
           *-vxworksmils*)
             tm_file="${tm_file} vx-common.h vxworksae.h rs6000/vxworks.h rs6000/vxworksmils.h"