[Nix-dev] Re: libgmp impurity
Eelco Dolstra
e.dolstra at tudelft.nl
Fri Jun 26 11:58:03 CEST 2009
Hi,
Ludovic Courtès wrote:
> Peter Simons <simons at cryp.to> writes:
>
>> the gmp library performs rather sophisticated compiler-flag guessing in
>> its configure script. When run on my system, for instance, it configures
>> itself as follows:
>
> Yes, it has a custom `config.guess', which reports the exact
> sub-architecture supported (unlike the "normal" `config.guess' that's
> used by other GNU projects).
>
> The impurity actually stems from syscalls like uname(2), which leak
> information about the underlying kernel. This breaks the Nix model
> because the kernel is not an explicit build input of user applications.
>
> There's no simple solution for this, I'm afraid. ptrace(2)? :-)
configureFlags = "--host=i686-pc-linux-gnu" should do the trick (for GMP - a
general solution is indeed a lot harder). To make it work on other platforms as
well something like
configureFlags="$configureFlags --host=`./configfsf.guess`"
in preConfigure should work. (GMP has wrapped the normal config.guess script
with one that changes the cpu type to values like "athlon" or "core2".)
--
Eelco Dolstra | http://www.st.ewi.tudelft.nl/~dolstra/
More information about the nix-dev
mailing list