patches/gcc/4.3.5/150-sparc64-bsd.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/150-sparc64-bsd.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/14_all_gcc-sparc64-bsd.patch
thomas@1461
     5
-= END original header =-
thomas@1461
     6
thomas@1461
     7
diff -durN gcc-4.3.3.orig/gcc/config/sparc/freebsd.h gcc-4.3.3/gcc/config/sparc/freebsd.h
thomas@1461
     8
--- gcc-4.3.3.orig/gcc/config/sparc/freebsd.h	2007-08-02 12:49:31.000000000 +0200
thomas@1461
     9
+++ gcc-4.3.3/gcc/config/sparc/freebsd.h	2009-01-27 22:19:20.000000000 +0100
thomas@1461
    10
@@ -25,9 +25,22 @@
thomas@1461
    11
 /* FreeBSD needs the platform name (sparc64) defined.
thomas@1461
    12
    Emacs needs to know if the arch is 64 or 32-bits.  */
thomas@1461
    13
 
thomas@1461
    14
-#undef  CPP_CPU64_DEFAULT_SPEC
thomas@1461
    15
-#define CPP_CPU64_DEFAULT_SPEC \
thomas@1461
    16
-  "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__"
thomas@1461
    17
+#undef  FBSD_TARGET_CPU_CPP_BUILTINS
thomas@1461
    18
+#define FBSD_TARGET_CPU_CPP_BUILTINS()                  \
thomas@1461
    19
+  do                                                    \
thomas@1461
    20
+    {                                                   \
thomas@1461
    21
+      if (TARGET_ARCH64)                                \
thomas@1461
    22
+        {                                               \
thomas@1461
    23
+          builtin_define ("__sparc64__");               \
thomas@1461
    24
+          builtin_define ("__sparc_v9__");              \
thomas@1461
    25
+          builtin_define ("__sparcv9");                 \
thomas@1461
    26
+        }                                               \
thomas@1461
    27
+      else                                              \
thomas@1461
    28
+        builtin_define ("__sparc");                     \
thomas@1461
    29
+      builtin_define ("__sparc__");                     \
thomas@1461
    30
+    }                                                   \
thomas@1461
    31
+  while (0)
thomas@1461
    32
+
thomas@1461
    33
 
thomas@1461
    34
 #define LINK_SPEC "%(link_arch)						\
thomas@1461
    35
   %{!mno-relax:%{!r:-relax}}						\