1 /* Base configuration file for all MINIX targets. 2 Copyright (C) 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc. 3 Adapted for MINIX by Lionel Sambuc <lionel@minix3.org> 4 5 This file is part of GCC. 6 7 GCC is free software; you can redistribute it and/or modify it 8 under the terms of the GNU General Public License as published 9 by the Free Software Foundation; either version 2, or (at your 10 option) any later version. 11 12 GCC is distributed in the hope that it will be useful, but WITHOUT 13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 15 License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with GCC; see the file COPYING. If not, write to the 19 Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, 20 MA 02110-1301, USA. */ 21 22 /* MINIX defines 23 * Default, architecture independent values for MINIX 24 * 25 * For this to work properly, the order in the tm_file variable has 26 * to be the following: 27 * minix-spec.h $arch/minix.h minix.h 28 * 29 * minix-spec.h : specifies default arch-independent values 30 * $arch/minix.h: redefines as needed default minix values 31 * minix.h : maps GCC defines to the minix defines. 32 * 33 * WARNING: 34 * When changing any default, also check in the arch headers 35 * if the default is redefined and update them as required. 36 */ 37 38 /* In case we need to know. */ 39 #define USING_CONFIG_MINIX_SPEC 1 40 41 /* This defines which switch letters take arguments. On FreeBSD, most of 42 the normal cases (defined in gcc.c) apply, and we also have -h* and 43 -z* options (for the linker) (coming from SVR4). 44 We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */ 45 #define MINIX_SWITCH_TAKES_ARG(CHAR) \ 46 (DEFAULT_SWITCH_TAKES_ARG (CHAR) \ 47 || (CHAR) == 'h' \ 48 || (CHAR) == 'z' /* ignored by ld */ \ 49 || (CHAR) == 'R') 50 51 /* This defines which multi-letter switches take arguments. */ 52 #define MINIX_WORD_SWITCH_TAKES_ARG(STR) \ 53 (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \ 54 || !strcmp ((STR), "rpath") || !strcmp ((STR), "rpath-link") \ 55 || !strcmp ((STR), "soname") || !strcmp ((STR), "defsym") \ 56 || !strcmp ((STR), "assert") || !strcmp ((STR), "dynamic-linker")) 57 58 #define MINIX_TARGET_OS_CPP_BUILTINS() \ 59 do \ 60 { \ 61 builtin_define ("__minix"); \ 62 builtin_define ("__minix__"); \ 63 builtin_define ("__unix__"); \ 64 builtin_assert ("system=bsd"); \ 65 builtin_assert ("system=unix"); \ 66 builtin_assert ("system=minix"); \ 67 MINIX_TARGET_CPU_CPP_BUILTINS(); \ 68 } \ 69 while (0) 70 71 /* Define the default MINIX-specific per-CPU hook code. */ 72 #define MINIX_TARGET_CPU_CPP_BUILTINS() do {} while (0) 73 74 /* Look for the include files in the system-defined places. */ 75 76 #define MINIX_GPLUSPLUS_INCLUDE_DIR "/usr/include/g++" 77 78 #define MINIX_GPLUSPLUS_BACKWARD_INCLUDE_DIR "/usr/include/g++/backward" 79 80 /* 81 * XXX figure out a better way to do this 82 */ 83 #define MINIX_GCC_INCLUDE_DIR "/usr/include/gcc-4.5" 84 85 #define MINIX_INCLUDE_DEFAULTS \ 86 { \ 87 { MINIX_GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 1 }, \ 88 { MINIX_GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 1 }, \ 89 { MINIX_GCC_INCLUDE_DIR, "GCC", 0, 0, 1 }, \ 90 { "/usr/include", "GCC", 0, 0, 1 }, \ 91 { 0, 0, 0, 0 } \ 92 } 93 94 /* Provide a CPP_SPEC appropriate for MINIX. We just deal with the GCC 95 option `-posix'. */ 96 #define MINIX_CPP_SPEC "%{posix:-D_POSIX_SOURCE}" 97 98 #define MINIX_CC1_SPEC "" 99 100 /* Pass -cxx-isystem to cc1plus. */ 101 #define MINIX_CC1PLUS_SPEC "%{cxx-isystem}" 102 103 #define MINIX_SUBTARGET_CPP_SPEC "" 104 #define MINIX_SUBTARGET_EXTRA_ASM_SPEC "" 105 #define MINIX_SUBTARGET_ASM_FLOAT_SPEC "" 106 107 #define MINIX_DYNAMIC_LINKER "/usr/libexec/ld.elf_so" 108 109 /* Under MINIX, just like on NetBSD, the normal location of the various 110 * *crt*.o files is the /usr/lib directory. */ 111 #define MINIX_STANDARD_STARTFILE_PREFIX "/usr/lib/" 112 113 #define MINIX_LINK_GCC_C_SEQUENCE_SPEC \ 114 "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}" 115 116 /* Provide a STARTFILE_SPEC appropriate for MINIX. Here we add 117 the magical crtbegin.o file (see crtstuff.c) which provides part 118 of the support for getting C++ file-scope static object constructed 119 before entering `main'. */ 120 #define MINIX_STARTFILE_SPEC \ 121 "%{!shared: \ 122 %{pg:gcrt0%O%s} \ 123 %{!pg: \ 124 %{p:gcrt0%O%s} \ 125 %{!p:%{profile:gcrt0%O%s} \ 126 %{!profile:crt0%O%s}}}} \ 127 %:if-exists(crti%O%s) \ 128 %{static:%:if-exists-else(crtbeginT%O%s crtbegin%O%s)} \ 129 %{!static: \ 130 %{!shared: \ 131 %{!pie:crtbegin%O%s} \ 132 %{pie:crtbeginS%O%s}} \ 133 %{shared:crtbeginS%O%s}}" 134 135 /* Provide an ENDFILE_SPEC appropriate for NetBSD ELF. Here we 136 add crtend.o, which provides part of the support for getting 137 C++ file-scope static objects deconstructed after exiting "main". */ 138 #define MINIX_ENDFILE_SPEC \ 139 "%{!shared: \ 140 %{!pie:crtend%O%s} \ 141 %{pie:crtendS%O%s}} \ 142 %{shared:crtendS%O%s} \ 143 %:if-exists(crtn%O%s)" 144 145 /* Provide a LIB_SPEC appropriate for MINIX. Just select the appropriate 146 libc, depending on whether we're doing profiling or need threads support. 147 (similar to the default, except no -lg, and no -p). */ 148 #define MINIX_LIB_SPEC " \ 149 %{pthread: %eThe -pthread option is only supported on MINIX when gcc \ 150 is built with the --enable-threads configure-time option.} \ 151 %{shared:-lc} \ 152 %{!shared: \ 153 %{!symbolic: \ 154 %{!p: \ 155 %{!pg:-lc}} \ 156 %{p:-lc_p} \ 157 %{pg:-lc_p}}}" 158 159 /* Provide a LINK_SPEC appropriate for MINIX. Here we provide support 160 for the special GCC options -static and -shared, which allow us to 161 link things in one of these three modes by applying the appropriate 162 combinations of options at link-time. We like to support here for 163 as many of the other GNU linker options as possible. But I don't 164 have the time to search for those flags. I am sure how to add 165 support for -soname shared_object_name. H.J. 166 167 I took out %{v:%{!V:-V}}. It is too much :-(. They can use 168 -Wl,-V. 169 170 When the -shared link option is used a final link is not being 171 done. */ 172 #define MINIX_LINK_SPEC " \ 173 -X \ 174 %{p:%nconsider using `-pg' instead of `-p' with gprof(1) } \ 175 %{assert*} %{R*} %{rpath*} \ 176 %{shared:-Bshareable %{h*} %{soname*}} \ 177 %{symbolic:-Bsymbolic} \ 178 %{!shared: \ 179 -dc -dp \ 180 %{!static: \ 181 %{rdynamic:-export-dynamic} \ 182 %{!dynamic-linker:-dynamic-linker %(minix_dynamic_linker) }} \ 183 %{static:-Bstatic}}" 184 185 #define MINIX_TARGET_UNWIND_TABLES_DEFAULT true 186