patches/gcc/4.3.3/110-trampolinewarn.patch
author Remy Bohmer <linux@bohmer.net>
Sun Jul 11 22:23:34 2010 +0200 (2010-07-11)
changeset 2021 3e52a1510f87
permissions -rw-r--r--
debug/gdb: Fix compilation for Mingw hosts

GDB requires PDcurses instead of ncurses while running on Windows.
So, do not always compile ncurses in case GDB needs to build.

PDcurses is provided by an earlier build step and is not described in
this file.

Signed-off-by: Remy Bohmer <linux@bohmer.net>
[yann.morin.1998@anciense.nib.fr: we already have a way to detect ncurses usage]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
     1 Original patch from: ../4.3.2/110-trampolinewarn.patch
     2 
     3 -= BEGIN original header =-
     4 Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/00_all_gcc-trampolinewarn.patch
     5 	This trivial patch causes gcc to emit a warning whenever
     6 	it generates a trampoline.  These are otherwise hard to
     7 	locate.  It is rigged to default ON - to have it default
     8 	to OFF remove the text 'Init(1)' from the common.opt
     9 	patch, leaving just 'Common Var(warn_trampolines)'.
    10 	Kevin F. Quinn <kevquinn@gentoo.org> 17 Jan 2006
    11 
    12 -= END original header =-
    13 
    14 diff -durN gcc-4.3.3.orig/gcc/builtins.c gcc-4.3.3/gcc/builtins.c
    15 --- gcc-4.3.3.orig/gcc/builtins.c	2008-08-19 18:37:13.000000000 +0200
    16 +++ gcc-4.3.3/gcc/builtins.c	2009-01-27 22:19:12.000000000 +0100
    17 @@ -5662,6 +5662,9 @@
    18    trampolines_created = 1;
    19    INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain);
    20  
    21 +  if (warn_trampolines)
    22 +    warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)");
    23 +
    24    return const0_rtx;
    25  }
    26  
    27 diff -durN gcc-4.3.3.orig/gcc/common.opt gcc-4.3.3/gcc/common.opt
    28 --- gcc-4.3.3.orig/gcc/common.opt	2008-01-22 15:11:44.000000000 +0100
    29 +++ gcc-4.3.3/gcc/common.opt	2009-01-27 22:19:12.000000000 +0100
    30 @@ -182,6 +182,10 @@
    31  Common Var(warn_system_headers) Warning
    32  Do not suppress warnings from system headers
    33  
    34 +Wtrampolines
    35 +Common Var(warn_trampolines) Init(1)
    36 +Warn whenever a trampoline is generated
    37 +
    38  Wuninitialized
    39  Common Var(warn_uninitialized) Warning
    40  Warn about uninitialized automatic variables