xref: /minix3/external/gpl3/gcc/files/minix-spec.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
10cdf705cSLionel Sambuc /* Base configuration file for all MINIX targets.
2d19d7d58SLionel Sambuc    Copyright (C) 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
30cdf705cSLionel Sambuc    Adapted for MINIX by Lionel Sambuc <lionel@minix3.org>
4d19d7d58SLionel Sambuc 
5d19d7d58SLionel Sambuc    This file is part of GCC.
6d19d7d58SLionel Sambuc 
70cdf705cSLionel Sambuc    GCC is free software; you can redistribute it and/or modify it
80cdf705cSLionel Sambuc    under the terms of the GNU General Public License as published
90cdf705cSLionel Sambuc    by the Free Software Foundation; either version 2, or (at your
100cdf705cSLionel Sambuc    option) any later version.
11d19d7d58SLionel Sambuc 
120cdf705cSLionel Sambuc    GCC is distributed in the hope that it will be useful, but WITHOUT
130cdf705cSLionel Sambuc    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
140cdf705cSLionel Sambuc    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
150cdf705cSLionel Sambuc    License for more details.
16d19d7d58SLionel Sambuc 
17d19d7d58SLionel Sambuc    You should have received a copy of the GNU General Public License
180cdf705cSLionel Sambuc    along with GCC; see the file COPYING.  If not, write to the
190cdf705cSLionel Sambuc    Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
200cdf705cSLionel Sambuc    MA 02110-1301, USA.  */
21d19d7d58SLionel Sambuc 
220cdf705cSLionel Sambuc /* MINIX defines
230cdf705cSLionel Sambuc  * Default, architecture independent values for MINIX
240cdf705cSLionel Sambuc  *
250cdf705cSLionel Sambuc  * For this to work properly, the order in the tm_file variable has
260cdf705cSLionel Sambuc  * to be the following:
270cdf705cSLionel Sambuc  *   minix-spec.h $arch/minix.h minix.h
280cdf705cSLionel Sambuc  *
290cdf705cSLionel Sambuc  * minix-spec.h	: specifies default arch-independent values
300cdf705cSLionel Sambuc  * $arch/minix.h: redefines as needed default minix values
310cdf705cSLionel Sambuc  * minix.h	: maps GCC defines to the minix defines.
320cdf705cSLionel Sambuc  *
330cdf705cSLionel Sambuc  * WARNING:
340cdf705cSLionel Sambuc  *   When changing any default, also check in the arch headers
350cdf705cSLionel Sambuc  *   if the default is redefined and update them as required.
36d19d7d58SLionel Sambuc  */
37d19d7d58SLionel Sambuc 
38d19d7d58SLionel Sambuc /* In case we need to know.  */
39d19d7d58SLionel Sambuc #define USING_CONFIG_MINIX_SPEC 1
40d19d7d58SLionel Sambuc 
41d19d7d58SLionel Sambuc #define MINIX_TARGET_OS_CPP_BUILTINS()					\
42d19d7d58SLionel Sambuc   do									\
43d19d7d58SLionel Sambuc     {									\
44d19d7d58SLionel Sambuc 		builtin_define ("__minix");				\
450cdf705cSLionel Sambuc 		builtin_define ("__minix__");				\
460cdf705cSLionel Sambuc 		builtin_define ("__unix__");				\
470cdf705cSLionel Sambuc 		builtin_assert ("system=bsd");				\
480cdf705cSLionel Sambuc 		builtin_assert ("system=unix");				\
490cdf705cSLionel Sambuc 		builtin_assert ("system=minix");			\
50d19d7d58SLionel Sambuc 		MINIX_TARGET_CPU_CPP_BUILTINS();			\
51d19d7d58SLionel Sambuc     }									\
52d19d7d58SLionel Sambuc   while (0)
53d19d7d58SLionel Sambuc 
54d19d7d58SLionel Sambuc /* Define the default MINIX-specific per-CPU hook code.  */
55d19d7d58SLionel Sambuc #define MINIX_TARGET_CPU_CPP_BUILTINS() do {} while (0)
56d19d7d58SLionel Sambuc 
5784d9c625SLionel Sambuc /* Look for the include files in the system-defined places.  */
5884d9c625SLionel Sambuc 
5984d9c625SLionel Sambuc #define MINIX_GPLUSPLUS_INCLUDE_DIR "/usr/include/g++"
6084d9c625SLionel Sambuc 
6184d9c625SLionel Sambuc #define MINIX_GPLUSPLUS_BACKWARD_INCLUDE_DIR "/usr/include/g++/backward"
6284d9c625SLionel Sambuc 
63*0a6a1f1dSLionel Sambuc #define MINIX_GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT 1
64*0a6a1f1dSLionel Sambuc 
65*0a6a1f1dSLionel Sambuc #define MINIX_GCC_INCLUDE_DIR_ADD_SYSROOT 1
66*0a6a1f1dSLionel Sambuc 
6784d9c625SLionel Sambuc /*
6884d9c625SLionel Sambuc  * XXX figure out a better way to do this
6984d9c625SLionel Sambuc  */
70*0a6a1f1dSLionel Sambuc #define MINIX_GCC_INCLUDE_DIR "/usr/include/gcc-4.8"
7184d9c625SLionel Sambuc 
72d19d7d58SLionel Sambuc /* Provide a CPP_SPEC appropriate for MINIX.  We just deal with the GCC
730cdf705cSLionel Sambuc    option `-posix'.  */
740cdf705cSLionel Sambuc #define MINIX_CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
75d19d7d58SLionel Sambuc 
76*0a6a1f1dSLionel Sambuc /* Pass -cxx-isystem to cc1/cc1plus.  */
770cdf705cSLionel Sambuc #define MINIX_CC1PLUS_SPEC "%{cxx-isystem}"
78*0a6a1f1dSLionel Sambuc #define MINIX_CC1_SPEC "%{cxx-isystem}"
79*0a6a1f1dSLionel Sambuc 
800cdf705cSLionel Sambuc 
810cdf705cSLionel Sambuc #define MINIX_SUBTARGET_CPP_SPEC ""
820cdf705cSLionel Sambuc #define MINIX_SUBTARGET_EXTRA_ASM_SPEC ""
830cdf705cSLionel Sambuc #define MINIX_SUBTARGET_ASM_FLOAT_SPEC ""
840cdf705cSLionel Sambuc 
85ff68abe6SLionel Sambuc #define MINIX_DYNAMIC_LINKER "/usr/libexec/ld.elf_so"
860cdf705cSLionel Sambuc 
870cdf705cSLionel Sambuc /* Under MINIX, just like on NetBSD, the normal location of the various
880cdf705cSLionel Sambuc  *    *crt*.o files is the /usr/lib directory.  */
890cdf705cSLionel Sambuc #define MINIX_STANDARD_STARTFILE_PREFIX	"/usr/lib/"
900cdf705cSLionel Sambuc 
91*0a6a1f1dSLionel Sambuc /* Under NetBSD, the normal location of the compiler back ends is the
92*0a6a1f1dSLionel Sambuc    /usr/libexec directory.  */
93*0a6a1f1dSLionel Sambuc 
94*0a6a1f1dSLionel Sambuc #define MINIX_STANDARD_EXEC_PREFIX		"/usr/libexec/"
95*0a6a1f1dSLionel Sambuc #define MINIX_TOOLDIR_BASE_PREFIX		"../"
96*0a6a1f1dSLionel Sambuc #define MINIX_STANDARD_BINDIR_PREFIX		"/usr/bin"
97*0a6a1f1dSLionel Sambuc #define MINIX_STANDARD_LIBEXEC_PREFIX		MINIX_STANDARD_EXEC_PREFIX
98*0a6a1f1dSLionel Sambuc 
9984d9c625SLionel Sambuc #define MINIX_LINK_GCC_C_SEQUENCE_SPEC \
10084d9c625SLionel Sambuc 	"%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
101d19d7d58SLionel Sambuc 
102d19d7d58SLionel Sambuc /* Provide a STARTFILE_SPEC appropriate for MINIX.  Here we add
103d19d7d58SLionel Sambuc    the magical crtbegin.o file (see crtstuff.c) which provides part
104d19d7d58SLionel Sambuc    of the support for getting C++ file-scope static object constructed
105d19d7d58SLionel Sambuc    before entering `main'.  */
106d19d7d58SLionel Sambuc #define MINIX_STARTFILE_SPEC	\
107d19d7d58SLionel Sambuc   "%{!shared:			\
1080cdf705cSLionel Sambuc      %{pg:gcrt0%O%s}		\
1090cdf705cSLionel Sambuc      %{!pg:			\
1100cdf705cSLionel Sambuc 	 %{p:gcrt0%O%s}		\
111f14fb602SLionel Sambuc 	 %{!p:%{profile:gcrt0%O%s} \
112f14fb602SLionel Sambuc 	      %{!profile:crt0%O%s}}}} \
1130cdf705cSLionel Sambuc    %:if-exists(crti%O%s)	\
1140cdf705cSLionel Sambuc    %{static:%:if-exists-else(crtbeginT%O%s crtbegin%O%s)} \
1150cdf705cSLionel Sambuc    %{!static:                   \
1160cdf705cSLionel Sambuc      %{!shared:			\
1170cdf705cSLionel Sambuc 	 %{!pie:crtbegin%O%s}	\
1180cdf705cSLionel Sambuc 	 %{pie:crtbeginS%O%s}}	\
1190cdf705cSLionel Sambuc      %{shared:crtbeginS%O%s}}"
120d19d7d58SLionel Sambuc 
1210cdf705cSLionel Sambuc /* Provide an ENDFILE_SPEC appropriate for NetBSD ELF.  Here we
1220cdf705cSLionel Sambuc    add crtend.o, which provides part of the support for getting
1230cdf705cSLionel Sambuc    C++ file-scope static objects deconstructed after exiting "main".  */
124d19d7d58SLionel Sambuc #define MINIX_ENDFILE_SPEC	\
1250cdf705cSLionel Sambuc   "%{!shared:                   \
1260cdf705cSLionel Sambuc     %{!pie:crtend%O%s}          \
1270cdf705cSLionel Sambuc     %{pie:crtendS%O%s}}         \
1280cdf705cSLionel Sambuc    %{shared:crtendS%O%s}        \
1290cdf705cSLionel Sambuc    %:if-exists(crtn%O%s)"
130d19d7d58SLionel Sambuc 
131d19d7d58SLionel Sambuc /* Provide a LIB_SPEC appropriate for MINIX.  Just select the appropriate
132d19d7d58SLionel Sambuc    libc, depending on whether we're doing profiling or need threads support.
133d19d7d58SLionel Sambuc    (similar to the default, except no -lg, and no -p).  */
134d19d7d58SLionel Sambuc #define MINIX_LIB_SPEC "						\
135b86af8beSLionel Sambuc %{pthread: %eThe -pthread option is only supported on MINIX when gcc	\
136d19d7d58SLionel Sambuc is built with the --enable-threads configure-time option.}		\
1370cdf705cSLionel Sambuc   %{shared:-lc}			\
138d19d7d58SLionel Sambuc   %{!shared:			\
1390cdf705cSLionel Sambuc     %{!symbolic:		\
1400cdf705cSLionel Sambuc       %{!p:			\
1410cdf705cSLionel Sambuc 	%{!pg:-lc}}		\
1420cdf705cSLionel Sambuc       %{p:-lc_p}		\
1430cdf705cSLionel Sambuc       %{pg:-lc_p}}}"
144d19d7d58SLionel Sambuc 
145b86af8beSLionel Sambuc /* Provide a LINK_SPEC appropriate for MINIX.  Here we provide support
146b86af8beSLionel Sambuc    for the special GCC options -static and -shared, which allow us to
147b86af8beSLionel Sambuc    link things in one of these three modes by applying the appropriate
148b86af8beSLionel Sambuc    combinations of options at link-time. We like to support here for
149b86af8beSLionel Sambuc    as many of the other GNU linker options as possible. But I don't
150b86af8beSLionel Sambuc    have the time to search for those flags. I am sure how to add
151b86af8beSLionel Sambuc    support for -soname shared_object_name. H.J.
152b86af8beSLionel Sambuc 
153b86af8beSLionel Sambuc    I took out %{v:%{!V:-V}}. It is too much :-(. They can use
154b86af8beSLionel Sambuc    -Wl,-V.
155b86af8beSLionel Sambuc 
156b86af8beSLionel Sambuc    When the -shared link option is used a final link is not being
157b86af8beSLionel Sambuc    done.  */
158b86af8beSLionel Sambuc #define MINIX_LINK_SPEC "						\
1590cdf705cSLionel Sambuc   -X									\
160b86af8beSLionel Sambuc   %{p:%nconsider using `-pg' instead of `-p' with gprof(1) }		\
1610cdf705cSLionel Sambuc   %{assert*} %{R*} %{rpath*}						\
162b86af8beSLionel Sambuc   %{shared:-Bshareable %{h*} %{soname*}}				\
1630cdf705cSLionel Sambuc   %{symbolic:-Bsymbolic}						\
164b86af8beSLionel Sambuc   %{!shared:								\
1650cdf705cSLionel Sambuc     -dc -dp								\
166b86af8beSLionel Sambuc     %{!static:								\
167b86af8beSLionel Sambuc       %{rdynamic:-export-dynamic}					\
168b86af8beSLionel Sambuc       %{!dynamic-linker:-dynamic-linker %(minix_dynamic_linker) }}	\
1690cdf705cSLionel Sambuc     %{static:-Bstatic}}"
17084d9c625SLionel Sambuc 
17184d9c625SLionel Sambuc #define MINIX_TARGET_UNWIND_TABLES_DEFAULT true
172