patches/binutils/2.18a/120-i386-no-divide-comment.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 866 5fec4dba671e
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)
yann@866
     1
diff -durN binutils-2.18.orig/gas/config/tc-i386.c binutils-2.18/gas/config/tc-i386.c
yann@866
     2
--- binutils-2.18.orig/gas/config/tc-i386.c	2007-08-24 16:01:22.000000000 +0200
yann@866
     3
+++ binutils-2.18/gas/config/tc-i386.c	2008-09-22 08:11:42.000000000 +0200
yann@866
     4
@@ -180,24 +180,10 @@
yann@866
     5
 #endif
yann@866
     6
 	;
yann@866
     7
 
yann@866
     8
-#if (defined (TE_I386AIX)				\
yann@866
     9
-     || ((defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF))	\
yann@866
    10
-	 && !defined (TE_GNU)				\
yann@866
    11
-	 && !defined (TE_LINUX)				\
yann@866
    12
- 	 && !defined (TE_NETWARE)			\
yann@866
    13
-	 && !defined (TE_FreeBSD)			\
yann@866
    14
-	 && !defined (TE_NetBSD)))
yann@866
    15
 /* This array holds the chars that always start a comment.  If the
yann@866
    16
-   pre-processor is disabled, these aren't very useful.  The option
yann@866
    17
-   --divide will remove '/' from this list.  */
yann@866
    18
-const char *i386_comment_chars = "#/";
yann@866
    19
-#define SVR4_COMMENT_CHARS 1
yann@866
    20
-#define PREFIX_SEPARATOR '\\'
yann@866
    21
-
yann@866
    22
-#else
yann@866
    23
+   pre-processor is disabled, these aren't very useful.  */
yann@866
    24
 const char *i386_comment_chars = "#";
yann@866
    25
 #define PREFIX_SEPARATOR '/'
yann@866
    26
-#endif
yann@866
    27
 
yann@866
    28
 /* This array holds the chars that only start a comment at the beginning of
yann@866
    29
    a line.  If the line seems to have the form '# 123 filename'
yann@866
    30
@@ -6061,20 +6047,6 @@
yann@866
    31
       break;
yann@866
    32
 
yann@866
    33
     case OPTION_DIVIDE:
yann@866
    34
-#ifdef SVR4_COMMENT_CHARS
yann@866
    35
-      {
yann@866
    36
-	char *n, *t;
yann@866
    37
-	const char *s;
yann@866
    38
-
yann@866
    39
-	n = (char *) xmalloc (strlen (i386_comment_chars) + 1);
yann@866
    40
-	t = n;
yann@866
    41
-	for (s = i386_comment_chars; *s != '\0'; s++)
yann@866
    42
-	  if (*s != '/')
yann@866
    43
-	    *t++ = *s;
yann@866
    44
-	*t = '\0';
yann@866
    45
-	i386_comment_chars = n;
yann@866
    46
-      }
yann@866
    47
-#endif
yann@866
    48
       break;
yann@866
    49
 
yann@866
    50
     case OPTION_MARCH:
yann@866
    51
@@ -6142,13 +6114,8 @@
yann@866
    52
   fprintf (stream, _("\
yann@866
    53
   --32/--64               generate 32bit/64bit code\n"));
yann@866
    54
 #endif
yann@866
    55
-#ifdef SVR4_COMMENT_CHARS
yann@866
    56
-  fprintf (stream, _("\
yann@866
    57
-  --divide                do not treat `/' as a comment character\n"));
yann@866
    58
-#else
yann@866
    59
   fprintf (stream, _("\
yann@866
    60
   --divide                ignored\n"));
yann@866
    61
-#endif
yann@866
    62
   fprintf (stream, _("\
yann@866
    63
   -march=CPU/-mtune=CPU   generate code/optimize for CPU, where CPU is one of:\n\
yann@866
    64
                            i386, i486, pentium, pentiumpro, pentium4, nocona,\n\