patches/uClibc/0.9.30.1/180-getline-conflict.patch
author Zoltan Devai <zdevai@gmail.com>
Wed Oct 28 12:03:38 2009 +0100 (2009-10-28)
changeset 1602 1ba79f2126df
permissions -rw-r--r--
libc/uClibc: fix building on system with recent glibc

While trying to build a toolchain with ct-ng 1.5.0,
arm-unknown-linux-uclibcgnueabi target,
I get the following error:

[INFO ] Installing C library headers
[EXTRA] Copying sources to build dir
[EXTRA] Applying configuration
[EXTRA] Building headers
[EXTRA] Installing headers
[ERROR] extra/scripts/unifdef.c:209: error: conflicting types for 'getline'
[ERROR] make[2]: *** [extra/scripts/unifdef] Error 1
[ERROR] Build failed in step 'Installing C library headers'

The following patch solves the problem.
(It's a backport of this uClibc commit:
http://git.uclibc.org/uClibc/commit/?id=49e81cada73616864b9b31df0aeb6961c30f5a6e
)

[--SNIP from another mail--]
AFAIK this is a problem since glibc 2.10.
zdevai@1602
     1
--- a/extra/scripts/unifdef.c
zdevai@1602
     2
+++ b/extra/scripts/unifdef.c
zdevai@1602
     3
@@ -206,7 +206,7 @@
zdevai@1602
     4
 static void             error(const char *);
zdevai@1602
     5
 static int              findsym(const char *);
zdevai@1602
     6
 static void             flushline(bool);
zdevai@1602
     7
-static Linetype         getline(void);
zdevai@1602
     8
+static Linetype         get_line(void);
zdevai@1602
     9
 static Linetype         ifeval(const char **);
zdevai@1602
    10
 static void             ignoreoff(void);
zdevai@1602
    11
 static void             ignoreon(void);
zdevai@1602
    12
@@ -512,7 +512,7 @@
zdevai@1602
    13
zdevai@1602
    14
 	for (;;) {
zdevai@1602
    15
 		linenum++;
zdevai@1602
    16
-		lineval = getline();
zdevai@1602
    17
+		lineval = get_line();
zdevai@1602
    18
 		trans_table[ifstate[depth]][lineval]();
zdevai@1602
    19
 		debug("process %s -> %s depth %d",
zdevai@1602
    20
 		    linetype_name[lineval],
zdevai@1602
    21
@@ -526,7 +526,7 @@
zdevai@1602
    22
  * help from skipcomment().
zdevai@1602
    23
  */
zdevai@1602
    24
 static Linetype
zdevai@1602
    25
-getline(void)
zdevai@1602
    26
+get_line(void)
zdevai@1602
    27
 {
zdevai@1602
    28
 	const char *cp;
zdevai@1602
    29
 	int cursym;
zdevai@1602
    30