patches/gcc/4.3.5/130-cross-compile.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/130-cross-compile.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/08_all_gcc-4.1-cross-compile.patch
thomas@1461
     5
Some notes on the 'bootstrap with or without libc headers' debate:
thomas@1461
     6
http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
thomas@1461
     7
http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
thomas@1461
     8
thomas@1461
     9
-= END original header =-
thomas@1461
    10
thomas@1461
    11
diff -durN gcc-4.3.3.orig/gcc/configure gcc-4.3.3/gcc/configure
thomas@1461
    12
--- gcc-4.3.3.orig/gcc/configure	2008-08-01 11:51:03.000000000 +0200
thomas@1461
    13
+++ gcc-4.3.3/gcc/configure	2009-01-27 22:19:16.000000000 +0100
thomas@1461
    14
@@ -13442,7 +13442,7 @@
thomas@1461
    15
 	    | powerpc*-*-*,powerpc64*-*-*)
thomas@1461
    16
 		CROSS="$CROSS -DNATIVE_CROSS" ;;
thomas@1461
    17
 	esac
thomas@1461
    18
-elif test "x$TARGET_SYSTEM_ROOT" != x; then
thomas@1461
    19
+elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
thomas@1461
    20
         SYSTEM_HEADER_DIR=$build_system_header_dir
thomas@1461
    21
 fi
thomas@1461
    22
 
thomas@1461
    23
diff -durN gcc-4.3.3.orig/gcc/configure.ac gcc-4.3.3/gcc/configure.ac
thomas@1461
    24
--- gcc-4.3.3.orig/gcc/configure.ac	2008-08-01 11:51:03.000000000 +0200
thomas@1461
    25
+++ gcc-4.3.3/gcc/configure.ac	2009-01-27 22:19:16.000000000 +0100
thomas@1461
    26
@@ -1749,7 +1749,7 @@
thomas@1461
    27
 	    | powerpc*-*-*,powerpc64*-*-*)
thomas@1461
    28
 		CROSS="$CROSS -DNATIVE_CROSS" ;;
thomas@1461
    29
 	esac
thomas@1461
    30
-elif test "x$TARGET_SYSTEM_ROOT" != x; then
thomas@1461
    31
+elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
thomas@1461
    32
         SYSTEM_HEADER_DIR=$build_system_header_dir 
thomas@1461
    33
 fi
thomas@1461
    34
 
thomas@1461
    35
diff -durN gcc-4.3.3.orig/gcc/unwind-dw2.c gcc-4.3.3/gcc/unwind-dw2.c
thomas@1461
    36
--- gcc-4.3.3.orig/gcc/unwind-dw2.c	2008-09-25 00:44:28.000000000 +0200
thomas@1461
    37
+++ gcc-4.3.3/gcc/unwind-dw2.c	2009-01-27 22:19:16.000000000 +0100
thomas@1461
    38
@@ -334,9 +334,11 @@
thomas@1461
    39
 }
thomas@1461
    40
 #endif
thomas@1461
    41
 
thomas@1461
    42
+#ifndef inhibit_libc
thomas@1461
    43
 #ifdef MD_UNWIND_SUPPORT
thomas@1461
    44
 #include MD_UNWIND_SUPPORT
thomas@1461
    45
 #endif
thomas@1461
    46
+#endif
thomas@1461
    47
 
thomas@1461
    48
 /* Extract any interesting information from the CIE for the translation
thomas@1461
    49
    unit F belongs to.  Return a pointer to the byte after the augmentation,