patches/gcc/4.3.2/210-noteGNUstack-00.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 747 d3e603e7c17c
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)
     1 Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/61_all_gcc4-ia64-noteGNUstack.patch
     2 2004-09-20  Jakub Jelinek  <jakub@redhat.com>
     3 
     4 	* config/rs6000/ppc-asm.h: Add .note.GNU-stack section also
     5 	on ppc64-linux.
     6 
     7 	* config/ia64/lib1funcs.asm: Add .note.GNU-stack section on
     8 	ia64-linux.
     9 	* config/ia64/crtbegin.asm: Likewise.
    10 	* config/ia64/crtend.asm: Likewise.
    11 	* config/ia64/crti.asm: Likewise.
    12 	* config/ia64/crtn.asm: Likewise.
    13 
    14 2004-05-14  Jakub Jelinek  <jakub@redhat.com>
    15 
    16 	* config/ia64/linux.h (TARGET_ASM_FILE_END): Define.
    17 
    18 diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtbegin.asm gcc-4.3.1/gcc/config/ia64/crtbegin.asm
    19 --- gcc-4.3.1.orig/gcc/config/ia64/crtbegin.asm	2005-09-27 02:52:24.000000000 +0200
    20 +++ gcc-4.3.1/gcc/config/ia64/crtbegin.asm	2008-06-10 14:58:17.000000000 +0200
    21 @@ -255,3 +255,7 @@
    22  .weak __cxa_finalize
    23  #endif
    24  .weak _Jv_RegisterClasses
    25 +
    26 +#ifdef __linux__
    27 +.section .note.GNU-stack; .previous
    28 +#endif
    29 diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtend.asm gcc-4.3.1/gcc/config/ia64/crtend.asm
    30 --- gcc-4.3.1.orig/gcc/config/ia64/crtend.asm	2005-09-27 02:52:24.000000000 +0200
    31 +++ gcc-4.3.1/gcc/config/ia64/crtend.asm	2008-06-10 14:58:17.000000000 +0200
    32 @@ -122,3 +122,7 @@
    33  
    34  	br.ret.sptk.many rp
    35  	.endp __do_global_ctors_aux
    36 +
    37 +#ifdef __linux__
    38 +.section .note.GNU-stack; .previous
    39 +#endif
    40 diff -durN gcc-4.3.1.orig/gcc/config/ia64/crti.asm gcc-4.3.1/gcc/config/ia64/crti.asm
    41 --- gcc-4.3.1.orig/gcc/config/ia64/crti.asm	2005-06-25 03:22:41.000000000 +0200
    42 +++ gcc-4.3.1/gcc/config/ia64/crti.asm	2008-06-10 14:58:17.000000000 +0200
    43 @@ -64,3 +64,7 @@
    44  	.body
    45  
    46  # end of crti.asm
    47 +
    48 +#ifdef __linux__
    49 +.section .note.GNU-stack; .previous
    50 +#endif
    51 diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtn.asm gcc-4.3.1/gcc/config/ia64/crtn.asm
    52 --- gcc-4.3.1.orig/gcc/config/ia64/crtn.asm	2005-06-25 03:22:41.000000000 +0200
    53 +++ gcc-4.3.1/gcc/config/ia64/crtn.asm	2008-06-10 14:58:17.000000000 +0200
    54 @@ -54,3 +54,7 @@
    55  	br.ret.sptk.many b0
    56  
    57  # end of crtn.asm
    58 +
    59 +#ifdef __linux__
    60 +.section .note.GNU-stack; .previous
    61 +#endif
    62 diff -durN gcc-4.3.1.orig/gcc/config/ia64/lib1funcs.asm gcc-4.3.1/gcc/config/ia64/lib1funcs.asm
    63 --- gcc-4.3.1.orig/gcc/config/ia64/lib1funcs.asm	2005-09-27 02:52:24.000000000 +0200
    64 +++ gcc-4.3.1/gcc/config/ia64/lib1funcs.asm	2008-06-10 14:58:17.000000000 +0200
    65 @@ -792,3 +792,7 @@
    66  	}
    67  	.endp __floattitf
    68  #endif
    69 +
    70 +#ifdef __linux__
    71 +.section .note.GNU-stack; .previous
    72 +#endif
    73 diff -durN gcc-4.3.1.orig/gcc/config/ia64/linux.h gcc-4.3.1/gcc/config/ia64/linux.h
    74 --- gcc-4.3.1.orig/gcc/config/ia64/linux.h	2006-12-12 16:15:19.000000000 +0100
    75 +++ gcc-4.3.1/gcc/config/ia64/linux.h	2008-06-10 14:58:17.000000000 +0200
    76 @@ -5,6 +5,8 @@
    77  
    78  #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
    79  
    80 +#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
    81 +
    82  /* This is for -profile to use -lc_p instead of -lc.  */
    83  #undef CC1_SPEC
    84  #define CC1_SPEC "%{profile:-p} %{G*}"
    85 diff -durN gcc-4.3.1.orig/gcc/config/rs6000/ppc-asm.h gcc-4.3.1/gcc/config/rs6000/ppc-asm.h
    86 --- gcc-4.3.1.orig/gcc/config/rs6000/ppc-asm.h	2003-06-04 18:44:51.000000000 +0200
    87 +++ gcc-4.3.1/gcc/config/rs6000/ppc-asm.h	2008-06-10 14:58:17.000000000 +0200
    88 @@ -158,7 +158,7 @@
    89  	.size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
    90  #endif
    91  
    92 -#if defined __linux__ && !defined __powerpc64__
    93 +#if defined __linux__
    94  	.section .note.GNU-stack
    95  	.previous
    96  #endif