patches/gcc/4.3.5/110-trampolinewarn.patch
changeset 2124 5dd0b83ae528
parent 1461 35b30f8fb307
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/gcc/4.3.5/110-trampolinewarn.patch	Sun Sep 19 18:37:18 2010 +0200
     1.3 @@ -0,0 +1,40 @@
     1.4 +Original patch from: ../4.3.2/110-trampolinewarn.patch
     1.5 +
     1.6 +-= BEGIN original header =-
     1.7 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/00_all_gcc-trampolinewarn.patch
     1.8 +	This trivial patch causes gcc to emit a warning whenever
     1.9 +	it generates a trampoline.  These are otherwise hard to
    1.10 +	locate.  It is rigged to default ON - to have it default
    1.11 +	to OFF remove the text 'Init(1)' from the common.opt
    1.12 +	patch, leaving just 'Common Var(warn_trampolines)'.
    1.13 +	Kevin F. Quinn <kevquinn@gentoo.org> 17 Jan 2006
    1.14 +
    1.15 +-= END original header =-
    1.16 +
    1.17 +diff -durN gcc-4.3.3.orig/gcc/builtins.c gcc-4.3.3/gcc/builtins.c
    1.18 +--- gcc-4.3.3.orig/gcc/builtins.c	2008-08-19 18:37:13.000000000 +0200
    1.19 ++++ gcc-4.3.3/gcc/builtins.c	2009-01-27 22:19:12.000000000 +0100
    1.20 +@@ -5662,6 +5662,9 @@
    1.21 +   trampolines_created = 1;
    1.22 +   INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain);
    1.23 + 
    1.24 ++  if (warn_trampolines)
    1.25 ++    warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)");
    1.26 ++
    1.27 +   return const0_rtx;
    1.28 + }
    1.29 + 
    1.30 +diff -durN gcc-4.3.3.orig/gcc/common.opt gcc-4.3.3/gcc/common.opt
    1.31 +--- gcc-4.3.3.orig/gcc/common.opt	2008-01-22 15:11:44.000000000 +0100
    1.32 ++++ gcc-4.3.3/gcc/common.opt	2009-01-27 22:19:12.000000000 +0100
    1.33 +@@ -182,6 +182,10 @@
    1.34 + Common Var(warn_system_headers) Warning
    1.35 + Do not suppress warnings from system headers
    1.36 + 
    1.37 ++Wtrampolines
    1.38 ++Common Var(warn_trampolines) Init(1)
    1.39 ++Warn whenever a trampoline is generated
    1.40 ++
    1.41 + Wuninitialized
    1.42 + Common Var(warn_uninitialized) Warning
    1.43 + Warn about uninitialized automatic variables