[ptxdist] Conflicting getline declarations in kernel 2.6.32

2010-01-18 Thread Frederik Sdun
Hi,

compiling kernel-headers with a recent host compiler yields the following error:

scripts/unifdef.c:209: error: conflicting types for 'getline'
/usr/include/stdio.h:651: note: previous declaration of 'getline' was 
here

in unifdef.c:
static Linetype getline(void);

in stdio.h:

extern _IO_ssize_t getline (char **__restrict __lineptr,
size_t *__restrict __n,
FILE *__restrict __stream) __wur;


It should only appear on newer systems as mentioned in this article [1].
I attached a patch which applies a patch based on Kyle McMartin's patch.
(HATTRICK)

Regards, Frederik

[1]http://blog.scottt.tw/2009/04/getline-is-in-posix-2008-and-exposed-in.html




-
Geschäftsführung:   Klaus Blankenagel   Karl-Heinz Malzahn
Sitz der Gesellschaft:  Ense
Amtsgericht:  Arnsberg HRB 4452

Diese Nachricht ist als vertraulich einzustufen. Sollten Sie nicht der 
vorgesehene Empfänger sein, bitten wir Sie höflich um eine kurze 
Mitteilung und um die Löschung dieser Nachricht.
Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulässig.
Diese Nachricht dient lediglich dem Austausch von Informationen und 
entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten 
Manipulierbarkeit von E-Mails können wir keine Haftung für den Inhalt 
übernehmen.

-
management:  Klaus Blankenagel  Karl-Heinz Malzahn
based in:Ense
competent country court:  Arnsberg HRB 4452

This message is confidential and may be privileged. If you are not 
the intended recipient, we kindly ask you to inform the sender and 
delete this message.
Any authorised dissemination or copying hereof is prohibited. 
This message servers for information purposes only and shall not 
have any legally binding effect. Given that e-mails can easily be 
subject to manipulation, we can not accept any liability for the 
content provided.

From a1b9f0384cb9695a26e073ab202e7872e2897e36 Mon Sep 17 00:00:00 2001
From: Frederik Sdun frederik.s...@inotec-licht.de
Date: Mon, 18 Jan 2010 14:44:08 +0100
Subject: [PATCH] Add patch to rename kernel's getline to parseline


Signed-off-by: Frederik Sdun frederik.s...@inotec-licht.de
---
 .../linux-2.6.27/rename_getline_parseline.patch|   31 
 patches/linux-2.6.27/series|1 +
 2 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/patches/linux-2.6.27/rename_getline_parseline.patch b/patches/linux-2.6.27/rename_getline_parseline.patch
new file mode 100644
index 000..74615a8
--- /dev/null
+++ b/patches/linux-2.6.27/rename_getline_parseline.patch
@@ -0,0 +1,31 @@
+diff --git a/scripts/unifdef.c b/scripts/unifdef.c
+index 552025e..977e682 100644
+--- a/scripts/unifdef.c
 b/scripts/unifdef.c
+@@ -206,7 +206,7 @@ static void done(void);
+static void error(const char *);
+static int findsym(const char *);
+static void flushline(bool);
+-static Linetype getline(void);
++static Linetype parseline(void);
+static Linetype ifeval(const char **);
+static void ignoreoff(void);
+static void ignoreon(void);
+@@ -512,7 +512,7 @@ process(void)
+
+for (;;) {
+linenum++;
+- lineval = getline();
++ lineval = parseline();
+trans_table[ifstate[depth]][lineval]();
+debug(process %s - %s depth %d,
+linetype_name[lineval],
+@@ -526,7 +526,7 @@ process(void)
+* help from skipcomment().
+*/
+static Linetype
+-getline(void)
++parseline(void)
+{
+const char *cp;
+int cursym;
diff --git a/patches/linux-2.6.27/series b/patches/linux-2.6.27/series
new file mode 100644
index 000..efe8051
--- /dev/null
+++ b/patches/linux-2.6.27/series
@@ -0,0 +1 @@
+rename_getline_parseline.patch
-- 
1.6.3.3

--
ptxdist mailing list
ptxdist@pengutronix.de


[ptxdist] [PATCH] [gdb] Add patch for gdb-6.8

2010-01-18 Thread Alexander Stein
Signed-off-by: Alexander Stein alexander.st...@systec-electronic.com
---
 patches/gdb-6.8/gdb-6.8-fix-compile-karmic.patch |   27 ++
 patches/gdb-6.8/series   |1 +
 2 files changed, 28 insertions(+), 0 deletions(-)
 create mode 100644 patches/gdb-6.8/gdb-6.8-fix-compile-karmic.patch

diff --git a/patches/gdb-6.8/gdb-6.8-fix-compile-karmic.patch 
b/patches/gdb-6.8/gdb-6.8-fix-compile-karmic.patch
new file mode 100644
index 000..1f4353f
--- /dev/null
+++ b/patches/gdb-6.8/gdb-6.8-fix-compile-karmic.patch
@@ -0,0 +1,27 @@
+From d7931d9affb51de54069b75ae0ae9648ffdd64fc Mon Sep 17 00:00:00 2001
+From: Holger Hans Peter Freyther ze...@selfish.org
+Date: Sun, 2 Aug 2009 04:09:03 +0200
+Subject: [PATCH] gdb: Add a patch to fix compilation of gdb 6.8
+
+gcc warns about the subscript_array being uninitialized,
+just memset this area... luckily I can not break much as
+this is for fortran code.
+
+Signed-off-by: Alexander Stein alexander.st...@systec-electronic.com
+
+Index: gdb-6.8/gdb/eval.c
+===
+--- gdb-6.8.orig/gdb/eval.c2009-08-02 03:25:20.0 +0200
 gdb-6.8/gdb/eval.c 2009-08-02 03:53:39.0 +0200
+@@ -1656,6 +1656,8 @@
+   if (nargs != ndimensions)
+ error (_(Wrong number of subscripts));
+ 
++memset(subscript_array, 0, sizeof(subscript_array));
++
+   /* Now that we know we have a legal array subscript expression 
+  let us actually find out where this element exists in the array. */
+ 
+-- 
+1.6.1
+
diff --git a/patches/gdb-6.8/series b/patches/gdb-6.8/series
index 6382ea6..32f89dd 100644
--- a/patches/gdb-6.8/series
+++ b/patches/gdb-6.8/series
@@ -1,2 +1,3 @@
 Makefile_in_cppflags.diff -p0
 m68k-linux-nat-get_regcache_arch.patch
+gdb-6.8-fix-compile-karmic.patch
-- 
1.6.4.4


--
ptxdist mailing list
ptxdist@pengutronix.de


Re: [ptxdist] Conflicting getline declarations in kernel 2.6.32

2010-01-18 Thread Remy Bohmer
Hi,

2010/1/18 Frederik Sdun frederik.s...@inotec-licht.de:
 Hi,

 compiling kernel-headers with a recent host compiler yields the following 
 error:

 scripts/unifdef.c:209: error: conflicting types for 'getline'
 /usr/include/stdio.h:651: note: previous declaration of 'getline' was
 here

 in unifdef.c:
 static Linetype         getline(void);

 in stdio.h:

 extern _IO_ssize_t getline (char **__restrict __lineptr,
                            size_t *__restrict __n,
                            FILE *__restrict __stream) __wur;


 It should only appear on newer systems as mentioned in this article [1].
 I attached a patch which applies a patch based on Kyle McMartin's patch.
 (HATTRICK)

In later kernels (if I look at 2.6.30 and newer) it has already been
solved, and it has been named get_line() instead of getline().
This is thus not a problem in 2.6.32 any more, but probably it still
is in 2.6.27 as on which your patch in based. So, the subject of this
message is wrong...
See also: 
http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.32.y.git;a=commit;h=d15bd1067b1fcb2b7250d22bc0c7c7fea0b759f7

It should only be applied if older kernels are being used. and it
should be preferred the diff from the commit above instead of your
patch.

Kind regards,

Remy

--
ptxdist mailing list
ptxdist@pengutronix.de