Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Kernel cross compilation error

40 views
Skip to first unread message

atoka

unread,
Nov 24, 2006, 12:50:17 AM11/24/06
to
hi everyone,
im a kernel newbie. im using a debian linux(ie ubuntu).i did
cross compilation for ia64 on my system which is ia32. Now im trying
to cross compile ia64 kernel but im getting some error. before
compiling kernel, i did made changes in Makefile to specify my
ia64-linux compiler and libraries .

when i gave make menuconfig command i got following errors

root@atoka-desktop:/linux-2.6.18# make ARCH=ia64 menuconfig
HOSTCC scripts/basic/fixdep
scripts/basic/fixdep.c: In function 'use_config':
scripts/basic/fixdep.c:204: error: 'PATH_MAX' undeclared (first use in
this function)
scripts/basic/fixdep.c:204: error: (Each undeclared identifier is
reported only once
scripts/basic/fixdep.c:204: error: for each function it appears in.)
scripts/basic/fixdep.c:204: warning: unused variable 's'
scripts/basic/fixdep.c: In function 'parse_dep_file':
scripts/basic/fixdep.c:300: error: 'PATH_MAX' undeclared (first use in
this function)
scripts/basic/fixdep.c:300: warning: unused variable 's'
make[1]: *** [scripts/basic/fixdep] Error 1
make: *** [scripts_basic] Error 2

i tried defining the PATH_MAX macro in fixdep.c to 100, but then it
gave error in some other file.
Can anyone help me out with this error?

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/


Willy Tarreau

unread,
Nov 24, 2006, 1:02:17 AM11/24/06
to
On Fri, Nov 24, 2006 at 11:20:17AM +0530, atoka wrote:
> hi everyone,
> im a kernel newbie. im using a debian linux(ie ubuntu).i did
> cross compilation for ia64 on my system which is ia32. Now im trying
> to cross compile ia64 kernel but im getting some error. before
> compiling kernel, i did made changes in Makefile to specify my
> ia64-linux compiler and libraries .

You should not have changed the contents of your makefile but just
passed it some parameters.

> when i gave make menuconfig command i got following errors
>
> root@atoka-desktop:/linux-2.6.18# make ARCH=ia64 menuconfig
> HOSTCC scripts/basic/fixdep
> scripts/basic/fixdep.c: In function 'use_config':
> scripts/basic/fixdep.c:204: error: 'PATH_MAX' undeclared (first use in
> this function)
> scripts/basic/fixdep.c:204: error: (Each undeclared identifier is
> reported only once
> scripts/basic/fixdep.c:204: error: for each function it appears in.)
> scripts/basic/fixdep.c:204: warning: unused variable 's'
> scripts/basic/fixdep.c: In function 'parse_dep_file':
> scripts/basic/fixdep.c:300: error: 'PATH_MAX' undeclared (first use in
> this function)
> scripts/basic/fixdep.c:300: warning: unused variable 's'
> make[1]: *** [scripts/basic/fixdep] Error 1
> make: *** [scripts_basic] Error 2

It is because you have changed HOSTCC which is the compiler for the
host you're building from. Normally, you just have to do something
like this :

$ make ARCH=ia64 CC=ia64-gcc menuconfig vmlinux ...

And BTW, don't build as root, one day you will regret it.

> i tried defining the PATH_MAX macro in fixdep.c to 100, but then it
> gave error in some other file.
> Can anyone help me out with this error?

Regards,
Willy

atoka

unread,
Nov 26, 2006, 3:40:54 AM11/26/06
to
On 11/26/06, Willy Tarreau <w...@1wt.eu> wrote:
> On Sun, Nov 26, 2006 at 11:53:18AM +0530, atoka wrote:
> > On 11/24/06, Willy Tarreau <w...@1wt.eu> wrote:

> > >On Fri, Nov 24, 2006 at 12:15:06PM +0530, atoka wrote:
> > >> On 11/24/06, Willy Tarreau <w...@1wt.eu> wrote:
> > >> >On Fri, Nov 24, 2006 at 11:20:17AM +0530, atoka wrote:
> > >> >> hi everyone,
> > >> >> im a kernel newbie. im using a debian linux(ie ubuntu).i did
> > >> >> cross compilation for ia64 on my system which is ia32. Now im trying
> > >> >> to cross compile ia64 kernel but im getting some error. before
> > >> >> compiling kernel, i did made changes in Makefile to specify my
> > >> >> ia64-linux compiler and libraries .
> > >> >
> > >> >You should not have changed the contents of your makefile but just
> > >> >passed it some parameters.
> > >>
> > >>
> > >> i have made following changes in Makefile,
> > >>
> > >> AS = $(CROSS_COMPILE)ia64-linux-as
> > >> LD = $(CROSS_COMPILE)ia64-linux-ld
> > >> CC = $(CROSS_COMPILE)ia64-linux-gcc
> > >> CPP = $(CC) -ia64-linux-E
> > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > >error here : you should have left :
> > >
> > > CPP = $(CC) -E
> > >
> > >> AR = $(CROSS_COMPILE)ia64-linux-ar
> > >> NM = $(CROSS_COMPILE)ia64-linux-nm
> > >> STRIP = $(CROSS_COMPILE)ia64-linux-strip
> > >> OBJCOPY = $(CROSS_COMPILE)ia64-linux-objcopy
> > >> OBJDUMP = $(CROSS_COMPILE)ia64-linux-objdump
> > >>
> > >> won't it work?
> > >
> > >It should work. Anyway, it would have been a lot easier to set
> > >CROSS_COMPILE=ia64-linux (either in the makefile or on the command
> > >line).
> > >
> > >Willy
> > >
> >
> > i kept the HOST gcc as it is,
> > changed CPP= $(CC) -ia64-linux-E to
> > CPP = $(CC) -E
> >
> > and run make ARCH=ia64 defconfig
> > and make ARCH=ia64 menuconfig command but its giving following errors..
> >
> >
> > root@atoka-desktop:/linux-2.6.18# make ARCH=ia64 defconfig
> > HOSTCC scripts/basic/fixdep
> > /bin/sh: gcc: command not found
> > make[1]: *** [scripts/basic/fixdep] Error 127

> > make: *** [scripts_basic] Error 2
> >
> >
> > root@atoka-desktop:/linux-2.6.18# make ARCH=ia64 menuconfig
> > HOSTCC scripts/basic/fixdep
> > /bin/sh: gcc: command not found
> > make[1]: *** [scripts/basic/fixdep] Error 127

> > make: *** [scripts_basic] Error 2
> > root@atoka-desktop:/linux-2.6.18#
> >
> >
> > by the way do i need to have HOST gcc installed in my system??
>
> yes of course, because some tools such as fixdep and dialog are compiled
> on your system to be used locally during the build process. You can install
> any version, it is not much important for those tools. Of course, you will
> need binutils too, so that the ".o" can be linked as a binary executable.
>
> Willy
>
>

i already have binutils installed in my system.but i have problem
installing gcc.
im not getting proper gcc binaries version for ubuntu, also i don't
have net connected to my ubuntu linux, so i can't use sudo apt-get
install gcc command...can you help..

Willy Tarreau

unread,
Nov 26, 2006, 3:46:14 AM11/26/06
to

Well, I have no idea how those packages work. That's what I hate in those
distros, everything works magically until one day, and users are lost.
I suspect you can download a package for your distro from its ftp site
and transfer it to your machine, then install it with some package management
utility provided with the distro.

If you cannot manage to do that, another solution would be to download gcc-3.4
sources, extract them and configure/make/make install to have a working gcc.
It might be easier and take less time than trying to figure out how to install
a package by hand on the distro and resolve the dependencies...

Regards,
willy

atoka

unread,
Nov 26, 2006, 4:28:46 AM11/26/06
to

i tried installing gcc from the source code i used gcc-4.0.2

but got following error

./configure: line 2339: cc: command not found
*** The command 'cc -o conftest -g conftest.c' failed.
*** You must set the environment variable CC to a working compiler

i even tried few other versions but got the same error.


-Atoka

Willy Tarreau

unread,
Nov 26, 2006, 4:35:51 AM11/26/06
to

Ah yes, sorry, I'm stupid. Since you have no gcc on your machine, you
cannot install from sources as you already need gcc to build it... So
you must find a way to find and install the pre-built gcc package for
your distro.

Willy

atoka

unread,
Nov 26, 2006, 4:52:08 AM11/26/06
to

thats what im saying,since i don't have gcc installed i can't do that..
i m not able to get the pre-built gcc package for my distro. i m
using Ubuntu 6.06. i even got a gcc-3.4 binary pkg but it was just
505kb.
When i tried to compile my hello.c program it gave errors as

stdio.h not found
stdlib.h not found

I don't think its a complete pkg.

where can i find one?

-Atoka

Willy Tarreau

unread,
Nov 26, 2006, 6:54:49 AM11/26/06
to

seems rather small.

> When i tried to compile my hello.c program it gave errors as
>
> stdio.h not found
> stdlib.h not found
>
> I don't think its a complete pkg.

OK, you also need the libraries, the headers, etc... Most probably, the
packages will be named glibc-devel and/or glibc-headers, and you'll
probably also need kernel-headers and libncurses-devel (to build lxdialog).
I understand this seems complicated, but setting up a build environment
on a machine which was not installed with this goal is rather tough.

> where can i find one?

probably that you can find those packages on the same site you found
the gcc binary. Otherwise, check your distro's repository. As I said,
I have no idea how to install anything on that distro, nor where to
find the packages.

> -Atoka

Cheers,
Willy

0 new messages