1/* Common VxWorks AE target definitions for GNU compiler.
2   Copyright (C) 2004-2020 Free Software Foundation, Inc.
3   Contributed by CodeSourcery, LLC.
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
9Software Foundation; either version 3, or (at your option) any later
10version.
11
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15for more details.
16
17You should have received a copy of the GNU General Public License
18along with GCC; see the file COPYING3.  If not see
19<http://www.gnu.org/licenses/>.  */
20
21/* This header should be included after including vx-common.h.  */
22
23/* Most of the definitions below this point are versions of the
24   vxworks.h definitions, without the -mrtp bits.  */
25
26/* Resolve subdirectory of VxWorks AE target headers.  */
27#define VXWORKSAE_TARGET_DIR(SUBDIR) "%:getenv(WIND_BASE /target" SUBDIR ")"
28
29/* Include target/vThreads/h or target/h (depending on the compilation
30   mode), and then target/val/h (in either mode).  The macros defined
31   are in the user's namespace, but the VxWorks headers require
32   them.  */
33#undef VXWORKS_ADDITIONAL_CPP_SPEC
34#define VXWORKS_ADDITIONAL_CPP_SPEC "					\
35 %{!nostdinc:%{isystem*}}						\
36 %{mvthreads:-DVTHREADS=1						\
37	 %{!nostdinc:-isystem " VXWORKSAE_TARGET_DIR("/vThreads/h") "}}	\
38 %{!mvthreads:-DAE653_BUILD=1						\
39	 %{!nostdinc:-isystem " VXWORKSAE_TARGET_DIR("/h") "}}		\
40 %{!nostdinc:-isystem " VXWORKSAE_TARGET_DIR("/val/h") "}"
41
42#undef VXWORKS_LIB_SPEC
43#define VXWORKS_LIB_SPEC ""
44
45#undef VXWORKS_LINK_SPEC
46#define VXWORKS_LINK_SPEC	\
47  "-r %{v:-V}"
48
49#undef VXWORKS_LIBGCC_SPEC
50#define VXWORKS_LIBGCC_SPEC	\
51  "-lgcc"
52
53/* The VxWorks AE ports features are restricted on purpose.  No RTPs,
54   for example.  */
55
56#undef TARGET_VXWORKS_HAVE_CTORS_DTORS
57#define TARGET_VXWORKS_HAVE_CTORS_DTORS 0
58
59#undef VXWORKS_STARTFILE_SPEC
60#define VXWORKS_STARTFILE_SPEC ""
61
62#define VXWORKS_KIND VXWORKS_KIND_AE
63
64/* Both kernels and RTPs have the facilities required by this macro.  */
65#define TARGET_POSIX_IO
66
67/* A VxWorks 653 implementation of TARGET_OS_CPP_BUILTINS.  */
68#define VXWORKS_OS_CPP_BUILTINS()                                       \
69  do                                                                    \
70    {                                                                   \
71      builtin_define ("__vxworks");                                     \
72      builtin_define ("__VXWORKS__");                                   \
73    }                                                                   \
74  while (0)
75
76/* Do VxWorks-specific parts of TARGET_OPTION_OVERRIDE.  */
77
78/* None of the VxWorks AE/653/MILS ports to date has native TLS support.  */
79#define VXWORKS_HAVE_TLS 0
80
81#undef VXWORKS_OVERRIDE_OPTIONS
82#define VXWORKS_OVERRIDE_OPTIONS vxworks_override_options ()
83extern void vxworks_override_options (void);
84
85/* Default dwarf control values, for non-gdb debuggers that come with
86   VxWorks.  */
87
88#undef VXWORKS_DWARF_VERSION_DEFAULT
89#define VXWORKS_DWARF_VERSION_DEFAULT 2
90
91#undef DWARF_GNAT_ENCODINGS_DEFAULT
92#define DWARF_GNAT_ENCODINGS_DEFAULT DWARF_GNAT_ENCODINGS_ALL
93