openbsd-ports/lang/gcc/3.3/patches/patch-gcc_toplev_c
2005-01-04 23:06:33 +00:00

87 lines
2.8 KiB
Plaintext

$OpenBSD: patch-gcc_toplev_c,v 1.2 2005/01/04 23:06:33 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;
@@ -904,6 +908,18 @@ int align_functions_log;
minimum function alignment. Zero means no alignment is forced. */
int force_align_functions_log;
+#if defined(STACK_PROTECTOR) && defined(STACK_GROWS_DOWNWARD)
+/* Nonzero means use propolice as a stack protection method */
+int flag_propolice_protection = 1;
+int flag_stack_protection = 0;
+#else
+int flag_propolice_protection = 0;
+int flag_stack_protection = 0;
+#endif
+/* Warn when not issuing stack smashing protection for some reason */
+int warn_stack_protector;
+
+
/* Table of supported debugging formats. */
static const struct
{
@@ -1188,6 +1201,10 @@ static const lang_independent_options f_
N_("Trap for signed overflow in addition / subtraction / multiplication") },
{ "new-ra", &flag_new_regalloc, 1,
N_("Use graph coloring register allocation.") },
+ {"stack-protector", &flag_propolice_protection, 1,
+ N_("Enables stack protection") },
+ {"stack-protector-all", &flag_stack_protection, 1,
+ N_("Enables stack protection of every function") } ,
};
/* Table of language-specific options. */
@@ -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 },
@@ -1547,7 +1567,9 @@ static const lang_independent_options W_
{"missing-noreturn", &warn_missing_noreturn, 1,
N_("Warn about functions which might be candidates for attribute noreturn") },
{"strict-aliasing", &warn_strict_aliasing, 1,
- N_ ("Warn about code which might break the strict aliasing rules") }
+ N_ ("Warn about code which might break the strict aliasing rules") },
+ {"stack-protector", &warn_stack_protector, 1,
+ N_("Warn when disabling stack protector for some reason")}
};
void
@@ -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;
}