public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mick <michaelkintzios@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] cross-compile attempt
Date: Mon, 01 Aug 2016 14:51:02 +0100	[thread overview]
Message-ID: <2788057.PL0PvVn3Vb@dell_xps> (raw)
In-Reply-To: <3503837.t7NQTNLzTh@dell_xps>

[-- Attachment #1: Type: text/plain, Size: 3533 bytes --]

On Sunday 31 Jul 2016 23:31:29 you wrote:
> 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.

Given Andrew's steer I had another look and found this guide:

https://wiki.gentoo.org/wiki/Project:AMD64/32-bit_Chroot_Guide

Is this approach still valid, or have things moved on since this article was 
authored (2012) and different configuration/approach is now recommended?

-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2016-08-01 13:51 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-31 18:40 [gentoo-user] cross-compile attempt Mick
2016-07-31 20:15 ` Jeremi Piotrowski
2016-07-31 20:18 ` Andrew Savchenko
2016-07-31 22:31   ` Mick
2016-08-01 13:51     ` Mick [this message]
2016-08-01 15:31       ` Peter Humphrey
2016-08-01 15:49         ` Mick
2016-08-01 16:21           ` Mick
2016-08-02  8:46             ` Peter Humphrey
2016-08-02 11:56           ` Neil Bothwick
2016-08-03  0:26             ` [gentoo-user] " Ian Zimmerman
2016-08-03  8:20               ` Neil Bothwick
2016-08-03 17:26                 ` james
2016-08-03 20:11                   ` R0b0t1
2016-07-31 20:36 ` [gentoo-user] " james
2016-08-01 15:23 ` waltdnes
2016-08-01 15:46   ` [gentoo-user] Re: [was cross-compile attempt] 32bit chroot Mick
2016-08-01 16:19     ` waltdnes
2016-08-01 16:32       ` Mick
2016-08-01 17:57         ` Mick
2016-08-01 21:21           ` Mick
2016-08-01 23:11             ` Jeremi Piotrowski
2016-08-02  4:33               ` waltdnes
2016-08-02  5:29                 ` Mick
2016-08-02  9:22           ` Peter Humphrey
2016-08-02 14:33             ` Neil Bothwick

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2788057.PL0PvVn3Vb@dell_xps \
    --to=michaelkintzios@gmail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox