FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 07-12-2008, 12:38 AM
Cameron Hutchison
 
Default Building an i386 kernel on amd64 host with make-kpkg

I am trying to build a kernel for my i386 box on my amd64 host. I want
to do this because the amd64 box build at least 10 times faster than the
target box.

I am using make-kpkg to build the kernel package. I am having the
following problem:
$ make-kpkg --rootcmd fakeroot --arch i386 kernel_image
....
/bin/sh: i486-linux-gnu-gcc: command not found
make: *** [debian/stamp-kernel-conf] Error 2
$

I thought that gcc on an amd64 box can build 32-bit binaries without
needing a separate cross compiler.

Can someone give me some pointers on how to do this?

Thanks


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 07-12-2008, 01:02 AM
Cameron Hutchison
 
Default Building an i386 kernel on amd64 host with make-kpkg

Cameron Hutchison <lists@xdna.net> writes:

>I am trying to build a kernel for my i386 box on my amd64 host. I want
>to do this because the amd64 box build at least 10 times faster than the
>target box.

>I am using make-kpkg to build the kernel package. I am having the
>following problem:
>$ make-kpkg --rootcmd fakeroot --arch i386 kernel_image

Following up with a solution to my own problem:

$ make-kpkg --rootcmd fakeroot --cross-compile - --arch i386 kernel_image

I just needed to add that "--cross-compile -" argument and it worked.

Information came from: http://wiki.debian.org/DebianAMD64Faq (last
question)


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 07-12-2008, 04:12 AM
Cameron Hutchison
 
Default Building an i386 kernel on amd64 host with make-kpkg

Cameron Hutchison <lists@xdna.net> writes:
>Cameron Hutchison <lists@xdna.net> writes:
>>I am trying to build a kernel for my i386 box on my amd64 host. I want
>>to do this because the amd64 box build at least 10 times faster than the
>>target box.

>>I am using make-kpkg to build the kernel package. I am having the
>>following problem:
>>$ make-kpkg --rootcmd fakeroot --arch i386 kernel_image

>Following up with a solution to my own problem:

>$ make-kpkg --rootcmd fakeroot --cross-compile - --arch i386 kernel_image

>I just needed to add that "--cross-compile -" argument and it worked.

I spoke too soon. It does not quite work. It builds an amd64 arch
package, so I cannot install it on an i386 arch. The build itself seems
to be done correctly for the target arch, but the package is created for
the host arch.

I would have thought that -arch i386 would produce an i386 arch package,
but apparently not.

Any ideas?


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 07-12-2008, 11:18 AM
Steve Kemp
 
Default Building an i386 kernel on amd64 host with make-kpkg

On Sat Jul 12, 2008 at 04:12:56 -0000, Cameron Hutchison wrote:

> >I just needed to add that "--cross-compile -" argument and it worked.
>
> I spoke too soon. It does not quite work. It builds an amd64 arch
> package, so I cannot install it on an i386 arch.

I use this:

setarch i386 make-kpkg --initrd --arch=i386 --revision $revision binary

That correctly builds an i386 package even on my AMD64 machines.
(Note setarch doesn't seem to be available in the util-linux package
for Etch, so you need to backport it.)

I hope that helps.

Steve
--
Managed Anti-Spam Service
http://mail-scanning.com/


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 07-14-2008, 02:00 AM
Cameron Hutchison
 
Default Building an i386 kernel on amd64 host with make-kpkg

Steve Kemp <skx@debian.org> writes:

>On Sat Jul 12, 2008 at 04:12:56 -0000, Cameron Hutchison wrote:

>> >I just needed to add that "--cross-compile -" argument and it worked.
>>
>> I spoke too soon. It does not quite work. It builds an amd64 arch
>> package, so I cannot install it on an i386 arch.

> I use this:

> setarch i386 make-kpkg --initrd --arch=i386 --revision $revision binary

Thanks for that info, Steve. However I still cannot get it to work.

When I run make-kpkg with the --arch parameter, it seems to always try
to use a cross-compiler - i486-linux-gnu-gcc (or something like that -
I've forgotten exactly and its scrolled off the screen now). This
happens whether I prefix make-kpkg with "setarch i386" or "linux32" or
not.

If I supply the argument "--cross-compiler -" it uses the correct
compiler but always builds a package for the host arch not the target
arch.

I got around it by hacking make-kpkg itself. It seems if you specify
--arch, it will build a deb for the target arch, but only if you dont
specify "--cross-compiler -". I remove the check for that, and now it
works fine.



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 09-20-2008, 08:11 AM
Yan Li
 
Default Building an i386 kernel on amd64 host with make-kpkg

>> setarch i386 make-kpkg --initrd --arch=i386 --revision $revision
>> binary
> Thanks for that info, Steve. However I still cannot get it to work.

Try this:
DEB_HOST_ARCH=i386 make-kpkg --arch i386 --cross_compile -
--rootcmd fakeroot --initrd --append-to-version mytest kernel_image

What you need is setting: DEB_HOST_ARCH=i386, no hack needed.

Tested on Etch.

--
Li, Yan

"Everything that is really great and inspiring is created by the
individual who can labor in freedom."
- Albert Einstein, in Out of My Later Years (1950)


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 04:00 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org