Re: Building the kernel with Cygwin

From: Christopher Faylor
Date: Fri Aug 26 2005 - 19:46:55 EST


On Thu, Aug 25, 2005 at 02:45:51PM -0400, Christopher Faylor wrote:
>On Thu, Aug 25, 2005 at 01:05:24PM -0400, linux-os (Dick Johnson) wrote:
>>On Thu, 25 Aug 2005, Chris du Quesnay wrote:
>>>The scripts/basic directory contains a fixdep.exe after the make is
>>>run. There is no fixdep file. I tried renaming the fixdep.exe to
>>>fixdep, but that also resulted in the same make error.
>>
>>Ah yes! The Makefile will not execute 'fixdep.exe` it executes 'fixdep'
>>--hard coded. I don't know how well cygwin emulates a Unix
>>environment, but maybe you can use an alias??? .. Like... alias
>>fixdep='fixdep.exe'
>
>How about a symlink?
>
>ln -s fixdep.exe fixdep

FWIW, I've just built a linux kernel on my cygwin system using a ppc cross
compiler.

Here's roughly what I did (this is not verbatim what I did but it should
serve as a rough guide):

c:\>c:\cygwin\bin\bash
bash$ export PATH=/bin:$PATH
bash$ cd /tmp
bash$ wget http://cygwin.com/snapshots/cygwin-inst-20050826.tar.bz2
bash$ wget http://cygwin.com/snapshots/cygwin1-20050826.dll.bz2
bash$ wget ftp://ftp.kernel.org:/pub/linux/kernel/v2.6/linux-2.6.12.tar.bz2
bash$ bzip2 -d cygwin1-20050826.dll.bz2
bash$ cd /
bash$ # expect some errors about being unable to overwrite
bash$ # cygwin1.dll below
bash$ tar xjf /tmp/cygwin-inst-20050826.tar.bz2
bash$ # exit from the running cygwin process so that the cygwin DLL can
bash$ # be overwritten
bash$ exit

c:\>copy c:\cygwin\tmp\cygwin1-20050826.dll c:\cygwin\bin\cygwin1.dll
c:\>c:\cygwin\bin\bash
bash$ export PATH=/bin:/path-to-cross/compiler:$PATH
bash$ mkdir /cygdrive/c/managed /managed
bash$ mount -b -o managed c:/managed /managed
bash$ cd /managed
bash$ tar xjf /tmp/linux-2.6.12.tar.bz2
bash$ cd linux-2.6.12
bash$ make ARCH=ppc HOST_LOADLIBES=-lintl defconfig
bash$ make ARCH=ppc CROSS_COMPILE=ppc-linux-

Note that I have recently added the elf.h header files to cygwin so this
should allow the kernel to be built without any addition steps. But,
you need to download a cygwin snapshot to get this because the headers
aren't part of the latest version of cygwin yet. You also need to
specify HOST_LOADLIBES on the command line because it's required for
cygwin. Using a "managed" mount also allows the creation of files with
mixed case.

I haven't yet checked that the kernel produced from these steps works
but the make does seem to complete without error.

cgf
--
Christopher Faylor spammer? -> aaaspam@xxxxxxxxxxxxxx
Cygwin Co-Project Leader aaaspam@xxxxxxxxxx
TimeSys, Inc.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/