1d19d7d58SLionel Sambuc /* Base configuration file for all FreeBSD targets. 2d19d7d58SLionel Sambuc Copyright (C) 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc. 3d19d7d58SLionel Sambuc 4d19d7d58SLionel Sambuc This file is part of GCC. 5d19d7d58SLionel Sambuc 6d19d7d58SLionel Sambuc GCC is free software; you can redistribute it and/or modify 7d19d7d58SLionel Sambuc it under the terms of the GNU General Public License as published by 8d19d7d58SLionel Sambuc the Free Software Foundation; either version 2, or (at your option) 9d19d7d58SLionel Sambuc any later version. 10d19d7d58SLionel Sambuc 11d19d7d58SLionel Sambuc GCC is distributed in the hope that it will be useful, 12d19d7d58SLionel Sambuc but WITHOUT ANY WARRANTY; without even the implied warranty of 13d19d7d58SLionel Sambuc MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14d19d7d58SLionel Sambuc GNU General Public License for more details. 15d19d7d58SLionel Sambuc 16d19d7d58SLionel Sambuc You should have received a copy of the GNU General Public License 17d19d7d58SLionel Sambuc along with GCC; see the file COPYING. If not, write to 18d19d7d58SLionel Sambuc the Free Software Foundation, 51 Franklin Street, Fifth Floor, 19d19d7d58SLionel Sambuc Boston, MA 02110-1301, USA. */ 20d19d7d58SLionel Sambuc 21d19d7d58SLionel Sambuc /* Common MINIX configuration. 22d19d7d58SLionel Sambuc All MINIX architectures should include this file, which will specify 23d19d7d58SLionel Sambuc their commonalities. 24d19d7d58SLionel Sambuc */ 25d19d7d58SLionel Sambuc 26d19d7d58SLionel Sambuc /* In case we need to know. */ 27d19d7d58SLionel Sambuc #define USING_CONFIG_MINIX_SPEC 1 28d19d7d58SLionel Sambuc 29d19d7d58SLionel Sambuc /* This defines which switch letters take arguments. On FreeBSD, most of 30d19d7d58SLionel Sambuc the normal cases (defined in gcc.c) apply, and we also have -h* and 31d19d7d58SLionel Sambuc -z* options (for the linker) (coming from SVR4). 32d19d7d58SLionel Sambuc We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */ 33d19d7d58SLionel Sambuc 34d19d7d58SLionel Sambuc #define MINIX_SWITCH_TAKES_ARG(CHAR) \ 35d19d7d58SLionel Sambuc (DEFAULT_SWITCH_TAKES_ARG (CHAR) \ 36d19d7d58SLionel Sambuc || (CHAR) == 'h' \ 37d19d7d58SLionel Sambuc || (CHAR) == 'z' /* ignored by ld */ \ 38d19d7d58SLionel Sambuc || (CHAR) == 'R') 39d19d7d58SLionel Sambuc 40d19d7d58SLionel Sambuc /* This defines which multi-letter switches take arguments. */ 41d19d7d58SLionel Sambuc 42d19d7d58SLionel Sambuc #define MINIX_WORD_SWITCH_TAKES_ARG(STR) \ 43d19d7d58SLionel Sambuc (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \ 44d19d7d58SLionel Sambuc || !strcmp ((STR), "rpath") || !strcmp ((STR), "rpath-link") \ 45d19d7d58SLionel Sambuc || !strcmp ((STR), "soname") || !strcmp ((STR), "defsym") \ 46d19d7d58SLionel Sambuc || !strcmp ((STR), "assert") || !strcmp ((STR), "dynamic-linker")) 47d19d7d58SLionel Sambuc 48d19d7d58SLionel Sambuc #define MINIX_TARGET_OS_CPP_BUILTINS() \ 49d19d7d58SLionel Sambuc do \ 50d19d7d58SLionel Sambuc { \ 51d19d7d58SLionel Sambuc builtin_define ("__minix"); \ 52d19d7d58SLionel Sambuc MINIX_TARGET_CPU_CPP_BUILTINS(); \ 53d19d7d58SLionel Sambuc } \ 54d19d7d58SLionel Sambuc while (0) 55d19d7d58SLionel Sambuc 56d19d7d58SLionel Sambuc /* Define the default MINIX-specific per-CPU hook code. */ 57d19d7d58SLionel Sambuc #define MINIX_TARGET_CPU_CPP_BUILTINS() do {} while (0) 58d19d7d58SLionel Sambuc 59d19d7d58SLionel Sambuc /* Provide a CPP_SPEC appropriate for MINIX. We just deal with the GCC 60d19d7d58SLionel Sambuc option `-posix', and PIC issues. */ 61d19d7d58SLionel Sambuc 62d19d7d58SLionel Sambuc #define MINIX_CPP_SPEC " \ 63d19d7d58SLionel Sambuc %(cpp_cpu) \ 64d19d7d58SLionel Sambuc %(cpp_arch) \ 65d19d7d58SLionel Sambuc %{posix:-D_POSIX_SOURCE}" 66d19d7d58SLionel Sambuc 67d19d7d58SLionel Sambuc /* Provide a STARTFILE_SPEC appropriate for MINIX. Here we add 68d19d7d58SLionel Sambuc the magical crtbegin.o file (see crtstuff.c) which provides part 69d19d7d58SLionel Sambuc of the support for getting C++ file-scope static object constructed 70d19d7d58SLionel Sambuc before entering `main'. */ 71d19d7d58SLionel Sambuc 72d19d7d58SLionel Sambuc #define MINIX_STARTFILE_SPEC \ 73d19d7d58SLionel Sambuc "%{!shared: \ 74*f14fb602SLionel Sambuc %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} \ 75*f14fb602SLionel Sambuc %{!p:%{profile:gcrt0%O%s} \ 76*f14fb602SLionel Sambuc %{!profile:crt0%O%s}}}} \ 77*f14fb602SLionel Sambuc crti%O%s %{!shared:crtbegin%O%s} %{shared:crtbeginS%O%s}" 78d19d7d58SLionel Sambuc 79d19d7d58SLionel Sambuc /* Provide a ENDFILE_SPEC appropriate for MINIX. Here we tack on 80d19d7d58SLionel Sambuc the magical crtend.o file (see crtstuff.c) which provides part of 81d19d7d58SLionel Sambuc the support for getting C++ file-scope static object constructed 82d19d7d58SLionel Sambuc before entering `main', followed by a normal "finalizer" file, 83d19d7d58SLionel Sambuc `crtn.o'. */ 84d19d7d58SLionel Sambuc 85d19d7d58SLionel Sambuc #define MINIX_ENDFILE_SPEC \ 86d19d7d58SLionel Sambuc "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" 87d19d7d58SLionel Sambuc 88d19d7d58SLionel Sambuc /* Provide a LIB_SPEC appropriate for MINIX. Just select the appropriate 89d19d7d58SLionel Sambuc libc, depending on whether we're doing profiling or need threads support. 90d19d7d58SLionel Sambuc (similar to the default, except no -lg, and no -p). */ 91d19d7d58SLionel Sambuc 92d19d7d58SLionel Sambuc #define MINIX_LIB_SPEC " \ 93d19d7d58SLionel Sambuc %{pthread: %eThe -pthread option is only supported on FreeBSD when gcc \ 94d19d7d58SLionel Sambuc is built with the --enable-threads configure-time option.} \ 95d19d7d58SLionel Sambuc %{!shared: \ 96d19d7d58SLionel Sambuc %{!pg: -lc} \ 97d19d7d58SLionel Sambuc %{pg: -lc_p} \ 98d19d7d58SLionel Sambuc }" 99d19d7d58SLionel Sambuc 100d19d7d58SLionel Sambuc /* Under MINIX, just like on NetBSD, the normal location of the various 101d19d7d58SLionel Sambuc * *crt*.o files is the /usr/lib directory. */ 102d19d7d58SLionel Sambuc 103d19d7d58SLionel Sambuc #undef STANDARD_STARTFILE_PREFIX 104d19d7d58SLionel Sambuc #define STANDARD_STARTFILE_PREFIX "/usr/lib/" 105d19d7d58SLionel Sambuc #undef STANDARD_STARTFILE_PREFIX_1 106d19d7d58SLionel Sambuc #define STANDARD_STARTFILE_PREFIX_1 "/usr/lib/" 107d19d7d58SLionel Sambuc 108d19d7d58SLionel Sambuc #define MINIX_DYNAMIC_LINKER "/libexec/ld-elf.so.1" 109