X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=gcc%2Fconfig%2Ffreebsd-spec.h;h=c726a158c6bfa95efebb5e0396a77bb1f8cea8fb;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=8b01536273bb3b07eea905f62fe1f9fefa1f68fb;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h index 8b015362..c726a158 100644 --- a/gcc/config/freebsd-spec.h +++ b/gcc/config/freebsd-spec.h @@ -1,22 +1,26 @@ /* Base configuration file for all FreeBSD targets. - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007, 2009 Free Software Foundation, Inc. -This file is part of GNU CC. +This file is part of GCC. -GNU CC is free software; you can redistribute it and/or modify +GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. -GNU CC is distributed in the hope that it will be useful, +GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +Under Section 7 of GPL version 3, you are granted additional +permissions described in the GCC Runtime Library Exception, version +3.1, as published by the Free Software Foundation. + +You should have received a copy of the GNU General Public License and +a copy of the GCC Runtime Library Exception along with this program; +see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +. */ /* Common FreeBSD configuration. All FreeBSD architectures should include this file, which will specify @@ -48,43 +52,34 @@ Boston, MA 02111-1307, USA. */ || !strcmp ((STR), "soname") || !strcmp ((STR), "defsym") \ || !strcmp ((STR), "assert") || !strcmp ((STR), "dynamic-linker")) -#if FBSD_MAJOR == 6 -#define FBSD_CPP_PREDEFINES \ - "-D__FreeBSD__=6 -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD" -#endif - -#if FBSD_MAJOR == 5 -#define FBSD_CPP_PREDEFINES \ - "-D__FreeBSD__=5 -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD" -#endif - -#if FBSD_MAJOR == 4 -#define FBSD_CPP_PREDEFINES \ - "-D__FreeBSD__=4 -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD" -#endif - -#if FBSD_MAJOR == 3 -#define FBSD_CPP_PREDEFINES \ - "-D__FreeBSD__=3 -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD" -#endif - -#ifndef FBSD_CPP_PREDEFINES -#define FBSD_CPP_PREDEFINES \ - "-D__FreeBSD__ -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD" -#endif +#define FBSD_TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define_with_int_value ("__FreeBSD__", FBSD_MAJOR); \ + builtin_define_std ("unix"); \ + builtin_define ("__KPRINTF_ATTRIBUTE__"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=bsd"); \ + builtin_assert ("system=FreeBSD"); \ + FBSD_TARGET_CPU_CPP_BUILTINS(); \ + } \ + while (0) + +/* Define the default FreeBSD-specific per-CPU hook code. */ +#define FBSD_TARGET_CPU_CPP_BUILTINS() do {} while (0) /* Provide a CPP_SPEC appropriate for FreeBSD. We just deal with the GCC option `-posix', and PIC issues. */ #define FBSD_CPP_SPEC " \ %(cpp_cpu) \ - %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} \ + %(cpp_arch) \ %{posix:-D_POSIX_SOURCE}" /* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add the magical crtbegin.o file (see crtstuff.c) which provides part of the support for getting C++ file-scope static object constructed - before entering `main'. */ + before entering `main'. */ #define FBSD_STARTFILE_SPEC \ "%{!shared: \ @@ -107,18 +102,18 @@ Boston, MA 02111-1307, USA. */ 500016, select the appropriate libc, depending on whether we're doing profiling or need threads support. At __FreeBSD_version 500016 and later, when threads support is requested include both - -lc and -lc_r instead of only -lc_r. To make matters interesting, - we can't actually use __FreeBSD_version provided by - directly since it breaks cross-compiling. As a final twist, make - it a hard error if -pthread is provided on the command line and gcc - was configured with --disable-threads (this will help avoid bug - reports from users complaining about threading when they + -lc and the threading lib instead of only -lc_r. To make matters + interesting, we can't actually use __FreeBSD_version provided by + directly since it breaks cross-compiling. As a final + twist, make it a hard error if -pthread is provided on the command + line and gcc was configured with --disable-threads (this will help + avoid bug reports from users complaining about threading when they misconfigured the gcc bootstrap but are later consulting FreeBSD manual pages that refer to the mythical -pthread option). */ /* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate libc, depending on whether we're doing profiling or need threads support. - (simular to the default, except no -lg, and no -p). */ + (similar to the default, except no -lg, and no -p). */ #ifdef FBSD_NO_THREADS #define FBSD_LIB_SPEC " \ @@ -129,13 +124,7 @@ is built with the --enable-threads configure-time option.} \ %{pg: -lc_p} \ }" #else -#if FBSD_MAJOR >= 5 -#define FBSD_LIB_SPEC " \ - %{!shared: \ - %{!pg: %{pthread:-lc_r} -lc} \ - %{pg: %{pthread:-lc_r_p} -lc_p} \ - }" -#else +#if FBSD_MAJOR < 5 #define FBSD_LIB_SPEC " \ %{!shared: \ %{!pg: \ @@ -145,5 +134,17 @@ is built with the --enable-threads configure-time option.} \ %{!pthread:-lc_p} \ %{pthread:-lc_r_p}} \ }" +#else +#define FBSD_LIB_SPEC " \ + %{!shared: \ + %{!pg: %{pthread:-lpthread} -lc} \ + %{pg: %{pthread:-lpthread_p} -lc_p} \ + }" +#endif #endif + +#if FBSD_MAJOR < 6 +#define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1" +#else +#define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1" #endif