patches/gcc/4.4.4/110-trampolinewarn.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Sep 12 23:38:18 2010 +0200 (2010-09-12)
changeset 2120 48de021b3a9e
child 2148 ada9128c98b8
permissions -rw-r--r--
arch/mips: add experimental mips64 samples

Both toolchains were tested to successfully:
- _build_ busybox, giving respectively an n32 and an n64 binary
although it has not been run-tested.
- build linux-2.6.36-rc3 for Loongson, giving an n64 vmlinux
(which is expected, due to the way the kernel is built),
and the kernel properly boots!

Credits are due to Julien MOUTHINO (julm on freenode#uClibc) for
testing that the kernel boots on his hardware! Cheers! ;-)

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
     1 diff -durN gcc-4.4.0.orig/gcc/builtins.c gcc-4.4.0/gcc/builtins.c
     2 
     3 diff -durN gcc-4.4.4.orig/gcc/builtins.c gcc-4.4.4/gcc/builtins.c
     4 --- gcc-4.4.4.orig/gcc/builtins.c	2010-03-22 16:00:20.000000000 +0100
     5 +++ gcc-4.4.4/gcc/builtins.c	2010-05-16 19:10:34.000000000 +0200
     6 @@ -5783,6 +5783,9 @@
     7    trampolines_created = 1;
     8    INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain);
     9  
    10 +  if (warn_trampolines)
    11 +    warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)");
    12 +
    13    return const0_rtx;
    14  }
    15  
    16 diff -durN gcc-4.4.4.orig/gcc/common.opt gcc-4.4.4/gcc/common.opt
    17 --- gcc-4.4.4.orig/gcc/common.opt	2009-03-28 18:28:45.000000000 +0100
    18 +++ gcc-4.4.4/gcc/common.opt	2010-05-16 19:10:34.000000000 +0200
    19 @@ -197,6 +197,10 @@
    20  Common Var(warn_type_limits) Init(-1) Warning
    21  Warn if a comparison is always true or always false due to the limited range of the data type
    22  
    23 +Wtrampolines
    24 +Common Var(warn_trampolines) Init(1)
    25 +Warn whenever a trampoline is generated
    26 +
    27  Wuninitialized
    28  Common Var(warn_uninitialized) Warning
    29  Warn about uninitialized automatic variables