[Nix-dev] patches to add mkcl and fix ecl

Michael Raskin 7c6f434c at mail.ru
Sat Mar 28 10:25:53 CET 2015


>attached is a patch which fixes ecl, using the gmp and libffi supplied
>by nix, preserving the dffi ecl feature.

Thanks, applied

>> Look at bittornado expression, for example, it sets PYTHONPATH for use
>> at runtime.
>>
>> For ECL we need to set NIX_CFLAGS_COMPILE, I guess. Any flags in 
>> NIX_CFLAGS_COMPILE are treated by NixPkgs gcc as if passed to gcc 
>> directly. There are also NIX_LDFLAGS.
>>
>>>Ecl invokes gcc at runtime, to compile lisp files.  At this point,
>>>libffi needs to be passed as gcc arg -I${libffi}/lib, which is not
>>>happening at the moment, and I haven't found a way how to do this.
>>>
>>>So unless this runtime gcc invocation works (with or without) libffi,
>>>ecl is not usable.
>
>I tried a few things as you suggested but without success.  E.g.
>
>   NIX_CFLAGS_COMPILE = [ "-I${libffi}/include" ];
>   NIX_LDFLAGS = [ "-L${libffi}/lib" ];
>
>   or
>
>   wrapProgram $out/bin/ecl \
>     --prefix NIX_CFLAGS_COMPILE ' ' "-I${libffi}/include" \
>     --prefix NIX_LDFLAGS ' ' "-L${libffi}/lib"
>
>but that did not work.  I think it makes sense, because it is ecl which
>creates the gcc arguments, not nix.

Well, I had a similar solution in environment, and it worked for me…

ECL should be invoking our wrapped GCC, which would inherit the 
environment variables and use them. At least that theory allowed me to
build a few executables using ECL.

>The attached patch adds with-libffi-prefix to configure.ac (similar to
>the existing with-gmp-prefix) and re-runs autoconf.

Well, that does seem to be a proper fix instead of dirty workarounds.





More information about the nix-dev mailing list