[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Cross compiling rpm packages



Johann Gunnar Oskarsson wrote:
Hi,

Let me be a little more specific. What I'm trying to do is to cross build a package that is my own. I have successfully set up a cross compiler and it cross compiles beautilfully with './configure --host=mipsEEel-linux'.

When I try to cross build with rpm there are a few problems:
1a) For some reason rpmbuild is braindamaged as it changes '--target mipsEEel-linux' into 'mipseeel-linux' and I have no tool called 'mipseeel-linux-gcc'. (This is probably some macro stuff that can hopefully be changed)

You need to learn to use all of the features of autoconf/configure/rpm. Specifically you need target specific macros. Your target specific macros need a way to tell your system WHAT the compiler, linker, assembler, etc are on your system..


1b) I have set up an alias so './configure --host=ee' works. EE is short for the Emotion Engine. But rpmbuild is still braindamaged as it now appends '-linux' to the 'ee' and again I have no tool called 'ee-linux-gcc'. I have 'ee-gcc'. (This is hopefully another macro that can be changed)

YOU need to set CC=, AS=, LD=, etc.. Easiest way is based on target macros.


2) I'm not really sure how to deal with target specifications inside the spec file. There seem to be no docs describing how to deal with cross builds in them. And downloading a whole distro to find examples that I may or may not be able to use is not my idea of something helpful. But this is something I can probably figure out as soon as problem 1a) or 1b) is solved.

Examples are as helpful as I'll be able to get.. it took my company almost 2 full years to figure out how to do this efficiently.. it's definatly not something I can describe in 10 minutes.. If you can look at examples you should be able to figure it out. This is NOT a trivial exercise.. The "easy" way is to setup simple macros based on the target type.. and then use those simple macros to provide configure with appropriate overrides.


3) How to I automarically create rpm packages for two (or more) different platforms when I build a package. There has to be someone that uses some technique to build i386 and i686 packages (for example) with the same build instruction?

My understanding is that you can only build one target type at a time.. os if you want both i386 and i686 you will need to perform the build twice.


4) And finally, I need to know if and how I can tell wheter I'm doing a cross compile (for the EE for example) or building on the target in question.

You need good macros to help you. What we do is have a "host type" macro and a "target type" macro and see if they are equal. If they are we're local.. if they're not it's cross.. In reality of our 200+ packages we probably only use that check 2 or 3 times.. It really shouldn't be necessary.


--Mark


Thanks in advance,


Johann

fray@mvista.com a écrit:

Cross compiling RPM packages takes a large amount of pre-existing knowledge to accomplish, it's not something you just "do". If you want examples, I suggest you find the ELDK (Free PPC embedded distro) and figure out how to rebuild it.

I know it took our company 2 years to figure out how to do it "well", and we are continuously improving the process with each release. It definatly requires specialized RPM macros...

--Mark


[snip]
My first questions are more accuratelly described above.



_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://listman.redhat.com/mailman/listinfo/rpm-list









[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []