NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Cross-compiler



IT geek 31 <itgeek31%googlemail.com@localhost> writes:

> Hi,
>
> I'm running NetBSD 5.2.2 on a few Cobalt Qubes and I think they're
> fantastic.
>
> However, when it comes to building packages from pkgsrc, they're not so
> great... mainly due to their 200MHz processor.
>
> Would it be possible to cross-compile for the Qube architecture on my
> NetBSD i386 box (which is infinitely more powerful)?
>
> If so, could someone point me in the direction of a guide on how to do this?

Really cross-compiling is pretty hard.  See /usr/pkgsrc/doc/*cross*.

But, I can suggest two things that will help and are less hard.

1) Set up ccache, with a big enough cache size.  See the guide, but I
have in mk.conf:
  PKGSRC_COMPILER=      ccache gcc
  CCACHE_DIR=           /home/gdt/.ccache

2) Use distcc and on the remote machine run the NetBSD toolchain that
you built cross with buidl.sh.  Still do the build on the Qube, but have
it use distcc to outsource the actual compiling.  This is vastly easier
because the build process for each package will not perceive that
anything is cross.  You'll have to do some hackery to get a distcc call
that wants "gcc" to really get the cross version from the TOOLDIR, but
that's way easier than actually making cross-compiling work right.  And
it should just be fiddly, not truly hard.  I have not done this, just
thought about it.  If you do figure out a nice way, it would be great to
document it for others.

Attachment: pgphvrA1VCkiB.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index