Update to gcc 4.6.3.

Also, sync a bit with base gcc:
- disable unsafe builtins
- disable -Wpointer-sign in -Wall
- move -fstrict-aliasing to -O3, disable -fstrict-overflow and
  -fdelete-null-pointer-checks
- enable -Wsystem-headers
- default to march=i486 on i386
- fix crtsavres on powerpc
- sync sparc64 config
- implement -Wvariable-decl, -Wstack-larger-than-N (alpha, amd64, i386, sparc,
  sparc64), -Wtrampolines, -ftrampolines
- default to -fno-ident
- fix -rdynamic by passing -export-dynamic to ld(1)

some bits from Brad, others from me.

tested by myself and jsg@, adastrap now hosted by sthen@ (thanks).

ok jsg@ sthen@
This commit is contained in:
pascal 2012-03-31 20:02:03 +00:00
parent 187ac581dd
commit e7f261aa15
28 changed files with 401 additions and 100 deletions

View File

@ -1,13 +1,13 @@
# $OpenBSD: Makefile,v 1.18 2012/03/07 20:39:37 kurt Exp $
# $OpenBSD: Makefile,v 1.19 2012/03/31 20:02:03 pascal Exp $
ONLY_FOR_ARCHS = amd64 i386 powerpc sparc sparc64
BROKEN-sparc64 = gengtype looping infinitely
V = 4.6.2
V = 4.6.3
FULL_VERSION = $V
FULL_PKGVERSION = $V
BOOTSTRAP_GEN = 4
LIBC_VERSION = 60.1
BOOTSTRAP_GEN = 0
LIBC_VERSION = 63.0
ADASTRAP = adastrap-i386-$V-${BOOTSTRAP_GEN}.tar.xz
PKGNAME-main = gcc-${FULL_PKGVERSION}
@ -19,15 +19,6 @@ PKGNAME-objc = gobjc-${FULL_PKGVERSION}
PKGNAME-ada = gnat-${FULL_PKGVERSION}
PKGNAME-go = gccgo-${FULL_PKGVERSION}
REVISION-main = 1
REVISION-c++ = 1
REVISION-estdc =1
REVISION-f95 = 0
REVISION-java = 1
REVISION-objc = 0
REVISION-ada = 0
REVISION-go = 0
SHARED_LIBS = estdc++ 14.0 \
gfortran 3.0 \
gcj 1.0 \
@ -69,8 +60,8 @@ REGRESS_DEPENDS = devel/dejagnu \
devel/autogen
MASTER_SITES = ${MASTER_SITE_GCC:=releases/gcc-$(FULL_VERSION)/}
#MASTER_SITES0 = http://spacehopper.org/mirrors/
MASTER_SITES0 = ftp://quatramaran.ens.fr/pub/espie/
MASTER_SITES0 = http://spacehopper.org/mirrors/
#MASTER_SITES0 = ftp://quatramaran.ens.fr/pub/espie/
MASTER_SITES1 = ftp://sources.redhat.com/pub/java/
LANGS = c
@ -236,8 +227,8 @@ post-install:
.include <bsd.port.mk>
ADA_PACKAGE = ${PACKAGE_REPOSITORY}/i386/all/${PKGNAME-ada}${PKG_SUFX}
GCC_PACKAGE = ${PACKAGE_REPOSITORY}/i386/all/${PKGNAME-main}${PKG_SUFX}
ADA_PACKAGE = ${PACKAGE_REPOSITORY}/i386/all/${PKGNAME-ada}.tgz
GCC_PACKAGE = ${PACKAGE_REPOSITORY}/i386/all/${PKGNAME-main}.tgz
adastrap: ${ADA_PACKAGE} ${GCC_PACKAGE}
.if !defined(LIBC_VERSION)

View File

@ -1,2 +1,3 @@
- test all arches (only sparc and sparc64 left)
- fails on alpha at bootstrap comparison
Failures:
- alpha (bootstrap comparison)
- gengtype loops on sparc64 with -O2, fine with -O0

View File

@ -1,15 +1,15 @@
MD5 (gcc/adastrap-i386-4.6.2-4.tar.xz) = FibxHoV1fg6jBcsB3D7DeA==
MD5 (gcc/adastrap-i386-4.6.3-0.tar.xz) = h3oa6vXJhsLyHMGSyQdGpg==
MD5 (gcc/ecj-4.5.jar) = 181qJ8iAHmbLqpZKA57P2w==
MD5 (gcc/gcc-4.6.2.tar.bz2) = AoEVxPv7bP111jafSpDYfg==
RMD160 (gcc/adastrap-i386-4.6.2-4.tar.xz) = YXEXTT1xsciAWS0MQaY4bMLPRVw=
MD5 (gcc/gcc-4.6.3.tar.bz2) = dzCS/lGUNTsCuwEQBSqXLg==
RMD160 (gcc/adastrap-i386-4.6.3-0.tar.xz) = gp0rq+VpuV1tiRT+YLLs+fCYFCQ=
RMD160 (gcc/ecj-4.5.jar) = 0/TaZX8Ia2Qj906T8AETL0hVNoo=
RMD160 (gcc/gcc-4.6.2.tar.bz2) = 5wQZM7OWKflSSEjc+BoaTAKiJcY=
SHA1 (gcc/adastrap-i386-4.6.2-4.tar.xz) = zDgUMphqiUrZWX2uC+3hWHkjVlY=
RMD160 (gcc/gcc-4.6.3.tar.bz2) = mrsvlA0I/ITy2RtqbOjWYsqIkmk=
SHA1 (gcc/adastrap-i386-4.6.3-0.tar.xz) = LaVcCPxDBBeZnD8tr+3+pgXxyzU=
SHA1 (gcc/ecj-4.5.jar) = WMHXnGTIzXGFUPMqkyzP3o0eZEk=
SHA1 (gcc/gcc-4.6.2.tar.bz2) = aRl0YTscHxXtAYLsU5+lShLdb5M=
SHA256 (gcc/adastrap-i386-4.6.2-4.tar.xz) = Cxx6UgMtW6Y4jWvomF9CBGrs4um2+M4aoINKZEUO2Wc=
SHA1 (gcc/gcc-4.6.3.tar.bz2) = zjF8pcgYW1i8kwAYK1NGCMV4Y38=
SHA256 (gcc/adastrap-i386-4.6.3-0.tar.xz) = b5+DW9S4owsMIiWLIJTFxbjLzYBBEj6W2mv9AfRIG2w=
SHA256 (gcc/ecj-4.5.jar) = mP0Sjx03TZ5C/Z1INr3SScbVEevGwN8X+8G535bD14E=
SHA256 (gcc/gcc-4.6.2.tar.bz2) = YLBUY9/hjUDWj7inGyW0CKAfhsxs6vXmsiI4trD0UMI=
SIZE (gcc/adastrap-i386-4.6.2-4.tar.xz) = 45729588
SHA256 (gcc/gcc-4.6.3.tar.bz2) = 6PWFPU7sL166+Kcq5NU8Q2qs+YFTskmfhjW0jEcYoJM=
SIZE (gcc/adastrap-i386-4.6.3-0.tar.xz) = 22075992
SIZE (gcc/ecj-4.5.jar) = 1470676
SIZE (gcc/gcc-4.6.2.tar.bz2) = 71995338
SIZE (gcc/gcc-4.6.3.tar.bz2) = 71999439

View File

@ -0,0 +1,27 @@
$OpenBSD: patch-gcc_builtins_c,v 1.1 2012/03/31 20:02:03 pascal Exp $
--- gcc/builtins.c.orig Sun Mar 11 19:11:50 2012
+++ gcc/builtins.c Sun Mar 11 19:12:42 2012
@@ -6112,9 +6112,11 @@ expand_builtin (tree exp, rtx target, rtx subtarget, e
break;
case BUILT_IN_STRCPY:
+#ifndef NO_UNSAFE_BUILTINS
target = expand_builtin_strcpy (exp, target);
if (target)
return target;
+#endif
break;
case BUILT_IN_STRNCPY:
@@ -6124,9 +6126,11 @@ expand_builtin (tree exp, rtx target, rtx subtarget, e
break;
case BUILT_IN_STPCPY:
+#ifndef NO_UNSAFE_BUILTINS
target = expand_builtin_stpcpy (exp, target, mode);
if (target)
return target;
+#endif
break;
case BUILT_IN_MEMCPY:

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-gcc_c-decl_c,v 1.1 2012/03/31 20:02:03 pascal Exp $
--- gcc/c-decl.c.orig Thu Feb 23 18:38:13 2012
+++ gcc/c-decl.c Mon Mar 12 08:42:51 2012
@@ -4788,6 +4788,8 @@ warn_variable_length_array (tree name, tree size)
"variable length array is used");
}
}
+ if (warn_variable_decl)
+ warning (OPT_Wvariable_decl, "variable-sized array %qE", name);
}
/* Given a size SIZE that may not be a constant, return a SAVE_EXPR to

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-gcc_c-family_c-opts_c,v 1.1 2012/03/31 20:02:03 pascal Exp $
--- gcc/c-family/c-opts.c.orig Sun Mar 11 19:21:01 2012
+++ gcc/c-family/c-opts.c Sun Mar 11 19:21:20 2012
@@ -405,8 +405,6 @@ c_common_handle_option (size_t scode, const char *arg,
cpp_opts->warn_comments = value;
cpp_opts->warn_num_sign_change = value;
- if (warn_pointer_sign == -1)
- warn_pointer_sign = value;
break;
case OPT_Wbuiltin_macro_redefined:

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-gcc_c-family_c_opt,v 1.1 2012/03/31 20:02:03 pascal Exp $
--- gcc/c-family/c.opt.orig Tue Mar 29 16:24:42 2011
+++ gcc/c-family/c.opt Sun Mar 11 23:00:25 2012
@@ -993,6 +993,10 @@ fthreadsafe-statics
C++ ObjC++ Optimization Var(flag_threadsafe_statics) Init(1)
-fno-threadsafe-statics Do not generate thread-safe code for initializing local statics
+ftrampolines
+Common Var(flag_trampolines)
+Allows trampolines
+
funsigned-bitfields
C ObjC C++ ObjC++ Var(flag_signed_bitfields, 0)
When \"signed\" or \"unsigned\" is not given make the bitfield unsigned

View File

@ -1,7 +1,56 @@
$OpenBSD: patch-gcc_common_opt,v 1.1 2012/02/16 21:30:15 pascal Exp $
$OpenBSD: patch-gcc_common_opt,v 1.2 2012/03/31 20:02:03 pascal Exp $
--- gcc/common.opt.orig Mon Apr 11 17:26:47 2011
+++ gcc/common.opt Sat Feb 11 08:40:59 2012
@@ -1779,7 +1779,7 @@ Common RejectNegative Joined Var(common_deferred_optio
+++ gcc/common.opt Sun Mar 11 22:52:35 2012
@@ -543,6 +543,10 @@ Wlarger-than=
Common RejectNegative Joined UInteger Warning
-Wlarger-than=<number> Warn if an object is larger than <number> bytes
+Wstack-larger-than-
+Common RejectNegative Joined UInteger
+-Wstack-larger-than-<number> Warn if a function is using more than <number> bytes of stack space for its local variables.
+
Wunsafe-loop-optimizations
Common Var(warn_unsafe_loop_optimizations) Warning
Warn if the loop cannot be optimized due to nontrivial assumptions.
@@ -616,7 +620,7 @@ Common Var(warn_switch_enum) Warning
Warn about all enumerated switches missing a specific case
Wsystem-headers
-Common Var(warn_system_headers) Warning
+Common Var(warn_system_headers) Init(1) Warning
Do not suppress warnings from system headers
Wtrampolines
@@ -667,6 +671,10 @@ Wunused-variable
Common Var(warn_unused_variable) Init(-1) Warning
Warn when a variable is unused
+Wvariable-decl
+Common Var(warn_variable_decl)
+Warn about variable-sized declarations
+
Wcoverage-mismatch
Common Var(warn_coverage_mismatch) Init(1) Warning
Warn in case profiles in -fprofile-use do not match
@@ -938,7 +946,7 @@ Common Report Var(flag_delayed_branch) Optimization
Attempt to fill delay slots of branch instructions
fdelete-null-pointer-checks
-Common Report Var(flag_delete_null_pointer_checks) Init(1) Optimization
+Common Report Var(flag_delete_null_pointer_checks)
Delete useless null pointer checks
fdevirtualize
@@ -1161,7 +1169,7 @@ Enable guessing of branch probabilities
; On SVR4 targets, it also controls whether or not to emit a
; string identifying the compiler.
fident
-Common Report Var(flag_no_ident,0)
+Common Report Var(flag_no_ident,1)
Process #ident directives
fif-conversion
@@ -1779,7 +1787,7 @@ Common RejectNegative Joined Var(common_deferred_optio
-fstack-limit-symbol=<name> Trap if the stack goes past symbol <name>
fstack-protector

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-gcc_config_alpha_alpha_c,v 1.2 2011/11/14 15:37:55 pascal Exp $
$OpenBSD: patch-gcc_config_alpha_alpha_c,v 1.3 2012/03/31 20:02:03 pascal Exp $
--- gcc/config/alpha/alpha.c.orig Sat Aug 6 20:41:14 2011
+++ gcc/config/alpha/alpha.c Mon Nov 14 15:58:46 2011
+++ gcc/config/alpha/alpha.c Mon Mar 12 08:44:40 2012
@@ -227,6 +227,10 @@ alpha_handle_option (size_t code, const char *arg, int
target_flags |= MASK_IEEE_CONFORMANT;
break;
@ -30,7 +30,17 @@ $OpenBSD: patch-gcc_config_alpha_alpha_c,v 1.2 2011/11/14 15:37:55 pascal Exp $
/* Align labels and loops for optimal branching. */
/* ??? Kludge these by not doing anything if we don't optimize and also if
@@ -7844,6 +7854,8 @@ alpha_expand_prologue (void)
@@ -7803,6 +7813,9 @@ alpha_expand_prologue (void)
sa_size = alpha_sa_size ();
frame_size = compute_frame_size (get_frame_size (), sa_size);
+ if (warn_stack_larger_than && frame_size > stack_larger_than_size)
+ warning (OPT_Wstack_larger_than_, "stack usage is %d bytes", frame_size);
+
if (flag_stack_usage)
current_function_static_stack_size = frame_size;
@@ -7844,6 +7857,8 @@ alpha_expand_prologue (void)
if (flag_stack_check)
probed_size += STACK_CHECK_PROTECT;
@ -39,7 +49,7 @@ $OpenBSD: patch-gcc_config_alpha_alpha_c,v 1.2 2011/11/14 15:37:55 pascal Exp $
if (probed_size <= 32768)
{
if (probed_size > 4096)
@@ -7937,6 +7949,44 @@ alpha_expand_prologue (void)
@@ -7937,6 +7952,44 @@ alpha_expand_prologue (void)
? -frame_size + 64
: -frame_size))));
}

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-gcc_config_alpha_openbsd_h,v 1.1.1.1 2011/11/14 13:00:57 pascal Exp $
--- gcc/config/alpha/openbsd.h.orig Sat Nov 12 13:28:07 2011
+++ gcc/config/alpha/openbsd.h Sat Nov 12 13:32:57 2011
@@ -19,6 +19,27 @@ along with GCC; see the file COPYING3. If not see
$OpenBSD: patch-gcc_config_alpha_openbsd_h,v 1.2 2012/03/31 20:02:03 pascal Exp $
--- gcc/config/alpha/openbsd.h.orig Sun Sep 27 15:20:23 2009
+++ gcc/config/alpha/openbsd.h Sun Mar 11 19:52:18 2012
@@ -19,6 +19,28 @@ along with GCC; see the file COPYING3. If not see
/* Controlling the compilation driver. */
@ -14,6 +14,7 @@ $OpenBSD: patch-gcc_config_alpha_openbsd_h,v 1.1.1.1 2011/11/14 13:00:57 pascal
+ %{shared:-shared} %{R*} \
+ %{static:-Bstatic} \
+ %{!static:-Bdynamic} \
+ %{rdynamic:-export-dynamic} \
+ %{assert*} \
+ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}"
+
@ -29,7 +30,7 @@ $OpenBSD: patch-gcc_config_alpha_openbsd_h,v 1.1.1.1 2011/11/14 13:00:57 pascal
/* run-time target specifications */
#define TARGET_OS_CPP_BUILTINS() \
do { \
@@ -28,18 +49,27 @@ along with GCC; see the file COPYING3. If not see
@@ -28,18 +50,27 @@ along with GCC; see the file COPYING3. If not see
/* Layout of source language data types. */

View File

@ -0,0 +1,30 @@
$OpenBSD: patch-gcc_config_i386_i386_c,v 1.1 2012/03/31 20:02:03 pascal Exp $
--- gcc/config/i386/i386.c.orig Wed Feb 22 20:17:42 2012
+++ gcc/config/i386/i386.c Mon Mar 12 08:48:17 2012
@@ -2326,6 +2326,8 @@ struct ix86_frame
HOST_WIDE_INT reg_save_offset;
HOST_WIDE_INT sse_reg_save_offset;
+ HOST_WIDE_INT local_size;
+
/* When save_regs_using_mov is set, emit prologue using
move instead of push instructions. */
bool save_regs_using_mov;
@@ -9223,6 +9225,7 @@ ix86_compute_frame_layout (struct ix86_frame *frame)
HOST_WIDE_INT size = get_frame_size ();
HOST_WIDE_INT to_allocate;
+ frame->local_size = size;
frame->nregs = ix86_nsaved_regs ();
frame->nsseregs = ix86_nsaved_sseregs ();
@@ -10498,6 +10501,9 @@ ix86_expand_prologue (void)
m->fs.sp_offset = INCOMING_FRAME_SP_OFFSET;
m->fs.realigned = true;
}
+
+ if (warn_stack_larger_than && frame.local_size > stack_larger_than_size)
+ warning (OPT_Wstack_larger_than_, "stack usage is %d bytes", frame.local_size);
if (frame_pointer_needed && !m->fs.fp_valid)
{

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-gcc_config_i386_openbsd64_h,v 1.1.1.1 2011/11/14 13:00:56 pascal Exp $
--- gcc/config/i386/openbsd64.h.orig Tue Nov 1 15:32:54 2011
+++ gcc/config/i386/openbsd64.h Tue Nov 1 15:33:56 2011
@@ -0,0 +1,121 @@
$OpenBSD: patch-gcc_config_i386_openbsd64_h,v 1.2 2012/03/31 20:02:03 pascal Exp $
--- gcc/config/i386/openbsd64.h.orig Sun Mar 11 19:10:40 2012
+++ gcc/config/i386/openbsd64.h Sun Mar 11 19:54:21 2012
@@ -0,0 +1,122 @@
+/* Configuration for an OpenBSD x86-64 target.
+
+ Copyright (C) 2003 Free Software Foundation, Inc.
@ -116,6 +116,7 @@ $OpenBSD: patch-gcc_config_i386_openbsd64_h,v 1.1.1.1 2011/11/14 13:00:56 pascal
+ %{shared:-shared} %{R*} \
+ %{static:-Bstatic} \
+ %{!static:-Bdynamic} \
+ %{rdynamic:-export-dynamic} \
+ %{assert*} \
+ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}"
+

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-gcc_config_i386_openbsdelf_h,v 1.1.1.1 2011/11/14 13:00:57 pascal Exp $
--- gcc/config/i386/openbsdelf.h.orig Sat Nov 12 13:37:59 2011
+++ gcc/config/i386/openbsdelf.h Sat Nov 12 13:40:14 2011
$OpenBSD: patch-gcc_config_i386_openbsdelf_h,v 1.2 2012/03/31 20:02:03 pascal Exp $
--- gcc/config/i386/openbsdelf.h.orig Wed Dec 22 13:06:01 2010
+++ gcc/config/i386/openbsdelf.h Sun Mar 11 19:53:39 2012
@@ -113,9 +113,6 @@ along with GCC; see the file COPYING3. If not see
/* Assembler format: exception region output. */
@ -11,3 +11,14 @@ $OpenBSD: patch-gcc_config_i386_openbsdelf_h,v 1.1.1.1 2011/11/14 13:00:57 pasca
/* Assembler format: alignment output. */
/* Note that we pick up ASM_OUTPUT_MAX_SKIP_ALIGN from i386/gas.h */
@@ -128,7 +125,10 @@ along with GCC; see the file COPYING3. If not see
%{shared:-shared} %{R*} \
%{static:-Bstatic} \
%{!static:-Bdynamic} \
+ %{rdynamic:-export-dynamic} \
%{assert*} \
-dynamic-linker /usr/libexec/ld.so"
#define OBSD_HAS_CORRECT_SPECS
+
+#define SUBTARGET32_DEFAULT_CPU "i486"

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-gcc_config_openbsd_h,v 1.1 2012/03/31 20:02:03 pascal Exp $
--- gcc/config/openbsd.h.orig Sun Mar 11 19:12:59 2012
+++ gcc/config/openbsd.h Sun Mar 11 19:19:46 2012
@@ -296,5 +296,11 @@ __enable_execute_stack (void *addr) \
perror ("mprotect of trampoline code"); \
}
+/*
+ * Disable the use of unsafe builtin functions, (strcat, strcpy, stpcpy),
+ * making them easier to spot in the object files.
+ */
+#define NO_UNSAFE_BUILTINS
+
#include <sys/types.h>
#include <sys/mman.h>

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-gcc_config_rs6000_openbsd_h,v 1.1.1.1 2011/11/14 13:00:57 pascal Exp $
--- gcc/config/rs6000/openbsd.h.orig Sat Jun 9 17:11:08 2007
+++ gcc/config/rs6000/openbsd.h Sat Jun 9 18:24:52 2007
@@ -0,0 +1,132 @@
$OpenBSD: patch-gcc_config_rs6000_openbsd_h,v 1.2 2012/03/31 20:02:03 pascal Exp $
--- gcc/config/rs6000/openbsd.h.orig Sun Mar 11 19:10:40 2012
+++ gcc/config/rs6000/openbsd.h Sun Mar 11 19:25:45 2012
@@ -0,0 +1,135 @@
+/* Configuration file for an rs6000 OpenBSD target.
+ Copyright (C) 1999 Free Software Foundation, Inc.
+
@ -79,6 +79,9 @@ $OpenBSD: patch-gcc_config_rs6000_openbsd_h,v 1.1.1.1 2011/11/14 13:00:57 pascal
+#undef STARTFILE_DEFAULT_SPEC
+#define STARTFILE_DEFAULT_SPEC "%(startfile_openbsd)"
+
+#undef CRTSAVRES_DEFAULT_SPEC
+#define CRTSAVRES_DEFAULT_SPEC ""
+
+#undef ENDFILE_DEFAULT_SPEC
+#define ENDFILE_DEFAULT_SPEC "%(endfile_openbsd)"
+

View File

@ -1,13 +0,0 @@
$OpenBSD: patch-gcc_config_rs6000_rs6000_c,v 1.1 2012/02/26 22:32:36 pascal Exp $
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51623
--- gcc/config/rs6000/rs6000.c.orig Tue Feb 21 09:54:58 2012
+++ gcc/config/rs6000/rs6000.c Tue Feb 21 09:55:36 2012
@@ -16613,7 +16613,7 @@ rs6000_assemble_integer (rtx x, unsigned int size, int
if (TARGET_RELOCATABLE
&& in_section != toc_section
&& in_section != text_section
- && !unlikely_text_section_p (in_section)
+ && (in_section && (in_section->common.flags & SECTION_CODE)) == 0
&& !recurse
&& GET_CODE (x) != CONST_INT
&& GET_CODE (x) != CONST_DOUBLE

View File

@ -1,13 +1,11 @@
$OpenBSD: patch-gcc_config_rs6000_sysv4_h,v 1.1 2011/11/14 22:37:23 pascal Exp $
--- gcc/config/rs6000/sysv4.h.orig Mon Nov 14 14:22:43 2011
+++ gcc/config/rs6000/sysv4.h Mon Nov 14 14:23:22 2011
@@ -405,7 +405,9 @@ do { \
$OpenBSD: patch-gcc_config_rs6000_sysv4_h,v 1.2 2012/03/31 20:02:03 pascal Exp $
--- gcc/config/rs6000/sysv4.h.orig Mon Mar 7 08:50:23 2011
+++ gcc/config/rs6000/sysv4.h Sun Mar 11 19:27:20 2012
@@ -405,6 +405,7 @@ do { \
asm_fprintf (FILE, "%L%s", PREFIX)
/* Globalizing directive for a label. */
+#ifndef GLOBAL_ASM_OP
+#undef GLOBAL_ASM_OP
#define GLOBAL_ASM_OP "\t.globl "
+#endif
/* This says how to output assembler code to declare an
uninitialized internal linkage data object. Under SVR4,

View File

@ -0,0 +1,48 @@
$OpenBSD: patch-gcc_config_sparc_openbsd64_h,v 1.1 2012/03/31 20:02:03 pascal Exp $
--- gcc/config/sparc/openbsd64.h.orig Sun Mar 11 19:27:37 2012
+++ gcc/config/sparc/openbsd64.h Sun Mar 11 19:55:59 2012
@@ -23,7 +23,7 @@ along with GCC; see the file COPYING3. If not see
/* 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
@@ -33,10 +33,7 @@ along with GCC; see the file COPYING3. If not see
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
- builtin_define ("__unix__"); \
- builtin_define ("__OpenBSD__"); \
- builtin_assert ("system=unix"); \
- builtin_assert ("system=OpenBSD"); \
+ OPENBSD_OS_CPP_BUILTINS();
builtin_define ("__sparc64__"); \
builtin_define ("__sparcv9__"); \
builtin_define ("__sparc_v9__"); \
@@ -64,6 +61,15 @@ along with GCC; see the file COPYING3. If not see
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 32
+#undef WINT_TYPE
+#define WINT_TYPE "int"
+
+#undef INTMAX_TYPE
+#define INTMAX_TYPE "long long int"
+
+#undef UINTMAX_TYPE
+#define UINTMAX_TYPE "long long unsigned int"
+
#undef LONG_DOUBLE_TYPE_SIZE
#define LONG_DOUBLE_TYPE_SIZE 128
@@ -73,6 +79,7 @@ along with GCC; see the file COPYING3. If not see
%{shared:-shared} %{R*} \
%{static:-Bstatic} \
%{!static:-Bdynamic} \
+ %{rdynamic:-export-dynamic} \
%{assert*} \
-dynamic-linker /usr/libexec/ld.so"

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-gcc_config_sparc_sparc_c,v 1.1 2012/03/31 20:02:03 pascal Exp $
--- gcc/config/sparc/sparc.c.orig Sat Dec 17 00:38:34 2011
+++ gcc/config/sparc/sparc.c Mon Mar 12 08:48:46 2012
@@ -4540,6 +4540,9 @@ sparc_expand_prologue (void)
actual_fsize
= sparc_compute_frame_size (get_frame_size(), sparc_leaf_function_p);
+ if (warn_stack_larger_than && actual_fsize > stack_larger_than_size)
+ warning (OPT_Wstack_larger_than_, "stack usage is %d bytes", actual_fsize);
+
/* Advertise that the data calculated just above are now valid. */
sparc_prologue_data_valid_p = true;

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-gcc_configure,v 1.2 2012/02/16 21:30:15 pascal Exp $
--- gcc/configure.orig Wed Oct 12 20:07:25 2011
+++ gcc/configure Sun Feb 12 21:02:13 2012
@@ -16927,7 +16927,7 @@ openbsd*)
$OpenBSD: patch-gcc_configure,v 1.3 2012/03/31 20:02:03 pascal Exp $
--- gcc/configure.orig Sun Nov 20 22:24:07 2011
+++ gcc/configure Sun Mar 11 19:10:40 2012
@@ -16917,7 +16917,7 @@ openbsd*)
*) need_version=no ;;
esac
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
@ -10,7 +10,7 @@ $OpenBSD: patch-gcc_configure,v 1.2 2012/02/16 21:30:15 pascal Exp $
shlibpath_var=LD_LIBRARY_PATH
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
case $host_os in
@@ -20586,7 +20586,7 @@ openbsd*)
@@ -20576,7 +20576,7 @@ openbsd*)
*) need_version=no ;;
esac
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
@ -19,7 +19,7 @@ $OpenBSD: patch-gcc_configure,v 1.2 2012/02/16 21:30:15 pascal Exp $
shlibpath_var=LD_LIBRARY_PATH
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
case $host_os in
@@ -25788,6 +25788,7 @@ else
@@ -25778,6 +25778,7 @@ else
fi
;;

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-gcc_flags_h,v 1.1 2012/03/31 20:02:03 pascal Exp $
--- gcc/flags.h.orig Sun Mar 11 21:50:11 2012
+++ gcc/flags.h Sun Mar 11 22:13:05 2012
@@ -28,6 +28,11 @@ along with GCC; see the file COPYING3. If not see
#if !defined(IN_LIBGCC2) && !defined(IN_TARGET_LIBS) && !defined(IN_RTS)
+/* Nonzero means warn about any function whose stack usage is larger than N
+ bytes. The value N is `stack_larger_than_size'. */
+extern int warn_stack_larger_than;
+extern HOST_WIDE_INT stack_larger_than_size;
+
/* Names of debug_info_type, for error messages. */
extern const char *const debug_type_names[];

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-gcc_java_lang_c,v 1.1 2012/02/16 21:30:15 pascal Exp $
--- gcc/java/lang.c.orig Fri Feb 10 15:52:19 2012
+++ gcc/java/lang.c Fri Feb 10 15:52:42 2012
@@ -916,4 +916,10 @@ java_eh_personality (void)
$OpenBSD: patch-gcc_java_lang_c,v 1.2 2012/03/31 20:02:03 pascal Exp $
--- gcc/java/lang.c.orig Mon Jan 23 12:12:01 2012
+++ gcc/java/lang.c Sun Mar 11 19:10:40 2012
@@ -917,4 +917,10 @@ java_eh_personality (void)
return java_eh_personality_decl;
}

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-gcc_lto_lto_c,v 1.1 2012/02/16 21:30:15 pascal Exp $
--- gcc/lto/lto.c.orig Fri Jan 20 17:01:24 2012
+++ gcc/lto/lto.c Fri Jan 20 17:01:55 2012
@@ -2479,4 +2479,10 @@ lto_main (void)
$OpenBSD: patch-gcc_lto_lto_c,v 1.2 2012/03/31 20:02:03 pascal Exp $
--- gcc/lto/lto.c.orig Tue Dec 13 23:03:05 2011
+++ gcc/lto/lto.c Sun Mar 11 19:10:40 2012
@@ -2483,4 +2483,10 @@ lto_main (void)
}
}

View File

@ -0,0 +1,42 @@
$OpenBSD: patch-gcc_opts_c,v 1.1 2012/03/31 20:02:03 pascal Exp $
--- gcc/opts.c.orig Thu Feb 17 23:51:57 2011
+++ gcc/opts.c Sun Mar 11 22:26:06 2012
@@ -43,6 +43,9 @@ along with GCC; see the file COPYING3. If not see
((strncmp (prefix, string, sizeof prefix - 1) == 0) \
? ((string += sizeof prefix - 1), 1) : 0)
+int warn_stack_larger_than;
+HOST_WIDE_INT stack_larger_than_size;
+
void
set_struct_debug_option (struct gcc_options *opts, location_t loc,
const char *spec)
@@ -477,8 +480,6 @@ static const struct default_options default_options_ta
{ OPT_LEVELS_2_PLUS, OPT_fschedule_insns2, NULL, 1 },
#endif
{ OPT_LEVELS_2_PLUS, OPT_fregmove, NULL, 1 },
- { OPT_LEVELS_2_PLUS, OPT_fstrict_aliasing, NULL, 1 },
- { OPT_LEVELS_2_PLUS, OPT_fstrict_overflow, NULL, 1 },
{ OPT_LEVELS_2_PLUS, OPT_freorder_blocks, NULL, 1 },
{ OPT_LEVELS_2_PLUS, OPT_freorder_functions, NULL, 1 },
{ OPT_LEVELS_2_PLUS, OPT_ftree_vrp, NULL, 1 },
@@ -494,6 +495,7 @@ static const struct default_options default_options_ta
{ OPT_LEVELS_2_PLUS, OPT_falign_functions, NULL, 1 },
/* -O3 optimizations. */
+ { OPT_LEVELS_3_PLUS, OPT_fstrict_aliasing, NULL, 1 },
{ OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribute_patterns, NULL, 1 },
{ OPT_LEVELS_3_PLUS, OPT_fpredictive_commoning, NULL, 1 },
/* Inlining of functions reducing size is a good idea with -Os
@@ -1411,6 +1413,11 @@ common_handle_option (struct gcc_options *opts,
case OPT_Wframe_larger_than_:
opts->x_frame_larger_than_size = value;
opts->x_warn_frame_larger_than = value != -1;
+ break;
+
+ case OPT_Wstack_larger_than_:
+ stack_larger_than_size = value;
+ warn_stack_larger_than = stack_larger_than_size != -1;
break;
case OPT_Wstrict_aliasing:

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-gcc_tree-nested_c,v 1.1 2012/03/31 20:02:03 pascal Exp $
--- gcc/tree-nested.c.orig Sat Nov 27 16:53:23 2010
+++ gcc/tree-nested.c Mon Mar 12 08:44:07 2012
@@ -1907,6 +1907,17 @@ convert_tramp_reference_op (tree *tp, int *walk_subtre
if (TREE_NO_TRAMPOLINE (t))
break;
+ if (!flag_trampolines)
+ {
+ error ("trampoline code generation is not allowed without -ftrampolines");
+ return NULL_TREE;
+ }
+ if (warn_trampolines)
+ {
+ warning (OPT_Wtrampolines,
+ "local function address taken needing trampoline generation");
+ }
+
/* Lookup the immediate parent of the callee, as that's where
we need to insert the trampoline. */
for (i = info; i->context != target_context; i = i->outer)

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-libgcc_config_host,v 1.2 2011/11/14 22:37:23 pascal Exp $
--- libgcc/config.host.orig Mon Mar 14 06:06:23 2011
+++ libgcc/config.host Mon Nov 14 13:27:23 2011
@@ -297,6 +297,8 @@ i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123])
$OpenBSD: patch-libgcc_config_host,v 1.3 2012/03/31 20:02:03 pascal Exp $
--- libgcc/config.host.orig Wed Nov 23 23:15:54 2011
+++ libgcc/config.host Sun Mar 11 19:10:41 2012
@@ -288,6 +288,8 @@ i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123])
;;
i[34567]86-*-openbsd*)
;;
@ -10,7 +10,7 @@ $OpenBSD: patch-libgcc_config_host,v 1.2 2011/11/14 22:37:23 pascal Exp $
i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu*)
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm"
@@ -467,6 +469,8 @@ powerpc-*-freebsd*)
@@ -458,6 +460,8 @@ powerpc-*-freebsd*)
tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-freebsd t-softfp"
;;
powerpc-*-netbsd*)

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-lto-plugin_Makefile_in,v 1.2 2011/11/20 11:10:36 pascal Exp $
--- lto-plugin/Makefile.in.orig Sun Feb 13 12:45:53 2011
+++ lto-plugin/Makefile.in Sun Nov 20 00:02:22 2011
@@ -239,9 +239,11 @@ liblto_plugin_la_SOURCES = lto-plugin.c
$OpenBSD: patch-lto-plugin_Makefile_in,v 1.3 2012/03/31 20:02:03 pascal Exp $
--- lto-plugin/Makefile.in.orig Tue Jan 3 14:15:21 2012
+++ lto-plugin/Makefile.in Sun Mar 11 19:10:42 2012
@@ -241,9 +241,11 @@ liblto_plugin_la_SOURCES = lto-plugin.c
liblto_plugin_la_LIBADD = \
$(if $(wildcard ../libiberty/pic/libiberty.a),$(Wc)../libiberty/pic/libiberty.a,)
@ -14,7 +14,7 @@ $OpenBSD: patch-lto-plugin_Makefile_in,v 1.2 2011/11/20 11:10:36 pascal Exp $
liblto_plugin_la_DEPENDENCIES = $(if $(wildcard \
../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,)
@@ -540,7 +542,7 @@ $(in_gcc_libs) : $(gcc_build_dir)/%: %
@@ -542,7 +544,7 @@ $(in_gcc_libs) : $(gcc_build_dir)/%: %
echo WARNING: $* is static, not copying to $@ >&2 ; \
else \
$(mkinstalldirs) $(gcc_build_dir) && \

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-lto-plugin_configure,v 1.1 2012/01/26 13:17:22 pascal Exp $
--- lto-plugin/configure.orig Wed Jan 25 17:52:19 2012
+++ lto-plugin/configure Wed Jan 25 17:52:28 2012
@@ -9920,7 +9920,7 @@ openbsd*)
$OpenBSD: patch-lto-plugin_configure,v 1.2 2012/03/31 20:02:03 pascal Exp $
--- lto-plugin/configure.orig Tue Jan 3 14:15:21 2012
+++ lto-plugin/configure Sun Mar 11 19:10:42 2012
@@ -9960,7 +9960,7 @@ openbsd*)
*) need_version=no ;;
esac
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'