- sync with in-tree gcc3

- add some missing header files
This commit is contained in:
sturm 2004-02-10 20:14:25 +00:00
parent 09c1a63b80
commit 85a5b3222c
6 changed files with 198 additions and 93 deletions

View File

@ -1,6 +1,32 @@
--- gcc/config/openbsd.h.orig 2002-11-26 05:54:46.000000000 +0100
+++ gcc/config/openbsd.h 2003-11-11 15:35:32.000000000 +0100
@@ -73,8 +73,35 @@ Boston, MA 02111-1307, USA. */
--- gcc/config/openbsd.h.orig 2002-11-25 21:54:46.000000000 -0700
+++ gcc/config/openbsd.h 2004-02-08 04:24:34.000000000 -0700
@@ -52,20 +52,20 @@ Boston, MA 02111-1307, USA. */
#ifdef OPENBSD_NATIVE
-#undef GCC_INCLUDE_DIR
-#define GCC_INCLUDE_DIR "/usr/include"
-
/* The compiler is configured with ONLY the gcc/g++ standard headers. */
#undef INCLUDE_DEFAULTS
#define INCLUDE_DEFAULTS \
{ \
{ GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 }, \
- { GCC_INCLUDE_DIR, "GCC", 0, 0 }, \
+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1 },\
+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1 }, \
+ { STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT, 0, 0 }, \
{ 0, 0, 0, 0 } \
}
/* Under OpenBSD, the normal location of the various *crt*.o files is the
/usr/lib directory. */
+#undef STANDARD_STARTFILE_PREFIX
-#define STANDARD_STARTFILE_PREFIX "/usr/lib/"
+#define STANDARD_STARTFILE_PREFIX "/usr/local/lib/"
#endif
@@ -73,8 +73,39 @@ Boston, MA 02111-1307, USA. */
/* Controlling the compilation driver. */
@ -9,7 +35,10 @@
+ do \
+ { \
+ builtin_define ("__OpenBSD__"); \
+ builtin_define ("__unix__"); \
+ builtin_define ("__ANSI_COMPAT"); \
+ builtin_assert ("system=unix"); \
+ builtin_assert ("system=bsd"); \
+ builtin_assert ("system=OpenBSD"); \
+ } \
+ while (0)
@ -28,6 +57,7 @@
+ do \
+ { \
+ builtin_define ("_LP64"); \
+ builtin_define ("__LP64__"); \
+ } \
+ while (0)
+
@ -37,7 +67,7 @@
since all code must be compiled with -pthread to work.
This two-stage defines makes it easy to pick that for targets that
have subspecs. */
@@ -84,10 +111,9 @@ Boston, MA 02111-1307, USA. */
@@ -84,10 +115,9 @@ Boston, MA 02111-1307, USA. */
#define OBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
#endif
@ -51,8 +81,3 @@
#ifndef OBSD_HAS_CORRECT_SPECS
@@ -289,3 +315,4 @@ do { \
as this depends on a few other details as well... */
#define HANDLE_SYSV_PRAGMA 1
+#define LIBSTDCXX "-lestdc++"

View File

@ -1,7 +1,18 @@
$OpenBSD: patch-gcc_config_sparc_openbsd64_h,v 1.11 2004/01/31 15:23:58 espie Exp $
--- gcc/config/sparc/openbsd64.h.orig 2002-05-30 22:35:58.000000000 +0200
+++ gcc/config/sparc/openbsd64.h 2003-11-12 22:11:26.000000000 +0100
@@ -31,8 +31,239 @@ Boston, MA 02111-1307, USA. */
$OpenBSD: patch-gcc_config_sparc_openbsd64_h,v 1.12 2004/02/10 20:14:25 sturm Exp $
--- gcc/config/sparc/openbsd64.h.orig 2002-05-30 14:35:58.000000000 -0600
+++ gcc/config/sparc/openbsd64.h 2004-02-08 02:14:44.000000000 -0700
@@ -21,18 +21,28 @@ Boston, MA 02111-1307, USA. */
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (sparc64 OpenBSD ELF)")
-/* XXX - do we really want HARD_QUAD? */
#undef TARGET_DEFAULT
#define TARGET_DEFAULT \
-(MASK_V9 + MASK_PTR64 + MASK_64BIT + MASK_HARD_QUAD \
+(MASK_V9 + MASK_PTR64 + MASK_64BIT \
+ MASK_APP_REGS + MASK_FPU + MASK_STACK_BIAS + MASK_LONG_DOUBLE_128)
#undef SPARC_DEFAULT_CMODEL
#define SPARC_DEFAULT_CMODEL CM_MEDMID
/* Run-time target specifications. */
@ -14,34 +25,19 @@ $OpenBSD: patch-gcc_config_sparc_openbsd64_h,v 1.11 2004/01/31 15:23:58 espie Ex
+ OPENBSD_OS_CPP_BUILTINS_LP64(); \
+ builtin_define ("__sparc64__"); \
+ builtin_define ("__sparc_v9__"); \
+ builtin_define ("__sparcv9__"); \
+ builtin_define ("__arch64__"); \
+ builtin_define ("__sparc"); \
+ builtin_define ("__sparc__"); \
+ } \
+ while (0)
+
+#undef CPP_SUBTARGET_SPEC
+#define CPP_SUBTARGET_SPEC ""
+
+#undef MD_EXEC_PREFIX
+#undef MD_STARTFILE_PREFIX
+
+#undef ASM_SPEC
+#define ASM_SPEC "\
+%{v:-V} -s %{fpic:-K PIC} %{fPIC:-K PIC} \
+%{mlittle-endian:-EL} \
+%(asm_cpu) %(asm_arch) \
+"
+
+/* Layout of source language data types. */
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+#undef LONG_DOUBLE_TYPE_SIZE
+#define LONG_DOUBLE_TYPE_SIZE 128
+
#undef CPP_SUBTARGET_SPEC
#define CPP_SUBTARGET_SPEC ""
@@ -57,6 +67,14 @@ Boston, MA 02111-1307, USA. */
#undef LONG_DOUBLE_TYPE_SIZE
#define LONG_DOUBLE_TYPE_SIZE 128
+#undef WINT_TYPE
+#define WINT_TYPE "long int"
+
@ -50,22 +46,13 @@ $OpenBSD: patch-gcc_config_sparc_openbsd64_h,v 1.11 2004/01/31 15:23:58 espie Ex
+
+#define HANDLE_PRAGMA_REDEFINE_EXTNAME 1
+
+#undef LINK_SPEC
+#define LINK_SPEC \
+ "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \
+ %{shared:-shared} %{R*} \
+ %{static:-Bstatic} \
+ %{!static:-Bdynamic} \
+ %{assert*} \
+ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}"
+
+/* As an elf system, we need crtbegin/crtend stuff. */
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC "\
+ %{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} %{!p:crt0%O%s}} \
+ crtbegin%O%s} %{shared:crtbeginS%O%s}"
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
#undef LINK_SPEC
#define LINK_SPEC \
"%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \
@@ -73,3 +91,146 @@ Boston, MA 02111-1307, USA. */
crtbegin%O%s} %{shared:crtbeginS%O%s}"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
+
+#undef ASM_CPU_DEFAULT_SPEC
+#define ASM_CPU_DEFAULT_SPEC "-xarch=v8plusa"
@ -209,37 +196,3 @@ $OpenBSD: patch-gcc_config_sparc_openbsd64_h,v 1.11 2004/01/31 15:23:58 espie Ex
+ perror ("mprotect of trampoline code"); \
+ } \
+}
+/* Configuration file for sparc64 OpenBSD target.
+ Copyright (C) 1999 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 2, 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 COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (sparc64 OpenBSD ELF)")
+
+/* XXX - do we really want HARD_QUAD? */
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT \
+(MASK_V9 + MASK_PTR64 + MASK_64BIT + MASK_HARD_QUAD \
+ + MASK_APP_REGS + MASK_FPU + MASK_STACK_BIAS + MASK_LONG_DOUBLE_128)
+
+#undef SPARC_DEFAULT_CMODEL
+#define SPARC_DEFAULT_CMODEL CM_MEDMID
#undef CPP_SUBTARGET_SPEC
#define CPP_SUBTARGET_SPEC ""

View File

@ -0,0 +1,74 @@
$OpenBSD: patch-gcc_cp_g++spec_c,v 1.1 2004/02/10 20:14:25 sturm Exp $
--- gcc/cp/g++spec.c.orig 2003-03-10 17:59:25.000000000 -0700
+++ gcc/cp/g++spec.c 2004-02-08 07:47:42.000000000 -0700
@@ -37,10 +37,16 @@ Boston, MA 02111-1307, USA. */
#endif
#ifndef LIBSTDCXX
-#define LIBSTDCXX "-lstdc++"
+#define LIBSTDCXX "-lestdc++"
#endif
#ifndef LIBSTDCXX_PROFILE
-#define LIBSTDCXX_PROFILE "-lstdc++"
+#define LIBSTDCXX_PROFILE "-lestdc++"
+#endif
+#ifndef LIBSUPCXX
+#define LIBSUPCXX "-lsupc++"
+#endif
+#ifndef LIBSUPCXX_PROFILE
+#define LIBSUPCXX_PROFILE "-lsupc++"
#endif
void
@@ -61,6 +67,10 @@ lang_specific_driver (in_argc, in_argv,
link in libstdc++. */
int library = 1;
+ /* This will be 1 if we encounter a situation where we should link
+ libsupc++. */
+ int libsupcxx = 0;
+
/* The number of arguments being added to what's in argv, other than
libraries. We use this to track the number of times we've inserted
-xc++/-xnone. */
@@ -128,10 +138,17 @@ lang_specific_driver (in_argc, in_argv,
if (argv[i][0] == '-')
{
- if (library != 0 && (strcmp (argv[i], "-nostdlib") == 0
+ if ((strcmp (argv[i], "-nostdlib") == 0
|| strcmp (argv[i], "-nodefaultlibs") == 0))
{
library = 0;
+ libsupcxx = -1;
+ }
+ else if (strcmp (argv[i], "-shared") == 0)
+ {
+ library = 0;
+ if (libsupcxx == 0)
+ libsupcxx = 1;
}
else if (strcmp (argv[i], "-lm") == 0
|| strcmp (argv[i], "-lmath") == 0
@@ -146,6 +163,8 @@ lang_specific_driver (in_argc, in_argv,
}
else if (strcmp (argv[i], "-lc") == 0)
args[i] |= WITHLIBC;
+ else if (strcmp (argv[i], "-lestdc++") == 0)
+ libsupcxx = -1;
else if (strcmp (argv[i], "-pg") == 0 || strcmp (argv[i], "-p") == 0)
saw_profile_flag++;
else if (strcmp (argv[i], "-v") == 0)
@@ -269,6 +288,12 @@ lang_specific_driver (in_argc, in_argv,
j++;
}
+ /* Add -lsupc++ for shared. */
+ if (libsupcxx == 1)
+ {
+ arglist[j++] = saw_profile_flag ? LIBSUPCXX_PROFILE : LIBSUPCXX;
+ added_libraries++;
+ }
/* Add `-lstdc++' if we haven't already done so. */
if (library)
{

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-gcc_libgcc2_c,v 1.1 2004/02/10 20:14:25 sturm Exp $
--- gcc/libgcc2.c.orig 2004-02-08 02:20:49.000000000 -0700
+++ gcc/libgcc2.c 2004-02-08 02:24:13.000000000 -0700
@@ -1740,6 +1740,9 @@ mprotect (char *addr, int len, int prot)
return -1;
}
+#else
+#include <sys/types.h>
+#include <sys/mman.h>
#endif /* WINNT && ! __CYGWIN__ && ! _UWIN */
#ifdef TRANSFER_FROM_TRAMPOLINE

View File

@ -1,7 +1,19 @@
$OpenBSD: patch-gcc_toplev_c,v 1.6 2004/01/31 15:23:58 espie Exp $
--- gcc/toplev.c.orig 2003-10-09 22:53:35.000000000 +0200
+++ gcc/toplev.c 2003-11-10 20:32:18.000000000 +0100
@@ -904,6 +904,9 @@ int align_functions_log;
$OpenBSD: patch-gcc_toplev_c,v 1.7 2004/02/10 20:14:25 sturm Exp $
--- gcc/toplev.c.orig 2003-10-09 14:53:35.000000000 -0600
+++ gcc/toplev.c 2004-02-08 01:47:51.000000000 -0700
@@ -852,7 +852,11 @@ int flag_instrument_function_entry_exit
On SVR4 targets, it also controls whether or not to emit a
string identifying the compiler. */
+#ifdef OPENBSD_NATIVE
+int flag_no_ident = 1;
+#else
int flag_no_ident = 0;
+#endif
/* This will perform a peephole pass before sched2. */
int flag_peephole2 = 0;
@@ -904,6 +908,9 @@ int align_functions_log;
minimum function alignment. Zero means no alignment is forced. */
int force_align_functions_log;
@ -11,7 +23,7 @@ $OpenBSD: patch-gcc_toplev_c,v 1.6 2004/01/31 15:23:58 espie Exp $
/* Table of supported debugging formats. */
static const struct
{
@@ -1186,6 +1189,8 @@ static const lang_independent_options f_
@@ -1186,6 +1193,8 @@ static const lang_independent_options f_
N_("Report on permanent memory allocation at end of run") },
{ "trapv", &flag_trapv, 1,
N_("Trap for signed overflow in addition / subtraction / multiplication") },
@ -20,7 +32,7 @@ $OpenBSD: patch-gcc_toplev_c,v 1.6 2004/01/31 15:23:58 espie Exp $
{ "new-ra", &flag_new_regalloc, 1,
N_("Use graph coloring register allocation.") },
};
@@ -1362,6 +1367,9 @@ documented_lang_options[] =
@@ -1362,6 +1371,9 @@ documented_lang_options[] =
{ "-Wwrite-strings",
N_("Mark strings as 'const char *'") },
{ "-Wno-write-strings", "" },
@ -30,3 +42,19 @@ $OpenBSD: patch-gcc_toplev_c,v 1.6 2004/01/31 15:23:58 espie Exp $
#define DEFINE_LANG_NAME(NAME) { NULL, NAME },
@@ -4898,7 +4910,6 @@ parse_options_and_default_flags (argc, a
flag_schedule_insns_after_reload = 1;
#endif
flag_regmove = 1;
- flag_strict_aliasing = 1;
flag_delete_null_pointer_checks = 1;
flag_reorder_blocks = 1;
flag_reorder_functions = 1;
@@ -4906,6 +4917,7 @@ parse_options_and_default_flags (argc, a
if (optimize >= 3)
{
+ flag_strict_aliasing = 1;
flag_inline_functions = 1;
flag_rename_registers = 1;
}

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-libiberty_choose-temp_c,v 1.1 2004/02/10 20:14:25 sturm Exp $
--- libiberty/choose-temp.c.orig 2004-02-08 02:18:04.000000000 -0700
+++ libiberty/choose-temp.c 2004-02-08 02:18:48.000000000 -0700
@@ -29,6 +29,8 @@ Boston, MA 02111-1307, USA. */
#include <string.h>
#endif
+#include <unistd.h> /* mktemp */
+
#include "libiberty.h"
extern char *choose_tmpdir PARAMS ((void));