[CentOS] rpmbuild for different architecture [OT?]

Jake Shipton jakems at fedoraproject.org
Sat Feb 9 12:31:00 UTC 2013


On Fri, 8 Feb 2013 15:08:15 -0500
Steve <zephod at cfl.rr.com> wrote:

> As far as I can tell, the rpm-list went defunct circa 2008 so I'm
> asking here. No doubt someone will let me know if this is not OK.
> 
> I'm trying to build an RPM on a CentOS VM targeted to run on an ARM
> architecture machine.
> 
> I have a test program, prime, that I cross compiled on my VM and when
> I copy it onto my target machine it runs correctly. Now I want to
> package it in an RPM.
> 
> On my target machine, I run
> $ uname -m
> armv71
> 
> so on the VM I wrote my spec file and ran
> $ rpmbuild -ba --target armv71 prime.spec
> ...
> processing files: prime-1.0-1.armv71
> unknown, 0: Warning using regular magic file '/etc/magic'
> Requires(rpmlib): rpmlib(payloadFilesHavePrefix) <= 4.0-1
> rpmlib(CompressedFileNames) <= 3.0.4-1 ...
> Wrote /home/steve/rpmbuild/RPMS/armv71/prime-1.0-1.armv71.rpm
> ...
> 
> So it seems that some parts of rpm realize that I've cross compiled
> and some parts don't. Any ideas on how to get rid of these warning
> messages? I tried putting 'Autoreq: 0' in the spec file but that
> didn't help.
> 
> A second problem is that when I go to install the rpm on the target
> machine, I get an error saying that the architecture doesn't match. I
> had to use --ignorarch to get it to install. What does rpm use to
> determine what the architecture is if not uname?
> 
> With the --ignorearch option, the RPM installs and the program runs
> as expected.
> 
> Thanks,
> Steve
> 
>  
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos

I would recommend using "Mock" for this as it would both provide a
clean build environment (chroot) and the ability to cross compile
easily. 

Once you get mock all configured and set up, it's actually a really
nice tool and handy :-). I highly recommend it.

Good luck! :-)

-- 
Jake Shipton (JakeMS)
GPG Key: 0xE3C31D8F
GPG Fingerprint: 7515 CC63 19BD 06F9 400A DE8A 1D0B A5CF E3C3 1D8F
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.centos.org/pipermail/centos/attachments/20130209/3a46448a/attachment.sig>


More information about the CentOS mailing list