[CentOS] RPM rebuild, cross compiling from x86 to x86_64

John Summerfield debian at herakles.homelinux.org
Fri Feb 16 22:13:44 UTC 2007


Johnny Hughes wrote:
> On Fri, 2007-02-16 at 16:53 +0100, Martin Hamant wrote:
>> Hi
>>
>> I want to recompile some RPMs (my own) for x86_64 arch from my i386
>> compatible build host (because of hardware restriction/funds).Is anyone
>> ever done this ? After a google search, it seems not so easy... i just
>> found this: http://www.speedblue.org/cross_compilation/ but haven't
>> tried it yet (i would have to convert these to RPM first).
>>
>> How is it done for Centos SRPMS rebuilds ? is it a different
>> hardware for each target arch ?
> 
> This will not be easy to do.
> 
> You can fairly easily build a cross compiler ... HOWEVER
> 
> You are also going to need to install packages that are BuildRequires
> for the packages that you want to build (so you can compile against
> them) ... and the xxxxxxx-devel.x86_64 files (the ones with the headers)
> are going to all REQUIRE the xxxxxxx.x86_64 packages too.
> 
> It is almost impossible to do this without installing the x86_64
> distro ... and that requires an x86_64 capable processor.
> 
> You might be able to emulate it (maybe qemu), but by the time you do
> that it would have been cheaper and easier to have spent $300.00 and
> obtained a cheap machine to do it on.

It might also be possible to build a cross compiler, then do your "make 
&& make install" from the source tree to put the binaries someplace, 
maybe /tmp/Build/package, and to construct a spec file that will take 
those binaries and create an rpm using those as "data" files. It's the 
sort of thing you'd do to transform a tarball of proprietary binaries 
into an rpm.

In the build environment, you do away with all the benefits of rpm, but 
it might work.




-- 

Cheers
John

-- spambait
1aaaaaaa at coco.merseine.nu  Z1aaaaaaa at coco.merseine.nu

Please do not reply off-list



More information about the CentOS mailing list