Chapter 5.6: Linux API Headers won't build

Smartboy smartboyathome at gmail.com
Mon Jun 29 21:36:25 PDT 2009


On Mon, Jun 29, 2009 at 9:21 PM, Bruce Dubbs <bruce.dubbs at gmail.com> wrote:

> Smartboy wrote:
> > I have checked, and went over the build exactly how the book says.
>
> What book?  There are lots of versions.
>
>
>  Yet, when
> > I try to compile the Linux API headers, I get stuck at make headers_check
> > with the error message:
> > "scripts/unifdef.c:209: error: conflicting types for 'getline'
> > /usr/include/stdio.h:651: error: previous declaration of 'getline' was
> here"
> > I did a google search, and it seems that a patch was made for this, but
> for
> > more recent kernels. You can find the patch here (
> > http://lkml.indiana.edu/hypermail/linux/kernel/0903.0/01708.html), but
> if
> > you try to apply it, you should get errors.
>
> I suggest you read
> http://www.linuxfromscratch.org/lfs/view/stable/chapter01/askforhelp.html
>
> and then re-ask the question.
>
> You might also provide the results of the script in
> http://www.linuxfromscratch.org/lfs/view/stable/prologue/hostreqs.html
>
>
>   -- Bruce
> --
> http://linuxfromscratch.org/mailman/listinfo/lfs-support
> FAQ: http://www.linuxfromscratch.org/lfs/faq.html
> Unsubscribe: See the above information page
>

Sorry about that, I am running Arch Linux with kernel version 2.6.30, and am
using the 6.4 version of the book (current stable). I got it to work using
the link that Justin posted, with a little modification to the patch. Here
is my new patch for it:

--- scripts/unifdef.c.orig    2008-10-25 15:05:07.000000000 -0700
+++ scripts/unifdef.c    2009-06-29 21:25:50.000000000 -0700
@@ -206,7 +206,7 @@
 static void             error(const char *);
 static int              findsym(const char *);
 static void             flushline(bool);
-static Linetype         getline(void);
+static Linetype         get_line(void);
 static Linetype         ifeval(const char **);
 static void             ignoreoff(void);
 static void             ignoreon(void);
@@ -512,7 +512,7 @@

     for (;;) {
         linenum++;
-        lineval = getline();
+        lineval = get_line();
         trans_table[ifstate[depth]][lineval]();
         debug("process %s -> %s depth %d",
             linetype_name[lineval],
@@ -526,7 +526,7 @@
  * help from skipcomment().
  */
 static Linetype
-getline(void)
+get_line(void)
 {
     const char *cp;
     int cursym;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfromscratch.org/pipermail/lfs-support/attachments/20090629/68b7843a/attachment.html>


More information about the lfs-support mailing list