patches/gcc/4.3.5/110-trampolinewarn.patch
author "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Wed Dec 14 16:55:22 2011 +0100 (2011-12-14)
branch1.13
changeset 2848 1ff89596dab0
parent 1461 35b30f8fb307
permissions -rw-r--r--
libc/eglibc: fix localedef 2.14 build

The localedef of eglibc 2.14 requires NOT_IN_libc to be defined in order to
compile intl/l10nflist.c.

This is because localedef is built separately from eglibc and uses some parts of
eglibc that don't compile in standalone without this preprocessor definition.

This fixes the following error:

[ALL ] gcc -g -O2 -DNO_SYSCONF -DNO_UNCOMPRESS
-DLOCALE_PATH='"/usr/lib/locale:/usr/share/i18n"'
-DLOCALEDIR='"/usr/lib/locale"' -DLOCALE_ALIAS_PATH='"/usr/share/locale"'
-DCHARMAP_PATH='"/usr/share/i18n/charmaps"'
-DREPERTOIREMAP_PATH='"/usr/share/i18n/repertoiremaps"'
-DLOCSRCDIR='"/usr/share/i18n/locales"' -Iglibc/locale/programs -Iglibc/locale
-I/<snip>/.build/src/eglibc-localedef-2_14/include
-I/<snip>/.build/src/eglibc-localedef-2_14 -I.
-include /<snip>/.build/src/eglibc-localedef-2_14/include/always.h -Wall
-Wno-format -c -o locarchive.o glibc/locale/programs/locarchive.c
[ALL ] glibc/locale/programs/locarchive.c: In function 'enlarge_archive':
[ALL ] glibc/locale/programs/locarchive.c:303:21: warning: variable
'oldlocrectab' set but not used [-Wunused-but-set-variable]
[ALL ] In file included from glibc/locale/programs/locarchive.c:651:0:
[ALL ] glibc/locale/programs/../../intl/l10nflist.c: In function
'_nl_normalize_codeset':
[ERROR] glibc/locale/programs/../../intl/l10nflist.c:342:9: error:
'_nl_C_locobj_ptr' undeclared (first use in this function)
[ALL ] glibc/locale/programs/../../intl/l10nflist.c:342:9: note: each
undeclared identifier is reported only once for each function it appears in
[ALL ] glibc/locale/programs/locarchive.c: In function
'add_locales_to_archive':
[ALL ] glibc/locale/programs/locarchive.c:1450:7: warning: passing argument
1 of '__xpg_basename' discards 'const' qualifier from pointer target type
[enabled by default]
[ALL ] /usr/include/libgen.h:35:14: note: expected 'char *' but argument is
of type 'const char *'
[ERROR] make[1]: *** [locarchive.o] Error 1

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