On Sunday 31 Jul 2016 23:18:00 Andrew Savchenko wrote: > On Sun, 31 Jul 2016 19:40:37 +0100 Mick wrote: > > Hi All, > > > > I am dipping my toe into cross-compile territory, in order to build i686 > > binaries for a 32bit box, which is too old to do its own emerges. I am > > using an amd64 box which is significantly faster to do all the heavy > > lifting and started applying this page: > > > > https://wiki.gentoo.org/wiki/Embedded_Handbook/General/Creating_a_cross-co > > mpiler > > > > which I followed up with: > > > > https://wiki.gentoo.org/wiki/Cross_build_environment > > And here comes this misconception again... Please, tell me, why on > the earth cross-compiling is needed for amd64 to produce i686 > binaries?!
I thought it did. From what you're saying I got this wrong. When I read the first use case bullet point, on the 2nd URL above, I thought I had arrived at the right place. :-/ > amd64 CPU _natively_ supports x86 instructions, amd64 kernel > natively supports x86 code (this can be disabled during kernel > config, but usually it isn't), amd64 gcc *can* produce x86 binaries. I thought amd64 can run x86 binaries, but I wasn't aware that it can compile them too, or what is needed to achieve this. My knowledge on gcc is pretty much minimal. I did search the Wiki, gentoo.org and Google for it, but all I could come across was cross-compiling. > There are two ways to help older x86 boxes to build packages faster: > > 1. Set up distcc to produce x86 code on your amd64 processors. Just > add -m32 to your *FLAGS. I read somewhere in these unsuccessful searches of mine that distcc is deprecated and it is better to use cross-compiling instead ... > 2. Copy old box system to a chroot dir on amd64. Run setarch i686 > and chroot to that directory, and build 32-bit packages as usual! > There are two ways to deliver them: > > 2.a. Generate binary packages on new box and install them on old > boxes. OK, I'll uninstall crossdev and try 2.a in the first instance. Is there a Wiki page explaining what parts of the x86 system are needed to carry across to the amd64 guest_root_fs? I wouldn't think I will need the whole x86 fs? Anything else I need to pay attention to? > 2.b. Instead of copying old box's root, mount it over NFS. I'll look into this later, after I get 2.a going. > I'm currently using 1, but planning to switch to 2.a, because > distcc can't help with everything (execution of java, python, > autotools and other stuff can't be helped with distcc). > > I used 2.b earlier on very old box (it is dead now). > > 3. Well, one can do full cross-compilation as you proposed, but > this is ridiculous. Cross-compilation is always a pain and if it > can be avoided, it should be avoided. Thanks for this advice. I am not particularly interested to use crossdev if it is not the best suited tool for the job, but I wasn't aware of the alternatives you suggested and haven't as yet found any HOWTOs on it. -- Regards, Mick
signature.asc
Description: This is a digitally signed message part.