[Nix-dev] Help on cross-building NixOS for other targets.

Armijn Hemel armijn at uulug.nl
Mon Jun 1 22:18:31 CEST 2009


On Mon, 2009-06-01 at 11:55 -0400, phætøn wrote:
> Hello all,Is there any tutorial or how-to on cross-building NixOS for (in my case) ppc-linux from ppc-macos, or building i586-linux from ppc-macos. If macos host is an issue, I can set up a ppc-linux install to do the build. Basically, I want to use NixOS on another platform other than the standard i686/amd64 builds. Any help would be greatly appreciated.Thank you.

Many many moons ago I tried to cross compile Nix and various packages.
As long as you are sticking to plain C with GCC it will no tbe that
hard. I have successfully compiled programs for ARM and MIPS and ran
them on it too.

The real pain is when you compile g++. I've never gotten libstdc++
compiled in a cross compilation setup with Nix. The reason for this is
juggling of flags and the complex configuration and compilation process
of libstdc++. The challenge is that at one point the cross compiler
itself is run for some tests and the flags that Nix set for linking were
used (normally these appear to be empty), linking the test programs (for
example, for ARM) to the libraries of the host system (x86), which will
simply not work. The solution would probably be a change to the
configuration and compilation process of libstdc++.

After fiddling with it for quite a long time I threw it in a corner and
haven't looked at it since (a few years ago now). With new versions of
GCC it might have become easier, I don't know.

armijn

-- 
-------------------------------------------------------------------------
armijn at uulug.nl | http://www.uulug.nl/ | UULug: Utrecht Linux Users Group
-------------------------------------------------------------------------




More information about the nix-dev mailing list