forgot a few patches... grrr.

This commit is contained in:
espie 2004-01-31 15:23:58 +00:00
parent a5f864f628
commit 9f545ad6b6
38 changed files with 1530 additions and 3 deletions

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-configure_in,v 1.6 2004/01/31 15:23:58 espie Exp $
--- configure.in.orig 2003-11-11 13:38:45.000000000 +0100
+++ configure.in 2003-11-11 13:39:21.000000000 +0100
@@ -638,6 +638,8 @@ case "${target}" in
*-*-lynxos*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
;;
+ *-*-openbsd*)
+ ;;
*-*-*)
noconfigdirs="$noconfigdirs ${libgcj}"
;;

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-gcc_ada_adaint_c,v 1.3 2004/01/31 15:23:58 espie Exp $
--- gcc/ada/adaint.c.orig 2002-11-18 15:39:46.000000000 +0100
+++ gcc/ada/adaint.c 2003-11-10 20:03:52.000000000 +0100
@@ -632,7 +632,7 @@ __gnat_open_new_temp (path, fmode)
strcpy (path, "GNAT-XXXXXX");
-#if defined (linux) && !defined (__vxworks)
+#if (defined (linux) && !defined (__vxworks)) || defined(__OpenBSD__)
return mkstemp (path);
#elif defined (__Lynx__)
mktemp (path);

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-gcc_ada_gnatchop_adb,v 1.3 2004/01/31 15:23:58 espie Exp $
--- gcc/ada/gnatchop.adb.orig 2002-03-14 11:59:24.000000000 +0100
+++ gcc/ada/gnatchop.adb 2003-11-10 19:19:33.000000000 +0100
@@ -48,7 +48,7 @@ procedure Gnatchop is
Config_File_Name : constant String_Access := new String'("gnat.adc");
-- The name of the file holding the GNAT configuration pragmas
- Gcc : String_Access := new String'("gcc");
+ Gcc : String_Access := new String'("egcc");
-- May be modified by switch --GCC=
Gcc_Set : Boolean := False;

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-gcc_ada_gnatlink_adb,v 1.3 2004/01/31 15:23:58 espie Exp $
--- gcc/ada/gnatlink.adb.orig 2002-10-23 09:33:25.000000000 +0200
+++ gcc/ada/gnatlink.adb 2003-11-10 20:03:52.000000000 +0100
@@ -121,7 +121,7 @@ procedure Gnatlink is
subtype chars_ptr is System.Address;
- Gcc : String_Access := Program_Name ("gcc");
+ Gcc : String_Access := Program_Name ("egcc");
Read_Mode : constant String := "r" & ASCII.Nul;

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-gcc_ada_make_adb,v 1.3 2004/01/31 15:23:58 espie Exp $
--- gcc/ada/make.adb.orig 2002-10-23 09:33:26.000000000 +0200
+++ gcc/ada/make.adb 2003-11-10 20:03:52.000000000 +0100
@@ -407,7 +407,7 @@ package body Make is
-- Compiler, Binder & Linker Data and Subprograms --
----------------------------------------------------
- Gcc : String_Access := Program_Name ("gcc");
+ Gcc : String_Access := Program_Name ("egcc");
Gnatbind : String_Access := Program_Name ("gnatbind");
Gnatlink : String_Access := Program_Name ("gnatlink");
-- Default compiler, binder, linker programs

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-gcc_ada_mlib-utl_adb,v 1.3 2004/01/31 15:23:58 espie Exp $
--- gcc/ada/mlib-utl.adb.orig 2002-03-14 11:59:31.000000000 +0100
+++ gcc/ada/mlib-utl.adb 2003-11-10 20:03:52.000000000 +0100
@@ -41,7 +41,7 @@ package body MLib.Utl is
Initialized : Boolean := False;
- Gcc_Name : constant String := "gcc";
+ Gcc_Name : constant String := "egcc";
Gcc_Exec : OS_Lib.String_Access;
Ar_Name : constant String := "ar";

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-gcc_c-common_c,v 1.1 2004/01/31 14:58:03 espie Exp $ $OpenBSD: patch-gcc_c-common_c,v 1.2 2004/01/31 15:23:58 espie Exp $
--- gcc/c-common.c.orig 2003-11-11 12:54:41.000000000 +0100 --- gcc/c-common.c.orig 2003-11-11 12:54:41.000000000 +0100
+++ gcc/c-common.c 2003-11-11 12:56:12.000000000 +0100 +++ gcc/c-common.c 2003-11-11 12:56:12.000000000 +0100
@@ -765,6 +765,8 @@ static tree handle_deprecated_attribute @@ -765,6 +765,8 @@ static tree handle_deprecated_attribute

View File

@ -0,0 +1,93 @@
$OpenBSD: patch-gcc_c-format_c,v 1.3 2004/01/31 15:23:58 espie Exp $
--- gcc/c-format.c.orig 2002-12-01 18:51:44.000000000 +0100
+++ gcc/c-format.c 2003-11-11 19:49:08.000000000 +0100
@@ -54,7 +54,7 @@ set_Wformat (setting)
/* This must be in the same order as format_types, with format_type_error
last. */
-enum format_type { printf_format_type, scanf_format_type,
+enum format_type { printf_format_type, kprintf_format_type, syslog_format_type, scanf_format_type,
strftime_format_type, strfmon_format_type,
format_type_error };
@@ -572,6 +572,14 @@ static const format_length_info printf_l
{ NULL, 0, 0, NULL, 0, 0 }
};
+static const format_length_info kprintf_length_specs[] =
+{
+ { "h", FMT_LEN_h, STD_C89, NULL, 0, 0 },
+ { "l", FMT_LEN_l, STD_C89, NULL, 0, 0 },
+ { "L", FMT_LEN_L, STD_C89, NULL, 0, 0 },
+ { NULL, 0, 0, NULL, 0, 0 }
+};
+
/* This differs from printf_length_specs only in that "Z" is not accepted. */
static const format_length_info scanf_length_specs[] =
@@ -765,6 +773,46 @@ static const format_char_info print_char
{ NULL, 0, 0, NOLENGTHS, NULL, NULL }
};
+static const format_char_info kprint_char_table[] =
+{
+ /* C89 conversion specifiers. */
+ { "di", 0, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, TEX_LL, T99_SST, T99_PD, T99_IM }, "-wp0 +'I", "i" },
+ { "oxX", 0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "-wp0#", "i" },
+ { "u", 0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "-wp0'I", "i" },
+ { "c", 0, STD_C89, { T89_I, BADLEN, BADLEN, T94_WI, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "" },
+ { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, T94_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "cR" },
+ { "p", 1, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "c" },
+/* Kernel bitmap formatting */
+ { "b", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" },
+/* Kernel recursive format */
+ { ":", 1, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" },
+/* Kernel debugger auto-radix printing */
+ { "nrz", 0, STD_C89, { T89_I, T89_I, T89_I, T89_L, T9L_LL, TEX_LL, BADLEN, BADLEN, BADLEN }, "-wp0# +", "" },
+ { NULL, 0, 0, NOLENGTHS, NULL, NULL }
+};
+
+static const format_char_info syslog_char_table[] =
+{
+ /* C89 conversion specifiers. */
+ { "di", 0, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, TEX_LL, T99_SST, T99_PD, T99_IM }, "-wp0 +'I", "i" },
+ { "oxX", 0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "-wp0#", "i" },
+ { "u", 0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "-wp0'I", "i" },
+ { "fgG", 0, STD_C89, { T89_D, BADLEN, BADLEN, T99_D, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#'", "" },
+ { "eE", 0, STD_C89, { T89_D, BADLEN, BADLEN, T99_D, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#", "" },
+ { "c", 0, STD_C89, { T89_I, BADLEN, BADLEN, T94_WI, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "" },
+ { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, T94_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "cR" },
+ { "p", 1, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "c" },
+ { "n", 1, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, BADLEN, T99_SST, T99_PD, T99_IM }, "", "W" },
+ /* C99 conversion specifiers. */
+ { "F", 0, STD_C99, { T99_D, BADLEN, BADLEN, T99_D, BADLEN, T99_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#'", "" },
+ { "aA", 0, STD_C99, { T99_D, BADLEN, BADLEN, T99_D, BADLEN, T99_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#", "" },
+ /* X/Open conversion specifiers. */
+ { "C", 0, STD_EXT, { TEX_WI, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "" },
+ { "S", 1, STD_EXT, { TEX_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "R" },
+ { "m", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "" },
+ { NULL, 0, 0, NOLENGTHS, NULL, NULL }
+};
+
static const format_char_info scan_char_table[] =
{
/* C89 conversion specifiers. */
@@ -828,6 +876,18 @@ static const format_kind_info format_typ
'w', 0, 'p', 0, 'L',
&integer_type_node, &integer_type_node
},
+ { "kprintf", kprintf_length_specs, kprint_char_table, " +#0-'I", NULL,
+ printf_flag_specs, printf_flag_pairs,
+ FMT_FLAG_ARG_CONVERT|FMT_FLAG_DOLLAR_MULTIPLE|FMT_FLAG_USE_DOLLAR|FMT_FLAG_EMPTY_PREC_OK,
+ 'w', 0, 'p', 0, 'L',
+ &integer_type_node, &integer_type_node
+ },
+ { "syslog", printf_length_specs, syslog_char_table, " +#0-'I", NULL,
+ printf_flag_specs, printf_flag_pairs,
+ FMT_FLAG_ARG_CONVERT|FMT_FLAG_DOLLAR_MULTIPLE|FMT_FLAG_USE_DOLLAR|FMT_FLAG_EMPTY_PREC_OK,
+ 'w', 0, 'p', 0, 'L',
+ &integer_type_node, &integer_type_node
+ },
{ "scanf", scanf_length_specs, scan_char_table, "*'I", NULL,
scanf_flag_specs, scanf_flag_pairs,
FMT_FLAG_ARG_CONVERT|FMT_FLAG_SCANF_A_KLUDGE|FMT_FLAG_USE_DOLLAR|FMT_FLAG_ZERO_WIDTH_BAD|FMT_FLAG_DOLLAR_GAP_POINTER_OK,

View File

@ -0,0 +1,27 @@
$OpenBSD: patch-gcc_config_alpha_openbsd1_h,v 1.3 2004/01/31 15:23:58 espie Exp $
--- gcc/config/alpha/openbsd1.h.orig Mon Jun 3 17:18:18 2002
+++ gcc/config/alpha/openbsd1.h Mon Jun 3 17:17:57 2002
@@ -0,0 +1,23 @@
+/* Configuration fragment for an alpha OpenBSD target.
+ Copyright (C) 1999 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC 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.
+
+GNU CC 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. */
+
+#define OBSD_HAS_DECLARE_FUNCTION_NAME
+#define OBSD_HAS_DECLARE_FUNCTION_SIZE
+#define OBSD_HAS_DECLARE_OBJECT

View File

@ -0,0 +1,131 @@
$OpenBSD: patch-gcc_config_alpha_openbsd_h,v 1.6 2004/01/31 15:23:58 espie Exp $
--- gcc/config/alpha/openbsd.h.orig 2002-05-13 07:57:38.000000000 +0200
+++ gcc/config/alpha/openbsd.h 2003-11-10 20:24:08.000000000 +0100
@@ -21,22 +21,25 @@ Boston, MA 02111-1307, USA. */
/* We settle for little endian for now. */
#define TARGET_ENDIAN_DEFAULT 0
-#define OBSD_NO_DYNAMIC_LIBRARIES
-#define OBSD_HAS_DECLARE_FUNCTION_NAME
-#define OBSD_HAS_DECLARE_FUNCTION_SIZE
-#define OBSD_HAS_DECLARE_OBJECT
-
-/* alpha ecoff supports only weak aliases, see below. */
-#define ASM_WEAKEN_LABEL(FILE,NAME) ASM_OUTPUT_WEAK_ALIAS (FILE,NAME,0)
-
-#include <openbsd.h>
-
/* Controlling the compilation driver. */
/* alpha needs __start. */
#undef LINK_SPEC
#define LINK_SPEC \
- "%{!nostdlib:%{!r*:%{!e*:-e __start}}} -dc -dp %{assert*}"
+ "%{!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}"
/* run-time target specifications */
#define TARGET_OS_CPP_BUILTINS() \
@@ -44,6 +47,7 @@ Boston, MA 02111-1307, USA. */
builtin_define ("__OpenBSD__"); \
builtin_define ("__ANSI_COMPAT"); \
builtin_define ("__unix__"); \
+ builtin_define ("__ELF__"); \
builtin_assert ("system=unix"); \
} while (0)
@@ -63,67 +67,22 @@ Boston, MA 02111-1307, USA. */
#define WCHAR_TYPE_SIZE 32
-#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+/* #undef PREFERRED_DEBUGGING_TYPE */
+/* #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG */
+/* Output and generation of labels. */
#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. egcs doesn't try too hard to check internal
- configuration files... */
-#ifdef INCOMING_RETURN_ADDR_RTX
-#undef DWARF2_UNWIND_INFO
-#define DWARF2_UNWIND_INFO 0
-#endif
-
-/* Assembler format: file framework. */
-
-/* Taken from alpha/osf.h. This used to be common to all alpha
- configurations, but elf has departed from it.
- Check alpha/alpha.h, alpha/osf.h for it when egcs is upgraded. */
-#ifndef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
-{ \
- alpha_write_verstamp (FILE); \
- fprintf (FILE, "\t.set noreorder\n"); \
- fprintf (FILE, "\t.set volatile\n"); \
- fprintf (FILE, "\t.set noat\n"); \
- if (TARGET_SUPPORT_ARCH) \
- fprintf (FILE, "\t.arch %s\n", \
- TARGET_CPU_EV6 ? "ev6" \
- : (TARGET_CPU_EV5 \
- ? (TARGET_MAX ? "pca56" : TARGET_BWX ? "ev56" : "ev5") \
- : "ev4")); \
- \
- ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename); \
-}
-#endif
-
-/* Assembler format: label output. */
-
-#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)
-
+/* .set on alpha is not used to output labels. */
+#undef SET_ASM_OP
+/* So, provide corresponding default, without the .set. */
+#undef ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL
+#define ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL(FILE, SY, HI, LO) \
+ do { \
+ assemble_name (FILE, SY); \
+ fputc ('=', FILE); \
+ assemble_name (FILE, HI); \
+ fputc ('-', FILE); \
+ assemble_name (FILE, LO); \
+ } while (0)

View File

@ -0,0 +1,74 @@
$OpenBSD: patch-gcc_config_gcc,v 1.17 2004/01/31 15:23:58 espie Exp $
--- gcc/config.gcc.orig 2003-10-01 21:07:01.000000000 +0200
+++ gcc/config.gcc 2003-11-11 16:17:26.000000000 +0100
@@ -578,10 +578,11 @@ alpha*-*-netbsd*)
;;
alpha*-*-openbsd*)
- tm_file="${cpu_type}/${cpu_type}.h ${tm_file}"
+ tm_file="alpha/alpha.h alpha/elf.h alpha/openbsd1.h openbsd.h ${tm_file}"
# default x-alpha is only appropriate for dec-osf.
target_cpu_default="MASK_GAS"
tmake_file="alpha/t-alpha alpha/t-ieee"
+ gas=yes gnu_ld=yes
;;
alpha*-dec-osf[45]*)
@@ -1142,13 +1143,23 @@ i[34567]86-*-netbsd*)
x86_64-*-netbsd*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h"
;;
-i[34567]86-*-openbsd*)
+i[34567]86-*-openbsd2* | i[34567]86-*-openbsd3.[0123])
tm_file="${cpu_type}/${cpu_type}.h i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h openbsd-oldgas.h openbsd.h ${tm_file}"
# needed to unconfuse gdb
tmake_file="t-libc-ok t-openbsd i386/t-openbsd"
# we need collect2 until our bug is fixed...
use_collect2=yes
;;
+i[34567]86-*-openbsd*)
+ # needed to unconfuse gdb
+ tmake_file="t-libc-ok t-openbsd i386/t-openbsd"
+ tm_file="${cpu_type}/${cpu_type}.h i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h"
+ tm_file="${tm_file} exec-stack.h"
+ tm_file="${tm_file} openbsd.h i386/openbsdelf.h"
+ gas=yes
+ gnu_ld=yes
+ stabs=yes
+ ;;
i[34567]86-*-coff*)
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/i386-coff.h"
;;
@@ -2016,8 +2027,8 @@ romp-*-openbsd*)
# Nothing special
;;
powerpc-*-openbsd*)
- tmake_file="${tmake_file} rs6000/t-rs6000 rs6000/t-openbsd"
- extra_headers=
+ tm_file="rs6000/rs6000.h rs6000/openbsd1.h dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h openbsd.h ${tm_file}"
+ tmake_file="${tmake_file} rs6000/t-ppcos rs6000/t-openbsd"
;;
powerpc64-*-linux*)
tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux64.h"
@@ -2397,17 +2408,19 @@ sparc-*-netbsd*)
use_collect2=yes
;;
sparc-*-openbsd*)
- tm_file="sparc/sparc.h ${tm_file}"
+ tm_file="sparc/sparc.h elfos.h svr4.h sparc/sysv4.h ${tm_file}"
# needed to unconfuse gdb
tmake_file="t-libc-ok t-openbsd sparc/t-openbsd"
# we need collect2 until our bug is fixed...
+ gas=yes gnu_ld=yes
use_collect2=yes
;;
sparc64-*-openbsd*)
- tm_file="sparc/openbsd1-64.h sparc/sparc.h elfos.h svr4.h sparc/sysv4.h sparc/sol2.h sparc/sp64-elf.h openbsd.h sparc/openbsd64.h"
+ tm_file="sparc/openbsd1-64.h sparc/sparc.h elfos.h svr4.h sparc/sysv4.h sparc/sp64-elf.h openbsd.h sparc/openbsd64.h"
xm_file=sparc/xm-sp64.h
gas=yes gnu_ld=yes
with_cpu=ultrasparc
+ float_format=i128
;;
sparc-*-bsd*)
tm_file="${tm_file} sparc/bsd.h"

View File

@ -0,0 +1,31 @@
$OpenBSD: patch-gcc_config_i386_openbsd_h,v 1.8 2004/01/31 15:23:58 espie Exp $
--- gcc/config/i386/openbsd.h.orig 2002-10-21 00:37:10.000000000 +0200
+++ gcc/config/i386/openbsd.h 2003-11-11 15:33:52.000000000 +0100
@@ -29,6 +29,7 @@ Boston, MA 02111-1307, USA. */
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
+ OPENBSD_OS_CPP_BUILTINS_COMMON(); \
builtin_define ("__unix__"); \
builtin_define ("__OpenBSD__"); \
builtin_assert ("system=unix"); \
@@ -101,3 +102,19 @@ Boston, MA 02111-1307, USA. */
/* OpenBSD gas currently does not support quad, so do not use it. */
#undef ASM_QUAD
+
+#define TRANSFER_FROM_TRAMPOLINE \
+extern void __enable_execute_stack (void *); \
+void \
+__enable_execute_stack (addr) \
+ void *addr; \
+{ \
+ long size = getpagesize (); \
+ long mask = ~(size-1); \
+ char *page = (char *) (((long) addr) & mask); \
+ char *end = (char *) ((((long) (addr + TRAMPOLINE_SIZE)) & mask) + size); \
+ \
+ /* 7 is PROT_READ | PROT_WRITE | PROT_EXEC */ \
+ if (mprotect (page, end - page, 7) < 0) \
+ perror ("mprotect of trampoline code"); \
+}

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-gcc_config_in,v 1.3 2004/01/31 15:23:58 espie Exp $
--- gcc/config.in.orig 2003-10-16 22:10:47.000000000 +0200
+++ gcc/config.in 2003-11-10 20:03:54.000000000 +0100
@@ -156,6 +156,9 @@
/* Define if you have the kill function. */
#undef HAVE_KILL
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+#undef HAVE_LANGINFO_CODESET
+
/* Define if you have the lstat function. */
#undef HAVE_LSTAT

View File

@ -0,0 +1,58 @@
--- 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. */
/* Controlling the compilation driver. */
+/* TARGET_OS_CPP_BUILTINS() common to all OpenBSD targets. */
+#define OPENBSD_OS_CPP_BUILTINS_COMMON() \
+ do \
+ { \
+ builtin_define ("__OpenBSD__"); \
+ builtin_assert ("system=unix"); \
+ builtin_assert ("system=OpenBSD"); \
+ } \
+ while (0)
+
+/* TARGET_OS_CPP_BUILTINS() common to all OpenBSD ELF targets. */
+#define OPENBSD_OS_CPP_BUILTINS_ELF() \
+ do \
+ { \
+ OPENBSD_OS_CPP_BUILTINS_COMMON(); \
+ 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"); \
+ } \
+ while (0)
+
/* CPP_SPEC appropriate for OpenBSD. We deal with -posix and -pthread.
- XXX the way threads are handling currently is not very satisfying,
+ XXX the way threads are handled currently is not very satisfying,
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. */
#define OBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
#endif
-/* LIB_SPEC appropriate for OpenBSD. Select the appropriate libc,
- depending on profiling and threads. Basically,
- -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}}}"
+/* LIB_SPEC appropriate for OpenBSD. 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}}}"
#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

@ -0,0 +1,12 @@
$OpenBSD: patch-gcc_config_rs6000_crtsavres_asm,v 1.3 2004/01/31 15:23:58 espie Exp $
--- gcc/config/rs6000/crtsavres.asm.orig Tue Feb 19 13:40:41 2002
+++ gcc/config/rs6000/crtsavres.asm Thu May 30 23:54:20 2002
@@ -39,7 +39,7 @@
.file "crtsavres.asm"
.section ".text"
- #include "ppc-asm.h"
+ #include "rs6000/ppc-asm.h"
#ifndef __powerpc64__

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-gcc_config_rs6000_eabi_asm,v 1.3 2004/01/31 15:23:58 espie Exp $
--- gcc/config/rs6000/eabi.asm.orig Tue Feb 19 13:40:41 2002
+++ gcc/config/rs6000/eabi.asm Thu May 30 21:55:17 2002
@@ -38,7 +38,7 @@
.file "eabi.asm"
.section ".text"
- #include "ppc-asm.h"
+ #include "rs6000/ppc-asm.h"
#ifndef __powerpc64__

View File

@ -0,0 +1,28 @@
$OpenBSD: patch-gcc_config_rs6000_openbsd1_h,v 1.3 2004/01/31 15:23:58 espie Exp $
--- gcc/config/rs6000/openbsd1.h.orig Thu May 30 00:56:45 2002
+++ gcc/config/rs6000/openbsd1.h Thu May 30 00:57:11 2002
@@ -0,0 +1,24 @@
+/* Configuration file for an rs6000 OpenBSD target.
+ Copyright (C) 1999 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC 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.
+
+GNU CC 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. */
+
+#define OBSD_HAS_CORRECT_SPECS
+#define OBSD_HAS_DECLARE_FUNCTION_NAME
+#define OBSD_HAS_DECLARE_FUNCTION_SIZE
+#define OBSD_HAS_DECLARE_OBJECT

View File

@ -0,0 +1,95 @@
$OpenBSD: patch-gcc_config_rs6000_openbsd_h,v 1.5 2004/01/31 15:23:58 espie Exp $
--- gcc/config/rs6000/openbsd.h.orig 2003-11-11 15:19:33.000000000 +0100
+++ gcc/config/rs6000/openbsd.h 2003-11-11 15:31:32.000000000 +0100
@@ -0,0 +1,91 @@
+/* Configuration file for an rs6000 OpenBSD target.
+ Copyright (C) 1999 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC 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.
+
+GNU CC 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. */
+
+/* XXX need to check ASM_WEAKEN_LABEL/ASM_GLOBALIZE_LABEL. */
+
+/* Run-time target specifications. */
+#undef TARGET_OS_CPP_BUILTINS /* FIXME: sysv4.h should not define this! */
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ OPENBSD_OS_CPP_BUILTINS_ELF(); \
+ builtin_define ("__powerpc__"); \
+ builtin_assert ("cpu=powerpc"); \
+ builtin_assert ("machine=powerpc"); \
+ } \
+ while (0)
+
+#undef CPP_OS_DEFAULT_SPEC
+#define CPP_OS_DEFAULT_SPEC "%(cpp_os_openbsd)"
+
+#undef LINKER_NAME
+#define LINKER_NAME "ld"
+
+#undef LINK_SPEC
+#define LINK_SPEC "%{shared:-shared} \
+ %{!shared: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}} \
+ %{static:-static}}"
+
+#undef LIB_DEFAULT_SPEC
+#define LIB_DEFAULT_SPEC "%(lib_openbsd)"
+
+#undef STARTFILE_DEFAULT_SPEC
+#define STARTFILE_DEFAULT_SPEC "%(startfile_openbsd)"
+
+#undef ENDFILE_DEFAULT_SPEC
+#define ENDFILE_DEFAULT_SPEC "%(endfile_openbsd)"
+
+#undef LINK_START_DEFAULT_SPEC
+#define LINK_START_DEFAULT_SPEC "%(link_start_openbsd)"
+
+#undef LINK_OS_DEFAULT_SPEC
+#define LINK_OS_DEFAULT_SPEC "%(link_os_openbsd)"
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (PowerPC OpenBSD)");
+
+/* Default ABI to use */
+#undef RS6000_ABI_NAME
+#define RS6000_ABI_NAME "openbsd"
+
+/* Define this macro as a C expression for the initializer of an
+ array of string to tell the driver program which options are
+ defaults for this target and thus do not need to be handled
+ specially when using `MULTILIB_OPTIONS'.
+
+ Do not define this macro if `MULTILIB_OPTIONS' is not defined in
+ the target makefile fragment or if none of the options listed in
+ `MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */
+
+#undef MULTILIB_DEFAULTS
+#define MULTILIB_DEFAULTS { "mbig", "mcall-openbsd" }
+
+/* collect2 support (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
+
+

View File

@ -0,0 +1,233 @@
$OpenBSD: patch-gcc_config_rs6000_sysv4_h,v 1.6 2004/01/31 15:23:58 espie Exp $
--- gcc/config/rs6000/sysv4.h.orig 2003-06-17 17:59:10.000000000 +0200
+++ gcc/config/rs6000/sysv4.h 2003-11-11 16:57:18.000000000 +0100
@@ -197,6 +197,8 @@ do { \
rs6000_current_abi = ABI_V4; \
else if (!strcmp (rs6000_abi_name, "linux")) \
rs6000_current_abi = ABI_V4; \
+ else if (!strcmp (rs6000_abi_name, "openbsd")) \
+ rs6000_current_abi = ABI_V4; \
else if (!strcmp (rs6000_abi_name, "gnu")) \
rs6000_current_abi = ABI_V4; \
else if (!strcmp (rs6000_abi_name, "netbsd")) \
@@ -823,6 +825,7 @@ do { \
%{mcall-freebsd: -mbig} \
%{mcall-i960-old: -mlittle} \
%{mcall-linux: -mbig} \
+ %{mcall-openbsd: -mbig} \
%{mcall-gnu: -mbig} \
%{mcall-netbsd: -mbig} \
}}}}"
@@ -847,11 +850,13 @@ do { \
%{mcall-freebsd: -mbig %(cc1_endian_big) } \
%{mcall-i960-old: -mlittle %(cc1_endian_little) } \
%{mcall-linux: -mbig %(cc1_endian_big) } \
+ %{mcall-openbsd: -mbig %(cc1_endian_big) } \
%{mcall-gnu: -mbig %(cc1_endian_big) } \
%{mcall-netbsd: -mbig %(cc1_endian_big) } \
- %{!mcall-aixdesc: %{!mcall-freebsd: %{!mcall-i960-old: %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd: \
+ %{!mcall-aixdesc: %{!mcall-freebsd: %{!mcall-i960-old: %{!mcall-linux: \
+ %{!mcall-openbsd: %{!mcall-gnu: %{!mcall-netbsd: \
%(cc1_endian_default) \
- }}}}}} \
+ }}}}}}} \
}}}} \
%{mno-sdata: -msdata=none } \
%{meabi: %{!mcall-*: -mcall-sysv }} \
@@ -860,6 +865,7 @@ do { \
%{mcall-freebsd: -mno-eabi } \
%{mcall-i960-old: -meabi } \
%{mcall-linux: -mno-eabi } \
+ %{mcall-openbsd: -mno-eabi } \
%{mcall-gnu: -mno-eabi } \
%{mcall-netbsd: -mno-eabi }}} \
%{msdata: -msdata=default} \
@@ -892,11 +898,12 @@ do { \
%{mwindiss: %(link_start_windiss) } \
%{mcall-freebsd: %(link_start_freebsd) } \
%{mcall-linux: %(link_start_linux) } \
+%{mcall-openbsd: %(link_start_openbsd) } \
%{mcall-gnu: %(link_start_gnu) } \
%{mcall-netbsd: %(link_start_netbsd) } \
%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
- %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd: \
- %{!mcall-freebsd: %(link_start_default) }}}}}}}}}"
+ %{!mcall-linux: %{!mcall-openbsd: %{!mcall-gnu: %{!mcall-netbsd: \
+ %{!mcall-freebsd: %(link_start_default) }}}}}}}}}}"
#define LINK_START_DEFAULT_SPEC ""
@@ -951,11 +958,12 @@ do { \
%{mwindiss: %(link_os_windiss) } \
%{mcall-freebsd: %(link_os_freebsd) } \
%{mcall-linux: %(link_os_linux) } \
+%{mcall-openbsd: %(link_os_openbsd) } \
%{mcall-gnu: %(link_os_gnu) } \
%{mcall-netbsd: %(link_os_netbsd) } \
%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
- %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
- %{!mcall-netbsd: %(link_os_default) }}}}}}}}}"
+ %{!mcall-freebsd: %{!mcall-linux: %{!mcall-openbsd: %{!mcall-gnu: \
+ %{!mcall-netbsd: %(link_os_default) }}}}}}}}}}"
#define LINK_OS_DEFAULT_SPEC ""
@@ -973,12 +981,13 @@ do { \
%{msim: %(cpp_os_sim) } \
%{mwindiss: %(cpp_os_windiss) } \
%{mcall-freebsd: %(cpp_os_freebsd) } \
+%{mcall-openbsd: %(cpp_os_openbsd) } \
%{mcall-linux: %(cpp_os_linux) } \
%{mcall-gnu: %(cpp_os_gnu) } \
%{mcall-netbsd: %(cpp_os_netbsd) } \
%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
- %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
- %{!mcall-netbsd: %(cpp_os_default) }}}}}}}}}"
+ %{!mcall-freebsd: %{!mcall-linux: %{!mcall-openbsd: %{!mcall-gnu: \
+ %{!mcall-netbsd: %(cpp_os_default) }}}}}}}}}}"
#define CPP_OS_DEFAULT_SPEC ""
@@ -992,11 +1001,12 @@ do { \
%{mwindiss: %(startfile_windiss) } \
%{mcall-freebsd: %(startfile_freebsd) } \
%{mcall-linux: %(startfile_linux) } \
+%{mcall-openbsd: %(startfile_openbsd) } \
%{mcall-gnu: %(startfile_gnu) } \
%{mcall-netbsd: %(startfile_netbsd) } \
%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
- %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
- %{!mcall-netbsd: %(startfile_default) }}}}}}}}}"
+ %{!mcall-freebsd: %{!mcall-linux: %{!mcall-openbsd: %{!mcall-gnu: \
+ %{!mcall-netbsd: %(startfile_default) }}}}}}}}}}"
#define STARTFILE_DEFAULT_SPEC ""
@@ -1010,11 +1020,12 @@ do { \
%{mwindiss: %(lib_windiss) } \
%{mcall-freebsd: %(lib_freebsd) } \
%{mcall-linux: %(lib_linux) } \
+%{mcall-openbsd: %(lib_openbsd) } \
%{mcall-gnu: %(lib_gnu) } \
%{mcall-netbsd: %(lib_netbsd) } \
%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
- %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
- %{!mcall-netbsd: %(lib_default) }}}}}}}}}"
+ %{!mcall-freebsd: %{!mcall-linux: %{!mcall-openbsd: %{!mcall-gnu: \
+ %{!mcall-netbsd: %(lib_default) }}}}}}}}}}"
#define LIB_DEFAULT_SPEC ""
@@ -1028,13 +1039,14 @@ do { \
%{mwindiss: %(endfile_windiss)} \
%{mcall-freebsd: crtsavres.o%s %(endfile_freebsd) } \
%{mcall-linux: crtsavres.o%s %(endfile_linux) } \
+%{mcall-openbsd: crtsavres.o%s %(endfile_openbsd) } \
%{mcall-gnu: crtsavres.o%s %(endfile_gnu) } \
%{mcall-netbsd: crtsavres.o%s %(endfile_netbsd) } \
%{mvxworks: crtsavres.o%s %(endfile_vxworks) } \
%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
- %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
+ %{!mcall-freebsd: %{!mcall-linux: %{!mcall-openbsd: %{!mcall-gnu: \
%{!mcall-netbsd: %{!mvxworks: %(crtsavres_default) \
- %(endfile_default) }}}}}}}}}}"
+ %(endfile_default) }}}}}}}}}}}"
#define CRTSAVRES_DEFAULT_SPEC "crtsavres.o%s"
@@ -1231,6 +1243,46 @@ ncrtn.o%s"
%{mcpu=821: %{!Dppc*: %{!Dmpc*: -Dmpc821} } } \
%{mcpu=860: %{!Dppc*: %{!Dmpc*: -Dmpc860} } }"
+/* OpenBSD support. */
+#ifndef LIB_OPENBSD_SPEC
+#define LIB_OPENBSD_SPEC "%{mnewlib: --start-group %(libc_openbsd) --end-group } %{!mnewlib: %(libc_openbsd) }"
+#endif
+
+#ifndef LIBC_OPENBSD_SPEC
+#define LIBC_OPENBSD_SPEC "%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}"
+#endif
+
+#ifndef STARTFILE_OPENBSD_SPEC
+#define STARTFILE_OPENBSD_SPEC "\
+%{!shared: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} \
+%{mnewlib: ecrti.o%s} \
+%{!mnewlib: %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
+#endif
+/*
+%{!mnewlib: crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
+*/
+
+#ifndef ENDFILE_OPENBSD_SPEC
+#define ENDFILE_OPENBSD_SPEC "\
+%{mnewlib: ecrtn.o%s} \
+%{!mnewlib: %{!shared:crtend.o%s} %{shared:crtendS.o%s}}"
+#endif
+/*
+%{!mnewlib: %{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s}"
+*/
+
+#ifndef LINK_START_OPENBSD_SPEC
+#define LINK_START_OPENBSD_SPEC "-Ttext 0x400074"
+#endif
+
+#ifndef LINK_OS_OPENBSD_SPEC
+#define LINK_OS_OPENBSD_SPEC ""
+#endif
+
+#ifndef CPP_OS_OPENBSD_SPEC
+#define CPP_OS_OPENBSD_SPEC OBSD_CPP_SPEC
+#endif
+
/* VxWorks support. */
/* VxWorks does all the library stuff itself. */
#define LIB_VXWORKS_SPEC ""
@@ -1306,6 +1358,8 @@ ncrtn.o%s"
{ "lib_gnu", LIB_GNU_SPEC }, \
{ "lib_linux", LIB_LINUX_SPEC }, \
{ "lib_netbsd", LIB_NETBSD_SPEC }, \
+ { "lib_openbsd", LIB_OPENBSD_SPEC }, \
+ { "libc_openbsd", LIBC_OPENBSD_SPEC }, \
{ "lib_vxworks", LIB_VXWORKS_SPEC }, \
{ "lib_windiss", LIB_WINDISS_SPEC }, \
{ "lib_default", LIB_DEFAULT_SPEC }, \
@@ -1317,6 +1371,7 @@ ncrtn.o%s"
{ "startfile_gnu", STARTFILE_GNU_SPEC }, \
{ "startfile_linux", STARTFILE_LINUX_SPEC }, \
{ "startfile_netbsd", STARTFILE_NETBSD_SPEC }, \
+ { "startfile_openbsd", STARTFILE_OPENBSD_SPEC }, \
{ "startfile_vxworks", STARTFILE_VXWORKS_SPEC }, \
{ "startfile_windiss", STARTFILE_WINDISS_SPEC }, \
{ "startfile_default", STARTFILE_DEFAULT_SPEC }, \
@@ -1328,6 +1383,7 @@ ncrtn.o%s"
{ "endfile_gnu", ENDFILE_GNU_SPEC }, \
{ "endfile_linux", ENDFILE_LINUX_SPEC }, \
{ "endfile_netbsd", ENDFILE_NETBSD_SPEC }, \
+ { "endfile_openbsd", ENDFILE_OPENBSD_SPEC }, \
{ "endfile_vxworks", ENDFILE_VXWORKS_SPEC }, \
{ "endfile_windiss", ENDFILE_WINDISS_SPEC }, \
{ "endfile_default", ENDFILE_DEFAULT_SPEC }, \
@@ -1343,6 +1399,7 @@ ncrtn.o%s"
{ "link_start_gnu", LINK_START_GNU_SPEC }, \
{ "link_start_linux", LINK_START_LINUX_SPEC }, \
{ "link_start_netbsd", LINK_START_NETBSD_SPEC }, \
+ { "link_start_openbsd", LINK_START_OPENBSD_SPEC }, \
{ "link_start_vxworks", LINK_START_VXWORKS_SPEC }, \
{ "link_start_windiss", LINK_START_WINDISS_SPEC }, \
{ "link_start_default", LINK_START_DEFAULT_SPEC }, \
@@ -1355,6 +1412,7 @@ ncrtn.o%s"
{ "link_os_linux", LINK_OS_LINUX_SPEC }, \
{ "link_os_gnu", LINK_OS_GNU_SPEC }, \
{ "link_os_netbsd", LINK_OS_NETBSD_SPEC }, \
+ { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \
{ "link_os_vxworks", LINK_OS_VXWORKS_SPEC }, \
{ "link_os_windiss", LINK_OS_WINDISS_SPEC }, \
{ "link_os_default", LINK_OS_DEFAULT_SPEC }, \
@@ -1368,6 +1426,7 @@ ncrtn.o%s"
{ "cpp_os_freebsd", CPP_OS_FREEBSD_SPEC }, \
{ "cpp_os_gnu", CPP_OS_GNU_SPEC }, \
{ "cpp_os_linux", CPP_OS_LINUX_SPEC }, \
+ { "cpp_os_openbsd", CPP_OS_OPENBSD_SPEC }, \
{ "cpp_os_netbsd", CPP_OS_NETBSD_SPEC }, \
{ "cpp_os_rtems", CPP_OS_RTEMS_SPEC }, \
{ "cpp_os_vxworks", CPP_OS_VXWORKS_SPEC }, \

View File

@ -0,0 +1,59 @@
$OpenBSD: patch-gcc_config_rs6000_t-openbsd,v 1.4 2004/01/31 15:23:58 espie Exp $
--- gcc/config/rs6000/t-openbsd.orig Thu May 30 22:09:28 2002
+++ gcc/config/rs6000/t-openbsd Thu May 30 22:18:47 2002
@@ -0,0 +1,55 @@
+# include t-rs6000 too
+# this is taken from t-ppccomm
+# but crt* removed.
+
+
+LIB2FUNCS_EXTRA = tramp.S
+
+# This one can't end up in shared libgcc
+LIB2FUNCS_STATIC_EXTRA = eabi.S
+
+# We want fine grained libraries, so use the new code to build the
+# floating point emulation libraries.
+FPBIT = fp-bit.c
+DPBIT = dp-bit.c
+
+
+dp-bit.c: $(srcdir)/config/fp-bit.c
+ cat $(srcdir)/config/fp-bit.c > dp-bit.c
+
+fp-bit.c: $(srcdir)/config/fp-bit.c
+ echo '#define FLOAT' > fp-bit.c
+ cat $(srcdir)/config/fp-bit.c >> fp-bit.c
+
+eabi.S: $(srcdir)/config/rs6000/eabi.asm
+ cat $(srcdir)/config/rs6000/eabi.asm > eabi.S
+
+tramp.S: $(srcdir)/config/rs6000/tramp.asm
+ cat $(srcdir)/config/rs6000/tramp.asm > tramp.S
+
+# Switch synonyms
+MULTILIB_MATCHES_FLOAT = msoft-float=mcpu?401 \
+ msoft-float=mcpu?403 \
+ msoft-float=mcpu?ec603e \
+ msoft-float=mcpu?801 \
+ msoft-float=mcpu?821 \
+ msoft-float=mcpu?823 \
+ msoft-float=mcpu?860
+MULTILIB_MATCHES_ENDIAN = mlittle=mlittle-endian mbig=mbig-endian
+MULTILIB_MATCHES_SYSV = mcall-sysv=mcall-sysv-eabi mcall-sysv=mcall-sysv-noeabi mcall-sysv=mcall-linux mcall-sysv=mcall-netbsd
+
+LIBGCC = stmp-multilib
+INSTALL_LIBGCC = install-multilib
+EXTRA_MULTILIB_PARTS = crtsavres$(objext)
+
+crtsavres.S: $(srcdir)/config/rs6000/crtsavres.asm
+ cat $(srcdir)/config/rs6000/crtsavres.asm >crtsavres.S
+
+$(T)crtsavres$(objext): crtsavres.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtsavres.S -o $(T)crtsavres$(objext)
+
+# It is important that crtbegin.o, etc., aren't surprised by stuff in .sdata.
+CRTSTUFF_T_CFLAGS = -msdata=none
+# Make sure crt*.o are built with -fPIC even if configured with
+# --enable-shared --disable-multilib
+CRTSTUFF_T_CFLAGS_S = -fPIC -msdata=none

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-gcc_config_rs6000_tramp_asm,v 1.3 2004/01/31 15:23:58 espie Exp $
--- gcc/config/rs6000/tramp.asm.orig Sat Dec 1 02:34:11 2001
+++ gcc/config/rs6000/tramp.asm Thu May 30 21:54:10 2002
@@ -37,7 +37,7 @@
.file "tramp.asm"
.section ".text"
- #include "ppc-asm.h"
+ #include "rs6000/ppc-asm.h"
.type trampoline_initial,@object
.align 2

View File

@ -0,0 +1,31 @@
$OpenBSD: patch-gcc_config_sparc_openbsd1-64_h,v 1.5 2004/01/31 15:23:58 espie Exp $
--- gcc/config/sparc/openbsd1-64.h.orig Thu May 30 22:42:33 2002
+++ gcc/config/sparc/openbsd1-64.h Thu Sep 12 14:50:59 2002
@@ -22,3 +22,27 @@ Boston, MA 02111-1307, USA. */
#define OBSD_HAS_DECLARE_FUNCTION_SIZE
#define OBSD_HAS_DECLARE_OBJECT
+/* 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. */
+
+#define OBSD_HAS_DECLARE_FUNCTION_NAME
+#define OBSD_HAS_DECLARE_FUNCTION_SIZE
+#define OBSD_HAS_DECLARE_OBJECT
+

View File

@ -0,0 +1,245 @@
$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. */
#define SPARC_DEFAULT_CMODEL CM_MEDMID
/* Run-time target specifications. */
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-D__unix__ -D__sparc__ -D__sparc64__ -D__sparcv9__ -D__sparc_v9__ -D__arch64__ -D__ELF__ -D__OpenBSD__ -Asystem(unix) -Asystem(OpenBSD) -Acpu(sparc) -Amachine(sparc)"
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ OPENBSD_OS_CPP_BUILTINS_ELF(); \
+ OPENBSD_OS_CPP_BUILTINS_LP64(); \
+ builtin_define ("__sparc64__"); \
+ builtin_define ("__sparc_v9__"); \
+ builtin_define ("__arch64__"); \
+ 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 WINT_TYPE
+#define WINT_TYPE "long int"
+
+#undef WINT_TYPE_SIZE
+#define WINT_TYPE_SIZE 32
+
+#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 ASM_CPU_DEFAULT_SPEC
+#define ASM_CPU_DEFAULT_SPEC "-xarch=v8plusa"
+
+#undef ASM_CPU_SPEC
+#define ASM_CPU_SPEC "\
+%{mcpu=v8plus:-xarch=v8plus} \
+%{mcpu=ultrasparc:-xarch=v8plusa} \
+%{!mcpu*:%(asm_cpu_default)} \
+"
+
+/* Same as sparc.h */
+#undef DBX_REGISTER_NUMBER
+#define DBX_REGISTER_NUMBER(REGNO) \
+ (TARGET_FLAT && (REGNO) == HARD_FRAME_POINTER_REGNUM ? 31 : REGNO)
+
+/* We use stabs-in-elf by default, because that is what the native
+ toolchain uses. */
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+
+/* The Solaris 2 assembler uses .skip, not .zero, so put this back. */
+#undef ASM_OUTPUT_SKIP
+#define ASM_OUTPUT_SKIP(FILE,SIZE) \
+ fprintf (FILE, "\t.skip %u\n", (SIZE))
+
+#undef LOCAL_LABEL_PREFIX
+#define LOCAL_LABEL_PREFIX "."
+
+/* This is how to output a definition of an internal numbered label where
+ PREFIX is the class of label and NUM is the number within the class. */
+
+#undef ASM_OUTPUT_INTERNAL_LABEL
+#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
+ fprintf (FILE, ".L%s%d:\n", PREFIX, NUM)
+
+/* This is how to output a reference to an internal numbered label where
+ PREFIX is the class of label and NUM is the number within the class. */
+
+#undef ASM_OUTPUT_INTERNAL_LABELREF
+#define ASM_OUTPUT_INTERNAL_LABELREF(FILE,PREFIX,NUM) \
+ fprintf (FILE, ".L%s%d", PREFIX, NUM)
+
+/* This is how to store into the string LABEL
+ the symbol_ref name of an internal numbered label where
+ PREFIX is the class of label and NUM is the number within the class.
+ This is suitable for output with `assemble_name'. */
+
+#undef ASM_GENERATE_INTERNAL_LABEL
+#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
+ sprintf ((LABEL), "*.L%s%ld", (PREFIX), (long)(NUM))
+
+/* Select a format to encode pointers in exception handling data. CODE
+ is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
+ true if the symbol may be affected by dynamic relocations.
+
+ Some Solaris dynamic linkers don't handle unaligned section relative
+ relocs properly, so force them to be aligned. */
+#ifndef HAVE_AS_SPARC_UA_PCREL
+#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
+ ((flag_pic || GLOBAL) ? DW_EH_PE_aligned : DW_EH_PE_absptr)
+#endif
+
+/* ??? This does not work in SunOS 4.x, so it is not enabled in sparc.h.
+ Instead, it is enabled here, because it does work under Solaris. */
+/* Define for support of TFmode long double and REAL_ARITHMETIC.
+ Sparc ABI says that long double is 4 words. */
+#define LONG_DOUBLE_TYPE_SIZE 128
+
+/* But indicate that it isn't supported by the hardware. */
+#define WIDEST_HARDWARE_FP_SIZE 64
+
+#define STDC_0_IN_SYSTEM_HEADERS 1
+
+#define MULDI3_LIBCALL "__mul64"
+#define DIVDI3_LIBCALL "__div64"
+#define UDIVDI3_LIBCALL "__udiv64"
+#define MODDI3_LIBCALL "__rem64"
+#define UMODDI3_LIBCALL "__urem64"
+
+#undef INIT_SUBTARGET_OPTABS
+#define INIT_SUBTARGET_OPTABS \
+ fixsfdi_libfunc \
+ = init_one_libfunc (TARGET_ARCH64 ? "__ftol" : "__ftoll"); \
+ fixunssfdi_libfunc \
+ = init_one_libfunc (TARGET_ARCH64 ? "__ftoul" : "__ftoull"); \
+ fixdfdi_libfunc \
+ = init_one_libfunc (TARGET_ARCH64 ? "__dtol" : "__dtoll"); \
+ fixunsdfdi_libfunc \
+ = init_one_libfunc (TARGET_ARCH64 ? "__dtoul" : "__dtoull")
+
+
+/*
+ * Attempt to turn on access permissions for the stack.
+ *
+ * This code must be defined when compiling gcc but not when compiling
+ * libgcc2.a, unless we're generating code for 64 bits SPARC
+ *
+ * _SC_STACK_PROT is only defined for post 2.6, but we want this code
+ * to run always. 2.6 can change the stack protection but has no way to
+ * query it.
+ *
+ */
+
+/* This declares mprotect (used in TRANSFER_FROM_TRAMPOLINE) for
+ libgcc2.c. */
+/* We don't want to include this because sys/mman.h is not present on
+ some non-Solaris configurations that use sol2.h. */
+#if 0 /* def L_trampoline */
+#include <sys/mman.h>
+#endif
+
+#define TRANSFER_FROM_TRAMPOLINE \
+static int need_enable_exec_stack; \
+ \
+static void check_enabling(void) __attribute__ ((constructor)); \
+static void check_enabling(void) \
+{ \
+ extern long sysconf(int); \
+ \
+ int prot = (int) sysconf(515 /*_SC_STACK_PROT */); \
+ if (prot != 7) \
+ need_enable_exec_stack = 1; \
+} \
+ \
+extern void __enable_execute_stack (void *); \
+void \
+__enable_execute_stack (addr) \
+ void *addr; \
+{ \
+ if (!need_enable_exec_stack) \
+ return; \
+ else { \
+ long size = getpagesize (); \
+ long mask = ~(size-1); \
+ char *page = (char *) (((long) addr) & mask); \
+ char *end = (char *) ((((long) (addr + TRAMPOLINE_SIZE)) & mask) + size); \
+ \
+ /* 7 is PROT_READ | PROT_WRITE | PROT_EXEC */ \
+ if (mprotect (page, end - page, 7) < 0) \
+ 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

@ -1,4 +1,4 @@
$OpenBSD: patch-gcc_config_sparc_openbsd_h,v 1.3 2004/01/31 14:58:03 espie Exp $ $OpenBSD: patch-gcc_config_sparc_openbsd_h,v 1.4 2004/01/31 15:23:58 espie Exp $
--- gcc/config/sparc/openbsd.h.orig 2003-11-11 15:37:54.000000000 +0100 --- gcc/config/sparc/openbsd.h.orig 2003-11-11 15:37:54.000000000 +0100
+++ gcc/config/sparc/openbsd.h 2003-11-11 15:39:02.000000000 +0100 +++ gcc/config/sparc/openbsd.h 2003-11-11 15:39:02.000000000 +0100
@@ -23,7 +23,14 @@ Boston, MA 02111-1307, USA. */ @@ -23,7 +23,14 @@ Boston, MA 02111-1307, USA. */

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-gcc_testsuite_g++_old-deja_old-deja_exp,v 1.3 2004/01/31 15:23:58 espie Exp $
--- gcc/testsuite/g++.old-deja/old-deja.exp.orig Sat Jun 28 11:44:23 2003
+++ gcc/testsuite/g++.old-deja/old-deja.exp Sat Jun 28 11:44:31 2003
@@ -52,7 +52,7 @@ foreach file [lsort [find $srcdir/$subdi
# We don't want old-dejagnu.exp to have to know about all the global
# variables we use. For now we tell it about CXXFLAGS and LIBS and
# leave LDFLAGS alone.
- old-dejagnu $GXX_UNDER_TEST "$file" "$tfile" "" "$DEFAULT_CXXFLAGS" "-lstdc++"
+ old-dejagnu $GXX_UNDER_TEST "$file" "$tfile" "" "$DEFAULT_CXXFLAGS" "-lestdc++"
}
# The framework doesn't like to see any error remnants,

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-gcc_testsuite_lib_mike-g++_exp,v 1.3 2004/01/31 15:23:58 espie Exp $
--- gcc/testsuite/lib/mike-g++.exp.orig Sat Jun 28 11:45:09 2003
+++ gcc/testsuite/lib/mike-g++.exp Sat Jun 28 11:45:22 2003
@@ -136,9 +136,9 @@ proc postbase { src_code run groups arg
}
if ![ishost "*-dos-*"] {
- lappend options "libs=-lstdc++ -lg++"
+ lappend options "libs=-lestdc++ -lg++"
} else {
- lappend options "libs=-lstdcxx -lgxx"
+ lappend options "libs=-lestdcxx -lgxx"
}
set comp_output [g++_target_compile $src_file $output_file $compile_type $options]

View File

@ -0,0 +1,32 @@
$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;
minimum function alignment. Zero means no alignment is forced. */
int force_align_functions_log;
+/* Fake StackProtector option, does nothing. */
+int flag_propolice_protection = 0;
+
/* Table of supported debugging formats. */
static const struct
{
@@ -1186,6 +1189,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") },
+ { "no-stack-protector", &flag_propolice_protection, 0,
+ N_("Fake disable stack protection") },
{ "new-ra", &flag_new_regalloc, 1,
N_("Use graph coloring register allocation.") },
};
@@ -1362,6 +1367,9 @@ documented_lang_options[] =
{ "-Wwrite-strings",
N_("Mark strings as 'const char *'") },
{ "-Wno-write-strings", "" },
+ { "-Wbounded",
+ N_("Fake bounds checking option") },
+ { "-Wno-bounded", "" },
#define DEFINE_LANG_NAME(NAME) { NULL, NAME },

View File

@ -0,0 +1,34 @@
--- libffi/configure.in.orig 2003-08-09 08:59:00.000000000 +0200
+++ libffi/configure.in 2003-11-10 20:33:50.000000000 +0100
@@ -47,11 +47,13 @@ AC_PROG_LIBTOOL
TARGETDIR="unknown"
case "$host" in
mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; TARGETDIR=mips;;
+mips*-*-openbsd*) TARGET=MIPS; TARGETDIR=mips;;
i*86-*-linux*) TARGET=X86; TARGETDIR=x86;;
i*86-*-sco3.2v5*) TARGET=X86; TARGETDIR=x86;;
i*86-*-solaris*) TARGET=X86; TARGETDIR=x86;;
i*86-*-beos*) TARGET=X86; TARGETDIR=x86;;
i*86-*-freebsd*) TARGET=X86; TARGETDIR=x86;;
+i*86-*-openbsd*) TARGET=X86; TARGETDIR=x86;;
i*86-*-netbsdelf*) TARGET=X86; TARGETDIR=x86;;
i*86-*-win32*) TARGET=X86_WIN32; TARGETDIR=x86;;
i*86-*-cygwin*) TARGET=X86_WIN32; TARGETDIR=x86;;
@@ -60,12 +62,17 @@ sparc-sun-4*) TARGET=SPARC; TARGETDIR=sp
sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;;
sparc-*-linux* | sparc-*-netbsdelf*) TARGET=SPARC; TARGETDIR=sparc;;
sparc64-*-linux* | sparc64-*-netbsd*) TARGET=SPARC; TARGETDIR=sparc;;
+sparc-*-openbsd*) TARGET=SPARC; TARGETDIR=sparc;;
+sparc64-*-openbsd*) TARGET=SPARC; TARGETDIR=sparc;;
alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-netbsd*) TARGET=ALPHA; TARGETDIR=alpha;;
+alpha*-*-openbsd*) TARGET=ALPHA; TARGETDIR=alpha;;
ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;;
m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;;
+m68k-*-openbsd*) TARGET=M68K; TARGETDIR=m68k;;
mips64*-*);;
mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;;
powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;;
+powerpc-*-openbsd*) TARGET=POWERPC; TARGETDIR=powerpc;;
powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;;
powerpc-*-darwin*) TARGET=POWERPC_DARWIN; TARGETDIR=powerpc;;
powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;;

View File

@ -0,0 +1,23 @@
$OpenBSD: patch-libjava_aclocal_m4,v 1.3 2004/01/31 15:23:58 espie Exp $
--- libjava/aclocal.m4.orig 2003-10-16 22:10:48.000000000 +0200
+++ libjava/aclocal.m4 2003-11-10 20:03:57.000000000 +0100
@@ -458,3 +458,19 @@ for am_file in <<$1>>; do
done<<>>dnl>>)
changequote([,]))])
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_LANGINFO_CODESET],
+[
+ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
+ [AC_TRY_LINK([#include <langinfo.h>],
+ [char* cs = nl_langinfo(CODESET);],
+ am_cv_langinfo_codeset=yes,
+ am_cv_langinfo_codeset=no)
+ ])
+ if test $am_cv_langinfo_codeset = yes; then
+ AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
+ [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
+ fi
+])
+

View File

@ -0,0 +1,42 @@
$OpenBSD: patch-libjava_configure_in,v 1.4 2004/01/31 15:23:58 espie Exp $
--- libjava/configure.in.orig 2003-06-17 18:04:20.000000000 +0200
+++ libjava/configure.in 2003-11-12 11:46:13.000000000 +0100
@@ -300,6 +300,7 @@ changequote(<<,>>)dnl
changequote([,])
GC=$enableval,
GC=boehm)
+GC=system-boehm
GCLIBS=
GCINCS=
GCDEPS=
@@ -323,6 +324,22 @@ case "$GC" in
dnl The POSIX thread support needs to know this.
AC_DEFINE(HAVE_BOEHM_GC)
;;
+ system-boehm)
+ AC_MSG_RESULT(system-boehm)
+ GCLIBS=/usr/local/lib/libgc.la
+ GCINCS='-I/usr/local/include'
+ GCSPEC=-lgc
+ JC1GCSPEC='-fuse-boehm-gc'
+ GCTESTSPEC="-L/usr/local/lib"
+
+ dnl We also want to pick up some cpp flags required when including
+ dnl boehm-config.h. Yuck.
+ GCINCS="$GCINCS -DSILENT=1 -DNO_SIGNALS=1 -DNO_EXECUTE_PERMISSION=1 -DALL_INTERIOR_POINTERS=1 -DJAVA_FINALIZATION=1 -DGC_GCJ_SUPPORT=1 -DATOMIC_UNCOLLECTABLE=1 "
+ GCOBJS=boehm.lo
+ GCHDR=boehm-gc.h
+ dnl The POSIX thread support needs to know this.
+ AC_DEFINE(HAVE_BOEHM_GC)
+ ;;
no)
AC_MSG_RESULT(none)
GCOBJS=nogc.lo
@@ -542,6 +559,7 @@ else
fi
AM_ICONV
+ AM_LANGINFO_CODESET
AM_LC_MESSAGES
AC_STRUCT_TIMEZONE

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-libjava_include_config_h_in,v 1.3 2004/01/31 15:23:58 espie Exp $
--- libjava/include/config.h.in.orig Mon Jun 3 16:40:12 2002
+++ libjava/include/config.h.in Mon Jun 3 16:40:42 2002
@@ -77,6 +77,9 @@
/* Define if you have the `gmtime_r' function. */
#undef HAVE_GMTIME_R
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+#undef HAVE_LANGINFO_CODESET
+
/* Define if you have the `localtime_r' function. */
#undef HAVE_LOCALTIME_R

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-libjava_java_lang_natRuntime_cc,v 1.1 2004/01/31 14:58:03 espie Exp $ $OpenBSD: patch-libjava_java_lang_natRuntime_cc,v 1.2 2004/01/31 15:23:58 espie Exp $
--- libjava/java/lang/natRuntime.cc.orig 2003-11-11 18:17:19.000000000 +0100 --- libjava/java/lang/natRuntime.cc.orig 2003-11-11 18:17:19.000000000 +0100
+++ libjava/java/lang/natRuntime.cc 2003-11-11 18:17:42.000000000 +0100 +++ libjava/java/lang/natRuntime.cc 2003-11-11 18:17:42.000000000 +0100
@@ -341,7 +341,7 @@ java::lang::Runtime::traceMethodCalls (j @@ -341,7 +341,7 @@ java::lang::Runtime::traceMethodCalls (j

View File

@ -0,0 +1,28 @@
--- libstdc++-v3/src/Makefile.in.orig 2003-03-17 20:07:39.000000000 +0100
+++ libstdc++-v3/src/Makefile.in 2003-11-12 19:18:45.000000000 +0100
@@ -145,7 +145,7 @@ glibcpp_srcdir = @glibcpp_srcdir@
glibcpp_builddir = @glibcpp_builddir@
toolexecdir = @glibcpp_toolexecdir@
toolexeclibdir = @glibcpp_toolexeclibdir@
-toolexeclib_LTLIBRARIES = libstdc++.la
+toolexeclib_LTLIBRARIES = libestdc++.la
@GLIBCPP_BUILD_VERSIONED_SHLIB_TRUE@version_arg = @GLIBCPP_BUILD_VERSIONED_SHLIB_TRUE@-Wl,--version-script=libstdc++-symbol.ver
@GLIBCPP_BUILD_VERSIONED_SHLIB_FALSE@version_arg =
@@ -408,7 +408,7 @@ distclean-libtool:
maintainer-clean-libtool:
-libstdc++.la: $(libstdc___la_OBJECTS) $(libstdc___la_DEPENDENCIES)
+libestdc++.la: $(libstdc___la_OBJECTS) $(libstdc___la_DEPENDENCIES)
$(CXXLINK) -rpath $(toolexeclibdir) $(libstdc___la_LDFLAGS) $(libstdc___la_OBJECTS) $(libstdc___la_LIBADD) $(LIBS)
.cc.o:
$(CXXCOMPILE) -c $<
@@ -544,6 +544,7 @@ mostlyclean distclean maintainer-clean
@GLIBCPP_BUILD_VERSIONED_SHLIB_TRUE@libstdc++-symbol.ver: ${glibcpp_srcdir}/@SYMVER_MAP@
@GLIBCPP_BUILD_VERSIONED_SHLIB_TRUE@ @LN_S@ ${glibcpp_srcdir}/@SYMVER_MAP@ ./libstdc++-symbol.ver || true
@GLIBCPP_BUILD_VERSIONED_SHLIB_FALSE@libstdc++-symbol.ver:
+@GLIBCPP_BUILD_VERSIONED_SHLIB_FALSE@ touch $@
codecvt_members.cc: ${glibcpp_srcdir}/@CCODECVT_CC@
@LN_S@ ${glibcpp_srcdir}/@CCODECVT_CC@ . || true

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-libtool_m4,v 1.3 2004/01/31 15:23:58 espie Exp $
--- libtool.m4.orig 2003-09-09 10:04:17.000000000 +0200
+++ libtool.m4 2003-11-10 20:03:58.000000000 +0100
@@ -701,6 +701,10 @@ newsos6)
lt_cv_file_magic_test_file=/usr/lib/libnls.so
;;
+openbsd*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
osf3* | osf4* | osf5*)
# this will be overridden with pass_all, but let us keep it just in case
lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'

View File

@ -0,0 +1,19 @@
$OpenBSD: patch-ltcf-c_sh,v 1.3 2004/01/31 15:23:58 espie Exp $
--- ltcf-c.sh.orig 2002-08-14 04:39:52.000000000 +0200
+++ ltcf-c.sh 2003-11-10 20:03:58.000000000 +0100
@@ -476,10 +476,13 @@ else
;;
openbsd*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-R$libdir'
+ archive_cmds='$CC $pic_flag -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ archive_expsym_cmds='$CC $pic_flag -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ hardcode_libdir_flag_spec='${wl}-R$libdir'
hardcode_direct=yes
hardcode_shlibpath_var=no
+ remove_lgcc=yes
+ output_verbose_link_cmds='$CC $ac_cv_prog_cc_pic -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
;;
os2*)

View File

@ -0,0 +1,23 @@
$OpenBSD: patch-ltcf-cxx_sh,v 1.3 2004/01/31 15:23:58 espie Exp $
--- ltcf-cxx.sh.orig 2003-02-20 02:12:47.000000000 +0100
+++ ltcf-cxx.sh 2003-11-10 20:03:58.000000000 +0100
@@ -407,6 +407,19 @@ case $host_os in
netbsd*)
# NetBSD uses g++ - do we need to do anything?
;;
+ openbsd*)
+ if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
+ # MM: OpenBSD 2.7 uses G++, but not GNU ld
+ archive_cmds='$CC $pic_flag -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ archive_expsym_cmds='$CC $pic_flag -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ old_archive_cmds="$old_archive_cmds~"'$RANLIB $oldlib'
+ hardcode_libdir_flag_spec='${wl}-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ remove_lgcc=yes
+ output_verbose_link_cmds='$CC $ac_cv_prog_cc_pic -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
+ fi
+ ;;
osf3*)
case $cc_basename in
KCC)

View File

@ -0,0 +1,19 @@
$OpenBSD: patch-ltcf-gcj_sh,v 1.3 2004/01/31 15:23:58 espie Exp $
--- ltcf-gcj.sh.orig Sun Sep 16 15:52:22 2001
+++ ltcf-gcj.sh Sun Sep 16 15:55:09 2001
@@ -445,10 +445,13 @@ else
;;
openbsd*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-R$libdir'
+ archive_cmds='$CC $pic_flag -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ archive_expsym_cmds='$CC $pic_flag -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ hardcode_libdir_flag_spec='${wl}-R$libdir'
hardcode_direct=yes
hardcode_shlibpath_var=no
+ remove_lgcc=yes
+ output_verbose_link_cmds='$CC $ac_cv_prog_cc_pic -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
;;
os2*)

View File

@ -0,0 +1,27 @@
$OpenBSD: patch-ltconfig,v 1.3 2004/01/31 15:23:58 espie Exp $
--- ltconfig.orig 2003-02-20 03:10:02.000000000 +0100
+++ ltconfig 2003-11-10 20:03:58.000000000 +0100
@@ -625,7 +625,12 @@ old_postuninstall_cmds=
if test -n "$RANLIB"; then
old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
- old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds";;
+ *)
+ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds";;
+ esac
fi
# Source the script associated with the $tagname tag configuration.
@@ -1281,6 +1286,9 @@ openbsd*)
library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ deplib_check_method=pass_all
+ sys_lib_dlsearch_path_spec='/usr/lib /usr/local/lib /usr/X11R6/lib'
;;
os2*)