[Top][All Lists]

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

Cross-GNU toolchain in Nixpkgs

From: Ludovic Courtès
Subject: Cross-GNU toolchain in Nixpkgs
Date: Sun, 23 May 2010 23:15:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)


With the Nix package manager [0], one can now use the cross-GNU
toolchain available in Nixpkgs [1] to cross-build packages from
GNU/Linux to GNU.  It uses GCC 4.5.0 and recent Hurd/Mach snapshots.

With Nix each package is installed in a prefix of its own, which led to
interesting problems blissfully ignored by the ‘cross-gnu’ script (which
was a good source of inspiration, besides):

  * The final cross-GCC depends on glibc, which depends on Hurd & Mach,
    so it must be told (via $CPATH) where to find the Hurd/Mach headers.
    More importantly, its “spec string” had to be augmented so that cpp
    would be run with ‘-I/path/to/hurd -I/path/to/mach’.

  * libc.so.0.3 has libhurduser.so and libmachuser.so as NEEDED.  The
    cross-linker needs to be told where to find them and it doesn’t care
    about RUNPATH.  Thus the libc.so linker script was augmented to
    contain libhurduser.so and libmachuser.so in its group.

Anyway, it works like a charm and it’s being used to continuously
cross-compile several GNU packages at <http://hydra.nixos.org/project/gnu>.

Compared to the ‘cross-gnu’ script and similar approaches, cross-GNU
builds with Nix are “referentially transparent”, meaning that the
complete dependency graph that led to a particular output can be traced.


[0] http://nixos.org/nix/
[1] http://repo.or.cz/w/nixpkgs-libre.git

Attachment: pgpFu8FBG8VnQ.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]