diff options
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/alpha/openbsd.h | 57 | ||||
-rw-r--r-- | gcc/config/i386/openbsdelf.h | 7 | ||||
-rw-r--r-- | gcc/config/m68k/openbsd.h | 7 | ||||
-rw-r--r-- | gcc/config/mips/openbsd.h | 7 | ||||
-rw-r--r-- | gcc/config/openbsd-libpthread.h | 22 | ||||
-rw-r--r-- | gcc/config/openbsd-stdint.h | 31 | ||||
-rw-r--r-- | gcc/config/openbsd.h | 47 | ||||
-rw-r--r-- | gcc/config/vax/openbsd.h | 7 |
8 files changed, 100 insertions, 85 deletions
diff --git a/gcc/config/alpha/openbsd.h b/gcc/config/alpha/openbsd.h index 31b074f..8efbaf5 100644 --- a/gcc/config/alpha/openbsd.h +++ b/gcc/config/alpha/openbsd.h @@ -17,23 +17,13 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ -/* We settle for little endian for now. */ -#define TARGET_ENDIAN_DEFAULT 0 - /* Controlling the compilation driver. */ -/* alpha needs __start. */ -#undef LINK_SPEC -#define LINK_SPEC \ - "%{!nostdlib:%{!r*:%{!e*:-e __start}}} -dc -dp %{assert*}" - /* run-time target specifications */ #define TARGET_OS_CPP_BUILTINS() \ do { \ - builtin_define ("__OpenBSD__"); \ - builtin_define ("__ANSI_COMPAT"); \ - builtin_define ("__unix__"); \ - builtin_assert ("system=unix"); \ + OPENBSD_OS_CPP_BUILTINS_ELF(); \ + OPENBSD_OS_CPP_BUILTINS_LP64(); \ } while (0) /* Layout of source language data types. */ @@ -52,47 +42,4 @@ along with GCC; see the file COPYING3. If not see #define WCHAR_TYPE_SIZE 32 -#undef PREFERRED_DEBUGGING_TYPE -#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG - #define LOCAL_LABEL_PREFIX "." - -/* We don't have an init section yet. */ -#undef HAS_INIT_SECTION - -/* collect2 support (assembler format: macros for initialization). */ - -/* Don't tell collect2 we use COFF as we don't have (yet ?) a dynamic ld - library with the proper functions to handle this -> collect2 will - default to using nm. */ -#undef OBJECT_FORMAT_COFF -#undef EXTENDED_COFF - -/* Assembler format: exception region output. */ - -/* All configurations that don't use elf must be explicit about not using - dwarf unwind information. */ -#ifdef INCOMING_RETURN_ADDR_RTX -#undef DWARF2_UNWIND_INFO -#define DWARF2_UNWIND_INFO 0 -#endif - -/* Assembler format: label output. */ - -/* alpha ecoff supports only weak aliases. */ -#undef ASM_WEAKEN_LABEL -#define ASM_WEAKEN_LABEL(FILE,NAME) ASM_OUTPUT_WEAK_ALIAS (FILE,NAME,0) - -#define ASM_OUTPUT_WEAK_ALIAS(FILE,NAME,VALUE) \ - do { \ - fputs ("\t.weakext\t", FILE); \ - assemble_name (FILE, NAME); \ - if (VALUE) \ - { \ - fputs (" , ", FILE); \ - assemble_name (FILE, VALUE); \ - } \ - fputc ('\n', FILE); \ - } while (0) - - diff --git a/gcc/config/i386/openbsdelf.h b/gcc/config/i386/openbsdelf.h index c76d26e..d372835 100644 --- a/gcc/config/i386/openbsdelf.h +++ b/gcc/config/i386/openbsdelf.h @@ -55,10 +55,10 @@ along with GCC; see the file COPYING3. If not see /* This must agree with <machine/ansi.h> */ #undef SIZE_TYPE -#define SIZE_TYPE "unsigned int" +#define SIZE_TYPE "long unsigned int" #undef PTRDIFF_TYPE -#define PTRDIFF_TYPE "int" +#define PTRDIFF_TYPE "long int" #undef WCHAR_TYPE #define WCHAR_TYPE "int" @@ -66,6 +66,9 @@ along with GCC; see the file COPYING3. If not see #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE BITS_PER_WORD +#undef WINT_TYPE +#define WINT_TYPE "int" + /* Assembler format: overall framework. */ #undef ASM_APP_ON diff --git a/gcc/config/m68k/openbsd.h b/gcc/config/m68k/openbsd.h index 30bfc20..b2ff062 100644 --- a/gcc/config/m68k/openbsd.h +++ b/gcc/config/m68k/openbsd.h @@ -42,10 +42,10 @@ along with GCC; see the file COPYING3. If not see /* This must agree with <machine/ansi.h> */ #undef SIZE_TYPE -#define SIZE_TYPE "unsigned int" +#define SIZE_TYPE "long unsigned int" #undef PTRDIFF_TYPE -#define PTRDIFF_TYPE "int" +#define PTRDIFF_TYPE "long int" #undef WCHAR_TYPE #define WCHAR_TYPE "int" @@ -53,6 +53,9 @@ along with GCC; see the file COPYING3. If not see #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE 32 +#undef WINT_TYPE +#define WINT_TYPE "int" + /* Storage layout. */ /* Every structure or union's size must be a multiple of 2 bytes. */ diff --git a/gcc/config/mips/openbsd.h b/gcc/config/mips/openbsd.h index d561c65..2cf7fbc 100644 --- a/gcc/config/mips/openbsd.h +++ b/gcc/config/mips/openbsd.h @@ -57,10 +57,10 @@ along with GCC; see the file COPYING3. If not see /* This must agree with <machine/ansi.h>. */ #undef SIZE_TYPE -#define SIZE_TYPE "unsigned int" +#define SIZE_TYPE "long unsigned int" #undef PTRDIFF_TYPE -#define PTRDIFF_TYPE "int" +#define PTRDIFF_TYPE "long int" #undef WCHAR_TYPE #define WCHAR_TYPE "int" @@ -68,6 +68,9 @@ along with GCC; see the file COPYING3. If not see #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE 32 +#undef WINT_TYPE +#define WINT_TYPE "int" + /* Controlling the compilation driver. */ /* LINK_SPEC appropriate for OpenBSD: support for GCC options diff --git a/gcc/config/openbsd-libpthread.h b/gcc/config/openbsd-libpthread.h new file mode 100644 index 0000000..104e645 --- /dev/null +++ b/gcc/config/openbsd-libpthread.h @@ -0,0 +1,22 @@ +/* LIB_SPEC appropriate for OpenBSD. Include -lpthread if -pthread is + specified on the command line. */ +/* Copyright (C) 2004 Free Software Foundation, Inc. + + This file is part of GCC. + + 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 3, or (at your + option) any later version. + + 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 GCC; see the file COPYING3. If not see + <http://www.gnu.org/licenses/>. */ + +#define OBSD_LIB_SPEC "%{!shared:%{pthread:-lpthread} -lc}" + diff --git a/gcc/config/openbsd-stdint.h b/gcc/config/openbsd-stdint.h new file mode 100644 index 0000000..de36455 --- /dev/null +++ b/gcc/config/openbsd-stdint.h @@ -0,0 +1,31 @@ +#define SIG_ATOMIC_TYPE "int" + +#define INT8_TYPE "signed char" +#define INT16_TYPE "short int" +#define INT32_TYPE "int" +#define INT64_TYPE "long long int" +#define UINT8_TYPE "unsigned char" +#define UINT16_TYPE "unsigned short int" +#define UINT32_TYPE "unsigned int" +#define UINT64_TYPE "unsigned long long int" + +#define INT_LEAST8_TYPE "signed char" +#define INT_LEAST16_TYPE "short int" +#define INT_LEAST32_TYPE "int" +#define INT_LEAST64_TYPE "long long int" +#define UINT_LEAST8_TYPE "unsigned char" +#define UINT_LEAST16_TYPE "unsigned short int" +#define UINT_LEAST32_TYPE "unsigned int" +#define UINT_LEAST64_TYPE "unsigned long long int" + +#define INT_FAST8_TYPE "int" +#define INT_FAST16_TYPE "int" +#define INT_FAST32_TYPE "int" +#define INT_FAST64_TYPE "long long int" +#define UINT_FAST8_TYPE "unsigned int" +#define UINT_FAST16_TYPE "unsigned int" +#define UINT_FAST32_TYPE "unsigned int" +#define UINT_FAST64_TYPE "unsigned long long int" + +#define INTPTR_TYPE "long int" +#define UINTPTR_TYPE "unsigned long int" diff --git a/gcc/config/openbsd.h b/gcc/config/openbsd.h index cbcff23..59728c3 100644 --- a/gcc/config/openbsd.h +++ b/gcc/config/openbsd.h @@ -84,6 +84,24 @@ along with GCC; see the file COPYING3. If not see } \ while (0) +/* TARGET_OS_CPP_BUILTINS() common to all OpenBSD ELF targets. */ +#define OPENBSD_OS_CPP_BUILTINS_ELF() \ + do \ + { \ + OPENBSD_OS_CPP_BUILTINS(); \ + builtin_define ("__ELF__"); \ + } \ +while (0) + +/* TARGET_OS_CPP_BUILTINS() common to all LP64 OpenBSD targets. */ +#define OPENBSD_OS_CPP_BUILTINS_LP64() \ + do \ + { \ + builtin_define ("_LP64"); \ + builtin_define ("__LP64__"); \ + } \ + while (0) + /* CPP_SPEC appropriate for OpenBSD. We deal with -posix and -pthread. XXX the way threads are handled currently is not very satisfying, since all code must be compiled with -pthread to work. @@ -95,15 +113,8 @@ along with GCC; see the file COPYING3. If not see #define OBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}" #endif -/* LIB_SPEC appropriate for OpenBSD. */ -#ifdef HAS_LIBC_R -/* -lc(_r)?(_p)?, select _r for threads, and _p for p or pg. */ -# define OBSD_LIB_SPEC "%{!shared:-lc%{pthread:_r}%{p:_p}%{!p:%{pg:_p}}}" -#else -/* Include -lpthread if -pthread is specified on the command line. */ -# define OBSD_LIB_SPEC "%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}" -#endif - +#undef LIB_SPEC +#define LIB_SPEC OBSD_LIB_SPEC #ifndef OBSD_HAS_CORRECT_SPECS @@ -128,15 +139,11 @@ along with GCC; see the file COPYING3. If not see /* Since we use gas, stdin -> - is a good idea. */ #define AS_NEEDS_DASH_FOR_PIPED_INPUT -/* LINK_SPEC appropriate for OpenBSD. Support for GCC options - -static, -assert, and -nostdlib. */ -#undef LINK_SPEC -#ifdef OBSD_NO_DYNAMIC_LIBRARIES -#define LINK_SPEC \ - "%{g:%{!nostdlib:-L/usr/lib/debug}} %{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{assert*}" -#else -#define LINK_SPEC \ - "%{g:%{!nostdlib:-L/usr/lib/debug}} %{!shared:%{!nostdlib:%{!r*:%{!e*:-e start}}}} %{shared:-Bshareable -x} -dc -dp %{R*} %{static:-Bstatic} %{assert*}" +#undef LIB_SPEC +#define LIB_SPEC OBSD_LIB_SPEC + +#if defined(HAVE_LD_EH_FRAME_HDR) +#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " #endif #undef LIB_SPEC @@ -281,10 +288,6 @@ do { \ /* Storage layout. */ -/* Otherwise, since we support weak, gthr.h erroneously tries to use - #pragma weak. */ -#define GTHREAD_USE_WEAK 0 - /* bug work around: we don't want to support #pragma weak, but the current code layout needs HANDLE_PRAGMA_WEAK asserted for __attribute((weak)) to work. On the other hand, we don't define HANDLE_PRAGMA_WEAK directly, diff --git a/gcc/config/vax/openbsd.h b/gcc/config/vax/openbsd.h index cc35740..cdff4ca 100644 --- a/gcc/config/vax/openbsd.h +++ b/gcc/config/vax/openbsd.h @@ -33,13 +33,16 @@ along with GCC; see the file COPYING3. If not see /* This must agree with <machine/ansi.h> */ #undef SIZE_TYPE -#define SIZE_TYPE "unsigned int" +#define SIZE_TYPE "long unsigned int" #undef PTRDIFF_TYPE -#define PTRDIFF_TYPE "int" +#define PTRDIFF_TYPE "long int" #undef WCHAR_TYPE #define WCHAR_TYPE "int" #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE 32 + +#undef WINT_TYPE +#define WINT_TYPE "int" |