[Nix-dev] Re: [Nix-commits] SVN commit: nix - 18468 - NicolasPierron - nixpkgs/branches/stdenv-updates/pkgs/lib

Lluís Batlle viriketo at gmail.com
Fri Nov 20 18:33:18 CET 2009


Salut!
2009/11/20 Ludovic Courtès <ludo at gnu.org>:
> Lluís Batlle <viriketo at gmail.com> writes:
>
>> An important part of the system.nix expressions developed by Nicolas
>> concerns the usage of nixpkgs on cross compiling.
>
> OK.
>
> However, whether an application is cross-compiled or not doesn’t change
> the kind of information it needs.  In the cross-compilation case, it
> just needs to be able to distinguish between the host and build
> platforms.  That means that ‘builtins.currentSystem’ is not enough for
> cross-compilation, obviously.
The kind of information it needs for cross-compilation may be
*different*, once some of the build system information can be
automatically asked to the OS or the hardware, but that of the cross
compilation no.
If nix offered a full abstraction of the system where things build or
things are built for, we would achieve that the information for both
native and cross builds will be enough and the same.

>
> [...]
>
>> For example, some arms and mips can arbitrarily deal with
>> little or big endian.
>
> Can it be changed at run time?  (I thought armel != arm and
> mipsel != mips, hardware-wise.)
I think it can be changed at run time, but I never tried. Similar also
with the Thumb instructions. Similar, I think, to i686 runing i586
code, or i486, as if those newer were not only extensions on top of
the older.

>
>> Arms can run programs compiled with thumb instructions, instead of the
>> non-thumb. For PCs, different processors have additional instruction
>> sets, and "i686" no more became a full definition for the
>> processor. Pentium 2, 3 and 4, fall into i686, although they have sse,
>> sse2 and sse3.
>
> glibc, mplayer, etc. all detect this at run time.  (In glibc 2.10, ELF
> was even extended with ‘STT_IFUNC’ so that code for all ISA variants can
> be compiled in and the right version is chosen by the dynamic linker.)
Not all programs may detect that at runtime, and choose that at build
time. It maybe that it is the case of atlas.

>> Those details have a strong meaning when building the compiler for
>> that platform.
>
> For x86 I believe GCC won’t use SSE et al. unless explicitly told to do
> so with ‘-msse’ or similar.
Right. These defaults can be changed at build time additionally, for
example changing the gcc specs.

Regards,
Lluís.



More information about the nix-dev mailing list