]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Setup TARGET_C_PREINCLUDE for VxWorks
authorJoel Brobecker <brobecker@adacore.com>
Mon, 30 Dec 2019 21:36:34 +0000 (21:36 +0000)
committerOlivier Hainque <hainque@gcc.gnu.org>
Mon, 30 Dec 2019 21:36:34 +0000 (21:36 +0000)
This patch modifies the C & C++ VxWorks compiler to predefine
the __STDC_ macros verified by gcc.dg/c99-predef-1.c in the testsuite.

2019-12-13  Joel Brobecker  <brobecker@adacore.com>

* config.gcc <*-*-vxworks*>: Add vxworks-c.o to c_target_objs
and cxx_target_objs. Set target_has_targetcm to "yes". Add
vxworks-predef.h to extra_headers.
* config/t-vxworks (vxworks-c.o): New target.
* config/vxworks-c.c: New file.
* config/vxworks/vxworks-predef.h: New file.

From-SVN: r279781

gcc/ChangeLog
gcc/config.gcc
gcc/config/t-vxworks

index 252e921d22821d717349827d9dacd3bacf83b252..6c9adffcb9ce22154aafa4c714cc67ada668c71b 100644 (file)
@@ -1,3 +1,12 @@
+2019-12-30  Joel Brobecker  <brobecker@adacore.com>
+
+       * config.gcc <*-*-vxworks*>: Add vxworks-c.o to c_target_objs
+       and cxx_target_objs. Set target_has_targetcm to "yes". Add
+       vxworks-predef.h to extra_headers.
+       * config/t-vxworks (vxworks-c.o): New target.
+       * config/vxworks-c.c: New file.
+       * config/vxworks/vxworks-predef.h: New file.
+
 2019-12-30  Alexandre Oliva  <oliva@adacore.com>
             Olivier Hainque  <hainque@adacore.com>
 
index 9802f436e06f3d768073018ff75849beb762fd07..1110f7bda742dfd3e3aee53594c9fff7aca3f197 100644 (file)
@@ -955,6 +955,10 @@ case ${target} in
   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"
   case ${enable_threads} in
index 86b26cc1ecc5b70c1a42a84f657003e576e133ed..69b3a2e319952807e31929864b1713ef28522fd3 100644 (file)
@@ -20,6 +20,10 @@ vxworks.o: $(srcdir)/config/vxworks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
        $(TARGET_H) output.h $(TM_H)
        $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
 
+vxworks-c.o: $(srcdir)/config/vxworks-c.c
+       $(COMPILE) $<
+       $(POSTCOMPILE)
+
 # Both the kernel and RTP headers provide limits.h.  They embed VxWorks
 # specificities and are dated on some configurations so we both need to
 # provide our own version and make sure the system one gets exposed.