somewhat cleaner port of gcc 3.3.x.
not ready yet...
This commit is contained in:
parent
fc4258e9ac
commit
b55756f2a0
156
lang/gcc/3.3/Makefile
Normal file
156
lang/gcc/3.3/Makefile
Normal file
@ -0,0 +1,156 @@
|
||||
# $OpenBSD: Makefile,v 1.1.1.1 2005/01/03 15:21:26 espie Exp $
|
||||
|
||||
ONLY_FOR_ARCHS= alpha i386 m68k sparc sparc64 powerpc vax
|
||||
|
||||
V=3.3.5
|
||||
FULL_VERSION=$V
|
||||
|
||||
MAINTAINER= Marc Espie <espie@openbsd.org>
|
||||
|
||||
WANTLIB=c z
|
||||
|
||||
|
||||
MAKE_GXX=Yes
|
||||
MAKE_FORTRAN=Yes
|
||||
MAKE_OBJC=Yes
|
||||
#MAKE_JAVA=Yes
|
||||
#MAKE_ADA=Yes
|
||||
|
||||
MAKE_GXX?=No
|
||||
MAKE_FORTRAN?=No
|
||||
MAKE_OBJC?=No
|
||||
MAKE_JAVA?=No
|
||||
MAKE_ADA?=No
|
||||
|
||||
|
||||
BUILD_DEPENDS= ::devel/autoconf/2.13
|
||||
BUILD_DEPENDS+= ::devel/metaauto
|
||||
SUBPACKAGE?=
|
||||
|
||||
.if ${MAKE_JAVA:L} == "yes"
|
||||
. if !defined(PACKAGING) || ${SUBPACKAGE} == "-java"
|
||||
LIB_DEPENDS+=gc::devel/boehm-gc
|
||||
. endif
|
||||
.endif
|
||||
|
||||
# This can be patched out, apart from java that wants a pure parser.
|
||||
BUILD_DEPENDS+= :bison-*:devel/bison
|
||||
|
||||
|
||||
.if ${MAKE_JAVA:L} == "yes"
|
||||
MAKE_GXX=Yes
|
||||
.endif
|
||||
|
||||
MULTI_PACKAGES=
|
||||
# No sub packages description
|
||||
DESCR=${PKGDIR}/DESCR
|
||||
|
||||
REGRESS_DEPENDS=::devel/dejagnu
|
||||
|
||||
# No way around it, java wants a pure parser
|
||||
.if ${MAKE_JAVA:L} == "yes"
|
||||
BUILD_DEPENDS+=:bison-*:devel/bison
|
||||
.endif
|
||||
|
||||
|
||||
DISTNAME= gcc-${FULL_VERSION}
|
||||
|
||||
|
||||
DISTFILES= ${DISTNAME}.tar.bz2
|
||||
|
||||
MASTER_SITES= ${MASTER_SITE_GCC:=releases/gcc-$(FULL_VERSION)/}
|
||||
|
||||
CONFIGURE_STYLE= gnu
|
||||
MODGNU_CONFIG_GUESS_DIRS= ${WRKSRC} ${WRKSRC}/gcc
|
||||
|
||||
LANGS=c
|
||||
.if ${MAKE_GXX:L} == "yes"
|
||||
LANGS:=${LANGS},c++
|
||||
MULTI_PACKAGES+=-c++ -estdc
|
||||
.endif
|
||||
.if ${MAKE_FORTRAN:L} == "yes"
|
||||
LANGS:=${LANGS},f77
|
||||
MULTI_PACKAGES+=-g77
|
||||
.endif
|
||||
.if ${MAKE_OBJC:L} == "yes"
|
||||
LANGS:=${LANGS},objc
|
||||
MULTI_PACKAGES+=-objc
|
||||
.endif
|
||||
.if ${MAKE_JAVA:L} == "yes"
|
||||
LANGS:=${LANGS},java
|
||||
MULTI_PACKAGES+=-java
|
||||
CONFIGURE_ARGS+=--enable-java-gc=system-boehm
|
||||
.endif
|
||||
.if ${MAKE_ADA:L} == "yes"
|
||||
LANGS:=${LANGS},ada
|
||||
MULTI_PACKAGES+=-ada
|
||||
|
||||
CONFIGURE_ENV=ADAC=${LOCALBASE}/bin/egcc GNATBIND=${LOCALBASE}/bin/gnatbind
|
||||
MAKE_ENV=ADAC=${LOCALBASE}/bin/egcc GNATBIND=${LOCALBASE}/bin/gnatbind
|
||||
CC=${LOCALBASE}/bin/egcc
|
||||
BUILD_DEPENDS+=:gnat-*:lang/egcs/stable,-ada
|
||||
.endif
|
||||
CONFIGURE_ENV+=am_cv_func_iconv=no
|
||||
|
||||
# Note: the configure target passes CFLAGS to the configure script anyways.
|
||||
|
||||
CFLAGS=-O2 -g
|
||||
|
||||
|
||||
CONFIGURE_ARGS= \
|
||||
--verbose \
|
||||
--program-transform-name=s,^,e, \
|
||||
--disable-nls \
|
||||
--with-system-zlib \
|
||||
--enable-languages=${LANGS}
|
||||
|
||||
# This is needed, as internal cpp is no longer compatible with the
|
||||
# visible beast
|
||||
CONFIGURE_ARGS+=--enable-cpp
|
||||
|
||||
.if ${MAKE_JAVA:L} == "yes"
|
||||
CONFIGURE_ARGS+=--enable-sjlj-exceptions
|
||||
.endif
|
||||
|
||||
|
||||
# if you wish to try your luck
|
||||
#CONFIGURE_ARGS+= --enable-threads=posix
|
||||
|
||||
CONFIGURE_ARGS += --with-gnu-as
|
||||
CONFIGURE_ARGS += --with-gnu-ld
|
||||
CONFIGURE_ARGS += ${CONFIGURE_SHARED}
|
||||
|
||||
SEPARATE_BUILD=concurrent
|
||||
|
||||
USE_GMAKE= yes
|
||||
|
||||
# you shouldn't skip bootstrap unless you know what you're doing
|
||||
# use bootstrap-lean if you're pressed for space
|
||||
ALL_TARGET=bootstrap
|
||||
|
||||
MAKE_FLAGS=libstdc___la_LDFLAGS='-version-info 31:0:0 -lm'
|
||||
|
||||
|
||||
.if ${MACHINE_ARCH} == "m68k" || ${MACHINE_ARCH} == "sparc"
|
||||
PKG_ARGS+=-DPIC=1
|
||||
.else
|
||||
PKG_ARGS+=-DPIC=0
|
||||
.endif
|
||||
|
||||
.if ${MACHINE_ARCH} == "powerpc"
|
||||
PKG_ARGS+=-DPPC=1
|
||||
.else
|
||||
PKG_ARGS+=-DPPC=0
|
||||
.endif
|
||||
|
||||
.if defined(PACKAGING) && defined(SUBPACKAGE)
|
||||
. if !empty(SUBPACKAGE) && ${SUBPACKAGE} != "-estdc"
|
||||
RUN_DEPENDS+=::${PKGPATH}
|
||||
. endif
|
||||
. if ${SUBPACKAGE} == "-c++"
|
||||
RUN_DEPENDS+=::${PKGPATH},-estdc
|
||||
. endif
|
||||
.endif
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
3
lang/gcc/3.3/distinfo
Normal file
3
lang/gcc/3.3/distinfo
Normal file
@ -0,0 +1,3 @@
|
||||
MD5 (gcc/gcc-3.3.5.tar.bz2) = 70ee088b498741bb08c779f9617df3a5
|
||||
RMD160 (gcc/gcc-3.3.5.tar.bz2) = 34adf1a6f7ea302e9937c1a06ccf362711e25c58
|
||||
SHA1 (gcc/gcc-3.3.5.tar.bz2) = ab24a8690040de967c25a1fc8560d7ecc25bd460
|
12
lang/gcc/3.3/patches/patch-configure_in
Normal file
12
lang/gcc/3.3/patches/patch-configure_in
Normal file
@ -0,0 +1,12 @@
|
||||
$OpenBSD: patch-configure_in,v 1.1.1.1 2005/01/03 15:21:27 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}"
|
||||
;;
|
23
lang/gcc/3.3/patches/patch-gcc_Makefile_in
Normal file
23
lang/gcc/3.3/patches/patch-gcc_Makefile_in
Normal file
@ -0,0 +1,23 @@
|
||||
$OpenBSD: patch-gcc_Makefile_in,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/Makefile.in.orig Mon Jan 3 12:27:24 2005
|
||||
+++ gcc/Makefile.in Mon Jan 3 12:28:10 2005
|
||||
@@ -742,7 +742,8 @@ CXX_TARGET_OBJS=@cxx_target_objs@
|
||||
|
||||
# Language-specific object files for C and Objective C.
|
||||
C_AND_OBJC_OBJS = attribs.o c-errors.o c-lex.o c-pragma.o c-decl.o c-typeck.o \
|
||||
- c-convert.o c-aux-info.o c-common.o c-opts.o c-format.o c-semantics.o \
|
||||
+ c-convert.o c-aux-info.o c-common.o c-opts.o c-format.o c-bounded.o \
|
||||
+ c-semantics.o \
|
||||
c-objc-common.o c-dump.o libcpp.a $(C_TARGET_OBJS)
|
||||
|
||||
# Language-specific object files for C.
|
||||
@@ -1269,6 +1270,9 @@ attribs.o : attribs.c $(CONFIG_H) $(SYST
|
||||
builtin-types.def $(TARGET_H) langhooks.h
|
||||
|
||||
c-format.o : c-format.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) langhooks.h \
|
||||
+ $(C_COMMON_H) flags.h toplev.h intl.h diagnostic.h
|
||||
+
|
||||
+c-bounded.o : c-bounded.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) langhooks.h \
|
||||
$(C_COMMON_H) flags.h toplev.h intl.h diagnostic.h
|
||||
|
||||
c-semantics.o : c-semantics.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
|
12
lang/gcc/3.3/patches/patch-gcc_ada_adaint_c
Normal file
12
lang/gcc/3.3/patches/patch-gcc_ada_adaint_c
Normal file
@ -0,0 +1,12 @@
|
||||
$OpenBSD: patch-gcc_ada_adaint_c,v 1.1.1.1 2005/01/03 15:21:27 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);
|
12
lang/gcc/3.3/patches/patch-gcc_ada_gnatchop_adb
Normal file
12
lang/gcc/3.3/patches/patch-gcc_ada_gnatchop_adb
Normal file
@ -0,0 +1,12 @@
|
||||
$OpenBSD: patch-gcc_ada_gnatchop_adb,v 1.1.1.1 2005/01/03 15:21:27 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;
|
12
lang/gcc/3.3/patches/patch-gcc_ada_gnatlink_adb
Normal file
12
lang/gcc/3.3/patches/patch-gcc_ada_gnatlink_adb
Normal file
@ -0,0 +1,12 @@
|
||||
$OpenBSD: patch-gcc_ada_gnatlink_adb,v 1.1.1.1 2005/01/03 15:21:27 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;
|
||||
|
12
lang/gcc/3.3/patches/patch-gcc_ada_make_adb
Normal file
12
lang/gcc/3.3/patches/patch-gcc_ada_make_adb
Normal file
@ -0,0 +1,12 @@
|
||||
$OpenBSD: patch-gcc_ada_make_adb,v 1.1.1.1 2005/01/03 15:21:27 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
|
12
lang/gcc/3.3/patches/patch-gcc_ada_mlib-utl_adb
Normal file
12
lang/gcc/3.3/patches/patch-gcc_ada_mlib-utl_adb
Normal file
@ -0,0 +1,12 @@
|
||||
$OpenBSD: patch-gcc_ada_mlib-utl_adb,v 1.1.1.1 2005/01/03 15:21:26 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";
|
78
lang/gcc/3.3/patches/patch-gcc_builtin-attrs_def
Normal file
78
lang/gcc/3.3/patches/patch-gcc_builtin-attrs_def
Normal file
@ -0,0 +1,78 @@
|
||||
$OpenBSD: patch-gcc_builtin-attrs_def,v 1.1.1.1 2005/01/03 15:21:29 espie Exp $
|
||||
--- gcc/builtin-attrs.def.orig Tue Mar 4 15:37:20 2003
|
||||
+++ gcc/builtin-attrs.def Mon Jan 3 10:17:41 2005
|
||||
@@ -71,13 +71,18 @@ DEF_ATTR_FOR_INT (4)
|
||||
CONCAT2 (ATTR_,VALUE1), CONCAT2 (ATTR_LIST_,VALUE2))
|
||||
DEF_LIST_INT_INT (1,0)
|
||||
DEF_LIST_INT_INT (1,2)
|
||||
+DEF_LIST_INT_INT (1,3)
|
||||
DEF_LIST_INT_INT (2,0)
|
||||
DEF_LIST_INT_INT (2,3)
|
||||
DEF_LIST_INT_INT (3,0)
|
||||
+DEF_LIST_INT_INT (3,2)
|
||||
DEF_LIST_INT_INT (3,4)
|
||||
+DEF_LIST_INT_INT (1,3_2)
|
||||
#undef DEF_LIST_INT_INT
|
||||
|
||||
/* Construct tress for identifiers. */
|
||||
+DEF_ATTR_IDENT (ATTR_BOUNDED, "bounded")
|
||||
+DEF_ATTR_IDENT (ATTR_BUFFER, "buffer")
|
||||
DEF_ATTR_IDENT (ATTR_CONST, "const")
|
||||
DEF_ATTR_IDENT (ATTR_FORMAT, "format")
|
||||
DEF_ATTR_IDENT (ATTR_FORMAT_ARG, "format_arg")
|
||||
@@ -88,7 +93,9 @@ DEF_ATTR_IDENT (ATTR_NOTHROW, "nothrow")
|
||||
DEF_ATTR_IDENT (ATTR_PRINTF, "printf")
|
||||
DEF_ATTR_IDENT (ATTR_PURE, "pure")
|
||||
DEF_ATTR_IDENT (ATTR_SCANF, "scanf")
|
||||
+DEF_ATTR_IDENT (ATTR_SIZE, "size")
|
||||
DEF_ATTR_IDENT (ATTR_STRFMON, "strfmon")
|
||||
+DEF_ATTR_IDENT (ATTR_STRING, "string")
|
||||
DEF_ATTR_IDENT (ATTR_STRFTIME, "strftime")
|
||||
|
||||
DEF_ATTR_TREE_LIST (ATTR_NOTHROW_LIST, ATTR_NOTHROW, ATTR_NULL, ATTR_NULL)
|
||||
@@ -136,6 +143,45 @@ DEF_FORMAT_ATTRIBUTE(STRFMON,3,3_4)
|
||||
DEF_FORMAT_ARG_ATTRIBUTE(1)
|
||||
DEF_FORMAT_ARG_ATTRIBUTE(2)
|
||||
#undef DEF_FORMAT_ARG_ATTRIBUTE
|
||||
+
|
||||
+/* Construct a tree for a bounded attribute. */
|
||||
+
|
||||
+/* Generate a fragment for future use in a bounded attr, e.g. ATTR_BUFFER_2_3 */
|
||||
+#define DEF_ATTR_BOUNDED_FRAG(TYPE, VALUES) \
|
||||
+ DEF_ATTR_TREE_LIST (CONCAT4 (ATTR_,TYPE,_,VALUES), ATTR_NULL, \
|
||||
+ CONCAT2 (ATTR_,TYPE), CONCAT2 (ATTR_LIST_,VALUES))
|
||||
+/* Create bounded attribute chained to nothrow, e.g. of the
|
||||
+ form ATTR_NOTHROW_BOUNDED_BUFFER_2_3 */
|
||||
+#define DEF_NOTHROW_BOUNDED_ATTRIBUTE(TYPE, VALUES) \
|
||||
+ DEF_ATTR_TREE_LIST (CONCAT4 (ATTR_NOTHROW_BOUNDED_,TYPE,_,VALUES), ATTR_BOUNDED, \
|
||||
+ CONCAT4 (ATTR_,TYPE,_,VALUES), ATTR_NOTHROW_LIST)
|
||||
+/* Chain multiple nothrow bounded buffer attributes together */
|
||||
+#define DEF_MULTIPLE_NOTHROW_BOUNDED_BUFFER_ATTRIBUTE(VAL1,VAL2) \
|
||||
+ DEF_ATTR_TREE_LIST (CONCAT4(ATTR_NOTHROW_BOUNDED_BUFFER_,VAL1,_,VAL2),ATTR_BOUNDED,\
|
||||
+ CONCAT2(ATTR_BUFFER_,VAL1), \
|
||||
+ CONCAT2(ATTR_NOTHROW_BOUNDED_BUFFER_,VAL2))
|
||||
+/* Chain a bounded attribute to a format printf attribute */
|
||||
+#define DEF_FORMAT_PRINTF_BOUNDED_ATTRIBUTE(TYPE, VALUES, PREPEND,PRINTVALS) \
|
||||
+ DEF_ATTR_TREE_LIST (CONCAT4 (PREPEND,TYPE,_,VALUES), \
|
||||
+ ATTR_BOUNDED, CONCAT4 (ATTR_,TYPE,_,VALUES), \
|
||||
+ CONCAT2(ATTR_FORMAT_PRINTF_,PRINTVALS))
|
||||
+DEF_ATTR_BOUNDED_FRAG(BUFFER,1_2)
|
||||
+DEF_ATTR_BOUNDED_FRAG(BUFFER,1_3)
|
||||
+DEF_ATTR_BOUNDED_FRAG(BUFFER,2_3)
|
||||
+DEF_ATTR_BOUNDED_FRAG(SIZE,1_3_2)
|
||||
+DEF_ATTR_BOUNDED_FRAG(STRING,1_2)
|
||||
+DEF_NOTHROW_BOUNDED_ATTRIBUTE(BUFFER,1_2)
|
||||
+DEF_NOTHROW_BOUNDED_ATTRIBUTE(BUFFER,1_3)
|
||||
+DEF_NOTHROW_BOUNDED_ATTRIBUTE(BUFFER,2_3)
|
||||
+DEF_NOTHROW_BOUNDED_ATTRIBUTE(SIZE,1_3_2)
|
||||
+DEF_MULTIPLE_NOTHROW_BOUNDED_BUFFER_ATTRIBUTE(2_3,1_3)
|
||||
+DEF_FORMAT_PRINTF_BOUNDED_ATTRIBUTE(STRING,1_2,ATTR_PRINTF_3_4_BOUNDED_,3_4)
|
||||
+DEF_FORMAT_PRINTF_BOUNDED_ATTRIBUTE(STRING,1_2,ATTR_PRINTF_3_0_BOUNDED_,3_0)
|
||||
+
|
||||
+#undef DEF_ATTR_BOUNDED_FRAG
|
||||
+#undef DEF_NOTHROW_BOUNDED_ATTRIBUTE
|
||||
+#undef DEF_MULTIPLE_NOTHROW_BOUNDED_ATTRIBUTE
|
||||
+#undef DEF_FORMAT_PRINTF_BOUNDED_ATTRIBUTE
|
||||
|
||||
/* Define an attribute for a function, along with the IDENTIFIER_NODE. */
|
||||
#define DEF_FN_ATTR_IDENT(NAME, ATTRS, PREDICATE) \
|
27
lang/gcc/3.3/patches/patch-gcc_builtins_c
Normal file
27
lang/gcc/3.3/patches/patch-gcc_builtins_c
Normal file
@ -0,0 +1,27 @@
|
||||
$OpenBSD: patch-gcc_builtins_c,v 1.1.1.1 2005/01/03 15:21:26 espie Exp $
|
||||
--- gcc/builtins.c.orig Tue Aug 3 22:06:45 2004
|
||||
+++ gcc/builtins.c Mon Jan 3 10:17:41 2005
|
||||
@@ -4003,9 +4003,11 @@ expand_builtin (exp, target, subtarget,
|
||||
break;
|
||||
|
||||
case BUILT_IN_STRCPY:
|
||||
+#ifndef NO_UNSAFE_BUILTINS
|
||||
target = expand_builtin_strcpy (exp, target, mode);
|
||||
if (target)
|
||||
return target;
|
||||
+#endif
|
||||
break;
|
||||
|
||||
case BUILT_IN_STRNCPY:
|
||||
@@ -4015,9 +4017,11 @@ expand_builtin (exp, target, subtarget,
|
||||
break;
|
||||
|
||||
case BUILT_IN_STRCAT:
|
||||
+#ifndef NO_UNSAFE_BUILTINS
|
||||
target = expand_builtin_strcat (arglist, target, mode);
|
||||
if (target)
|
||||
return target;
|
||||
+#endif
|
||||
break;
|
||||
|
||||
case BUILT_IN_STRNCAT:
|
75
lang/gcc/3.3/patches/patch-gcc_builtins_def
Normal file
75
lang/gcc/3.3/patches/patch-gcc_builtins_def
Normal file
@ -0,0 +1,75 @@
|
||||
$OpenBSD: patch-gcc_builtins_def,v 1.1.1.1 2005/01/03 15:21:29 espie Exp $
|
||||
--- gcc/builtins.def.orig Mon May 5 18:59:19 2003
|
||||
+++ gcc/builtins.def Mon Jan 3 10:17:41 2005
|
||||
@@ -230,7 +230,7 @@ DEF_BUILTIN (BUILT_IN_BZERO,
|
||||
BT_FN_VOID_PTR_SIZE,
|
||||
BT_FN_VOID_VAR,
|
||||
true, true, true,
|
||||
- ATTR_NOTHROW_LIST)
|
||||
+ ATTR_NOTHROW_BOUNDED_BUFFER_1_2)
|
||||
DEF_BUILTIN (BUILT_IN_BCMP,
|
||||
"__builtin_bcmp",
|
||||
BUILT_IN_NORMAL,
|
||||
@@ -255,7 +255,7 @@ DEF_EXT_LIB_BUILTIN(BUILT_IN_RINDEX,
|
||||
DEF_LIB_BUILTIN(BUILT_IN_MEMCPY,
|
||||
"__builtin_memcpy",
|
||||
BT_FN_PTR_PTR_CONST_PTR_SIZE,
|
||||
- ATTR_NOTHROW_LIST)
|
||||
+ ATTR_NOTHROW_BOUNDED_BUFFER_2_3_1_3)
|
||||
DEF_LIB_BUILTIN(BUILT_IN_MEMCMP,
|
||||
"__builtin_memcmp",
|
||||
BT_FN_INT_CONST_PTR_CONST_PTR_SIZE,
|
||||
@@ -263,7 +263,7 @@ DEF_LIB_BUILTIN(BUILT_IN_MEMCMP,
|
||||
DEF_LIB_BUILTIN(BUILT_IN_MEMSET,
|
||||
"__builtin_memset",
|
||||
BT_FN_PTR_PTR_INT_SIZE,
|
||||
- ATTR_NOTHROW_LIST)
|
||||
+ ATTR_NOTHROW_BOUNDED_BUFFER_1_3)
|
||||
|
||||
DEF_LIB_BUILTIN(BUILT_IN_STRCAT,
|
||||
"__builtin_strcat",
|
||||
@@ -272,7 +272,7 @@ DEF_LIB_BUILTIN(BUILT_IN_STRCAT,
|
||||
DEF_LIB_BUILTIN(BUILT_IN_STRNCAT,
|
||||
"__builtin_strncat",
|
||||
BT_FN_STRING_STRING_CONST_STRING_SIZE,
|
||||
- ATTR_NOTHROW_LIST)
|
||||
+ ATTR_NOTHROW_BOUNDED_BUFFER_1_3)
|
||||
DEF_LIB_BUILTIN(BUILT_IN_STRCPY,
|
||||
"__builtin_strcpy",
|
||||
BT_FN_STRING_STRING_CONST_STRING,
|
||||
@@ -280,7 +280,7 @@ DEF_LIB_BUILTIN(BUILT_IN_STRCPY,
|
||||
DEF_LIB_BUILTIN(BUILT_IN_STRNCPY,
|
||||
"__builtin_strncpy",
|
||||
BT_FN_STRING_STRING_CONST_STRING_SIZE,
|
||||
- ATTR_NOTHROW_LIST)
|
||||
+ ATTR_NOTHROW_BOUNDED_BUFFER_1_3)
|
||||
DEF_LIB_BUILTIN(BUILT_IN_STRCMP,
|
||||
"__builtin_strcmp",
|
||||
BT_FN_INT_CONST_STRING_CONST_STRING,
|
||||
@@ -542,7 +542,7 @@ DEF_LIB_BUILTIN(BUILT_IN_PUTS,
|
||||
DEF_C99_BUILTIN(BUILT_IN_SNPRINTF,
|
||||
"__builtin_snprintf",
|
||||
BT_FN_INT_STRING_SIZE_CONST_STRING_VAR,
|
||||
- ATTR_FORMAT_PRINTF_3_4)
|
||||
+ ATTR_PRINTF_3_4_BOUNDED_STRING_1_2)
|
||||
DEF_LIB_BUILTIN(BUILT_IN_SPRINTF,
|
||||
"__builtin_sprintf",
|
||||
BT_FN_INT_STRING_CONST_STRING_VAR,
|
||||
@@ -570,7 +570,7 @@ DEF_C99_BUILTIN(BUILT_IN_VSSCANF,
|
||||
DEF_C99_BUILTIN(BUILT_IN_VSNPRINTF,
|
||||
"__builtin_vsnprintf",
|
||||
BT_FN_INT_STRING_SIZE_CONST_STRING_VALIST_ARG,
|
||||
- ATTR_FORMAT_PRINTF_3_0)
|
||||
+ ATTR_PRINTF_3_0_BOUNDED_STRING_1_2)
|
||||
DEF_LIB_BUILTIN(BUILT_IN_VSPRINTF,
|
||||
"__builtin_vsprintf",
|
||||
BT_FN_INT_STRING_CONST_STRING_VALIST_ARG,
|
||||
@@ -597,7 +597,7 @@ DEF_BUILTIN (BUILT_IN_FPUTS,
|
||||
DEF_FALLBACK_BUILTIN(BUILT_IN_FWRITE,
|
||||
"__builtin_fwrite",
|
||||
BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR,
|
||||
- ATTR_NOTHROW_LIST)
|
||||
+ ATTR_NOTHROW_BOUNDED_SIZE_1_3_2)
|
||||
DEF_FRONT_END_LIB_BUILTIN(BUILT_IN_FPRINTF,
|
||||
"__builtin_fprintf",
|
||||
BT_FN_INT_PTR_CONST_STRING_VAR,
|
494
lang/gcc/3.3/patches/patch-gcc_c-bounded_c
Normal file
494
lang/gcc/3.3/patches/patch-gcc_c-bounded_c
Normal file
@ -0,0 +1,494 @@
|
||||
$OpenBSD: patch-gcc_c-bounded_c,v 1.1.1.1 2005/01/03 15:21:29 espie Exp $
|
||||
--- gcc/c-bounded.c.orig Mon Jan 3 10:17:41 2005
|
||||
+++ gcc/c-bounded.c Mon Jan 3 10:17:41 2005
|
||||
@@ -0,0 +1,490 @@
|
||||
+/* Bounds checker for library functions with buffers and sizes.
|
||||
+ *
|
||||
+ * Copyright (c) 2004 Anil Madhavapeddy <anil@recoil.org>
|
||||
+ *
|
||||
+ * Permission to use, copy, modify, and distribute this software for any
|
||||
+ * purpose with or without fee is hereby granted, provided that the above
|
||||
+ * copyright notice and this permission notice appear in all copies.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
+ */
|
||||
+
|
||||
+#include "config.h"
|
||||
+#include "system.h"
|
||||
+#include "tree.h"
|
||||
+#include "c-tree.h"
|
||||
+#include "flags.h"
|
||||
+#include "toplev.h"
|
||||
+#include "c-common.h"
|
||||
+#include "intl.h"
|
||||
+#include "diagnostic.h"
|
||||
+#include "langhooks.h"
|
||||
+
|
||||
+/* Handle attributes associated with bounds checking. */
|
||||
+
|
||||
+/* Bounded attribute types */
|
||||
+enum bounded_type { buffer_bound_type, string_bound_type,
|
||||
+ minbytes_bound_type, size_bound_type,
|
||||
+ bounded_type_error };
|
||||
+
|
||||
+typedef struct bound_check_info
|
||||
+{
|
||||
+ enum bounded_type bounded_type; /* type of bound (string, minsize, etc) */
|
||||
+ unsigned HOST_WIDE_INT bounded_buf; /* number of buffer pointer arg */
|
||||
+ unsigned HOST_WIDE_INT bounded_num; /* number of buffer length arg || min size */
|
||||
+ unsigned HOST_WIDE_INT bounded_size; /* number of buffer element size arg */
|
||||
+} function_bounded_info;
|
||||
+
|
||||
+tree handle_bounded_attribute(tree *, tree, tree, int, bool *);
|
||||
+void check_function_bounded (int *, tree, tree);
|
||||
+
|
||||
+static bool decode_bounded_attr PARAMS ((tree, function_bounded_info *, int));
|
||||
+static enum bounded_type decode_bounded_type PARAMS ((const char *));
|
||||
+
|
||||
+/* Handle a "bounded" attribute; arguments as in
|
||||
+ struct attribute_spec.handler. */
|
||||
+tree
|
||||
+handle_bounded_attribute (node, name, args, flags, no_add_attrs)
|
||||
+ tree *node;
|
||||
+ tree name ATTRIBUTE_UNUSED;
|
||||
+ tree args;
|
||||
+ int flags ATTRIBUTE_UNUSED;
|
||||
+ bool *no_add_attrs;
|
||||
+{
|
||||
+ tree type = *node;
|
||||
+ function_bounded_info info;
|
||||
+ tree argument, arg_iterate;
|
||||
+ unsigned HOST_WIDE_INT arg_num;
|
||||
+
|
||||
+ if (!decode_bounded_attr (args, &info, 0))
|
||||
+ {
|
||||
+ *no_add_attrs = true;
|
||||
+ return NULL_TREE;
|
||||
+ }
|
||||
+
|
||||
+ /* `min_size' directly specifies the minimum buffer length */
|
||||
+ if (info.bounded_type == minbytes_bound_type
|
||||
+ && info.bounded_num <= 0)
|
||||
+ {
|
||||
+ error ("`minbytes' bound size must be a positive integer value");
|
||||
+ *no_add_attrs = true;
|
||||
+ return NULL_TREE;
|
||||
+ }
|
||||
+
|
||||
+ argument = TYPE_ARG_TYPES (type);
|
||||
+ if (argument)
|
||||
+ {
|
||||
+ arg_iterate = argument;
|
||||
+ for (arg_num = 1; ; ++arg_num)
|
||||
+ {
|
||||
+ if (arg_iterate == 0 || arg_num == info.bounded_buf)
|
||||
+ break;
|
||||
+ arg_iterate = TREE_CHAIN (arg_iterate);
|
||||
+ }
|
||||
+ if (! arg_iterate
|
||||
+ || (TREE_CODE (TREE_VALUE (arg_iterate)) != POINTER_TYPE
|
||||
+ && TREE_CODE (TREE_VALUE (arg_iterate)) != ARRAY_TYPE))
|
||||
+ {
|
||||
+ error ("bound buffer argument not an array or pointer type");
|
||||
+ *no_add_attrs = true;
|
||||
+ return NULL_TREE;
|
||||
+ }
|
||||
+
|
||||
+ if (info.bounded_type == size_bound_type
|
||||
+ || info.bounded_type == string_bound_type
|
||||
+ || info.bounded_type == buffer_bound_type)
|
||||
+ {
|
||||
+ arg_iterate = argument;
|
||||
+ for (arg_num = 1; ; ++arg_num)
|
||||
+ {
|
||||
+ if (arg_iterate == 0 || arg_num == info.bounded_num)
|
||||
+ break;
|
||||
+ arg_iterate = TREE_CHAIN (arg_iterate);
|
||||
+ }
|
||||
+ if (! arg_iterate
|
||||
+ || TREE_CODE (TREE_VALUE (arg_iterate)) != INTEGER_TYPE)
|
||||
+ {
|
||||
+ error ("bound length argument not an integer type");
|
||||
+ *no_add_attrs = true;
|
||||
+ return NULL_TREE;
|
||||
+ }
|
||||
+ }
|
||||
+ if (info.bounded_type == size_bound_type)
|
||||
+ {
|
||||
+ arg_iterate = argument;
|
||||
+ for (arg_num = 1; ; ++arg_num)
|
||||
+ {
|
||||
+ if (arg_iterate == 0 || arg_num == info.bounded_size)
|
||||
+ break;
|
||||
+ arg_iterate = TREE_CHAIN (arg_iterate);
|
||||
+ }
|
||||
+ if (! arg_iterate
|
||||
+ || TREE_CODE (TREE_VALUE (arg_iterate)) != INTEGER_TYPE)
|
||||
+ {
|
||||
+ error ("bound element size argument not an integer type");
|
||||
+ *no_add_attrs = true;
|
||||
+ return NULL_TREE;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return NULL_TREE;
|
||||
+}
|
||||
+
|
||||
+/* Decode the arguments to a "bounded" attribute into a function_bounded_info
|
||||
+ structure. It is already known that the list is of the right length.
|
||||
+ If VALIDATED_P is true, then these attributes have already been validated
|
||||
+ and this function will abort if they are erroneous; if false, it
|
||||
+ will give an error message. Returns true if the attributes are
|
||||
+ successfully decoded, false otherwise. */
|
||||
+
|
||||
+static bool
|
||||
+decode_bounded_attr (args, info, validated_p)
|
||||
+ tree args;
|
||||
+ function_bounded_info *info;
|
||||
+ int validated_p;
|
||||
+{
|
||||
+ int bounded_num;
|
||||
+ tree bounded_type_id = TREE_VALUE (args);
|
||||
+ tree bounded_buf_expr = TREE_VALUE (TREE_CHAIN (args));
|
||||
+ tree bounded_num_expr = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (args)));
|
||||
+ tree bounded_size_expr = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (args)));
|
||||
+
|
||||
+ if (TREE_CODE (bounded_type_id) != IDENTIFIER_NODE)
|
||||
+ {
|
||||
+ if (validated_p)
|
||||
+ abort ();
|
||||
+ error ("unrecognized bounded type specifier");
|
||||
+ return false;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ const char *p = IDENTIFIER_POINTER (bounded_type_id);
|
||||
+
|
||||
+ info->bounded_type = decode_bounded_type (p);
|
||||
+
|
||||
+ if (info->bounded_type == bounded_type_error)
|
||||
+ {
|
||||
+ if (validated_p)
|
||||
+ abort ();
|
||||
+ warning ("`%s' is an unrecognized bounded function type", p);
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* Extract the third argument if its appropriate */
|
||||
+ switch (info->bounded_type)
|
||||
+ {
|
||||
+ case bounded_type_error:
|
||||
+ /* should never happen */
|
||||
+ internal_error ("unexpected bounded_type_error in decode_bounded_attr");
|
||||
+ break;
|
||||
+ case string_bound_type:
|
||||
+ if (bounded_size_expr)
|
||||
+ warning ("`string' bound type only takes 2 parameters");
|
||||
+ bounded_size_expr = size_int (0);
|
||||
+ break;
|
||||
+ case buffer_bound_type:
|
||||
+ if (bounded_size_expr)
|
||||
+ warning ("`buffer' bound type only takes 2 parameters");
|
||||
+ bounded_size_expr = size_int (0);
|
||||
+ break;
|
||||
+ case minbytes_bound_type:
|
||||
+ if (bounded_size_expr)
|
||||
+ warning("`minbytes' bound type only takes 2 parameters");
|
||||
+ bounded_size_expr = size_int (0);
|
||||
+ break;
|
||||
+ case size_bound_type:
|
||||
+ if (bounded_size_expr)
|
||||
+ bounded_size_expr = TREE_VALUE (bounded_size_expr);
|
||||
+ else
|
||||
+ {
|
||||
+ error ("parameter 3 not specified for `size' bounded function");
|
||||
+ return false;
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ /* Strip any conversions from the buffer parameters and verify they
|
||||
+ are constants */
|
||||
+ while (TREE_CODE (bounded_num_expr) == NOP_EXPR
|
||||
+ || TREE_CODE (bounded_num_expr) == CONVERT_EXPR
|
||||
+ || TREE_CODE (bounded_num_expr) == NON_LVALUE_EXPR)
|
||||
+ bounded_num_expr = TREE_OPERAND (bounded_num_expr, 0);
|
||||
+
|
||||
+ while (TREE_CODE (bounded_buf_expr) == NOP_EXPR
|
||||
+ || TREE_CODE (bounded_buf_expr) == CONVERT_EXPR
|
||||
+ || TREE_CODE (bounded_buf_expr) == NON_LVALUE_EXPR)
|
||||
+ bounded_buf_expr = TREE_OPERAND (bounded_buf_expr, 0);
|
||||
+
|
||||
+ while (TREE_CODE (bounded_size_expr) == NOP_EXPR
|
||||
+ || TREE_CODE (bounded_size_expr) == CONVERT_EXPR
|
||||
+ || TREE_CODE (bounded_size_expr) == NON_LVALUE_EXPR)
|
||||
+ bounded_size_expr = TREE_OPERAND (bounded_size_expr, 0);
|
||||
+
|
||||
+ if (TREE_CODE (bounded_num_expr) != INTEGER_CST)
|
||||
+ {
|
||||
+ if (validated_p)
|
||||
+ abort ();
|
||||
+ error ("bound length operand number is not an integer constant");
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ if (TREE_CODE (bounded_buf_expr) != INTEGER_CST)
|
||||
+ {
|
||||
+ if (validated_p)
|
||||
+ abort ();
|
||||
+ error ("bound buffer operand number is not an integer constant");
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ if (TREE_CODE (bounded_size_expr) != INTEGER_CST)
|
||||
+ {
|
||||
+ if (validated_p)
|
||||
+ abort ();
|
||||
+ error ("bound element size operand number is not an integer constant");
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ info->bounded_buf = TREE_INT_CST_LOW (bounded_buf_expr);
|
||||
+ info->bounded_size = TREE_INT_CST_LOW (bounded_size_expr);
|
||||
+ bounded_num = TREE_INT_CST_LOW (bounded_num_expr);
|
||||
+
|
||||
+ /* `minbytes' directly specifies the minimum buffer length */
|
||||
+ if (info->bounded_type == minbytes_bound_type
|
||||
+ && bounded_num <= 0)
|
||||
+ {
|
||||
+ if (validated_p)
|
||||
+ abort ();
|
||||
+ error ("`minbytes' bound size must be a positive integer value");
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ info->bounded_num = (unsigned HOST_WIDE_INT) bounded_num;
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+static void check_bounded_info PARAMS ((int *, function_bounded_info *, tree));
|
||||
+
|
||||
+/* Decode a bounded type from a string, returning the type, or
|
||||
+ bounded_type_error if not valid, in which case the caller should print an
|
||||
+ error message. */
|
||||
+static enum bounded_type
|
||||
+decode_bounded_type (s)
|
||||
+ const char *s;
|
||||
+{
|
||||
+ if (!strcmp (s, "string") || !strcmp (s, "__string__"))
|
||||
+ return string_bound_type;
|
||||
+ else if (!strcmp (s, "buffer") || !strcmp (s, "__buffer__"))
|
||||
+ return buffer_bound_type;
|
||||
+ else if (!strcmp (s, "minbytes") || !strcmp (s, "__minbytes__"))
|
||||
+ return minbytes_bound_type;
|
||||
+ else if (!strcmp (s, "size") || !strcmp (s, "__size__"))
|
||||
+ return size_bound_type;
|
||||
+ else
|
||||
+ return bounded_type_error;
|
||||
+}
|
||||
+
|
||||
+/* Check the argument list of a call to memcpy, bzero, etc.
|
||||
+ ATTRS are the attributes on the function type.
|
||||
+ PARAMS is the list of argument values. */
|
||||
+
|
||||
+void
|
||||
+check_function_bounded (status, attrs, params)
|
||||
+ int *status;
|
||||
+ tree attrs;
|
||||
+ tree params;
|
||||
+{
|
||||
+ tree a;
|
||||
+ /* See if this function has any bounded attributes. */
|
||||
+ for (a = attrs; a; a = TREE_CHAIN (a))
|
||||
+ {
|
||||
+ if (is_attribute_p ("bounded", TREE_PURPOSE (a)))
|
||||
+ {
|
||||
+ /* Yup; check it. */
|
||||
+ function_bounded_info info;
|
||||
+ decode_bounded_attr (TREE_VALUE (a), &info, 1);
|
||||
+ check_bounded_info (status, &info, params);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/* This function replaces `warning' inside the bounds checking
|
||||
+ functions. If the `status' parameter is non-NULL, then it is
|
||||
+ dereferenced and set to 1 whenever a warning is caught. Otherwise
|
||||
+ it warns as usual by replicating the innards of the warning
|
||||
+ function from diagnostic.c. */
|
||||
+static void
|
||||
+status_warning VPARAMS ((int *status, const char *msgid, ...))
|
||||
+{
|
||||
+ diagnostic_info diagnostic ;
|
||||
+
|
||||
+ VA_OPEN (ap, msgid);
|
||||
+ VA_FIXEDARG (ap, int *, status);
|
||||
+ VA_FIXEDARG (ap, const char *, msgid);
|
||||
+
|
||||
+ if (status)
|
||||
+ *status = 1;
|
||||
+ else
|
||||
+ {
|
||||
+ /* This duplicates the warning function behavior. */
|
||||
+ diagnostic_set_info (&diagnostic, _(msgid), &ap, input_filename, lineno,
|
||||
+ DK_WARNING);
|
||||
+ report_diagnostic (&diagnostic);
|
||||
+ }
|
||||
+
|
||||
+ VA_CLOSE (ap);
|
||||
+}
|
||||
+
|
||||
+/* Check the argument list of a call to memcpy, bzero, etc.
|
||||
+ INFO points to the function_bounded_info structure.
|
||||
+ PARAMS is the list of argument values. */
|
||||
+
|
||||
+static void
|
||||
+check_bounded_info (status, info, params)
|
||||
+ int *status;
|
||||
+ function_bounded_info *info;
|
||||
+ tree params;
|
||||
+{
|
||||
+ tree buf_expr, length_expr, size_expr;
|
||||
+ unsigned HOST_WIDE_INT arg_num;
|
||||
+
|
||||
+ /* Extract the buffer expression from the arguments */
|
||||
+ buf_expr = params;
|
||||
+ for (arg_num = 1; ; ++arg_num)
|
||||
+ {
|
||||
+ if (buf_expr == 0)
|
||||
+ return;
|
||||
+ if (arg_num == info->bounded_buf)
|
||||
+ break;
|
||||
+ buf_expr = TREE_CHAIN (buf_expr);
|
||||
+ }
|
||||
+ buf_expr = TREE_VALUE (buf_expr);
|
||||
+
|
||||
+ /* Get the buffer length, either directly from the function attribute
|
||||
+ info, or from the parameter pointed to */
|
||||
+ if (info->bounded_type == minbytes_bound_type)
|
||||
+ length_expr = size_int (info->bounded_num);
|
||||
+ else
|
||||
+ {
|
||||
+ /* Extract the buffer length expression from the arguments */
|
||||
+ length_expr = params;
|
||||
+ for (arg_num = 1; ; ++arg_num)
|
||||
+ {
|
||||
+ if (length_expr == 0)
|
||||
+ return;
|
||||
+ if (arg_num == info->bounded_num)
|
||||
+ break;
|
||||
+ length_expr = TREE_CHAIN (length_expr);
|
||||
+ }
|
||||
+ length_expr = TREE_VALUE (length_expr);
|
||||
+ }
|
||||
+
|
||||
+ /* If the bound type is `size', resolve the third parameter */
|
||||
+ if (info->bounded_type == size_bound_type)
|
||||
+ {
|
||||
+ size_expr = params;
|
||||
+ for (arg_num = 1; ; ++arg_num)
|
||||
+ {
|
||||
+ if (size_expr == 0)
|
||||
+ return;
|
||||
+ if (arg_num == info->bounded_size)
|
||||
+ break;
|
||||
+ size_expr = TREE_CHAIN (size_expr);
|
||||
+ }
|
||||
+ size_expr = TREE_VALUE (size_expr);
|
||||
+ }
|
||||
+ else
|
||||
+ size_expr = size_int (0);
|
||||
+
|
||||
+ STRIP_NOPS (buf_expr);
|
||||
+
|
||||
+ /* Check for a possible sizeof(pointer) error in string functions */
|
||||
+ if (info->bounded_type == string_bound_type
|
||||
+ && SIZEOF_PTR_DERIVED (length_expr))
|
||||
+ status_warning(status, "sizeof(pointer) possibly incorrect in argument %d",
|
||||
+ info->bounded_num);
|
||||
+
|
||||
+ /* We only need to check if the buffer expression is a static
|
||||
+ * array (which is inside an ADDR_EXPR) */
|
||||
+ if (TREE_CODE (buf_expr) != ADDR_EXPR)
|
||||
+ return;
|
||||
+ buf_expr = TREE_OPERAND (buf_expr, 0);
|
||||
+
|
||||
+ if (TREE_CODE (TREE_TYPE (buf_expr)) == ARRAY_TYPE
|
||||
+ && TYPE_DOMAIN (TREE_TYPE (buf_expr)))
|
||||
+ {
|
||||
+ int array_size, length, elem_size, type_size;
|
||||
+ tree array_size_expr = TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (buf_expr)));
|
||||
+ tree array_type = TREE_TYPE (TREE_TYPE (buf_expr));
|
||||
+ tree array_type_size_expr = TYPE_SIZE (array_type);
|
||||
+
|
||||
+ /* Can't deal with variable-sized arrays yet */
|
||||
+ if (TREE_CODE (array_type_size_expr) != INTEGER_CST)
|
||||
+ return;
|
||||
+
|
||||
+ /* Get the size of the type of the array and sanity check it */
|
||||
+ type_size = TREE_INT_CST_LOW (array_type_size_expr);
|
||||
+ if ((type_size % 8) != 0)
|
||||
+ {
|
||||
+ error ("found non-byte aligned type while checking bounds");
|
||||
+ return;
|
||||
+ }
|
||||
+ type_size /= 8;
|
||||
+
|
||||
+ /* Both the size of the static buffer and the length should be
|
||||
+ * integer constants by now */
|
||||
+ if (TREE_CODE (array_size_expr) != INTEGER_CST
|
||||
+ || TREE_CODE (length_expr) != INTEGER_CST
|
||||
+ || TREE_CODE (size_expr) != INTEGER_CST)
|
||||
+ return;
|
||||
+
|
||||
+ /* array_size_expr contains maximum array index, so add one for size */
|
||||
+ array_size = (TREE_INT_CST_LOW (array_size_expr) + 1) * type_size;
|
||||
+ length = TREE_INT_CST_LOW (length_expr);
|
||||
+
|
||||
+ /* XXX - warn about a too-small buffer? */
|
||||
+ if (array_size < 1)
|
||||
+ return;
|
||||
+
|
||||
+ switch (info->bounded_type)
|
||||
+ {
|
||||
+ case bounded_type_error:
|
||||
+ /* should never happen */
|
||||
+ internal_error ("unexpected bounded_type_error");
|
||||
+ break;
|
||||
+ case string_bound_type:
|
||||
+ case buffer_bound_type:
|
||||
+ /* warn about illegal bounds value */
|
||||
+ if (length < 0)
|
||||
+ status_warning (status, "non-positive bounds length (%d) detected", length);
|
||||
+ /* check if the static buffer is smaller than bound length */
|
||||
+ if (array_size < length)
|
||||
+ status_warning(status, "array size (%d) smaller than bound length (%d)",
|
||||
+ array_size, length);
|
||||
+ break;
|
||||
+ case minbytes_bound_type:
|
||||
+ /* check if array is smaller than the minimum allowed */
|
||||
+ if (array_size < length)
|
||||
+ status_warning (status, "array size (%d) is smaller than minimum required (%d)",
|
||||
+ array_size, length);
|
||||
+ break;
|
||||
+ case size_bound_type:
|
||||
+ elem_size = TREE_INT_CST_LOW (size_expr);
|
||||
+ /* warn about illegal bounds value */
|
||||
+ if (length < 1)
|
||||
+ status_warning (status, "non-positive bounds length (%d) detected", length);
|
||||
+ /* check if the static buffer is smaller than bound length */
|
||||
+ if (array_size < (length * elem_size))
|
||||
+ status_warning(status, "array size (%d) smaller than required length (%d * %d)",
|
||||
+ array_size, length, elem_size);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
120
lang/gcc/3.3/patches/patch-gcc_c-common_c
Normal file
120
lang/gcc/3.3/patches/patch-gcc_c-common_c
Normal file
@ -0,0 +1,120 @@
|
||||
$OpenBSD: patch-gcc_c-common_c,v 1.1.1.1 2005/01/03 15:21:29 espie Exp $
|
||||
--- gcc/c-common.c.orig Sun Jun 8 00:13:24 2003
|
||||
+++ gcc/c-common.c Mon Jan 3 10:17:41 2005
|
||||
@@ -39,7 +39,6 @@ Software Foundation, 59 Temple Place - S
|
||||
#include "langhooks.h"
|
||||
#include "except.h" /* For USING_SJLJ_EXCEPTIONS. */
|
||||
#include "tree-inline.h"
|
||||
-#include "c-tree.h"
|
||||
|
||||
cpp_reader *parse_in; /* Declared in c-pragma.h. */
|
||||
|
||||
@@ -333,7 +332,10 @@ int warn_format_nonliteral;
|
||||
|
||||
int warn_format_security;
|
||||
|
||||
+/* Warn about buffer size mismatches. */
|
||||
|
||||
+int warn_bounded;
|
||||
+
|
||||
/* C/ObjC language option variables. */
|
||||
|
||||
|
||||
@@ -767,6 +769,8 @@ static tree handle_vector_size_attribute
|
||||
bool *));
|
||||
static tree handle_nonnull_attribute PARAMS ((tree *, tree, tree, int,
|
||||
bool *));
|
||||
+static tree handle_sentinel_attribute PARAMS ((tree *, tree, tree, int,
|
||||
+ bool *));
|
||||
static tree handle_nothrow_attribute PARAMS ((tree *, tree, tree, int,
|
||||
bool *));
|
||||
static tree handle_cleanup_attribute PARAMS ((tree *, tree, tree, int,
|
||||
@@ -850,12 +854,16 @@ const struct attribute_spec c_common_att
|
||||
handle_deprecated_attribute },
|
||||
{ "vector_size", 1, 1, false, true, false,
|
||||
handle_vector_size_attribute },
|
||||
+ { "bounded", 3, 4, false, true, false,
|
||||
+ handle_bounded_attribute },
|
||||
{ "visibility", 1, 1, true, false, false,
|
||||
handle_visibility_attribute },
|
||||
{ "tls_model", 1, 1, true, false, false,
|
||||
handle_tls_model_attribute },
|
||||
{ "nonnull", 0, -1, false, true, true,
|
||||
handle_nonnull_attribute },
|
||||
+ { "sentinel", 0, 0, false, true, true,
|
||||
+ handle_sentinel_attribute },
|
||||
{ "nothrow", 0, 0, true, false, false,
|
||||
handle_nothrow_attribute },
|
||||
{ "may_alias", 0, 0, false, true, false, NULL },
|
||||
@@ -3052,6 +3060,7 @@ c_sizeof_or_alignof_type (type, op, comp
|
||||
const char *op_name;
|
||||
tree value = NULL;
|
||||
enum tree_code type_code = TREE_CODE (type);
|
||||
+ bool sizeof_ptr_flag = false;
|
||||
|
||||
my_friendly_assert (op == SIZEOF_EXPR || op == ALIGNOF_EXPR, 20020720);
|
||||
op_name = op == SIZEOF_EXPR ? "sizeof" : "__alignof__";
|
||||
@@ -3083,10 +3092,15 @@ c_sizeof_or_alignof_type (type, op, comp
|
||||
else
|
||||
{
|
||||
if (op == SIZEOF_EXPR)
|
||||
- /* Convert in case a char is more than one unit. */
|
||||
- value = size_binop (CEIL_DIV_EXPR, TYPE_SIZE_UNIT (type),
|
||||
- size_int (TYPE_PRECISION (char_type_node)
|
||||
- / BITS_PER_UNIT));
|
||||
+ {
|
||||
+ /* Convert in case a char is more than one unit. */
|
||||
+ value = size_binop (CEIL_DIV_EXPR, TYPE_SIZE_UNIT (type),
|
||||
+ size_int (TYPE_PRECISION (char_type_node)
|
||||
+ / BITS_PER_UNIT));
|
||||
+
|
||||
+ if (type_code == POINTER_TYPE)
|
||||
+ sizeof_ptr_flag = true;
|
||||
+ }
|
||||
else
|
||||
value = size_int (TYPE_ALIGN (type) / BITS_PER_UNIT);
|
||||
}
|
||||
@@ -3097,7 +3111,10 @@ c_sizeof_or_alignof_type (type, op, comp
|
||||
`size_t', which is just a typedef for an ordinary integer type. */
|
||||
value = fold (build1 (NOP_EXPR, size_type_node, value));
|
||||
my_friendly_assert (!TYPE_IS_SIZETYPE (TREE_TYPE (value)), 20001021);
|
||||
-
|
||||
+
|
||||
+ if (sizeof_ptr_flag)
|
||||
+ SIZEOF_PTR_DERIVED (value) = 1;
|
||||
+
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -6381,6 +6398,21 @@ vector_size_helper (type, bottom)
|
||||
return outer;
|
||||
}
|
||||
|
||||
+/* Handle a "sentinel" attribute.
|
||||
+ Just a stub for now. */
|
||||
+
|
||||
+static tree
|
||||
+handle_sentinel_attribute (node, name, args, flags, no_add_attrs)
|
||||
+ tree *node;
|
||||
+ tree name ATTRIBUTE_UNUSED;
|
||||
+ tree args;
|
||||
+ int flags ATTRIBUTE_UNUSED;
|
||||
+ bool *no_add_attrs;
|
||||
+{
|
||||
+ *no_add_attrs = true;
|
||||
+ return NULL_TREE;
|
||||
+}
|
||||
+
|
||||
/* Handle the "nonnull" attribute. */
|
||||
static tree
|
||||
handle_nonnull_attribute (node, name, args, flags, no_add_attrs)
|
||||
@@ -6594,6 +6626,9 @@ check_function_arguments (attrs, params)
|
||||
|
||||
if (warn_format)
|
||||
check_function_format (NULL, attrs, params);
|
||||
+
|
||||
+ if (warn_bounded)
|
||||
+ check_function_bounded (NULL, attrs, params);
|
||||
}
|
||||
|
||||
/* Generic argument checking recursion routine. PARAM is the argument to
|
25
lang/gcc/3.3/patches/patch-gcc_c-common_h
Normal file
25
lang/gcc/3.3/patches/patch-gcc_c-common_h
Normal file
@ -0,0 +1,25 @@
|
||||
$OpenBSD: patch-gcc_c-common_h,v 1.1.1.1 2005/01/03 15:21:29 espie Exp $
|
||||
--- gcc/c-common.h.orig Sun Dec 1 18:51:44 2002
|
||||
+++ gcc/c-common.h Mon Jan 3 10:17:41 2005
|
||||
@@ -501,7 +501,10 @@ extern int warn_format_nonliteral;
|
||||
|
||||
extern int warn_format_security;
|
||||
|
||||
+/* Warn about buffer size mismatches. */
|
||||
|
||||
+extern int warn_bounded;
|
||||
+
|
||||
/* C/ObjC language option variables. */
|
||||
|
||||
|
||||
@@ -866,7 +869,10 @@ extern void check_function_arguments_rec
|
||||
void *, tree,
|
||||
unsigned HOST_WIDE_INT));
|
||||
extern void check_function_format PARAMS ((int *, tree, tree));
|
||||
+extern void check_function_bounded PARAMS ((int *, tree, tree));
|
||||
extern void set_Wformat PARAMS ((int));
|
||||
+extern tree handle_bounded_attribute PARAMS ((tree *, tree, tree,
|
||||
+ int, bool *));
|
||||
extern tree handle_format_attribute PARAMS ((tree *, tree, tree,
|
||||
int, bool *));
|
||||
extern tree handle_format_arg_attribute PARAMS ((tree *, tree, tree,
|
200
lang/gcc/3.3/patches/patch-gcc_c-format_c
Normal file
200
lang/gcc/3.3/patches/patch-gcc_c-format_c
Normal file
@ -0,0 +1,200 @@
|
||||
$OpenBSD: patch-gcc_c-format_c,v 1.1.1.1 2005/01/03 15:21:29 espie Exp $
|
||||
--- gcc/c-format.c.orig Sun Dec 1 18:51:44 2002
|
||||
+++ gcc/c-format.c Mon Jan 3 10:17:41 2005
|
||||
@@ -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 };
|
||||
|
||||
@@ -540,6 +540,10 @@ typedef struct format_wanted_type
|
||||
/* Whether the argument, dereferenced once, is written into and so the
|
||||
argument must not be a pointer to a const-qualified type. */
|
||||
int writing_in_flag;
|
||||
+ /* If the argument is to be written into and is an array, should the
|
||||
+ width specifier be equal to the size of the array, or one less
|
||||
+ (to accommodate a NULL being placed at the end) */
|
||||
+ int size_equals_width;
|
||||
/* Whether the argument, dereferenced once, is read from and so
|
||||
must not be a NULL pointer. */
|
||||
int reading_from_flag;
|
||||
@@ -552,6 +556,8 @@ typedef struct format_wanted_type
|
||||
const char *name;
|
||||
/* The actual parameter to check against the wanted type. */
|
||||
tree param;
|
||||
+ /* Field width of type */
|
||||
+ int field_width;
|
||||
/* The argument number of that parameter. */
|
||||
int arg_num;
|
||||
/* The next type to check for this format conversion, or NULL if none. */
|
||||
@@ -572,7 +578,15 @@ 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 +779,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 +882,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,
|
||||
@@ -1574,6 +1640,7 @@ check_format_info_main (status, res, inf
|
||||
const format_length_info *fli = NULL;
|
||||
const format_char_info *fci = NULL;
|
||||
char flag_chars[256];
|
||||
+ int field_width = 0;
|
||||
int aflag = 0;
|
||||
if (*format_chars == 0)
|
||||
{
|
||||
@@ -1715,20 +1782,29 @@ check_format_info_main (status, res, inf
|
||||
/* Possibly read a numeric width. If the width is zero,
|
||||
we complain if appropriate. */
|
||||
int non_zero_width_char = FALSE;
|
||||
- int found_width = FALSE;
|
||||
+ unsigned int found_width = 0;
|
||||
+ char format_num_str[32];
|
||||
+
|
||||
+ format_num_str[0] = '\0';
|
||||
while (ISDIGIT (*format_chars))
|
||||
{
|
||||
- found_width = TRUE;
|
||||
+ if (found_width < (sizeof(format_num_str)-2))
|
||||
+ {
|
||||
+ format_num_str[found_width++] = *format_chars;
|
||||
+ format_num_str[found_width] = '\0';
|
||||
+ }
|
||||
if (*format_chars != '0')
|
||||
non_zero_width_char = TRUE;
|
||||
++format_chars;
|
||||
}
|
||||
- if (found_width && !non_zero_width_char &&
|
||||
+
|
||||
+ if (found_width > 0 && !non_zero_width_char &&
|
||||
(fki->flags & (int) FMT_FLAG_ZERO_WIDTH_BAD))
|
||||
status_warning (status, "zero width in %s format",
|
||||
fki->name);
|
||||
- if (found_width)
|
||||
+ if (found_width > 0)
|
||||
{
|
||||
+ field_width = atoi(format_num_str);
|
||||
i = strlen (flag_chars);
|
||||
flag_chars[i++] = fki->width_char;
|
||||
flag_chars[i] = 0;
|
||||
@@ -2126,10 +2202,15 @@ check_format_info_main (status, res, inf
|
||||
main_wanted_type.wanted_type_name = wanted_type_name;
|
||||
main_wanted_type.pointer_count = fci->pointer_count + aflag;
|
||||
main_wanted_type.char_lenient_flag = 0;
|
||||
+ main_wanted_type.field_width = field_width;
|
||||
if (strchr (fci->flags2, 'c') != 0)
|
||||
main_wanted_type.char_lenient_flag = 1;
|
||||
main_wanted_type.writing_in_flag = 0;
|
||||
main_wanted_type.reading_from_flag = 0;
|
||||
+ if (strchr (fci->format_chars, 'c') != 0)
|
||||
+ main_wanted_type.size_equals_width = 1;
|
||||
+ else
|
||||
+ main_wanted_type.size_equals_width = 0;
|
||||
if (aflag)
|
||||
main_wanted_type.writing_in_flag = 1;
|
||||
else
|
||||
@@ -2224,6 +2305,27 @@ check_format_types (status, types)
|
||||
cur_param = TREE_OPERAND (cur_param, 0);
|
||||
else
|
||||
cur_param = 0;
|
||||
+
|
||||
+ /* Test static string bounds for sscan if -Wbounded is on as well */
|
||||
+ if (warn_bounded
|
||||
+ && types->writing_in_flag
|
||||
+ && i == 0
|
||||
+ && cur_param != 0
|
||||
+ && COMPLETE_TYPE_P (TREE_TYPE (cur_param))
|
||||
+ && TREE_CODE (TREE_TYPE (cur_param)) == ARRAY_TYPE
|
||||
+ && TREE_CODE (TREE_TYPE (TREE_TYPE (cur_param))) == INTEGER_TYPE)
|
||||
+ {
|
||||
+ tree array_domain = TYPE_DOMAIN (TREE_TYPE (cur_param));
|
||||
+ tree array_size_expr = TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (cur_param)));
|
||||
+ int f = types->size_equals_width ? 0 : 1;
|
||||
+ if (array_size_expr != 0 && types->field_width > 0)
|
||||
+ {
|
||||
+ int array_size = TREE_INT_CST_LOW (array_size_expr) + 1;
|
||||
+ if (array_size < (types->field_width + f))
|
||||
+ warning ("Array size (%d) smaller than format string size (%d)",
|
||||
+ array_size, types->field_width + f);
|
||||
+ }
|
||||
+ }
|
||||
|
||||
/* See if this is an attempt to write into a const type with
|
||||
scanf or with printf "%n". Note: the writing in happens
|
30
lang/gcc/3.3/patches/patch-gcc_c-opts_c
Normal file
30
lang/gcc/3.3/patches/patch-gcc_c-opts_c
Normal file
@ -0,0 +1,30 @@
|
||||
$OpenBSD: patch-gcc_c-opts_c,v 1.1.1.1 2005/01/03 15:21:26 espie Exp $
|
||||
--- gcc/c-opts.c.orig Thu Jun 12 13:58:31 2003
|
||||
+++ gcc/c-opts.c Mon Jan 3 10:17:41 2005
|
||||
@@ -127,6 +127,7 @@ static void sanitize_cpp_opts PARAMS ((v
|
||||
OPT("Wabi", CL_CXX, OPT_Wabi) \
|
||||
OPT("Wall", CL_ALL, OPT_Wall) \
|
||||
OPT("Wbad-function-cast", CL_C, OPT_Wbad_function_cast) \
|
||||
+ OPT("Wbounded", CL_ALL, OPT_Wbounded) \
|
||||
OPT("Wcast-qual", CL_ALL, OPT_Wcast_qual) \
|
||||
OPT("Wchar-subscripts", CL_ALL, OPT_Wchar_subscripts) \
|
||||
OPT("Wcomment", CL_ALL, OPT_Wcomment) \
|
||||
@@ -694,6 +695,7 @@ c_common_decode_option (argc, argv)
|
||||
set_Wunused (on);
|
||||
set_Wformat (on);
|
||||
set_Wimplicit (on);
|
||||
+ warn_bounded = on;
|
||||
warn_char_subscripts = on;
|
||||
warn_missing_braces = on;
|
||||
warn_parentheses = on;
|
||||
@@ -787,6 +789,10 @@ c_common_decode_option (argc, argv)
|
||||
|
||||
case OPT_Wfloat_equal:
|
||||
warn_float_equal = on;
|
||||
+ break;
|
||||
+
|
||||
+ case OPT_Wbounded:
|
||||
+ warn_bounded = on;
|
||||
break;
|
||||
|
||||
case OPT_Wformat:
|
12
lang/gcc/3.3/patches/patch-gcc_collect2_c
Normal file
12
lang/gcc/3.3/patches/patch-gcc_collect2_c
Normal file
@ -0,0 +1,12 @@
|
||||
$OpenBSD: patch-gcc_collect2_c,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/collect2.c.orig Mon Dec 8 20:02:39 2003
|
||||
+++ gcc/collect2.c Mon Jan 3 10:17:41 2005
|
||||
@@ -1572,7 +1572,7 @@ collect_execute (prog, argv, redir)
|
||||
if (redir)
|
||||
{
|
||||
/* Open response file. */
|
||||
- redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT);
|
||||
+ redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT, 0666);
|
||||
|
||||
/* Duplicate the stdout and stderr file handles
|
||||
so they can be restored later. */
|
27
lang/gcc/3.3/patches/patch-gcc_config_alpha_openbsd1_h
Normal file
27
lang/gcc/3.3/patches/patch-gcc_config_alpha_openbsd1_h
Normal file
@ -0,0 +1,27 @@
|
||||
$OpenBSD: patch-gcc_config_alpha_openbsd1_h,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/config/alpha/openbsd1.h.orig Mon Jan 3 10:17:43 2005
|
||||
+++ gcc/config/alpha/openbsd1.h Mon Jan 3 10:17:43 2005
|
||||
@@ -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
|
133
lang/gcc/3.3/patches/patch-gcc_config_alpha_openbsd_h
Normal file
133
lang/gcc/3.3/patches/patch-gcc_config_alpha_openbsd_h
Normal file
@ -0,0 +1,133 @@
|
||||
$OpenBSD: patch-gcc_config_alpha_openbsd_h,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/config/alpha/openbsd.h.orig Mon May 13 07:57:38 2002
|
||||
+++ gcc/config/alpha/openbsd.h Mon Jan 3 10:17:43 2005
|
||||
@@ -21,30 +21,31 @@ 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() \
|
||||
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. */
|
||||
@@ -63,67 +64,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
|
||||
+/* .set on alpha is not used to output labels. */
|
||||
+#undef SET_ASM_OP
|
||||
|
||||
-/* 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)
|
||||
-
|
||||
-
|
||||
+/* 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)
|
18
lang/gcc/3.3/patches/patch-gcc_config_arm_arm_md
Normal file
18
lang/gcc/3.3/patches/patch-gcc_config_arm_arm_md
Normal file
@ -0,0 +1,18 @@
|
||||
$OpenBSD: patch-gcc_config_arm_arm_md,v 1.1.1.1 2005/01/03 15:21:26 espie Exp $
|
||||
--- gcc/config/arm/arm.md.orig Tue Mar 30 22:43:44 2004
|
||||
+++ gcc/config/arm/arm.md Mon Jan 3 10:17:43 2005
|
||||
@@ -3948,7 +3948,13 @@
|
||||
(match_operand:DI 1 "general_operand" ""))]
|
||||
"TARGET_EITHER"
|
||||
"
|
||||
- if (TARGET_THUMB)
|
||||
+ if (TARGET_ARM)
|
||||
+ {
|
||||
+ /* Everything except mem = const or mem = mem can be done easily */
|
||||
+ if (GET_CODE (operands[0]) == MEM)
|
||||
+ operands[1] = force_reg (DImode, operands[1]);
|
||||
+ }
|
||||
+ else /* TARGET_THUMB.... */
|
||||
{
|
||||
if (!no_new_pseudos)
|
||||
{
|
26
lang/gcc/3.3/patches/patch-gcc_config_arm_openbsd1_h
Normal file
26
lang/gcc/3.3/patches/patch-gcc_config_arm_openbsd1_h
Normal file
@ -0,0 +1,26 @@
|
||||
$OpenBSD: patch-gcc_config_arm_openbsd1_h,v 1.1.1.1 2005/01/03 15:21:26 espie Exp $
|
||||
--- gcc/config/arm/openbsd1.h.orig Mon Jan 3 10:17:43 2005
|
||||
+++ gcc/config/arm/openbsd1.h Mon Jan 3 10:17:43 2005
|
||||
@@ -0,0 +1,22 @@
|
||||
+/* Definitions of target machine for GNU compiler, OpenBSD/arm ELF version.
|
||||
+ Copyright (C) 2002 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. */
|
||||
+
|
||||
+/* StrongARM family default cpu. */
|
||||
+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_strongarm
|
262
lang/gcc/3.3/patches/patch-gcc_config_arm_openbsd_h
Normal file
262
lang/gcc/3.3/patches/patch-gcc_config_arm_openbsd_h
Normal file
@ -0,0 +1,262 @@
|
||||
$OpenBSD: patch-gcc_config_arm_openbsd_h,v 1.1.1.1 2005/01/03 15:21:26 espie Exp $
|
||||
--- gcc/config/arm/openbsd.h.orig Mon Jan 3 10:17:43 2005
|
||||
+++ gcc/config/arm/openbsd.h Mon Jan 3 10:17:43 2005
|
||||
@@ -0,0 +1,258 @@
|
||||
+/* Definitions of target machine for GNU compiler, OpenBSD/arm ELF version.
|
||||
+ Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
+ Contributed by Wasabi Systems, 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. */
|
||||
+
|
||||
+/* Run-time Target Specification. */
|
||||
+#undef TARGET_VERSION
|
||||
+#define TARGET_VERSION fputs (" (OpenBSD/arm)", stderr);
|
||||
+
|
||||
+/* This is used in ASM_FILE_START. */
|
||||
+#undef ARM_OS_NAME
|
||||
+#define ARM_OS_NAME "OpenBSD"
|
||||
+
|
||||
+/* Unsigned chars produces much better code than signed. */
|
||||
+#define DEFAULT_SIGNED_CHAR 0
|
||||
+
|
||||
+
|
||||
+/* This defaults us to little-endian. */
|
||||
+#ifndef TARGET_ENDIAN_DEFAULT
|
||||
+#define TARGET_ENDIAN_DEFAULT 0
|
||||
+#endif
|
||||
+
|
||||
+#undef MULTILIB_DEFAULTS
|
||||
+
|
||||
+/* strongarm family default cpu. */
|
||||
+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_strongarm
|
||||
+
|
||||
+/* Default is to use APCS-32 mode. */
|
||||
+
|
||||
+/* Default it to use ATPCS with soft-VFP. */
|
||||
+#undef TARGET_DEFAULT
|
||||
+/* Default it to use ATPCS with soft-VFP. */
|
||||
+#undef TARGET_DEFAULT
|
||||
+#define TARGET_DEFAULT \
|
||||
+ (ARM_FLAG_APCS_32 \
|
||||
+ | ARM_FLAG_SOFT_FLOAT \
|
||||
+ | ARM_FLAG_APCS_FRAME \
|
||||
+ | ARM_FLAG_ATPCS \
|
||||
+ | ARM_FLAG_VFP \
|
||||
+ | ARM_FLAG_MMU_TRAPS \
|
||||
+ | TARGET_ENDIAN_DEFAULT)
|
||||
+
|
||||
+
|
||||
+#define TARGET_OS_CPP_BUILTINS() \
|
||||
+ do \
|
||||
+ { \
|
||||
+ OPENBSD_OS_CPP_BUILTINS_ELF(); \
|
||||
+ } \
|
||||
+ while (0)
|
||||
+
|
||||
+#undef SUBTARGET_CPP_SPEC
|
||||
+#define SUBTARGET_CPP_SPEC OBSD_CPP_SPEC
|
||||
+
|
||||
+/* Because TARGET_DEFAULT sets ARM_FLAG_APCS_32 */
|
||||
+#undef CPP_APCS_PC_DEFAULT_SPEC
|
||||
+#define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
|
||||
+
|
||||
+/* Because TARGET_DEFAULT sets ARM_FLAG_SOFT_FLOAT */
|
||||
+#undef CPP_FLOAT_DEFAULT_SPEC
|
||||
+#define CPP_FLOAT_DEFAULT_SPEC "-D__SOFTFP__"
|
||||
+
|
||||
+/* OBSD_LINK_SPEC appropriate for OpenBSD. Support for GCC options
|
||||
+ -static, -assert, and -nostdlib. */
|
||||
+#undef OBSD_LINK_SPEC
|
||||
+#ifdef OBSD_NO_DYNAMIC_LIBRARIES
|
||||
+#define OBSD_LINK_SPEC \
|
||||
+ "%{!nostdlib:%{!r*:%{!e*:-e __start}}} %{assert*}"
|
||||
+#else
|
||||
+#define OBSD_LINK_SPEC \
|
||||
+ "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \
|
||||
+ %{shared:-shared} %{R*} \
|
||||
+ %{static:-Bstatic} \
|
||||
+ %{!static:-Bdynamic} \
|
||||
+ %{assert*} \
|
||||
+ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}"
|
||||
+#endif
|
||||
+
|
||||
+#undef SUBTARGET_EXTRA_ASM_SPEC
|
||||
+#define SUBTARGET_EXTRA_ASM_SPEC \
|
||||
+ "-matpcs %{fpic:-k} %{fPIC:-k}"
|
||||
+
|
||||
+/* Default floating point model is soft-VFP.
|
||||
+ FIXME: -mhard-float currently implies FPA. */
|
||||
+#undef SUBTARGET_ASM_FLOAT_SPEC
|
||||
+#define SUBTARGET_ASM_FLOAT_SPEC \
|
||||
+ "%{mhard-float:-mfpu=fpa} \
|
||||
+ %{msoft-float:-mfpu=softvfp} \
|
||||
+ %{!mhard-float: \
|
||||
+ %{!msoft-float:-mfpu=softvfp}}"
|
||||
+
|
||||
+#undef SUBTARGET_EXTRA_SPECS
|
||||
+#define SUBTARGET_EXTRA_SPECS \
|
||||
+ { "subtarget_extra_asm_spec", SUBTARGET_EXTRA_ASM_SPEC }, \
|
||||
+ { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC }, \
|
||||
+ { "openbsd_link_spec", OBSD_LINK_SPEC }, \
|
||||
+ { "openbsd_entry_point", OPENBSD_ENTRY_POINT },
|
||||
+
|
||||
+#define OPENBSD_ENTRY_POINT "__start"
|
||||
+
|
||||
+/* Pass -X to the linker so that it will strip symbols starting with 'L' */
|
||||
+#undef LINK_SPEC
|
||||
+#define LINK_SPEC \
|
||||
+ "-X %{mbig-endian:-EB} %{mlittle-endian:-EL} \
|
||||
+ %(openbsd_link_spec)"
|
||||
+
|
||||
+/* Make GCC agree with <machine/ansi.h>. */
|
||||
+
|
||||
+#undef SIZE_TYPE
|
||||
+#define SIZE_TYPE "unsigned int"
|
||||
+
|
||||
+#undef PTRDIFF_TYPE
|
||||
+#define PTRDIFF_TYPE "int"
|
||||
+
|
||||
+/* We don't have any limit on the length as out debugger is GDB. */
|
||||
+#undef DBX_CONTIN_LENGTH
|
||||
+
|
||||
+/* OpenBSD and NetBSD do their profiling differently to the Acorn compiler. We
|
||||
+ don't need a word following the mcount call; and to skip it
|
||||
+ requires either an assembly stub or use of fomit-frame-pointer when
|
||||
+ compiling the profiling functions. Since we break Acorn CC
|
||||
+ compatibility below a little more won't hurt. */
|
||||
+
|
||||
+#undef ARM_FUNCTION_PROFILER
|
||||
+#define ARM_FUNCTION_PROFILER(STREAM,LABELNO) \
|
||||
+{ \
|
||||
+ asm_fprintf (STREAM, "\tmov\t%Rip, %Rlr\n"); \
|
||||
+ asm_fprintf (STREAM, "\tbl\t__mcount%s\n", \
|
||||
+ NEED_PLT_RELOC ? "(PLT)" : ""); \
|
||||
+}
|
||||
+
|
||||
+/* On the ARM `@' introduces a comment, so we must use something else
|
||||
+ for .type directives. */
|
||||
+#undef TYPE_OPERAND_FMT
|
||||
+#define TYPE_OPERAND_FMT "%%%s"
|
||||
+
|
||||
+/* OpenBSD and NetBSD use the old PCC style aggregate returning conventions. */
|
||||
+#undef DEFAULT_PCC_STRUCT_RETURN
|
||||
+#define DEFAULT_PCC_STRUCT_RETURN 1
|
||||
+
|
||||
+/* Although not normally relevant (since by default, all aggregates
|
||||
+ are returned in memory) compiling some parts of libc requires
|
||||
+ non-APCS style struct returns. */
|
||||
+#undef RETURN_IN_MEMORY
|
||||
+
|
||||
+
|
||||
+/* VERY BIG NOTE: Change of structure alignment for OpenBSD|NetBSD/arm.
|
||||
+ There are consequences you should be aware of...
|
||||
+
|
||||
+ Normally GCC/arm uses a structure alignment of 32 for compatibility
|
||||
+ with armcc. This means that structures are padded to a word
|
||||
+ boundary. However this causes problems with bugged OpenBSD|NetBSD kernel
|
||||
+ code (possibly userland code as well - I have not checked every
|
||||
+ binary). The nature of this bugged code is to rely on sizeof()
|
||||
+ returning the correct size of various structures rounded to the
|
||||
+ nearest byte (SCSI and ether code are two examples, the vm system
|
||||
+ is another). This code breaks when the structure alignment is 32
|
||||
+ as sizeof() will report a word=rounded size. By changing the
|
||||
+ structure alignment to 8. GCC will conform to what is expected by
|
||||
+ OpenBSD|NetBSD.
|
||||
+
|
||||
+ This has several side effects that should be considered.
|
||||
+ 1. Structures will only be aligned to the size of the largest member.
|
||||
+ i.e. structures containing only bytes will be byte aligned.
|
||||
+ structures containing shorts will be half word alinged.
|
||||
+ structures containing ints will be word aligned.
|
||||
+
|
||||
+ This means structures should be padded to a word boundary if
|
||||
+ alignment of 32 is required for byte structures etc.
|
||||
+
|
||||
+ 2. A potential performance penalty may exist if strings are no longer
|
||||
+ word aligned. GCC will not be able to use word load/stores to copy
|
||||
+ short strings.
|
||||
+
|
||||
+ This modification is not encouraged but with the present state of the
|
||||
+ OpenBSD|NetBSD source tree it is currently the only solution that meets the
|
||||
+ requirements. */
|
||||
+
|
||||
+#undef DEFAULT_STRUCTURE_SIZE_BOUNDARY
|
||||
+#define DEFAULT_STRUCTURE_SIZE_BOUNDARY 8
|
||||
+
|
||||
+/* Emit code to set up a trampoline and synchronize the caches. */
|
||||
+#undef INITIALIZE_TRAMPOLINE
|
||||
+#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
|
||||
+do \
|
||||
+ { \
|
||||
+ emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 8)), \
|
||||
+ (CXT)); \
|
||||
+ emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 12)), \
|
||||
+ (FNADDR)); \
|
||||
+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \
|
||||
+ 0, VOIDmode, 2, TRAMP, Pmode, \
|
||||
+ plus_constant (TRAMP, TRAMPOLINE_SIZE), Pmode); \
|
||||
+ } \
|
||||
+while (0)
|
||||
+
|
||||
+/* Clear the instruction cache from `BEG' to `END'. This makes a
|
||||
+ call to the ARM_SYNC_ICACHE architecture specific syscall. */
|
||||
+#define CLEAR_INSN_CACHE(BEG, END) \
|
||||
+do \
|
||||
+ { \
|
||||
+ extern int sysarch(int number, void *args); \
|
||||
+ struct { \
|
||||
+ unsigned int addr; \
|
||||
+ int len; \
|
||||
+ } s; \
|
||||
+ s.addr = (unsigned int)(BEG); \
|
||||
+ s.len = (END) - (BEG); \
|
||||
+ (void) sysarch (0, &s); \
|
||||
+ } \
|
||||
+while (0)
|
||||
+
|
||||
+/* Provide a STARTFILE_SPEC appropriate for OpenBSD ELF. Here we
|
||||
+ provide support for the special GCC option -static. On ELF
|
||||
+ targets, we also add the crtbegin.o file, which provides part
|
||||
+ of the support for getting C++ file-scope static objects
|
||||
+ constructed before entering "main". */
|
||||
+
|
||||
+#define OPENBSD_STARTFILE_SPEC \
|
||||
+ "%{!shared: \
|
||||
+ %{pg:gcrt0%O%s} \
|
||||
+ %{!pg: \
|
||||
+ %{p:gcrt0%O%s} \
|
||||
+ %{!p:crt0%O%s}}} \
|
||||
+ %:if-exists(crti%O%s) \
|
||||
+ %{static:%:if-exists-else(crtbeginT%O%s crtbegin%O%s)} \
|
||||
+ %{!static: \
|
||||
+ %{!shared:crtbegin%O%s} %{shared:crtbeginS%O%s}}"
|
||||
+
|
||||
+#undef STARTFILE_SPEC
|
||||
+#define STARTFILE_SPEC OPENBSD_STARTFILE_SPEC
|
||||
+
|
||||
+/* Provide an ENDFILE_SPEC appropriate for OpenBSD ELF. Here we
|
||||
+add crtend.o, which provides part of the support for getting
|
||||
+C++ file-scope static objects deconstructed after exiting "main". */
|
||||
+
|
||||
+#define OPENBSD_ENDFILE_SPEC \
|
||||
+ "%{!shared:crtend%O%s} %{shared:crtendS%O%s} \
|
||||
+ %:if-exists(crtn%O%s)"
|
||||
+
|
||||
+#undef ENDFILE_SPEC
|
||||
+#define ENDFILE_SPEC OPENBSD_ENDFILE_SPEC
|
||||
+
|
11
lang/gcc/3.3/patches/patch-gcc_config_arm_t-openbsd
Normal file
11
lang/gcc/3.3/patches/patch-gcc_config_arm_t-openbsd
Normal file
@ -0,0 +1,11 @@
|
||||
$OpenBSD: patch-gcc_config_arm_t-openbsd,v 1.1.1.1 2005/01/03 15:21:26 espie Exp $
|
||||
--- gcc/config/arm/t-openbsd.orig Mon Jan 3 10:17:43 2005
|
||||
+++ gcc/config/arm/t-openbsd Mon Jan 3 10:17:43 2005
|
||||
@@ -0,0 +1,7 @@
|
||||
+# Just for these, we omit the frame pointer since it makes such a big
|
||||
+# difference. It is then pointless adding debugging.
|
||||
+TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fpic
|
||||
+LIBGCC2_DEBUG_CFLAGS = -g0
|
||||
+
|
||||
+# Don't build enquire
|
||||
+ENQUIRE=
|
44
lang/gcc/3.3/patches/patch-gcc_config_exec-stack_h
Normal file
44
lang/gcc/3.3/patches/patch-gcc_config_exec-stack_h
Normal file
@ -0,0 +1,44 @@
|
||||
$OpenBSD: patch-gcc_config_exec-stack_h,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/config/exec-stack.h.orig Mon Jan 3 10:17:43 2005
|
||||
+++ gcc/config/exec-stack.h Mon Jan 3 10:17:43 2005
|
||||
@@ -0,0 +1,40 @@
|
||||
+/* Enable stack execute around trampoline address.
|
||||
+ Copyright (C) 2002 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. */
|
||||
+
|
||||
+#undef FINALIZE_TRAMPOLINE
|
||||
+#define FINALIZE_TRAMPOLINE(TRAMP) \
|
||||
+ emit_library_call(gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"), \
|
||||
+ 0, VOIDmode, 1, memory_address (SImode, (TRAMP)), Pmode)
|
||||
+
|
||||
+#undef TRANSFER_FROM_TRAMPOLINE
|
||||
+#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); \
|
||||
+ \
|
||||
+ if (mprotect (page, end - page, PROT_READ | PROT_WRITE | PROT_EXEC) < 0) \
|
||||
+ perror ("mprotect of trampoline code"); \
|
||||
+}
|
181
lang/gcc/3.3/patches/patch-gcc_config_gcc
Normal file
181
lang/gcc/3.3/patches/patch-gcc_config_gcc
Normal file
@ -0,0 +1,181 @@
|
||||
$OpenBSD: patch-gcc_config_gcc,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/config.gcc.orig Thu Apr 29 06:42:47 2004
|
||||
+++ gcc/config.gcc Mon Jan 3 10:17:41 2005
|
||||
@@ -402,9 +402,19 @@ case $machine in
|
||||
esac
|
||||
;;
|
||||
*-*-openbsd*)
|
||||
- tm_file=${cpu_type}/openbsd.h
|
||||
+ case $machine in
|
||||
+ *-*-openbsd2* | *-*-openbsd3.[012])
|
||||
+ openbsd_libspec="openbsd-libc_r.h"
|
||||
+ ;;
|
||||
+ *)
|
||||
+ openbsd_libspec="openbsd-libpthread.h"
|
||||
+ ;;
|
||||
+ esac
|
||||
+ tm_file="${openbsd_libspec} ${cpu_type}/openbsd.h"
|
||||
tmake_file="t-libc-ok t-openbsd t-libgcc-pic"
|
||||
xm_defines=POSIX
|
||||
+ # for gcc in tree, we use our own fragment
|
||||
+ xmake_file=x-openbsd
|
||||
if test x$enable_threads = xyes; then
|
||||
thread_file='posix'
|
||||
tmake_file="${tmake_file} t-openbsd-thread"
|
||||
@@ -578,10 +588,12 @@ 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}"
|
||||
+ tm_file="${tm_file} exec-stack.h"
|
||||
# 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]*)
|
||||
@@ -691,6 +703,11 @@ arm*-*-netbsdelf*)
|
||||
tm_file="dbxelf.h elfos.h netbsd.h netbsd-elf.h arm/elf.h arm/aout.h arm/arm.h arm/netbsd-elf.h"
|
||||
tmake_file="${tmake_file} arm/t-netbsd"
|
||||
;;
|
||||
+arm*-*-openbsd*)
|
||||
+ tm_file="dbxelf.h elfos.h arm/openbsd1.h arm/elf.h arm/aout.h arm/arm.h openbsd.h ${tm_file}"
|
||||
+ tm_file="${tm_file} exec-stack.h"
|
||||
+ tmake_file="${tmake_file} arm/t-openbsd"
|
||||
+ ;;
|
||||
arm*-*-netbsd*)
|
||||
tm_file="arm/aout.h arm/arm.h netbsd.h netbsd-aout.h arm/netbsd.h"
|
||||
tmake_file="t-netbsd arm/t-netbsd"
|
||||
@@ -818,12 +835,13 @@ hppa*-*-linux* | parisc*-*-linux*)
|
||||
tmake_file="t-slibgcc-elf-ver t-linux pa/t-linux"
|
||||
;;
|
||||
hppa*-*-openbsd*)
|
||||
- target_cpu_default="MASK_PA_11"
|
||||
- tmake_file=pa/t-bsd
|
||||
+ target_cpu_default="MASK_PA_11 | MASK_NO_SPACE_REGS"
|
||||
+ tmake_file="t-libc-ok t-openbsd t-openbsd-thread pa/t-openbsd"
|
||||
;;
|
||||
hppa1.1-*-pro*)
|
||||
target_cpu_default="(MASK_JUMP_IN_DELAY | MASK_PORTABLE_RUNTIME | MASK_GAS | MASK_NO_SPACE_REGS | MASK_SOFT_FLOAT)"
|
||||
tm_file="${tm_file} pa/pa32-regs.h dbxelf.h elfos.h pa/elf.h pa/pa-pro-end.h libgloss.h"
|
||||
+ tm_file="${tm_file} exec-stack.h"
|
||||
tmake_file="pa/t-bsd pa/t-pro"
|
||||
xmake_file="pa/x-ada"
|
||||
;;
|
||||
@@ -1142,13 +1160,28 @@ 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 openbsd-libpthread.h i386/openbsdelf.h"
|
||||
+ gas=yes
|
||||
+ gnu_ld=yes
|
||||
+ stabs=yes
|
||||
+ ;;
|
||||
+x86_64-*-openbsd*)
|
||||
+ tm_file="i386/biarch64.h i386/i386.h i386/unix.h i386/att.h dbxelf.h elfos.h openbsd.h openbsd-libpthread.h i386/x86-64.h i386/openbsd64.h"
|
||||
+ tm_file="${tm_file} exec-stack.h"
|
||||
+ tmake_file="t-libc-ok t-openbsd i386/t-openbsd"
|
||||
+ ;;
|
||||
i[34567]86-*-coff*)
|
||||
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/i386-coff.h"
|
||||
;;
|
||||
@@ -1711,6 +1744,7 @@ m68k*-*-openbsd*)
|
||||
tmake_file="t-libc-ok t-openbsd m68k/t-openbsd"
|
||||
# we need collect2 until our bug is fixed...
|
||||
use_collect2=yes
|
||||
+ tm_file="${tm_file} exec-stack.h"
|
||||
;;
|
||||
m68k-*-sysv4*) # Motorola m68k's running system V.4
|
||||
tm_file=m68k/m68kv4.h
|
||||
@@ -1762,6 +1796,7 @@ m88k-*-aout*)
|
||||
m88k-*-openbsd*)
|
||||
tmake_file="${tmake_file} m88k/t-luna-gas"
|
||||
tm_file="m88k/aout-dbx.h aoutos.h m88k/m88k.h openbsd.h ${tm_file}"
|
||||
+ tm_file="${tm_file} exec-stack.h"
|
||||
;;
|
||||
m88k-*-sysv4*)
|
||||
xm_defines=POSIX
|
||||
@@ -1893,13 +1928,19 @@ mips*-*-linux*) # Linux MIPS, either
|
||||
esac
|
||||
tmake_file="t-slibgcc-elf-ver t-linux mips/t-linux"
|
||||
;;
|
||||
-mips*el-*-openbsd*) # mips little endian
|
||||
+mips*-*-openbsd*)
|
||||
target_cpu_default="MASK_GAS|MASK_ABICALLS"
|
||||
+ tm_file="elfos.h ${tm_file}"
|
||||
+ case $machine in
|
||||
+ mips64*-*)
|
||||
+ tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_64"
|
||||
+ tmake_file="mips/t-openbsd64"
|
||||
+ ;;
|
||||
+ mips*-*)
|
||||
+ tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32"
|
||||
+ ;;
|
||||
+ esac
|
||||
;;
|
||||
-mips*-*-openbsd*) # mips big endian
|
||||
- target_cpu_default="MASK_GAS|MASK_ABICALLS"
|
||||
- tm_file="mips/openbsd-be.h ${tm_file}"
|
||||
- ;;
|
||||
mips-*-ecoff* | mipsel-*-ecoff*)
|
||||
if test x$stabs = xyes; then
|
||||
tm_file="${tm_file} dbx.h"
|
||||
@@ -2016,8 +2057,9 @@ 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"
|
||||
+ tm_file="${tm_file} exec-stack.h"
|
||||
;;
|
||||
powerpc64-*-linux*)
|
||||
tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux64.h"
|
||||
@@ -2397,17 +2439,21 @@ 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}"
|
||||
+ tm_file="${tm_file} exec-stack.h"
|
||||
# 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 ${openbsd_libspec} sparc/openbsd64.h"
|
||||
+ tm_file="${tm_file} exec-stack.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"
|
||||
@@ -2717,6 +2763,7 @@ vax-*-netbsd*)
|
||||
;;
|
||||
vax-*-openbsd*)
|
||||
tm_file="vax/vax.h vax/openbsd1.h openbsd.h ${tm_file}"
|
||||
+ tm_file="${tm_file} exec-stack.h"
|
||||
use_collect2=yes
|
||||
;;
|
||||
vax-*-ultrix*) # VAXen running ultrix
|
125
lang/gcc/3.3/patches/patch-gcc_config_i386_openbsd64_h
Normal file
125
lang/gcc/3.3/patches/patch-gcc_config_i386_openbsd64_h
Normal file
@ -0,0 +1,125 @@
|
||||
$OpenBSD: patch-gcc_config_i386_openbsd64_h,v 1.1.1.1 2005/01/03 15:21:26 espie Exp $
|
||||
--- gcc/config/i386/openbsd64.h.orig Mon Jan 3 10:17:43 2005
|
||||
+++ gcc/config/i386/openbsd64.h Mon Jan 3 10:17:43 2005
|
||||
@@ -0,0 +1,121 @@
|
||||
+/* Configuration for an OpenBSD x86-64 target.
|
||||
+
|
||||
+ Copyright (C) 2003 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. */
|
||||
+
|
||||
+#undef TARGET_VERSION
|
||||
+#define TARGET_VERSION fprintf (stderr, " (OpenBSD/x86-64 ELF)")
|
||||
+
|
||||
+/* This gets defined in tm.h->linux.h->svr4.h, and keeps us from using
|
||||
+ libraries compiled with the native cc, so undef it. */
|
||||
+#undef NO_DOLLAR_IN_LABEL
|
||||
+
|
||||
+/* Override the default comment-starter of "/". */
|
||||
+#undef ASM_COMMENT_START
|
||||
+#define ASM_COMMENT_START "#"
|
||||
+
|
||||
+/* Run-time target specifications */
|
||||
+
|
||||
+#define TARGET_OS_CPP_BUILTINS() \
|
||||
+ do \
|
||||
+ { \
|
||||
+ OPENBSD_OS_CPP_BUILTINS_ELF(); \
|
||||
+ if (TARGET_64BIT) \
|
||||
+ OPENBSD_OS_CPP_BUILTINS_LP64(); \
|
||||
+ } \
|
||||
+ while (0)
|
||||
+
|
||||
+/* 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}"
|
||||
+
|
||||
+/* Layout of source language data types. */
|
||||
+
|
||||
+/* This must agree with <machine/ansi.h> */
|
||||
+#undef SIZE_TYPE
|
||||
+#define SIZE_TYPE "long unsigned int"
|
||||
+
|
||||
+#undef PTRDIFF_TYPE
|
||||
+#define PTRDIFF_TYPE "long int"
|
||||
+
|
||||
+#undef WCHAR_TYPE
|
||||
+#define WCHAR_TYPE "int"
|
||||
+
|
||||
+#undef WCHAR_TYPE_SIZE
|
||||
+#define WCHAR_TYPE_SIZE 32
|
||||
+
|
||||
+/* Assembler format: overall framework. */
|
||||
+
|
||||
+#undef ASM_APP_ON
|
||||
+#define ASM_APP_ON "#APP\n"
|
||||
+
|
||||
+#undef ASM_APP_OFF
|
||||
+#define ASM_APP_OFF "#NO_APP\n"
|
||||
+
|
||||
+#undef SET_ASM_OP
|
||||
+#define SET_ASM_OP "\t.set\t"
|
||||
+
|
||||
+/* The following macros were originally stolen from i386v4.h.
|
||||
+ These have to be defined to get PIC code correct. */
|
||||
+
|
||||
+/* Assembler format: dispatch tables. */
|
||||
+
|
||||
+/* Assembler format: sections. */
|
||||
+
|
||||
+/* Stack & calling: aggregate returns. */
|
||||
+
|
||||
+/* Don't default to pcc-struct-return, because gcc is the only compiler, and
|
||||
+ we want to retain compatibility with older gcc versions. */
|
||||
+#define DEFAULT_PCC_STRUCT_RETURN 0
|
||||
+
|
||||
+/* Assembler format: alignment output. */
|
||||
+
|
||||
+/* Stack & calling: profiling. */
|
||||
+
|
||||
+/* OpenBSD's profiler recovers all information from the stack pointer.
|
||||
+ The icky part is not here, but in machine/profile.h. */
|
||||
+#undef FUNCTION_PROFILER
|
||||
+#define FUNCTION_PROFILER(FILE, LABELNO) \
|
||||
+ fputs (flag_pic ? "\tcall __mcount@PLT\n": "\tcall __mcount\n", FILE);
|
||||
+
|
||||
+/* Assembler format: exception region output. */
|
||||
+
|
||||
+/* Assembler format: alignment output. */
|
||||
+
|
||||
+/* Note that we pick up ASM_OUTPUT_MAX_SKIP_ALIGN from i386/gas.h */
|
||||
+
|
||||
+/* Note that we pick up ASM_OUTPUT_MI_THUNK from unix.h. */
|
||||
+
|
||||
+#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}"
|
||||
+
|
||||
+#define OBSD_HAS_CORRECT_SPECS
|
||||
+
|
||||
+#undef JUMP_TABLES_IN_TEXT_SECTION
|
||||
+#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
|
16
lang/gcc/3.3/patches/patch-gcc_config_i386_openbsd_h
Normal file
16
lang/gcc/3.3/patches/patch-gcc_config_i386_openbsd_h
Normal file
@ -0,0 +1,16 @@
|
||||
$OpenBSD: patch-gcc_config_i386_openbsd_h,v 1.1.1.1 2005/01/03 15:21:26 espie Exp $
|
||||
--- gcc/config/i386/openbsd.h.orig Mon Oct 21 00:37:10 2002
|
||||
+++ gcc/config/i386/openbsd.h Mon Jan 3 10:17:43 2005
|
||||
@@ -29,11 +29,7 @@ Boston, MA 02111-1307, USA. */
|
||||
#define TARGET_OS_CPP_BUILTINS() \
|
||||
do \
|
||||
{ \
|
||||
- builtin_define ("__unix__"); \
|
||||
- builtin_define ("__OpenBSD__"); \
|
||||
- builtin_assert ("system=unix"); \
|
||||
- builtin_assert ("system=bsd"); \
|
||||
- builtin_assert ("system=OpenBSD"); \
|
||||
+ OPENBSD_OS_CPP_BUILTINS_COMMON(); \
|
||||
} \
|
||||
while (0)
|
||||
|
138
lang/gcc/3.3/patches/patch-gcc_config_i386_openbsdelf_h
Normal file
138
lang/gcc/3.3/patches/patch-gcc_config_i386_openbsdelf_h
Normal file
@ -0,0 +1,138 @@
|
||||
$OpenBSD: patch-gcc_config_i386_openbsdelf_h,v 1.1.1.1 2005/01/03 15:21:26 espie Exp $
|
||||
--- gcc/config/i386/openbsdelf.h.orig Mon Jan 3 10:17:43 2005
|
||||
+++ gcc/config/i386/openbsdelf.h Mon Jan 3 10:17:43 2005
|
||||
@@ -0,0 +1,134 @@
|
||||
+/* Configuration for an OpenBSD i386 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. */
|
||||
+
|
||||
+/* This gets defined in tm.h->linux.h->svr4.h, and keeps us from using
|
||||
+ libraries compiled with the native cc, so undef it. */
|
||||
+#undef NO_DOLLAR_IN_LABEL
|
||||
+
|
||||
+/* Override the default comment-starter of "/". */
|
||||
+#undef ASM_COMMENT_START
|
||||
+#define ASM_COMMENT_START "#"
|
||||
+
|
||||
+
|
||||
+/* This goes away when the math-emulator is fixed */
|
||||
+#undef TARGET_DEFAULT
|
||||
+#define TARGET_DEFAULT \
|
||||
+ (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_NO_FANCY_MATH_387)
|
||||
+
|
||||
+/* Run-time target specifications */
|
||||
+
|
||||
+#define TARGET_OS_CPP_BUILTINS() \
|
||||
+ do \
|
||||
+ { \
|
||||
+ OPENBSD_OS_CPP_BUILTINS_ELF(); \
|
||||
+ } \
|
||||
+ while (0)
|
||||
+
|
||||
+/* 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}"
|
||||
+
|
||||
+/* Layout of source language data types. */
|
||||
+
|
||||
+/* This must agree with <machine/ansi.h> */
|
||||
+#undef SIZE_TYPE
|
||||
+#define SIZE_TYPE "unsigned int"
|
||||
+
|
||||
+#undef PTRDIFF_TYPE
|
||||
+#define PTRDIFF_TYPE "int"
|
||||
+
|
||||
+#undef WCHAR_TYPE
|
||||
+#define WCHAR_TYPE "int"
|
||||
+
|
||||
+#undef WCHAR_TYPE_SIZE
|
||||
+#define WCHAR_TYPE_SIZE BITS_PER_WORD
|
||||
+
|
||||
+/* Assembler format: overall framework. */
|
||||
+
|
||||
+#undef ASM_APP_ON
|
||||
+#define ASM_APP_ON "#APP\n"
|
||||
+
|
||||
+#undef ASM_APP_OFF
|
||||
+#define ASM_APP_OFF "#NO_APP\n"
|
||||
+
|
||||
+#undef SET_ASM_OP
|
||||
+#define SET_ASM_OP "\t.set\t"
|
||||
+
|
||||
+/* The following macros were originally stolen from i386v4.h.
|
||||
+ These have to be defined to get PIC code correct. */
|
||||
+
|
||||
+/* Assembler format: dispatch tables. */
|
||||
+
|
||||
+/* Assembler format: sections. */
|
||||
+
|
||||
+/* Stack & calling: aggregate returns. */
|
||||
+
|
||||
+/* Don't default to pcc-struct-return, because gcc is the only compiler, and
|
||||
+ we want to retain compatibility with older gcc versions. */
|
||||
+#define DEFAULT_PCC_STRUCT_RETURN 0
|
||||
+
|
||||
+/* Assembler format: alignment output. */
|
||||
+
|
||||
+#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
|
||||
+#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
|
||||
+ if ((LOG) != 0) {\
|
||||
+ if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
|
||||
+ else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
+/* Stack & calling: profiling. */
|
||||
+
|
||||
+/* OpenBSD's profiler recovers all information from the stack pointer.
|
||||
+ The icky part is not here, but in machine/profile.h. */
|
||||
+#undef FUNCTION_PROFILER
|
||||
+#define FUNCTION_PROFILER(FILE, LABELNO) \
|
||||
+ fputs (flag_pic ? "\tcall __mcount@PLT\n": "\tcall __mcount\n", FILE);
|
||||
+
|
||||
+/* Assembler format: exception region output. */
|
||||
+
|
||||
+/* our configuration still doesn't handle dwarf2 correctly */
|
||||
+#define DWARF2_UNWIND_INFO 0
|
||||
+
|
||||
+/* Assembler format: alignment output. */
|
||||
+
|
||||
+/* Note that we pick up ASM_OUTPUT_MAX_SKIP_ALIGN from i386/gas.h */
|
||||
+
|
||||
+/* Note that we pick up ASM_OUTPUT_MI_THUNK from unix.h. */
|
||||
+
|
||||
+#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}"
|
||||
+
|
||||
+#define OBSD_HAS_CORRECT_SPECS
|
||||
+
|
||||
+/* pick up defines for mprotect (used in TRANSFER_FROM_TRANPOLINE) */
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/mman.h>
|
13
lang/gcc/3.3/patches/patch-gcc_config_in
Normal file
13
lang/gcc/3.3/patches/patch-gcc_config_in
Normal file
@ -0,0 +1,13 @@
|
||||
$OpenBSD: patch-gcc_config_in,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/config.in.orig Thu Sep 30 19:34:19 2004
|
||||
+++ gcc/config.in Mon Jan 3 10:17:41 2005
|
||||
@@ -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
|
||||
|
25
lang/gcc/3.3/patches/patch-gcc_config_mips_openbsd-be_h
Normal file
25
lang/gcc/3.3/patches/patch-gcc_config_mips_openbsd-be_h
Normal file
@ -0,0 +1,25 @@
|
||||
$OpenBSD: patch-gcc_config_mips_openbsd-be_h,v 1.1.1.1 2005/01/03 15:21:26 espie Exp $
|
||||
--- gcc/config/mips/openbsd-be.h.orig Mon Sep 27 22:02:46 1999
|
||||
+++ gcc/config/mips/openbsd-be.h Mon Jan 3 10:17:43 2005
|
||||
@@ -1,21 +0,0 @@
|
||||
-/* Configuration fragment for a mips big-endian 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 TARGET_ENDIAN_DEFAULT MASK_BIG_ENDIAN
|
145
lang/gcc/3.3/patches/patch-gcc_config_mips_openbsd_h
Normal file
145
lang/gcc/3.3/patches/patch-gcc_config_mips_openbsd_h
Normal file
@ -0,0 +1,145 @@
|
||||
$OpenBSD: patch-gcc_config_mips_openbsd_h,v 1.1.1.1 2005/01/03 15:21:26 espie Exp $
|
||||
--- gcc/config/mips/openbsd.h.orig Tue Jun 11 09:26:38 2002
|
||||
+++ gcc/config/mips/openbsd.h Mon Jan 3 10:17:43 2005
|
||||
@@ -27,20 +27,25 @@ Boston, MA 02111-1307, USA. */
|
||||
#define SUBTARGET_CPP_SPEC OBSD_CPP_SPEC
|
||||
|
||||
/* Needed for ELF (inspired by netbsd-elf). */
|
||||
+#undef PREFERRED_DEBUGGING_TYPE
|
||||
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
|
||||
#define LOCAL_LABEL_PREFIX "."
|
||||
|
||||
-/* The profiling lib spec here is not really correct but we leave
|
||||
- it as it is until we have some kind of profiling working. */
|
||||
-#define LIB_SPEC OBSD_LIB_SPEC
|
||||
+#define ASM_FINAL_SPEC ""
|
||||
+#include <mips/mips.h>
|
||||
|
||||
-/* By default, OpenBSD mips is little endian. This is important to set
|
||||
- here as mips/mips.h defaults to big endian. */
|
||||
-#ifndef TARGET_ENDIAN_DEFAULT
|
||||
-#define TARGET_ENDIAN_DEFAULT 0
|
||||
-#endif
|
||||
+#undef MDEBUG_ASM_SPEC
|
||||
+#define MDEBUG_ASM_SPEC ""
|
||||
|
||||
-#include <mips/mips.h>
|
||||
+#include <mips/elf.h>
|
||||
+#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 LIB_SPEC
|
||||
+#define LIB_SPEC OBSD_LIB_SPEC
|
||||
|
||||
/* Get generic OpenBSD definitions. */
|
||||
#define OBSD_HAS_DECLARE_FUNCTION_NAME
|
||||
@@ -53,27 +58,53 @@ Boston, MA 02111-1307, USA. */
|
||||
support. */
|
||||
#undef SET_ASM_OP
|
||||
|
||||
+#undef TARGET_OS_CPP_BUILTINS
|
||||
#define TARGET_OS_CPP_BUILTINS() \
|
||||
do { \
|
||||
- builtin_define ("__unix__"); \
|
||||
- builtin_define ("__SYSTYPE_BSD__"); \
|
||||
+ OPENBSD_OS_CPP_BUILTINS_ELF(); \
|
||||
builtin_define ("__NO_LEADING_UNDERSCORES__"); \
|
||||
builtin_define ("__GP_SUPPORT__"); \
|
||||
- builtin_define ("__OpenBSD__"); \
|
||||
- builtin_assert ("system=unix"); \
|
||||
- builtin_assert ("system=OpenBSD"); \
|
||||
- builtin_assert ("machine=mips"); \
|
||||
+ builtin_assert ("machine=mips"); \
|
||||
+ if (TARGET_LONG64) \
|
||||
+ builtin_define ("__LONG64"); \
|
||||
+ if (TARGET_64BIT) \
|
||||
+ OPENBSD_OS_CPP_BUILTINS_LP64(); \
|
||||
+ if (TARGET_ABICALLS) \
|
||||
+ builtin_define ("__ABICALLS__"); \
|
||||
+ if (mips_abi == ABI_EABI) \
|
||||
+ builtin_define ("__mips_eabi"); \
|
||||
+ else if (mips_abi == ABI_N32) \
|
||||
+ builtin_define ("__mips_n32"); \
|
||||
+ else if (mips_abi == ABI_64) \
|
||||
+ builtin_define ("__mips_n64"); \
|
||||
+ else if (mips_abi == ABI_O64) \
|
||||
+ builtin_define ("__mips_o64"); \
|
||||
+ /* Needed to make libgcc to build properly */ \
|
||||
+ if (mips_abi == ABI_N32) \
|
||||
+ { \
|
||||
+ builtin_define ("_ABIN32=2"); \
|
||||
+ builtin_define ("_MIPS_SIM=_ABIN32"); \
|
||||
+ builtin_define ("_MIPS_SZLONG=32"); \
|
||||
+ builtin_define ("_MIPS_SZPTR=32"); \
|
||||
+ } \
|
||||
+ else if (mips_abi == ABI_64) \
|
||||
+ { \
|
||||
+ builtin_define ("_ABI64=3"); \
|
||||
+ builtin_define ("_MIPS_SIM=_ABI64"); \
|
||||
+ builtin_define ("_MIPS_SZLONG=64"); \
|
||||
+ builtin_define ("_MIPS_SZPTR=64"); \
|
||||
+ } \
|
||||
+ else \
|
||||
+ { \
|
||||
+ builtin_define ("_MIPS_SIM=_MIPS_SIM_ABI32"); \
|
||||
+ builtin_define ("_MIPS_SZLONG=32"); \
|
||||
+ builtin_define ("_MIPS_SZPTR=32"); \
|
||||
+ } \
|
||||
} while (0)
|
||||
|
||||
+
|
||||
/* Layout of source language data types. */
|
||||
|
||||
-/* This must agree with <machine/ansi.h>. */
|
||||
-#undef SIZE_TYPE
|
||||
-#define SIZE_TYPE "unsigned int"
|
||||
-
|
||||
-#undef PTRDIFF_TYPE
|
||||
-#define PTRDIFF_TYPE "int"
|
||||
-
|
||||
#undef WCHAR_TYPE
|
||||
#define WCHAR_TYPE "int"
|
||||
|
||||
@@ -86,7 +117,8 @@ Boston, MA 02111-1307, USA. */
|
||||
-static, -assert, and -nostdlib. Dynamic loader control. */
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC \
|
||||
- "%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} \
|
||||
+ "%(endian_spec) \
|
||||
+ %{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips64} \
|
||||
%{bestGnum} %{shared} %{non_shared} \
|
||||
%{call_shared} %{no_archive} %{exact_version} \
|
||||
%{!shared: %{!non_shared: %{!call_shared: -non_shared}}} \
|
||||
@@ -100,29 +132,3 @@ Boston, MA 02111-1307, USA. */
|
||||
#define MIPS_DEFAULT_GVALUE 0
|
||||
|
||||
|
||||
-/* Since gas and gld are standard on OpenBSD, we don't need these. */
|
||||
-#undef ASM_FINAL_SPEC
|
||||
-#undef STARTFILE_SPEC
|
||||
-
|
||||
-/* Switch into a generic section. */
|
||||
-#undef TARGET_ASM_NAMED_SECTION
|
||||
-#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
|
||||
-
|
||||
-/* Not having TARGET_GAS here seems a mistake. If we actually need to
|
||||
- be prepared for file switching, then we need a custom
|
||||
- TARGET_ASM_NAMED_SECTION too. */
|
||||
-
|
||||
-#undef TEXT_SECTION
|
||||
-#define TEXT_SECTION() \
|
||||
-do { \
|
||||
- if (TARGET_FILE_SWITCHING) \
|
||||
- abort (); \
|
||||
- fputs (TEXT_SECTION_ASM_OP, asm_out_file); \
|
||||
- fputc ('\n', asm_out_file); \
|
||||
-} while (0)
|
||||
-
|
||||
-/* collect2 support (Macros for initialization). */
|
||||
-
|
||||
-/* Mips default configuration is COFF-only, and confuses collect2. */
|
||||
-#undef OBJECT_FORMAT_COFF
|
||||
-#undef EXTENDED_COFF
|
18
lang/gcc/3.3/patches/patch-gcc_config_mips_t-openbsd64
Normal file
18
lang/gcc/3.3/patches/patch-gcc_config_mips_t-openbsd64
Normal file
@ -0,0 +1,18 @@
|
||||
$OpenBSD: patch-gcc_config_mips_t-openbsd64,v 1.1.1.1 2005/01/03 15:21:26 espie Exp $
|
||||
--- gcc/config/mips/t-openbsd64.orig Mon Jan 3 10:17:43 2005
|
||||
+++ gcc/config/mips/t-openbsd64 Mon Jan 3 10:17:43 2005
|
||||
@@ -0,0 +1,14 @@
|
||||
+
|
||||
+LIB2FUNCS_EXTRA = $(srcdir)/config/mips/_tilib.c
|
||||
+
|
||||
+TPBIT = tp-bit.c
|
||||
+
|
||||
+tp-bit.c: $(srcdir)/config/fp-bit.c
|
||||
+ echo '#ifdef __MIPSEL__' > tp-bit.c
|
||||
+ echo '# define FLOAT_BIT_ORDER_MISMATCH' >> tp-bit.c
|
||||
+ echo '#endif' >> tp-bit.c
|
||||
+ echo '#if __LDBL_MANT_DIG__ == 113' >> tp-bit.c
|
||||
+ echo '# define TFLOAT' >> tp-bit.c
|
||||
+ cat $(srcdir)/config/fp-bit.c >> tp-bit.c
|
||||
+ echo '#endif' >> tp-bit.c
|
||||
+
|
28
lang/gcc/3.3/patches/patch-gcc_config_openbsd-libc_r_h
Normal file
28
lang/gcc/3.3/patches/patch-gcc_config_openbsd-libc_r_h
Normal file
@ -0,0 +1,28 @@
|
||||
$OpenBSD: patch-gcc_config_openbsd-libc_r_h,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/config/openbsd-libc_r.h.orig Mon Jan 3 10:17:43 2005
|
||||
+++ gcc/config/openbsd-libc_r.h Mon Jan 3 10:17:43 2005
|
||||
@@ -0,0 +1,24 @@
|
||||
+/* 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. */
|
||||
+/* Copyright (C) 2004 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_LIB_SPEC "%{!shared:-lc%{pthread:_r}%{p:_p}%{!p:%{pg:_p}}}"
|
||||
+
|
27
lang/gcc/3.3/patches/patch-gcc_config_openbsd-libpthread_h
Normal file
27
lang/gcc/3.3/patches/patch-gcc_config_openbsd-libpthread_h
Normal file
@ -0,0 +1,27 @@
|
||||
$OpenBSD: patch-gcc_config_openbsd-libpthread_h,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/config/openbsd-libpthread.h.orig Mon Jan 3 10:17:43 2005
|
||||
+++ gcc/config/openbsd-libpthread.h Mon Jan 3 10:17:43 2005
|
||||
@@ -0,0 +1,23 @@
|
||||
+/* 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 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_LIB_SPEC "%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}"
|
||||
+
|
104
lang/gcc/3.3/patches/patch-gcc_config_openbsd_h
Normal file
104
lang/gcc/3.3/patches/patch-gcc_config_openbsd_h
Normal file
@ -0,0 +1,104 @@
|
||||
$OpenBSD: patch-gcc_config_openbsd_h,v 1.1.1.1 2005/01/03 15:21:26 espie Exp $
|
||||
--- gcc/config/openbsd.h.orig Tue Nov 26 05:54:46 2002
|
||||
+++ gcc/config/openbsd.h Mon Jan 3 10:17:43 2005
|
||||
@@ -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/"
|
||||
|
||||
#endif
|
||||
@@ -73,8 +73,39 @@ 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_define ("__unix__"); \
|
||||
+ builtin_define ("__ANSI_COMPAT"); \
|
||||
+ builtin_assert ("system=unix"); \
|
||||
+ builtin_assert ("system=bsd"); \
|
||||
+ 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"); \
|
||||
+ 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,11 +115,6 @@ 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}}}"
|
||||
-
|
||||
#ifndef OBSD_HAS_CORRECT_SPECS
|
||||
|
||||
#ifndef OBSD_NO_DYNAMIC_LIBRARIES
|
||||
@@ -127,6 +153,10 @@ Boston, MA 02111-1307, USA. */
|
||||
"%{g:%{!nostdlib:-L/usr/lib/debug}} %{!shared:%{!nostdlib:%{!r*:%{!e*:-e start}}}} %{shared:-Bshareable -x} -dc -dp %{R*} %{static:-Bstatic} %{assert*}"
|
||||
#endif
|
||||
|
||||
+#if defined(HAVE_LD_EH_FRAME_HDR)
|
||||
+#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
|
||||
+#endif
|
||||
+
|
||||
#undef LIB_SPEC
|
||||
#define LIB_SPEC OBSD_LIB_SPEC
|
||||
#endif
|
||||
@@ -289,3 +319,11 @@ do { \
|
||||
as this depends on a few other details as well... */
|
||||
#define HANDLE_SYSV_PRAGMA 1
|
||||
|
||||
+/* Disable the use of unsafe builtin functions, (strcat, strcpy), making
|
||||
+ * them easier to spot in the object files.
|
||||
+ */
|
||||
+#define NO_UNSAFE_BUILTINS
|
||||
+
|
||||
+/* pick up defines for mprotect (used in TRANSFER_FROM_TRAMPOLINE) */
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/mman.h>
|
220
lang/gcc/3.3/patches/patch-gcc_config_pa_openbsd_h
Normal file
220
lang/gcc/3.3/patches/patch-gcc_config_pa_openbsd_h
Normal file
@ -0,0 +1,220 @@
|
||||
$OpenBSD: patch-gcc_config_pa_openbsd_h,v 1.1.1.1 2005/01/03 15:21:26 espie Exp $
|
||||
--- gcc/config/pa/openbsd.h.orig Mon Jan 3 10:17:43 2005
|
||||
+++ gcc/config/pa/openbsd.h Mon Jan 3 10:17:43 2005
|
||||
@@ -0,0 +1,216 @@
|
||||
+/* Configuration file for an hppa risc 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. */
|
||||
+
|
||||
+
|
||||
+#include <pa/pa.h>
|
||||
+#include <pa/pa32-regs.h>
|
||||
+#define OBSD_HAS_DECLARE_FUNCTION_NAME
|
||||
+#include <openbsd.h>
|
||||
+
|
||||
+/* Turn off various SOM crap we don't want. */
|
||||
+#undef TARGET_ELF32
|
||||
+#define TARGET_ELF32 1
|
||||
+
|
||||
+#undef MAX_OFILE_ALIGNMENT
|
||||
+#define MAX_OFILE_ALIGNMENT 0x8000
|
||||
+
|
||||
+/* libc's profiling functions don't need gcc to allocate counters. */
|
||||
+#define NO_PROFILE_COUNTERS 1
|
||||
+
|
||||
+/* Run-time target specifications. */
|
||||
+#undef TARGET_OS_CPP_BUILTINS
|
||||
+#define TARGET_OS_CPP_BUILTINS() \
|
||||
+ do \
|
||||
+ { \
|
||||
+ OPENBSD_OS_CPP_BUILTINS_ELF(); \
|
||||
+ } \
|
||||
+ while (0)
|
||||
+
|
||||
+
|
||||
+/* XXX Why doesn't PA support -R like everyone ??? */
|
||||
+#undef LINK_SPEC
|
||||
+#define LINK_SPEC \
|
||||
+ "%{EB} %{EL} %{shared} %{non_shared} \
|
||||
+ %{call_shared} %{no_archive} %{exact_version} \
|
||||
+ %{!shared: %{!non_shared: %{!call_shared: -non_shared}}} \
|
||||
+ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so} \
|
||||
+ %{!nostdlib:%{!r*:%{!e*:-e __start}}} -dc -dp \
|
||||
+ %{static:-Bstatic} %{!static:-Bdynamic} %{assert*}"
|
||||
+
|
||||
+/* Layout of source language data types. */
|
||||
+
|
||||
+/* This must agree with <machine/ansi.h> */
|
||||
+#undef SIZE_TYPE
|
||||
+#define SIZE_TYPE "unsigned int"
|
||||
+
|
||||
+#undef PTRDIFF_TYPE
|
||||
+#define PTRDIFF_TYPE "int"
|
||||
+
|
||||
+#undef WCHAR_TYPE
|
||||
+#define WCHAR_TYPE "int"
|
||||
+
|
||||
+#undef WCHAR_TYPE_SIZE
|
||||
+#define WCHAR_TYPE_SIZE 32
|
||||
+
|
||||
+/* Output at beginning of assembler file. */
|
||||
+/* This is slightly changed from main pa.h to only output dyncall
|
||||
+ when compiling PIC. */
|
||||
+#undef ASM_FILE_START
|
||||
+#define ASM_FILE_START(FILE) \
|
||||
+do { \
|
||||
+ if (write_symbols != NO_DEBUG) \
|
||||
+ output_file_directive ((FILE), main_input_filename); \
|
||||
+ if (TARGET_64BIT) \
|
||||
+ fputs("\t.LEVEL 2.0w\n", FILE); \
|
||||
+ else if (TARGET_PA_20) \
|
||||
+ fputs("\t.LEVEL 2.0\n", FILE); \
|
||||
+ else if (TARGET_PA_11) \
|
||||
+ fputs("\t.LEVEL 1.1\n", FILE); \
|
||||
+ else \
|
||||
+ fputs("\t.LEVEL 1.0\n", FILE); \
|
||||
+ if (flag_pic || !TARGET_FAST_INDIRECT_CALLS) \
|
||||
+ fputs ("\t.IMPORT $$dyncall, MILLICODE\n", FILE); \
|
||||
+ if (profile_flag) \
|
||||
+ fputs ("\t.IMPORT _mcount, CODE\n", FILE); \
|
||||
+ } while (0)
|
||||
+
|
||||
+#undef ASM_OUTPUT_FUNCTION_PREFIX
|
||||
+
|
||||
+/* We want local labels to start with period if made with asm_fprintf. */
|
||||
+#undef LOCAL_LABEL_PREFIX
|
||||
+#define LOCAL_LABEL_PREFIX "."
|
||||
+
|
||||
+/* Use the default. */
|
||||
+#undef ASM_OUTPUT_LABEL
|
||||
+
|
||||
+/* This is how to output an internal numbered label where
|
||||
+ PREFIX is the class of label and NUM is the number within the class.
|
||||
+
|
||||
+ For most svr4 systems, the convention is that any symbol which begins
|
||||
+ with a period is not put into the linker symbol table by the assembler. */
|
||||
+
|
||||
+#undef ASM_OUTPUT_INTERNAL_LABEL
|
||||
+#define ASM_OUTPUT_INTERNAL_LABEL(FILE, PREFIX, NUM) \
|
||||
+ do \
|
||||
+ { \
|
||||
+ fprintf (FILE, ".%s%u:\n", PREFIX, (unsigned) (NUM)); \
|
||||
+ } \
|
||||
+ while (0)
|
||||
+
|
||||
+/* 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'.
|
||||
+
|
||||
+ For most svr4 systems, the convention is that any symbol which begins
|
||||
+ with a period is not put into the linker symbol table by the assembler. */
|
||||
+
|
||||
+#undef ASM_GENERATE_INTERNAL_LABEL
|
||||
+#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
|
||||
+ do \
|
||||
+ { \
|
||||
+ sprintf (LABEL, "*.%s%u", PREFIX, (unsigned) (NUM)); \
|
||||
+ } \
|
||||
+ while (0)
|
||||
+
|
||||
+#undef ASM_OUTPUT_ADDR_VEC_ELT
|
||||
+#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
|
||||
+ if (TARGET_BIG_SWITCH) \
|
||||
+ fprintf (FILE, "\tstw %%r1,-16(%%r30)\n\tldil LR'.L%d,%%r1\n\tbe RR'.L%d(%%sr4,%%r1)\n\tldw -16(%%r30),%%r1\n", VALUE, VALUE); \
|
||||
+ else \
|
||||
+ fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE)
|
||||
+#undef ASM_OUTPUT_ADDR_DIFF_ELT
|
||||
+#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
|
||||
+ if (TARGET_BIG_SWITCH) \
|
||||
+ fprintf (FILE, "\tstw %%r1,-16(%%r30)\n\tldw T'.L%d(%%r19),%%r1\n\tbv %%r0(%%r1)\n\tldw -16(%%r30),%%r1\n", VALUE); \
|
||||
+ else \
|
||||
+ fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE)
|
||||
+
|
||||
+#undef STRING_ASM_OP
|
||||
+#define STRING_ASM_OP ".stringz"
|
||||
+
|
||||
+#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
|
||||
+
|
||||
+#undef ASM_OUTPUT_SECTION_NAME
|
||||
+/* Switch into a generic section.
|
||||
+ This is currently only used to support section attributes.
|
||||
+
|
||||
+ We make the section read-only and executable for a function decl,
|
||||
+ read-only for a const data decl, and writable for a non-const data decl. */
|
||||
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
|
||||
+ fprintf (FILE, "\t.section\t%s,\"%s\",@progbits\n", NAME, \
|
||||
+ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
|
||||
+ (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
|
||||
+
|
||||
+/* FIXME: Hacked from the <elfos.h> one so that we avoid multiple
|
||||
+ labels in a function declaration (since pa.c seems determined to do
|
||||
+ it differently) */
|
||||
+
|
||||
+#undef ASM_DECLARE_FUNCTION_NAME
|
||||
+#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
|
||||
+ do \
|
||||
+ { \
|
||||
+ if (TREE_PUBLIC (DECL)) \
|
||||
+ { \
|
||||
+ fputs ("\t.export ", FILE); \
|
||||
+ assemble_name (FILE, NAME); \
|
||||
+ fputs (", entry\n", FILE); \
|
||||
+ } \
|
||||
+ ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \
|
||||
+ ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
|
||||
+ } \
|
||||
+ while (0)
|
||||
+
|
||||
+/* As well as globalizing the label, we need to encode the label
|
||||
+ to ensure a plabel is generated in an indirect call. */
|
||||
+#undef ASM_OUTPUT_EXTERNAL_LIBCALL
|
||||
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
|
||||
+ do \
|
||||
+ { \
|
||||
+ if (!FUNCTION_NAME_P (XSTR (FUN, 0))) \
|
||||
+ hppa_encode_label (FUN); \
|
||||
+ (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0)); \
|
||||
+ } \
|
||||
+ while (0)
|
||||
+
|
||||
+/* 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 TEXT_SECTION_ASM_OP
|
||||
+#define TEXT_SECTION_ASM_OP "\t.text"
|
||||
+#undef READONLY_DATA_SECTION_ASM_OP
|
||||
+#define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rodata"
|
||||
+#undef DATA_SECTION_ASM_OP
|
||||
+#define DATA_SECTION_ASM_OP "\t.data"
|
||||
+#undef BSS_SECTION_ASM_OP
|
||||
+#define BSS_SECTION_ASM_OP "\t.section\t.bss"
|
||||
+#define CTORS_SECTION_ASM_OP "\t.section\t.ctors,\"aw\""
|
||||
+#define DTORS_SECTION_ASM_OP "\t.section\t.dtors,\"aw\""
|
||||
+#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
|
||||
+
|
||||
+/* Remove hpux specific pa defines. */
|
||||
+#undef LDD_SUFFIX
|
||||
+#undef PARSE_LDD_OUTPUT
|
||||
+
|
||||
+#undef DO_GLOBAL_DTORS_BODY
|
||||
+#define HAS_INIT_SECTION
|
17
lang/gcc/3.3/patches/patch-gcc_config_pa_pa_c
Normal file
17
lang/gcc/3.3/patches/patch-gcc_config_pa_pa_c
Normal file
@ -0,0 +1,17 @@
|
||||
$OpenBSD: patch-gcc_config_pa_pa_c,v 1.1.1.1 2005/01/03 15:21:26 espie Exp $
|
||||
--- gcc/config/pa/pa.c.orig Sun Jul 25 20:53:31 2004
|
||||
+++ gcc/config/pa/pa.c Mon Jan 3 10:17:43 2005
|
||||
@@ -8359,11 +8359,11 @@ pa_select_section (exp, reloc, align)
|
||||
&& DECL_INITIAL (exp)
|
||||
&& (DECL_INITIAL (exp) == error_mark_node
|
||||
|| TREE_CONSTANT (DECL_INITIAL (exp)))
|
||||
- && !reloc)
|
||||
+ && !(reloc && flag_pic))
|
||||
readonly_data_section ();
|
||||
else if (TREE_CODE_CLASS (TREE_CODE (exp)) == 'c'
|
||||
&& !(TREE_CODE (exp) == STRING_CST && flag_writable_strings)
|
||||
- && !reloc)
|
||||
+ && !(reloc && flag_pic))
|
||||
readonly_data_section ();
|
||||
else
|
||||
data_section ();
|
20
lang/gcc/3.3/patches/patch-gcc_config_pa_t-openbsd
Normal file
20
lang/gcc/3.3/patches/patch-gcc_config_pa_t-openbsd
Normal file
@ -0,0 +1,20 @@
|
||||
$OpenBSD: patch-gcc_config_pa_t-openbsd,v 1.1.1.1 2005/01/03 15:21:26 espie Exp $
|
||||
--- gcc/config/pa/t-openbsd.orig Mon Jan 3 10:17:43 2005
|
||||
+++ gcc/config/pa/t-openbsd Mon Jan 3 10:17:43 2005
|
||||
@@ -0,0 +1,16 @@
|
||||
+#Plug millicode routines into libgcc.a We want these on both native and
|
||||
+#cross compiles. We use the "64-bit" routines because the "32-bit" code
|
||||
+#is broken for certain corner cases.
|
||||
+
|
||||
+LIB1ASMFUNCS = _divI _divU _remI _remU _div_const _mulI _dyncall
|
||||
+LIB1ASMSRC = pa/milli64.S
|
||||
+
|
||||
+# Compile libgcc2.a as PIC.
|
||||
+TARGET_LIBGCC2_CFLAGS = -fPIC -DELF=1 -DLINUX
|
||||
+
|
||||
+LIB2FUNCS_EXTRA=fptr.c
|
||||
+
|
||||
+fptr.c: $(srcdir)/config/pa/fptr.c
|
||||
+ rm -f fptr.c
|
||||
+ cp $(srcdir)/config/pa/fptr.c .
|
||||
+
|
12
lang/gcc/3.3/patches/patch-gcc_config_rs6000_crtsavres_asm
Normal file
12
lang/gcc/3.3/patches/patch-gcc_config_rs6000_crtsavres_asm
Normal file
@ -0,0 +1,12 @@
|
||||
$OpenBSD: patch-gcc_config_rs6000_crtsavres_asm,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/config/rs6000/crtsavres.asm.orig Tue Feb 19 20:40:41 2002
|
||||
+++ gcc/config/rs6000/crtsavres.asm Mon Jan 3 10:17:43 2005
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
.file "crtsavres.asm"
|
||||
.section ".text"
|
||||
- #include "ppc-asm.h"
|
||||
+ #include "rs6000/ppc-asm.h"
|
||||
|
||||
#ifndef __powerpc64__
|
||||
|
12
lang/gcc/3.3/patches/patch-gcc_config_rs6000_eabi_asm
Normal file
12
lang/gcc/3.3/patches/patch-gcc_config_rs6000_eabi_asm
Normal file
@ -0,0 +1,12 @@
|
||||
$OpenBSD: patch-gcc_config_rs6000_eabi_asm,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/config/rs6000/eabi.asm.orig Sat Sep 21 01:46:58 2002
|
||||
+++ gcc/config/rs6000/eabi.asm Mon Jan 3 10:17:43 2005
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
.file "eabi.asm"
|
||||
.section ".text"
|
||||
- #include "ppc-asm.h"
|
||||
+ #include "rs6000/ppc-asm.h"
|
||||
|
||||
#ifndef __powerpc64__
|
||||
|
28
lang/gcc/3.3/patches/patch-gcc_config_rs6000_openbsd1_h
Normal file
28
lang/gcc/3.3/patches/patch-gcc_config_rs6000_openbsd1_h
Normal file
@ -0,0 +1,28 @@
|
||||
$OpenBSD: patch-gcc_config_rs6000_openbsd1_h,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/config/rs6000/openbsd1.h.orig Mon Jan 3 10:17:43 2005
|
||||
+++ gcc/config/rs6000/openbsd1.h Mon Jan 3 10:17:43 2005
|
||||
@@ -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
|
99
lang/gcc/3.3/patches/patch-gcc_config_rs6000_openbsd_h
Normal file
99
lang/gcc/3.3/patches/patch-gcc_config_rs6000_openbsd_h
Normal file
@ -0,0 +1,99 @@
|
||||
$OpenBSD: patch-gcc_config_rs6000_openbsd_h,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/config/rs6000/openbsd.h.orig Mon Jan 3 10:17:43 2005
|
||||
+++ gcc/config/rs6000/openbsd.h Mon Jan 3 10:17:43 2005
|
||||
@@ -0,0 +1,95 @@
|
||||
+/* 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 ("__PPC"); \
|
||||
+ builtin_define ("__PPC__"); \
|
||||
+ builtin_define ("__powerpc"); \
|
||||
+ 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
|
||||
+
|
||||
+/* Some code gets optimized incorrectly by move_movables() in loop.c */
|
||||
+#define BROKEN_MOVE_MOVABLES_P
|
233
lang/gcc/3.3/patches/patch-gcc_config_rs6000_sysv4_h
Normal file
233
lang/gcc/3.3/patches/patch-gcc_config_rs6000_sysv4_h
Normal file
@ -0,0 +1,233 @@
|
||||
$OpenBSD: patch-gcc_config_rs6000_sysv4_h,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/config/rs6000/sysv4.h.orig Mon Mar 29 21:16:43 2004
|
||||
+++ gcc/config/rs6000/sysv4.h Mon Jan 3 10:17:43 2005
|
||||
@@ -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")) \
|
||||
@@ -838,6 +840,7 @@ do { \
|
||||
%{mcall-freebsd: -mbig} \
|
||||
%{mcall-i960-old: -mlittle} \
|
||||
%{mcall-linux: -mbig} \
|
||||
+ %{mcall-openbsd: -mbig} \
|
||||
%{mcall-gnu: -mbig} \
|
||||
%{mcall-netbsd: -mbig} \
|
||||
}}}}"
|
||||
@@ -862,11 +865,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 }} \
|
||||
@@ -875,6 +880,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} \
|
||||
@@ -907,11 +913,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 ""
|
||||
|
||||
@@ -966,11 +973,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 ""
|
||||
|
||||
@@ -988,12 +996,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 ""
|
||||
|
||||
@@ -1007,11 +1016,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 ""
|
||||
|
||||
@@ -1025,11 +1035,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 ""
|
||||
|
||||
@@ -1043,13 +1054,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"
|
||||
|
||||
@@ -1246,6 +1258,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 ""
|
||||
@@ -1321,6 +1373,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 }, \
|
||||
@@ -1332,6 +1386,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 }, \
|
||||
@@ -1343,6 +1398,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 }, \
|
||||
@@ -1358,6 +1414,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 }, \
|
||||
@@ -1370,6 +1427,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 }, \
|
||||
@@ -1383,6 +1441,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 }, \
|
59
lang/gcc/3.3/patches/patch-gcc_config_rs6000_t-openbsd
Normal file
59
lang/gcc/3.3/patches/patch-gcc_config_rs6000_t-openbsd
Normal file
@ -0,0 +1,59 @@
|
||||
$OpenBSD: patch-gcc_config_rs6000_t-openbsd,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/config/rs6000/t-openbsd.orig Mon Jan 3 10:17:43 2005
|
||||
+++ gcc/config/rs6000/t-openbsd Mon Jan 3 10:17:43 2005
|
||||
@@ -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
|
12
lang/gcc/3.3/patches/patch-gcc_config_rs6000_tramp_asm
Normal file
12
lang/gcc/3.3/patches/patch-gcc_config_rs6000_tramp_asm
Normal file
@ -0,0 +1,12 @@
|
||||
$OpenBSD: patch-gcc_config_rs6000_tramp_asm,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/config/rs6000/tramp.asm.orig Sat Dec 1 09:34:11 2001
|
||||
+++ gcc/config/rs6000/tramp.asm Mon Jan 3 10:17:43 2005
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
.file "tramp.asm"
|
||||
.section ".text"
|
||||
- #include "ppc-asm.h"
|
||||
+ #include "rs6000/ppc-asm.h"
|
||||
|
||||
.type trampoline_initial,@object
|
||||
.align 2
|
142
lang/gcc/3.3/patches/patch-gcc_config_sparc_openbsd64_h
Normal file
142
lang/gcc/3.3/patches/patch-gcc_config_sparc_openbsd64_h
Normal file
@ -0,0 +1,142 @@
|
||||
$OpenBSD: patch-gcc_config_sparc_openbsd64_h,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/config/sparc/openbsd64.h.orig Thu May 30 22:35:58 2002
|
||||
+++ gcc/config/sparc/openbsd64.h Mon Jan 3 10:17:43 2005
|
||||
@@ -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_HARD_QUAD */ \
|
||||
+ 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. */
|
||||
-#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 ("__sparcv9__"); \
|
||||
+ builtin_define ("__arch64__"); \
|
||||
+ builtin_define ("__sparc"); \
|
||||
+ builtin_define ("__sparc__"); \
|
||||
+ } \
|
||||
+ while (0)
|
||||
|
||||
#undef CPP_SUBTARGET_SPEC
|
||||
#define CPP_SUBTARGET_SPEC ""
|
||||
@@ -54,9 +64,14 @@ Boston, MA 02111-1307, USA. */
|
||||
#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 "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}}}} \
|
||||
@@ -73,3 +88,88 @@ 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"
|
||||
+
|
||||
+#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)
|
||||
+
|
||||
+/* 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")
|
47
lang/gcc/3.3/patches/patch-gcc_config_sparc_openbsd_h
Normal file
47
lang/gcc/3.3/patches/patch-gcc_config_sparc_openbsd_h
Normal file
@ -0,0 +1,47 @@
|
||||
$OpenBSD: patch-gcc_config_sparc_openbsd_h,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/config/sparc/openbsd.h.orig Mon Oct 21 00:37:13 2002
|
||||
+++ gcc/config/sparc/openbsd.h Mon Jan 3 10:17:43 2005
|
||||
@@ -19,11 +19,17 @@ the Free Software Foundation, 59 Temple
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Get generic OpenBSD definitions. */
|
||||
-#define OBSD_OLD_GAS
|
||||
#include <openbsd.h>
|
||||
|
||||
/* Run-time target specifications. */
|
||||
-#define CPP_PREDEFINES "-D__unix__ -D__sparc__ -D__OpenBSD__ -Asystem=unix -Asystem=OpenBSD -Acpu=sparc -Amachine=sparc"
|
||||
+#define TARGET_OS_CPP_BUILTINS() \
|
||||
+ do \
|
||||
+ { \
|
||||
+ OPENBSD_OS_CPP_BUILTINS_ELF(); \
|
||||
+ builtin_define ("__sparc"); \
|
||||
+ builtin_define ("__sparc__"); \
|
||||
+ } \
|
||||
+ while (0)
|
||||
|
||||
/* Layout of source language data types */
|
||||
|
||||
@@ -39,6 +45,23 @@ Boston, MA 02111-1307, USA. */
|
||||
|
||||
#undef WCHAR_TYPE_SIZE
|
||||
#define WCHAR_TYPE_SIZE 32
|
||||
+
|
||||
+#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}"
|
||||
|
||||
/* Specific options for DBX Output. */
|
||||
|
13
lang/gcc/3.3/patches/patch-gcc_config_t-openbsd
Normal file
13
lang/gcc/3.3/patches/patch-gcc_config_t-openbsd
Normal file
@ -0,0 +1,13 @@
|
||||
$OpenBSD: patch-gcc_config_t-openbsd,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/config/t-openbsd.orig Fri Dec 21 00:35:42 2001
|
||||
+++ gcc/config/t-openbsd Mon Jan 3 10:17:43 2005
|
||||
@@ -3,3 +3,9 @@ STMP_FIXPROTO =
|
||||
|
||||
# We don't need GCC's own include files.
|
||||
USER_H =
|
||||
+
|
||||
+# Use unwind-dw2-fde-openbsd
|
||||
+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-openbsd.c \
|
||||
+ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
|
||||
+LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c \
|
||||
+ unwind-dw2-fde-glibc.c
|
14
lang/gcc/3.3/patches/patch-gcc_cp_Make-lang_in
Normal file
14
lang/gcc/3.3/patches/patch-gcc_cp_Make-lang_in
Normal file
@ -0,0 +1,14 @@
|
||||
$OpenBSD: patch-gcc_cp_Make-lang_in,v 1.1.1.1 2005/01/03 15:21:26 espie Exp $
|
||||
--- gcc/cp/Make-lang.in.orig Sat May 8 23:52:43 2004
|
||||
+++ gcc/cp/Make-lang.in Mon Jan 3 10:17:44 2005
|
||||
@@ -78,8 +78,8 @@ g++-cross$(exeext): g++$(exeext)
|
||||
|
||||
# The compiler itself.
|
||||
# Shared with C front end:
|
||||
-CXX_C_OBJS = attribs.o c-common.o c-format.o c-pragma.o c-semantics.o c-lex.o \
|
||||
- c-dump.o $(CXX_TARGET_OBJS) c-pretty-print.o c-opts.o
|
||||
+CXX_C_OBJS = attribs.o c-common.o c-format.o c-bounded.o c-pragma.o c-semantics.o \
|
||||
+ c-lex.o c-dump.o $(CXX_TARGET_OBJS) c-pretty-print.o c-opts.o
|
||||
|
||||
# Language-specific object files.
|
||||
CXX_OBJS = cp/call.o cp/decl.o cp/expr.o cp/pt.o cp/typeck2.o \
|
14
lang/gcc/3.3/patches/patch-gcc_cp_call_c
Normal file
14
lang/gcc/3.3/patches/patch-gcc_cp_call_c
Normal file
@ -0,0 +1,14 @@
|
||||
$OpenBSD: patch-gcc_cp_call_c,v 1.1.1.1 2005/01/03 15:21:26 espie Exp $
|
||||
--- gcc/cp/call.c.orig Wed Jul 28 04:17:21 2004
|
||||
+++ gcc/cp/call.c Mon Jan 3 10:17:44 2005
|
||||
@@ -4616,6 +4616,10 @@ build_over_call (cand, args, flags)
|
||||
check_function_format (NULL, TYPE_ATTRIBUTES (TREE_TYPE (fn)),
|
||||
converted_args);
|
||||
|
||||
+ if (warn_bounded)
|
||||
+ check_function_bounded (NULL, TYPE_ATTRIBUTES (TREE_TYPE (fn)),
|
||||
+ converted_args);
|
||||
+
|
||||
/* Avoid actually calling copy constructors and copy assignment operators,
|
||||
if possible. */
|
||||
|
76
lang/gcc/3.3/patches/patch-gcc_cp_g++spec_c
Normal file
76
lang/gcc/3.3/patches/patch-gcc_cp_g++spec_c
Normal file
@ -0,0 +1,76 @@
|
||||
$OpenBSD: patch-gcc_cp_g++spec_c,v 1.1.1.1 2005/01/03 15:21:26 espie Exp $
|
||||
--- gcc/cp/g++spec.c.orig Tue Mar 11 01:59:25 2003
|
||||
+++ gcc/cp/g++spec.c Mon Jan 3 10:54:03 2005
|
||||
@@ -37,11 +37,17 @@ 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
|
||||
lang_specific_driver (in_argc, in_argv, in_added_libraries)
|
||||
@@ -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,11 +138,18 @@ 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
|
||||
|| strcmp (argv[i], MATH_LIBRARY) == 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)
|
||||
{
|
13
lang/gcc/3.3/patches/patch-gcc_cp_typeck_c
Normal file
13
lang/gcc/3.3/patches/patch-gcc_cp_typeck_c
Normal file
@ -0,0 +1,13 @@
|
||||
$OpenBSD: patch-gcc_cp_typeck_c,v 1.1.1.1 2005/01/03 15:21:26 espie Exp $
|
||||
--- gcc/cp/typeck.c.orig Sun Feb 22 17:27:37 2004
|
||||
+++ gcc/cp/typeck.c Mon Jan 3 10:17:44 2005
|
||||
@@ -2739,6 +2739,9 @@ build_function_call_real (function, para
|
||||
if (warn_format)
|
||||
check_function_format (NULL, TYPE_ATTRIBUTES (fntype), coerced_params);
|
||||
|
||||
+ if (warn_bounded)
|
||||
+ check_function_bounded (NULL, TYPE_ATTRIBUTES (fntype), coerced_params);
|
||||
+
|
||||
/* Recognize certain built-in functions so we can make tree-codes
|
||||
other than CALL_EXPR. We do this when it enables fold-const.c
|
||||
to do something useful. */
|
21
lang/gcc/3.3/patches/patch-gcc_fixinc_fixincl_c
Normal file
21
lang/gcc/3.3/patches/patch-gcc_fixinc_fixincl_c
Normal file
@ -0,0 +1,21 @@
|
||||
$OpenBSD: patch-gcc_fixinc_fixincl_c,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/fixinc/fixincl.c.orig Wed Dec 5 00:29:42 2001
|
||||
+++ gcc/fixinc/fixincl.c Mon Jan 3 10:17:44 2005
|
||||
@@ -568,7 +568,7 @@ create_file ()
|
||||
|
||||
sprintf (fname, "%s/%s", pz_dest_dir, pz_curr_file + find_base_len);
|
||||
|
||||
- fd = open (fname, O_WRONLY | O_CREAT | O_TRUNC, S_IRALL);
|
||||
+ fd = open (fname, O_WRONLY | O_CREAT | O_TRUNC, S_IRALL, 0666);
|
||||
|
||||
/* We may need to create the directories needed... */
|
||||
if ((fd < 0) && (errno == ENOENT))
|
||||
@@ -589,7 +589,7 @@ create_file ()
|
||||
}
|
||||
|
||||
/* Now, lets try the open again... */
|
||||
- fd = open (fname, O_WRONLY | O_CREAT | O_TRUNC, S_IRALL);
|
||||
+ fd = open (fname, O_WRONLY | O_CREAT | O_TRUNC, S_IRALL, 0666);
|
||||
}
|
||||
if (fd < 0)
|
||||
{
|
12
lang/gcc/3.3/patches/patch-gcc_fixinc_mkfixinc_sh
Normal file
12
lang/gcc/3.3/patches/patch-gcc_fixinc_mkfixinc_sh
Normal file
@ -0,0 +1,12 @@
|
||||
$OpenBSD: patch-gcc_fixinc_mkfixinc_sh,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/fixinc/mkfixinc.sh.orig Fri Nov 7 00:13:36 2003
|
||||
+++ gcc/fixinc/mkfixinc.sh Mon Jan 3 10:17:44 2005
|
||||
@@ -47,7 +47,7 @@ case $machine in
|
||||
fixincludes=fixinc.interix
|
||||
;;
|
||||
|
||||
- i?86-*-openbsd*)
|
||||
+ *-*-openbsd*)
|
||||
fixincludes=fixinc.wrap
|
||||
;;
|
||||
|
46
lang/gcc/3.3/patches/patch-gcc_fold-const_c
Normal file
46
lang/gcc/3.3/patches/patch-gcc_fold-const_c
Normal file
@ -0,0 +1,46 @@
|
||||
$OpenBSD: patch-gcc_fold-const_c,v 1.1.1.1 2005/01/03 15:21:26 espie Exp $
|
||||
--- gcc/fold-const.c.orig Sun Aug 8 20:55:28 2004
|
||||
+++ gcc/fold-const.c Mon Jan 3 10:17:42 2005
|
||||
@@ -1036,7 +1036,11 @@ int_const_binop (code, arg1, arg2, notru
|
||||
= (TREE_CODE (type) == INTEGER_TYPE && TYPE_IS_SIZETYPE (type));
|
||||
int overflow = 0;
|
||||
int no_overflow = 0;
|
||||
+ int sizeof_flag = 0;
|
||||
|
||||
+ if (SIZEOF_PTR_DERIVED (arg1) == 1 || SIZEOF_PTR_DERIVED (arg2) == 1)
|
||||
+ sizeof_flag = 1;
|
||||
+
|
||||
int1l = TREE_INT_CST_LOW (arg1);
|
||||
int1h = TREE_INT_CST_HIGH (arg1);
|
||||
int2l = TREE_INT_CST_LOW (arg2);
|
||||
@@ -1203,6 +1207,10 @@ int_const_binop (code, arg1, arg2, notru
|
||||
TREE_CONSTANT_OVERFLOW (t) = (TREE_OVERFLOW (t)
|
||||
| TREE_CONSTANT_OVERFLOW (arg1)
|
||||
| TREE_CONSTANT_OVERFLOW (arg2));
|
||||
+
|
||||
+ if (sizeof_flag == 1)
|
||||
+ SIZEOF_PTR_DERIVED (t) = 1;
|
||||
+
|
||||
return t;
|
||||
}
|
||||
|
||||
@@ -5039,6 +5047,9 @@ fold (expr)
|
||||
| force_fit_type (t, overflow && !TREE_UNSIGNED (type)));
|
||||
TREE_CONSTANT_OVERFLOW (t)
|
||||
= TREE_OVERFLOW (t) | TREE_CONSTANT_OVERFLOW (arg0);
|
||||
+ /* If arg0 was calculated from sizeof(ptr), record this */
|
||||
+ if (SIZEOF_PTR_DERIVED (arg0))
|
||||
+ SIZEOF_PTR_DERIVED (t) = 1;
|
||||
}
|
||||
else if (TREE_CODE (arg0) == REAL_CST)
|
||||
t = build_real (type, REAL_VALUE_NEGATE (TREE_REAL_CST (arg0)));
|
||||
@@ -5082,6 +5093,9 @@ fold (expr)
|
||||
| force_fit_type (t, overflow));
|
||||
TREE_CONSTANT_OVERFLOW (t)
|
||||
= TREE_OVERFLOW (t) | TREE_CONSTANT_OVERFLOW (arg0);
|
||||
+ /* If arg0 was calculated from sizeof(ptr), record this */
|
||||
+ if (SIZEOF_PTR_DERIVED (arg0))
|
||||
+ SIZEOF_PTR_DERIVED (t) = 1;
|
||||
}
|
||||
}
|
||||
else if (TREE_CODE (arg0) == REAL_CST)
|
15
lang/gcc/3.3/patches/patch-gcc_gcc_c
Normal file
15
lang/gcc/3.3/patches/patch-gcc_gcc_c
Normal file
@ -0,0 +1,15 @@
|
||||
$OpenBSD: patch-gcc_gcc_c,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/gcc.c.orig Thu Apr 1 18:55:17 2004
|
||||
+++ gcc/gcc.c Mon Jan 3 10:17:42 2005
|
||||
@@ -6767,9 +6767,9 @@ used_arg (p, len)
|
||||
them. */
|
||||
for (i = 0; i < n_mdswitches; i++)
|
||||
{
|
||||
- const char *r;
|
||||
+ const char *r, *eq;
|
||||
|
||||
- for (q = multilib_options; *q != '\0'; q++)
|
||||
+ for (q = multilib_options, eq = q + strlen(q); q < eq; q++)
|
||||
{
|
||||
while (*q == ' ')
|
||||
q++;
|
96
lang/gcc/3.3/patches/patch-gcc_mklibgcc_in
Normal file
96
lang/gcc/3.3/patches/patch-gcc_mklibgcc_in
Normal file
@ -0,0 +1,96 @@
|
||||
$OpenBSD: patch-gcc_mklibgcc_in,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/mklibgcc.in.orig Wed Dec 24 23:42:28 2003
|
||||
+++ gcc/mklibgcc.in Mon Jan 3 10:17:42 2005
|
||||
@@ -63,10 +63,10 @@ make_compile='$(MAKE) GCC_FOR_TARGET="$(
|
||||
LANGUAGES="$(LANGUAGES)"'
|
||||
|
||||
# Dependencies for libgcc2.c
|
||||
-libgcc2_c_dep='stmp-dirs $(srcdir)/libgcc2.c $(CONFIG_H) $(MACHMODE_H) longlong.h gbl-ctors.h config.status stmp-int-hdrs tsystem.h'" $LIB2ADDEHDEP"
|
||||
+libgcc2_c_dep='$(srcdir)/libgcc2.c $(CONFIG_H) $(MACHMODE_H) longlong.h gbl-ctors.h config.status stmp-int-hdrs tsystem.h'" $LIB2ADDEHDEP"
|
||||
|
||||
# Dependencies for fp-bit.c
|
||||
-fpbit_c_dep='stmp-dirs config.status tsystem.h'
|
||||
+fpbit_c_dep='config.status tsystem.h'
|
||||
|
||||
#
|
||||
# Build libgcc1 components.
|
||||
@@ -80,7 +80,7 @@ for name in $LIB1ASMFUNCS; do
|
||||
flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
|
||||
out="libgcc/${dir}/${name}${objext}"
|
||||
|
||||
- echo ${out}: stmp-dirs '$(srcdir)/config/$(LIB1ASMSRC)'
|
||||
+ echo ${out}: '$(srcdir)/config/$(LIB1ASMSRC)'
|
||||
echo " $gcc_compile" $flags -DL$name -xassembler-with-cpp \
|
||||
-c '$(srcdir)/config/$(LIB1ASMSRC)' -o $out
|
||||
|
||||
@@ -203,7 +203,7 @@ for file in $LIB2ADD; do
|
||||
flags="$flags -xassembler-with-cpp"
|
||||
fi
|
||||
|
||||
- echo $out: stmp-dirs $file
|
||||
+ echo $out: $file
|
||||
echo " $gcc_compile" $flags -c $file -o $out
|
||||
done
|
||||
libgcc2_objs="$libgcc2_objs ${oname}${objext}"
|
||||
@@ -221,7 +221,7 @@ for file in $LIB2ADDEH; do
|
||||
flags="$flags -xassembler-with-cpp"
|
||||
fi
|
||||
|
||||
- echo $out: stmp-dirs $file
|
||||
+ echo $out: $file
|
||||
echo " $gcc_compile" $flags -fexceptions -c $file -o $out
|
||||
done
|
||||
if [ "$SHLIB_LINK" ]; then
|
||||
@@ -243,7 +243,7 @@ for file in $LIB2ADD_ST; do
|
||||
flags="$flags -xassembler-with-cpp"
|
||||
fi
|
||||
|
||||
- echo $out: stmp-dirs $file
|
||||
+ echo $out: $file
|
||||
echo " $gcc_compile" $flags -c $file -o $out
|
||||
done
|
||||
libgcc2_st_objs="$libgcc2_st_objs ${oname}${objext}"
|
||||
@@ -299,14 +299,14 @@ for ml in $MULTILIBS; do
|
||||
if [ "@libgcc_visibility@" = yes -a "$SHLIB_LINK" ]; then
|
||||
libgcc_a_objs=
|
||||
echo ""
|
||||
- echo "libgcc/${dir}/stacknote.s: stmp-dirs"
|
||||
+ echo "libgcc/${dir}/stacknote.s:"
|
||||
echo ' @( echo | $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) '${flags}' -S -o - -xc - | grep .note.GNU-stack || : ) > $@.tmp'
|
||||
echo ' @mv -f $@.tmp $@'
|
||||
echo ""
|
||||
for o in $libgcc_objs $libgcc_st_objs; do
|
||||
# .oS objects will have all non-local symbol definitions .hidden
|
||||
oS=`echo ${o} | sed s~${objext}'$~.oS~g'`
|
||||
- echo "${oS}: stmp-dirs libgcc/${dir}/stacknote.s ${o}"
|
||||
+ echo "${oS}: libgcc/${dir}/stacknote.s ${o}"
|
||||
echo ' @( $(NM_FOR_TARGET) '${SHLIB_NM_FLAGS} ${o}' | $(AWK) '\''NF == 3 { print "\t.hidden", $$3 }'\''; cat libgcc/${dir}/stacknote.s ) | $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) '${flags}' -r -nostdinc -nostdlib -o $@ '${o}' -xassembler -'
|
||||
libgcc_a_objs="${libgcc_a_objs} ${oS}"
|
||||
done
|
||||
@@ -319,7 +319,7 @@ for ml in $MULTILIBS; do
|
||||
# dependency is required; the directory containing the archive must
|
||||
# exist before the archive itself can be created.
|
||||
echo ""
|
||||
- echo "${dir}/libgcc.a: stmp-dirs $libgcc_a_objs"
|
||||
+ echo "${dir}/libgcc.a: $libgcc_a_objs"
|
||||
echo " -rm -rf ${dir}/libgcc.a"
|
||||
echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc.a $libgcc_a_objs
|
||||
echo ' if $(RANLIB_TEST_FOR_TARGET) ; then' \\
|
||||
@@ -329,7 +329,7 @@ for ml in $MULTILIBS; do
|
||||
if [ "$SHLIB_LINK" ]; then
|
||||
|
||||
echo ""
|
||||
- echo "${dir}/libgcc_eh.a: stmp-dirs $libgcc_eh_objs"
|
||||
+ echo "${dir}/libgcc_eh.a: $libgcc_eh_objs"
|
||||
echo " -rm -rf ${dir}/libgcc_eh.a"
|
||||
echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc_eh.a $libgcc_eh_objs
|
||||
echo ' if $(RANLIB_TEST_FOR_TARGET) ; then' \\
|
||||
@@ -446,7 +446,7 @@ for f in $EXTRA_MULTILIB_PARTS; do
|
||||
*) targ=$out ;;
|
||||
esac
|
||||
|
||||
- echo $out: stmp-dirs
|
||||
+ echo $out:
|
||||
echo " $make_compile" \\
|
||||
echo ' LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)' $flags '" ' \\
|
||||
echo ' MULTILIB_CFLAGS="'$flags'"' T=$t $targ
|
45
lang/gcc/3.3/patches/patch-gcc_toplev_c
Normal file
45
lang/gcc/3.3/patches/patch-gcc_toplev_c
Normal file
@ -0,0 +1,45 @@
|
||||
$OpenBSD: patch-gcc_toplev_c,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/toplev.c.orig Mon Jan 3 12:24:48 2005
|
||||
+++ gcc/toplev.c Mon Jan 3 12:27:08 2005
|
||||
@@ -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;
|
||||
@@ -1362,6 +1366,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 },
|
||||
|
||||
@@ -4910,14 +4917,19 @@ parse_options_and_default_flags (argc, a
|
||||
flag_schedule_insns_after_reload = 1;
|
||||
#endif
|
||||
flag_regmove = 1;
|
||||
+#ifndef OPENBSD_NATIVE
|
||||
flag_strict_aliasing = 1;
|
||||
flag_delete_null_pointer_checks = 1;
|
||||
+#endif
|
||||
flag_reorder_blocks = 1;
|
||||
flag_reorder_functions = 1;
|
||||
}
|
||||
|
||||
if (optimize >= 3)
|
||||
{
|
||||
+#ifdef OPENBSD_NATIVE
|
||||
+ flag_strict_aliasing = 1;
|
||||
+#endif
|
||||
flag_inline_functions = 1;
|
||||
flag_rename_registers = 1;
|
||||
}
|
14
lang/gcc/3.3/patches/patch-gcc_tree_h
Normal file
14
lang/gcc/3.3/patches/patch-gcc_tree_h
Normal file
@ -0,0 +1,14 @@
|
||||
$OpenBSD: patch-gcc_tree_h,v 1.1.1.1 2005/01/03 15:21:26 espie Exp $
|
||||
--- gcc/tree.h.orig Mon Jan 3 12:24:09 2005
|
||||
+++ gcc/tree.h Mon Jan 3 12:24:21 2005
|
||||
@@ -698,6 +698,10 @@ extern void tree_vec_elt_check_failed PA
|
||||
#define TREE_LANG_FLAG_4(NODE) ((NODE)->common.lang_flag_4)
|
||||
#define TREE_LANG_FLAG_5(NODE) ((NODE)->common.lang_flag_5)
|
||||
#define TREE_LANG_FLAG_6(NODE) ((NODE)->common.lang_flag_6)
|
||||
+
|
||||
+/* Used to track constants derived from sizeof(pointer) operations */
|
||||
+#define SIZEOF_PTR_DERIVED(NODE) (TREE_LANG_FLAG_6((NODE)))
|
||||
+
|
||||
|
||||
/* Define additional fields and accessors for nodes representing constants. */
|
||||
|
13
lang/gcc/3.3/patches/patch-gcc_unwind-dw2-fde-openbsd_c
Normal file
13
lang/gcc/3.3/patches/patch-gcc_unwind-dw2-fde-openbsd_c
Normal file
@ -0,0 +1,13 @@
|
||||
$OpenBSD: patch-gcc_unwind-dw2-fde-openbsd_c,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- gcc/unwind-dw2-fde-openbsd.c.orig Mon Jan 3 10:17:42 2005
|
||||
+++ gcc/unwind-dw2-fde-openbsd.c Mon Jan 3 10:17:42 2005
|
||||
@@ -0,0 +1,9 @@
|
||||
+/* XXX This file provides a few defines such that we can compile the
|
||||
+ source from unwind-dw2-fde-glibc.c on OpenBSD. Hopefully we can
|
||||
+ integrate these defines in that file and rename it to something
|
||||
+ like unwind-de2-fde-phdr.c in the up-stream sources. */
|
||||
+
|
||||
+#define ElfW(type) Elf_##type
|
||||
+
|
||||
+#define __GLIBC__ 3 /* Fool unwind-dw2-fde-glibc.c. */
|
||||
+#include "unwind-dw2-fde-glibc.c"
|
34
lang/gcc/3.3/patches/patch-libffi_configure_in
Normal file
34
lang/gcc/3.3/patches/patch-libffi_configure_in
Normal 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;;
|
12
lang/gcc/3.3/patches/patch-libiberty_choose-temp_c
Normal file
12
lang/gcc/3.3/patches/patch-libiberty_choose-temp_c
Normal file
@ -0,0 +1,12 @@
|
||||
$OpenBSD: patch-libiberty_choose-temp_c,v 1.1.1.1 2005/01/03 15:21:27 espie 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));
|
||||
|
23
lang/gcc/3.3/patches/patch-libjava_aclocal_m4
Normal file
23
lang/gcc/3.3/patches/patch-libjava_aclocal_m4
Normal file
@ -0,0 +1,23 @@
|
||||
$OpenBSD: patch-libjava_aclocal_m4,v 1.1.1.1 2005/01/03 15:21:27 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
|
||||
+])
|
||||
+
|
42
lang/gcc/3.3/patches/patch-libjava_configure_in
Normal file
42
lang/gcc/3.3/patches/patch-libjava_configure_in
Normal file
@ -0,0 +1,42 @@
|
||||
$OpenBSD: patch-libjava_configure_in,v 1.1.1.1 2005/01/03 15:21:27 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
|
||||
|
13
lang/gcc/3.3/patches/patch-libjava_include_config_h_in
Normal file
13
lang/gcc/3.3/patches/patch-libjava_include_config_h_in
Normal file
@ -0,0 +1,13 @@
|
||||
$OpenBSD: patch-libjava_include_config_h_in,v 1.1.1.1 2005/01/03 15:21:27 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
|
||||
|
12
lang/gcc/3.3/patches/patch-libjava_java_lang_natRuntime_cc
Normal file
12
lang/gcc/3.3/patches/patch-libjava_java_lang_natRuntime_cc
Normal file
@ -0,0 +1,12 @@
|
||||
$OpenBSD: patch-libjava_java_lang_natRuntime_cc,v 1.1.1.1 2005/01/03 15:21:27 espie Exp $
|
||||
--- 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
|
||||
@@ -341,7 +341,7 @@ java::lang::Runtime::traceMethodCalls (j
|
||||
}
|
||||
|
||||
#if ! defined (DEFAULT_FILE_ENCODING) && defined (HAVE_ICONV) \
|
||||
- && defined (HAVE_NL_LANGINFO)
|
||||
+ && defined (HAVE_LANGINFO_CODESET)
|
||||
|
||||
static char *
|
||||
file_encoding ()
|
21
lang/gcc/3.3/patches/patch-libstdc++-v3_src_Makefile_in
Normal file
21
lang/gcc/3.3/patches/patch-libstdc++-v3_src_Makefile_in
Normal file
@ -0,0 +1,21 @@
|
||||
$OpenBSD: patch-libstdc++-v3_src_Makefile_in,v 1.1.1.1 2005/01/03 15:21:29 espie Exp $
|
||||
--- libstdc++-v3/src/Makefile.in.orig Mon Jan 3 10:54:34 2005
|
||||
+++ libstdc++-v3/src/Makefile.in Mon Jan 3 10:55:23 2005
|
||||
@@ -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 =
|
||||
@GLIBCPP_BUILD_VERSIONED_SHLIB_TRUE@version_dep = libstdc++-symbol.ver
|
||||
@@ -410,7 +410,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 $<
|
14
lang/gcc/3.3/patches/patch-libtool_m4
Normal file
14
lang/gcc/3.3/patches/patch-libtool_m4
Normal file
@ -0,0 +1,14 @@
|
||||
$OpenBSD: patch-libtool_m4,v 1.1.1.1 2005/01/03 15:21:27 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'
|
19
lang/gcc/3.3/patches/patch-ltcf-c_sh
Normal file
19
lang/gcc/3.3/patches/patch-ltcf-c_sh
Normal file
@ -0,0 +1,19 @@
|
||||
$OpenBSD: patch-ltcf-c_sh,v 1.1.1.1 2005/01/03 15:21:29 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*)
|
23
lang/gcc/3.3/patches/patch-ltcf-cxx_sh
Normal file
23
lang/gcc/3.3/patches/patch-ltcf-cxx_sh
Normal file
@ -0,0 +1,23 @@
|
||||
$OpenBSD: patch-ltcf-cxx_sh,v 1.1.1.1 2005/01/03 15:21:29 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)
|
19
lang/gcc/3.3/patches/patch-ltcf-gcj_sh
Normal file
19
lang/gcc/3.3/patches/patch-ltcf-gcj_sh
Normal file
@ -0,0 +1,19 @@
|
||||
$OpenBSD: patch-ltcf-gcj_sh,v 1.1.1.1 2005/01/03 15:21:29 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*)
|
27
lang/gcc/3.3/patches/patch-ltconfig
Normal file
27
lang/gcc/3.3/patches/patch-ltconfig
Normal file
@ -0,0 +1,27 @@
|
||||
$OpenBSD: patch-ltconfig,v 1.1.1.1 2005/01/03 15:21:29 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*)
|
17
lang/gcc/3.3/pkg/DESCR
Normal file
17
lang/gcc/3.3/pkg/DESCR
Normal file
@ -0,0 +1,17 @@
|
||||
OpenBSD currently ships with a slightly modified gcc 2.95.3, which
|
||||
should be adequate for most people.
|
||||
|
||||
Selected changes:
|
||||
|
||||
* gcc 3.2 is much slower compiling than gcc 2.95.
|
||||
* integrated preprocessor, somewhat better diagnostics.
|
||||
* much better C++ support, almost fully ISO compliant.
|
||||
* better C++ template diagnostics.
|
||||
* better code generation, (scheduling on newer intel platforms), sparc64,
|
||||
and others...
|
||||
* function at-a-time compile and tree based inliner, that should give
|
||||
better results than the old inliner.
|
||||
* profiler-directed optimizations.
|
||||
* built-in for mmx (needs new gas though) or altivec.
|
||||
* integrated ada and java compiler (boehm-gc does not work on OpenBSD yet).
|
||||
* more robust, especially where odd compile options are concerned.
|
3
lang/gcc/3.3/pkg/PFRAG.PIC
Normal file
3
lang/gcc/3.3/pkg/PFRAG.PIC
Normal file
@ -0,0 +1,3 @@
|
||||
@comment $OpenBSD: PFRAG.PIC,v 1.1.1.1 2005/01/03 15:21:30 espie Exp $
|
||||
lib/gcc-lib/${CONFIG}/${V}/fpic/
|
||||
lib/gcc-lib/${CONFIG}/${V}/fpic/libgcc.a
|
6
lang/gcc/3.3/pkg/PFRAG.PIC-c++
Normal file
6
lang/gcc/3.3/pkg/PFRAG.PIC-c++
Normal file
@ -0,0 +1,6 @@
|
||||
@comment $OpenBSD: PFRAG.PIC-c++,v 1.1.1.1 2005/01/03 15:21:30 espie Exp $
|
||||
lib/fpic/libestdc++.a
|
||||
@comment lib/fpic/libestdc++.la
|
||||
lib/fpic/libiberty.a
|
||||
lib/fpic/libsupc++.a
|
||||
@comment lib/fpic/libsupc++.la
|
4
lang/gcc/3.3/pkg/PFRAG.PIC-g77
Normal file
4
lang/gcc/3.3/pkg/PFRAG.PIC-g77
Normal file
@ -0,0 +1,4 @@
|
||||
@comment $OpenBSD: PFRAG.PIC-g77,v 1.1.1.1 2005/01/03 15:21:30 espie Exp $
|
||||
lib/fpic/libfrtbegin.a
|
||||
lib/fpic/libg2c.a
|
||||
lib/fpic/libg2c.la
|
7
lang/gcc/3.3/pkg/PFRAG.PIC-java
Normal file
7
lang/gcc/3.3/pkg/PFRAG.PIC-java
Normal file
@ -0,0 +1,7 @@
|
||||
@comment $OpenBSD: PFRAG.PIC-java,v 1.1.1.1 2005/01/03 15:21:30 espie Exp $
|
||||
lib/fpic/lib-org-w3c-dom.a
|
||||
lib/fpic/lib-org-w3c-dom.la
|
||||
lib/fpic/lib-org-xml-sax.a
|
||||
lib/fpic/lib-org-xml-sax.la
|
||||
lib/fpic/libffi.a
|
||||
lib/fpic/libffi.la
|
3
lang/gcc/3.3/pkg/PFRAG.PIC-objc
Normal file
3
lang/gcc/3.3/pkg/PFRAG.PIC-objc
Normal file
@ -0,0 +1,3 @@
|
||||
@comment $OpenBSD: PFRAG.PIC-objc,v 1.1.1.1 2005/01/03 15:21:30 espie Exp $
|
||||
lib/fpic/libobjc.a
|
||||
lib/fpic/libobjc.la
|
2
lang/gcc/3.3/pkg/PFRAG.PPC
Normal file
2
lang/gcc/3.3/pkg/PFRAG.PPC
Normal file
@ -0,0 +1,2 @@
|
||||
@comment $OpenBSD: PFRAG.PPC,v 1.1.1.1 2005/01/03 15:21:30 espie Exp $
|
||||
lib/gcc-lib/${CONFIG}/${V}/crtsavres.o
|
3
lang/gcc/3.3/pkg/PFRAG.shared-estdc
Normal file
3
lang/gcc/3.3/pkg/PFRAG.shared-estdc
Normal file
@ -0,0 +1,3 @@
|
||||
@comment $OpenBSD: PFRAG.shared-estdc,v 1.1.1.1 2005/01/03 15:21:30 espie Exp $
|
||||
@comment @lib lib/fpic/libestdc++.so.5.7
|
||||
@lib lib/libestdc++.so.5.7
|
3
lang/gcc/3.3/pkg/PFRAG.shared-g77
Normal file
3
lang/gcc/3.3/pkg/PFRAG.shared-g77
Normal file
@ -0,0 +1,3 @@
|
||||
@comment $OpenBSD: PFRAG.shared-g77,v 1.1.1.1 2005/01/03 15:21:30 espie Exp $
|
||||
@lib lib/libg2c.so.0.0
|
||||
@comment @lib lib/fpic/libg2c.so.0.0
|
7
lang/gcc/3.3/pkg/PFRAG.shared-java
Normal file
7
lang/gcc/3.3/pkg/PFRAG.shared-java
Normal file
@ -0,0 +1,7 @@
|
||||
@comment $OpenBSD: PFRAG.shared-java,v 1.1.1.1 2005/01/03 15:21:30 espie Exp $
|
||||
@lib lib/lib-org-w3c-dom.so.0.0
|
||||
@lib lib/lib-org-xml-sax.so.0.0
|
||||
lib/libffi-2.00-beta.so
|
||||
lib/libffi.so
|
||||
@comment @lib lib/libgc.so.1.2
|
||||
@lib lib/libgcj.so.4.0
|
3
lang/gcc/3.3/pkg/PFRAG.shared-objc
Normal file
3
lang/gcc/3.3/pkg/PFRAG.shared-objc
Normal file
@ -0,0 +1,3 @@
|
||||
@comment $OpenBSD: PFRAG.shared-objc,v 1.1.1.1 2005/01/03 15:21:30 espie Exp $
|
||||
@lib lib/libobjc.so.1.0
|
||||
@comment @lib lib/fpic/libobjc.so.1.0
|
42
lang/gcc/3.3/pkg/PLIST
Normal file
42
lang/gcc/3.3/pkg/PLIST
Normal file
@ -0,0 +1,42 @@
|
||||
@comment $OpenBSD: PLIST,v 1.1.1.1 2005/01/03 15:21:30 espie Exp $
|
||||
@conflict egcs-*-core
|
||||
bin/ecpp
|
||||
bin/egcc
|
||||
bin/egccbug
|
||||
bin/egcov
|
||||
bin/${CONFIG}-egcc
|
||||
bin/${CONFIG}-gcc-${V}
|
||||
@info info/cpp.info
|
||||
@info info/cppinternals.info
|
||||
@info info/gcc.info
|
||||
@info info/gccint.info
|
||||
lib/fpic/
|
||||
lib/gcc-lib/
|
||||
lib/gcc-lib/${CONFIG}/
|
||||
lib/gcc-lib/${CONFIG}/${V}/
|
||||
lib/gcc-lib/${CONFIG}/${V}/cc1
|
||||
lib/gcc-lib/${CONFIG}/${V}/collect2
|
||||
lib/gcc-lib/${CONFIG}/${V}/include/
|
||||
lib/gcc-lib/${CONFIG}/${V}/include/README
|
||||
lib/gcc-lib/${CONFIG}/${V}/include/limits.h
|
||||
lib/gcc-lib/${CONFIG}/${V}/include/math.h
|
||||
lib/gcc-lib/${CONFIG}/${V}/include/syslimits.h
|
||||
lib/gcc-lib/${CONFIG}/${V}/install-tools/
|
||||
lib/gcc-lib/${CONFIG}/${V}/install-tools/fixinc.sh
|
||||
lib/gcc-lib/${CONFIG}/${V}/install-tools/gsyslimits.h
|
||||
lib/gcc-lib/${CONFIG}/${V}/install-tools/include/
|
||||
lib/gcc-lib/${CONFIG}/${V}/install-tools/include/README
|
||||
lib/gcc-lib/${CONFIG}/${V}/install-tools/include/limits.h
|
||||
lib/gcc-lib/${CONFIG}/${V}/install-tools/mkheaders
|
||||
lib/gcc-lib/${CONFIG}/${V}/install-tools/mkheaders.conf
|
||||
lib/gcc-lib/${CONFIG}/${V}/libgcc.a
|
||||
lib/gcc-lib/${CONFIG}/${V}/specs
|
||||
@comment lib/libiberty.a
|
||||
@man man/man1/cpp.1
|
||||
@man man/man1/egcc.1
|
||||
@man man/man1/gcov.1
|
||||
%%PIC%%
|
||||
%%PPC%%
|
||||
@comment @man man/man7/fsf-funding.7
|
||||
@comment @man man/man7/gfdl.7
|
||||
@comment @man man/man7/gpl.7
|
1088
lang/gcc/3.3/pkg/PLIST-ada
Normal file
1088
lang/gcc/3.3/pkg/PLIST-ada
Normal file
File diff suppressed because it is too large
Load Diff
206
lang/gcc/3.3/pkg/PLIST-c++
Normal file
206
lang/gcc/3.3/pkg/PLIST-c++
Normal file
@ -0,0 +1,206 @@
|
||||
@comment $OpenBSD: PLIST-c++,v 1.1.1.1 2005/01/03 15:21:30 espie Exp $
|
||||
@conflict egcs-*-core
|
||||
bin/ec++
|
||||
bin/eg++
|
||||
bin/${CONFIG}-ec++
|
||||
bin/${CONFIG}-eg++
|
||||
include/c++/
|
||||
include/c++/${V}/
|
||||
include/c++/${V}/algorithm
|
||||
include/c++/${V}/backward/
|
||||
include/c++/${V}/backward/algo.h
|
||||
include/c++/${V}/backward/algobase.h
|
||||
include/c++/${V}/backward/alloc.h
|
||||
include/c++/${V}/backward/backward_warning.h
|
||||
include/c++/${V}/backward/bvector.h
|
||||
include/c++/${V}/backward/complex.h
|
||||
include/c++/${V}/backward/defalloc.h
|
||||
include/c++/${V}/backward/deque.h
|
||||
include/c++/${V}/backward/fstream.h
|
||||
include/c++/${V}/backward/function.h
|
||||
include/c++/${V}/backward/hash_map.h
|
||||
include/c++/${V}/backward/hash_set.h
|
||||
include/c++/${V}/backward/hashtable.h
|
||||
include/c++/${V}/backward/heap.h
|
||||
include/c++/${V}/backward/iomanip.h
|
||||
include/c++/${V}/backward/iostream.h
|
||||
include/c++/${V}/backward/istream.h
|
||||
include/c++/${V}/backward/iterator.h
|
||||
include/c++/${V}/backward/list.h
|
||||
include/c++/${V}/backward/map.h
|
||||
include/c++/${V}/backward/multimap.h
|
||||
include/c++/${V}/backward/multiset.h
|
||||
include/c++/${V}/backward/new.h
|
||||
include/c++/${V}/backward/ostream.h
|
||||
include/c++/${V}/backward/pair.h
|
||||
include/c++/${V}/backward/queue.h
|
||||
include/c++/${V}/backward/rope.h
|
||||
include/c++/${V}/backward/set.h
|
||||
include/c++/${V}/backward/slist.h
|
||||
include/c++/${V}/backward/stack.h
|
||||
include/c++/${V}/backward/stream.h
|
||||
include/c++/${V}/backward/streambuf.h
|
||||
include/c++/${V}/backward/strstream
|
||||
include/c++/${V}/backward/tempbuf.h
|
||||
include/c++/${V}/backward/tree.h
|
||||
include/c++/${V}/backward/vector.h
|
||||
include/c++/${V}/bits/
|
||||
include/c++/${V}/bits/basic_ios.h
|
||||
include/c++/${V}/bits/basic_ios.tcc
|
||||
include/c++/${V}/bits/basic_string.h
|
||||
include/c++/${V}/bits/basic_string.tcc
|
||||
include/c++/${V}/bits/boost_concept_check.h
|
||||
include/c++/${V}/bits/char_traits.h
|
||||
include/c++/${V}/bits/cmath.tcc
|
||||
include/c++/${V}/bits/codecvt.h
|
||||
include/c++/${V}/bits/concept_check.h
|
||||
include/c++/${V}/bits/cpp_type_traits.h
|
||||
include/c++/${V}/bits/deque.tcc
|
||||
include/c++/${V}/bits/fpos.h
|
||||
include/c++/${V}/bits/fstream.tcc
|
||||
include/c++/${V}/bits/functexcept.h
|
||||
include/c++/${V}/bits/gslice.h
|
||||
include/c++/${V}/bits/gslice_array.h
|
||||
include/c++/${V}/bits/indirect_array.h
|
||||
include/c++/${V}/bits/ios_base.h
|
||||
include/c++/${V}/bits/istream.tcc
|
||||
include/c++/${V}/bits/list.tcc
|
||||
include/c++/${V}/bits/locale_classes.h
|
||||
include/c++/${V}/bits/locale_facets.h
|
||||
include/c++/${V}/bits/locale_facets.tcc
|
||||
include/c++/${V}/bits/localefwd.h
|
||||
include/c++/${V}/bits/mask_array.h
|
||||
include/c++/${V}/bits/ostream.tcc
|
||||
include/c++/${V}/bits/pthread_allocimpl.h
|
||||
include/c++/${V}/bits/slice_array.h
|
||||
include/c++/${V}/bits/sstream.tcc
|
||||
include/c++/${V}/bits/stl_algo.h
|
||||
include/c++/${V}/bits/stl_algobase.h
|
||||
include/c++/${V}/bits/stl_alloc.h
|
||||
include/c++/${V}/bits/stl_bvector.h
|
||||
include/c++/${V}/bits/stl_construct.h
|
||||
include/c++/${V}/bits/stl_deque.h
|
||||
include/c++/${V}/bits/stl_function.h
|
||||
include/c++/${V}/bits/stl_heap.h
|
||||
include/c++/${V}/bits/stl_iterator.h
|
||||
include/c++/${V}/bits/stl_iterator_base_funcs.h
|
||||
include/c++/${V}/bits/stl_iterator_base_types.h
|
||||
include/c++/${V}/bits/stl_list.h
|
||||
include/c++/${V}/bits/stl_map.h
|
||||
include/c++/${V}/bits/stl_multimap.h
|
||||
include/c++/${V}/bits/stl_multiset.h
|
||||
include/c++/${V}/bits/stl_numeric.h
|
||||
include/c++/${V}/bits/stl_pair.h
|
||||
include/c++/${V}/bits/stl_pthread_alloc.h
|
||||
include/c++/${V}/bits/stl_queue.h
|
||||
include/c++/${V}/bits/stl_raw_storage_iter.h
|
||||
include/c++/${V}/bits/stl_relops.h
|
||||
include/c++/${V}/bits/stl_set.h
|
||||
include/c++/${V}/bits/stl_stack.h
|
||||
include/c++/${V}/bits/stl_tempbuf.h
|
||||
include/c++/${V}/bits/stl_threads.h
|
||||
include/c++/${V}/bits/stl_tree.h
|
||||
include/c++/${V}/bits/stl_uninitialized.h
|
||||
include/c++/${V}/bits/stl_vector.h
|
||||
include/c++/${V}/bits/stream_iterator.h
|
||||
include/c++/${V}/bits/streambuf.tcc
|
||||
include/c++/${V}/bits/streambuf_iterator.h
|
||||
include/c++/${V}/bits/stringfwd.h
|
||||
include/c++/${V}/bits/type_traits.h
|
||||
include/c++/${V}/bits/valarray_array.h
|
||||
include/c++/${V}/bits/valarray_array.tcc
|
||||
include/c++/${V}/bits/valarray_meta.h
|
||||
include/c++/${V}/bits/vector.tcc
|
||||
include/c++/${V}/bitset
|
||||
include/c++/${V}/cassert
|
||||
include/c++/${V}/cctype
|
||||
include/c++/${V}/cerrno
|
||||
include/c++/${V}/cfloat
|
||||
include/c++/${V}/ciso646
|
||||
include/c++/${V}/climits
|
||||
include/c++/${V}/clocale
|
||||
include/c++/${V}/cmath
|
||||
include/c++/${V}/complex
|
||||
include/c++/${V}/csetjmp
|
||||
include/c++/${V}/csignal
|
||||
include/c++/${V}/cstdarg
|
||||
include/c++/${V}/cstddef
|
||||
include/c++/${V}/cstdio
|
||||
include/c++/${V}/cstdlib
|
||||
include/c++/${V}/cstring
|
||||
include/c++/${V}/ctime
|
||||
include/c++/${V}/cwchar
|
||||
include/c++/${V}/cwctype
|
||||
include/c++/${V}/cxxabi.h
|
||||
include/c++/${V}/deque
|
||||
include/c++/${V}/exception
|
||||
include/c++/${V}/exception_defines.h
|
||||
include/c++/${V}/ext/
|
||||
include/c++/${V}/ext/algorithm
|
||||
include/c++/${V}/ext/enc_filebuf.h
|
||||
include/c++/${V}/ext/functional
|
||||
include/c++/${V}/ext/hash_map
|
||||
include/c++/${V}/ext/hash_set
|
||||
include/c++/${V}/ext/iterator
|
||||
include/c++/${V}/ext/memory
|
||||
include/c++/${V}/ext/numeric
|
||||
include/c++/${V}/ext/rb_tree
|
||||
include/c++/${V}/ext/rope
|
||||
include/c++/${V}/ext/ropeimpl.h
|
||||
include/c++/${V}/ext/slist
|
||||
include/c++/${V}/ext/stdio_filebuf.h
|
||||
include/c++/${V}/ext/stl_hash_fun.h
|
||||
include/c++/${V}/ext/stl_hashtable.h
|
||||
include/c++/${V}/ext/stl_rope.h
|
||||
include/c++/${V}/fstream
|
||||
include/c++/${V}/functional
|
||||
include/c++/${V}/${CONFIG}/
|
||||
include/c++/${V}/${CONFIG}/bits/
|
||||
include/c++/${V}/${CONFIG}/bits/atomicity.h
|
||||
include/c++/${V}/${CONFIG}/bits/basic_file.h
|
||||
include/c++/${V}/${CONFIG}/bits/c++config.h
|
||||
include/c++/${V}/${CONFIG}/bits/c++io.h
|
||||
include/c++/${V}/${CONFIG}/bits/c++locale.h
|
||||
include/c++/${V}/${CONFIG}/bits/codecvt_specializations.h
|
||||
include/c++/${V}/${CONFIG}/bits/ctype_base.h
|
||||
include/c++/${V}/${CONFIG}/bits/ctype_inline.h
|
||||
include/c++/${V}/${CONFIG}/bits/ctype_noninline.h
|
||||
include/c++/${V}/${CONFIG}/bits/gthr-default.h
|
||||
include/c++/${V}/${CONFIG}/bits/gthr-posix.h
|
||||
include/c++/${V}/${CONFIG}/bits/gthr-single.h
|
||||
include/c++/${V}/${CONFIG}/bits/gthr.h
|
||||
include/c++/${V}/${CONFIG}/bits/messages_members.h
|
||||
include/c++/${V}/${CONFIG}/bits/os_defines.h
|
||||
include/c++/${V}/${CONFIG}/bits/time_members.h
|
||||
include/c++/${V}/iomanip
|
||||
include/c++/${V}/ios
|
||||
include/c++/${V}/iosfwd
|
||||
include/c++/${V}/iostream
|
||||
include/c++/${V}/istream
|
||||
include/c++/${V}/iterator
|
||||
include/c++/${V}/limits
|
||||
include/c++/${V}/list
|
||||
include/c++/${V}/locale
|
||||
include/c++/${V}/map
|
||||
include/c++/${V}/memory
|
||||
include/c++/${V}/new
|
||||
include/c++/${V}/numeric
|
||||
include/c++/${V}/ostream
|
||||
include/c++/${V}/queue
|
||||
include/c++/${V}/set
|
||||
include/c++/${V}/sstream
|
||||
include/c++/${V}/stack
|
||||
include/c++/${V}/stdexcept
|
||||
include/c++/${V}/streambuf
|
||||
include/c++/${V}/string
|
||||
include/c++/${V}/typeinfo
|
||||
include/c++/${V}/utility
|
||||
include/c++/${V}/valarray
|
||||
include/c++/${V}/vector
|
||||
lib/gcc-lib/${CONFIG}/${V}/cc1plus
|
||||
lib/libestdc++.a
|
||||
@comment lib/libestdc++.la
|
||||
lib/libsupc++.a
|
||||
@comment lib/libsupc++.la
|
||||
@man man/man1/eg++.1
|
||||
%%PIC%%
|
2
lang/gcc/3.3/pkg/PLIST-estdc
Normal file
2
lang/gcc/3.3/pkg/PLIST-estdc
Normal file
@ -0,0 +1,2 @@
|
||||
@comment $OpenBSD: PLIST-estdc,v 1.1.1.1 2005/01/03 15:21:30 espie Exp $
|
||||
%%SHARED%%
|
12
lang/gcc/3.3/pkg/PLIST-g77
Normal file
12
lang/gcc/3.3/pkg/PLIST-g77
Normal file
@ -0,0 +1,12 @@
|
||||
@comment $OpenBSD: PLIST-g77,v 1.1.1.1 2005/01/03 15:21:30 espie Exp $
|
||||
@conflict egcs-*-core
|
||||
bin/eg77
|
||||
@info info/g77.info
|
||||
lib/gcc-lib/${CONFIG}/${V}/f771
|
||||
lib/gcc-lib/${CONFIG}/${V}/include/g2c.h
|
||||
lib/libfrtbegin.a
|
||||
lib/libg2c.a
|
||||
lib/libg2c.la
|
||||
@man man/man1/eg77.1
|
||||
%%SHARED%%
|
||||
%%PIC%%
|
1887
lang/gcc/3.3/pkg/PLIST-java
Normal file
1887
lang/gcc/3.3/pkg/PLIST-java
Normal file
File diff suppressed because it is too large
Load Diff
19
lang/gcc/3.3/pkg/PLIST-objc
Normal file
19
lang/gcc/3.3/pkg/PLIST-objc
Normal file
@ -0,0 +1,19 @@
|
||||
@comment $OpenBSD: PLIST-objc,v 1.1.1.1 2005/01/03 15:21:30 espie Exp $
|
||||
@conflict egcs-*-core
|
||||
lib/gcc-lib/${CONFIG}/${V}/cc1obj
|
||||
lib/gcc-lib/${CONFIG}/${V}/include/objc/
|
||||
lib/gcc-lib/${CONFIG}/${V}/include/objc/NXConstStr.h
|
||||
lib/gcc-lib/${CONFIG}/${V}/include/objc/Object.h
|
||||
lib/gcc-lib/${CONFIG}/${V}/include/objc/Protocol.h
|
||||
lib/gcc-lib/${CONFIG}/${V}/include/objc/encoding.h
|
||||
lib/gcc-lib/${CONFIG}/${V}/include/objc/hash.h
|
||||
lib/gcc-lib/${CONFIG}/${V}/include/objc/objc-api.h
|
||||
lib/gcc-lib/${CONFIG}/${V}/include/objc/objc-list.h
|
||||
lib/gcc-lib/${CONFIG}/${V}/include/objc/objc.h
|
||||
lib/gcc-lib/${CONFIG}/${V}/include/objc/sarray.h
|
||||
lib/gcc-lib/${CONFIG}/${V}/include/objc/thr.h
|
||||
lib/gcc-lib/${CONFIG}/${V}/include/objc/typedstream.h
|
||||
lib/libobjc.a
|
||||
lib/libobjc.la
|
||||
%%SHARED%%
|
||||
%%PIC%%
|
Loading…
x
Reference in New Issue
Block a user