1 /* Target independent definitions for LynxOS.
2 Copyright (C) 1993-2018 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 GCC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
20 /* In this file we set up defaults that can be chosen by
21 <target>/lynx.h files. A target-specific lynx.h file can decide
22 either to define and override these definitions or to use them by
23 ensuring they are undefined at this point. If we were to #undef
24 them here we might accidentally disable some target-specific
27 #ifndef EXTRA_OS_LYNX_TARGET_SPECS
28 # define EXTRA_OS_LYNX_TARGET_SPECS
31 #ifndef EXTRA_OS_LYNX_SPECS
32 # define EXTRA_OS_LYNX_SPECS \
33 { "cpp_os_lynx", CPP_OS_LYNX_SPEC }, \
34 { "lib_os_lynx", LIB_OS_LYNX_SPEC }, \
35 { "link_os_lynx", LINK_OS_LYNX_SPEC }, \
36 { "startfile_os_lynx", STARTFILE_OS_LYNX_SPEC }, \
37 { "endfile_os_lynx", ENDFILE_OS_LYNX_SPEC }, \
38 EXTRA_OS_LYNX_TARGET_SPECS
41 #ifndef SUBTARGET_EXTRA_SPECS
42 # define SUBTARGET_EXTRA_SPECS EXTRA_OS_LYNX_SPECS
46 # define CPP_SPEC "%(cpp_cpu) %(cpp_os_lynx)"
50 # define LIB_SPEC "%(lib_os_lynx)"
54 # define LINK_SPEC "%(link_os_lynx)"
57 #ifndef STARTFILE_SPEC
58 # define STARTFILE_SPEC "%(startfile_os_lynx)"
62 # define ENDFILE_SPEC "%(endfile_os_lynx)"
65 #ifndef CPP_OS_LYNX_SPEC
66 # define CPP_OS_LYNX_SPEC \
69 %ecannot use mthreads and mlegacy-threads together}} \
70 %{mthreads: -D_MULTITHREADED} \
71 %{mlegacy-threads: -D_THREADS_POSIX4ad4} \
72 -Asystem=lynx -Asystem=unix -D__Lynx__ -D__unix__"
75 #ifndef LIB_OS_LYNX_SPEC
76 # define LIB_OS_LYNX_SPEC \
77 "%{mlegacy-threads:-lposix-pre1c} -lm -lc"
80 /* We link static executables for LynxOS by default unless -mshared is
81 used when linking an executable. Along the same line, we link to
82 shared libraries when linking a shared object by default unless
85 We have to pass in our -L options here otherwise the translated
86 startfile directories (%D) will take priority over this.
87 Furthermore since we have to pass in -L options here we have to
88 make sure that -L options provided by the user take priority over
89 everything we specify. */
91 #ifndef LINK_OS_LYNX_SPEC
92 # define LINK_OS_LYNX_SPEC \
93 "%{shared} %{static} \
94 %{mshared: %{static: %ecannot use mshared and static together}} \
95 %{!mshared: %{!shared: %{!static: -static}}} \
98 %{mshared: -L/lib/thread/shlib -rpath /lib/thread/shlib} \
100 %{!static: -L/lib/thread/shlib -rpath /lib/thread/shlib} \
101 %{!mshared: -L/lib/thread}} \
102 %{shared: %{static: -L/lib/thread}}} \
104 %{mshared: -L/lib/shlib -rpath /lib/shlib} \
105 %{shared: -L/lib/shlib -rpath /lib/shlib}} \
106 %{mlegacy-threads:-lposix-pre1c} -lm -lc"
109 #ifndef STARTFILE_OS_LYNX_SPEC
110 # define STARTFILE_OS_LYNX_SPEC \
113 %{p:gcrt1.o%s} %{pg:gcrt1.o%s} \
114 %{!p:%{!pg:crt1.o%s}}} \
116 %{p:thread/gcrt1.o%s} %{pg:thread/gcrt1.o%s} \
117 %{!p:%{!pg:thread/crt1.o%s }}}}\
118 %{mthreads: thread/crti.o%s} %{!mthreads: crti.o%s} \
119 %{!shared: crtbegin.o%s} \
120 %{shared: crtbeginS.o%s}"
123 #ifndef ENDFILE_OS_LYNX_SPEC
124 # define ENDFILE_OS_LYNX_SPEC \
125 "%{!shared: crtend.o%s} \
126 %{shared: crtendS.o%s} \
127 %{mthreads: thread/crtn.o%s} %{!mthreads: crtn.o%s}"
130 /* Define the actual types of some ANSI-mandated types. */
133 # define SIZE_TYPE "unsigned int"
137 # define PTRDIFF_TYPE "int"
141 # define WCHAR_TYPE "long int"
144 #ifndef WCHAR_TYPE_SIZE
145 # define WCHAR_TYPE_SIZE BITS_PER_WORD
148 /* Define ASM_OUTPUT_ALIGN to use the .balign directive rather that
149 the .align directive with GAS. */
151 #ifndef ASM_OUTPUT_ALIGN
152 # define ASM_OUTPUT_ALIGN(FILE, LOG) \
156 fprintf ((FILE), "\t.balign %d\n", 1 << (LOG)); \
161 /* Keep the *_DEBUGGING_INFO defines from elfos.h except that stabs is
162 the default on LynxOS. */
164 #ifndef PREFERRED_DEBUGGING_TYPE
165 # define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
168 /* We have C++ support in our system headers. */
170 #ifndef NO_IMPLICIT_EXTERN_C
171 # define NO_IMPLICIT_EXTERN_C
174 #ifndef TARGET_POSIX_IO
175 # define TARGET_POSIX_IO