diff options
author | Jonathan Gray <jsg@openbsd.org> | 2009-09-27 13:20:23 +0000 |
---|---|---|
committer | Gerald Pfeifer <gerald@gcc.gnu.org> | 2009-09-27 13:20:23 +0000 |
commit | aa58f943d88dfcb1d0d7609b62079269e318cf1d (patch) | |
tree | f0527ec4e131c2d0cf30d66b4903df0b659e292a /gcc | |
parent | ffaf6f258a248a8c90267455c0e681ac1fb5345c (diff) | |
download | gcc-aa58f943d88dfcb1d0d7609b62079269e318cf1d.zip gcc-aa58f943d88dfcb1d0d7609b62079269e318cf1d.tar.gz gcc-aa58f943d88dfcb1d0d7609b62079269e318cf1d.tar.bz2 |
config.gcc: Update OpenBSD targets.
* config.gcc: Update OpenBSD targets.
* config/openbsd-stdint.h: New file.
* config/openbsd-libpthread.h: New file.
* config/openbsd.h: Update and break out LIB_SPEC definition.
* config/alpha/openbsd.h: Overhaul to reflect ELF migration.
* config/i386/openbsdelf.h: Correct types.
* config/m68k/openbsd.h: Likewise.
* config/mips/openbsd.h: Likewise.
* config/vax/openbsd.h: Likewise.
From-SVN: r152218
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/config.gcc | 17 | ||||
-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 |
10 files changed, 121 insertions, 93 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cbe3820..b62d1e1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2009-09-19 Jonathan Gray <jsg@openbsd.org> + + * config.gcc: Update OpenBSD targets. + * config/openbsd-stdint.h: New file. + * config/openbsd-libpthread.h: New file. + * config/openbsd.h: Update and break out LIB_SPEC definition. + * config/alpha/openbsd.h: Overhaul to reflect ELF migration. + * config/i386/openbsdelf.h: Correct types. + * config/m68k/openbsd.h: Likewise. + * config/mips/openbsd.h: Likewise. + * config/vax/openbsd.h: Likewise. + 2009-09-27 Eric Botcazou <ebotcazou@adacore.com> * fold-const.c (maybe_lvalue_p): Return false for M(IN|AX)_EXPR. diff --git a/gcc/config.gcc b/gcc/config.gcc index 2e28ea2..89996f5 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -632,11 +632,11 @@ alpha*-*-netbsd*) tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee" ;; alpha*-*-openbsd*) - tm_defines="${tm_defines} OBSD_NO_DYNAMIC_LIBRARIES OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_FUNCTION_SIZE OBSD_HAS_DECLARE_OBJECT" - tm_file="alpha/alpha.h openbsd.h alpha/openbsd.h" + tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_FUNCTION_SIZE OBSD_HAS_DECLARE_OBJECT" + tm_file="alpha/alpha.h alpha/elf.h openbsd.h openbsd-stdint.h alpha/openbsd.h openbsd-libpthread.h" # default x-alpha is only appropriate for dec-osf. target_cpu_default="MASK_GAS" - tmake_file="alpha/t-alpha alpha/t-ieee" + tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee" ;; alpha*-dec-osf[45]*) if test x$stabs = xyes @@ -1120,7 +1120,7 @@ i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123]) ;; i[34567]86-*-openbsd*) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h" - tm_file="${tm_file} openbsd.h i386/openbsdelf.h" + tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h i386/openbsdelf.h" gas=yes gnu_ld=yes ;; @@ -1561,7 +1561,7 @@ m68k*-*-openbsd*) default_cf_cpu=5475 # needed to unconfuse gdb tm_defines="${tm_defines} OBSD_OLD_GAS" - tm_file="${tm_file} openbsd.h m68k/openbsd.h" + tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h m68k/openbsd.h" tmake_file="t-libc-ok t-openbsd m68k/t-openbsd" # we need collect2 until our bug is fixed... use_collect2=yes @@ -1699,7 +1699,7 @@ mips*-*-linux*) # Linux MIPS, either endian. mips*-*-openbsd*) tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_OBJECT OBSD_HAS_CORRECT_SPECS" target_cpu_default="MASK_ABICALLS" - tm_file="mips/mips.h openbsd.h mips/openbsd.h mips/sdb.h" + tm_file="mips/mips.h openbsd.h openbsd-stdint.h openbsd-libpthread.h mips/openbsd.h mips/sdb.h" case ${target} in mips*el-*-openbsd*) tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=0";; @@ -2301,7 +2301,8 @@ sparc-*-netbsdelf*) extra_options="${extra_options} sparc/long-double-switch.opt" ;; sparc64-*-openbsd*) - tm_file="sparc/openbsd1-64.h ${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sp64-elf.h openbsd.h sparc/openbsd64.h" + tm_file="sparc/openbsd1-64.h ${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sp64-elf.h" + tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h sparc/openbsd64.h" extra_options="${extra_options} sparc/little-endian.opt" gas=yes gnu_ld=yes with_cpu=ultrasparc @@ -2511,7 +2512,7 @@ vax-*-netbsd*) use_collect2=yes ;; vax-*-openbsd*) - tm_file="vax/vax.h vax/openbsd1.h openbsd.h vax/openbsd.h" + tm_file="vax/vax.h vax/openbsd1.h openbsd.h openbsd-stdint.h openbsd-pthread.h vax/openbsd.h" use_collect2=yes ;; xstormy16-*-elf) 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" |