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

Ludovic Courtès ludo at gnu.org
Fri Nov 20 18:25:27 CET 2009


Hey,

Nicolas Pierron <nicolas.b.pierron at gmail.com> writes:

> On Fri, Nov 20, 2009 at 15:13, Ludovic Courtès <ludo at gnu.org> wrote:
>> Lluís Batlle <viriketo at gmail.com> writes:
>>> 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.
>>
>>> 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.

[...]

> This can break the binary distribution.  How ...?  Simple, if the
> buildfarm has sse3 and your computer does not have it, the program
> will only work on sse3 hardware and it may cause illegal instructions
> on others.

glibc, mplayer, etc. detect the supported instruction set at run time,
and they choose the right compiled code (among the pre-compiled function
versions with or without SSE, MMX, etc.) at run time base on the
available CPU features at run time.  The ‘IFUNC’ ELF extension is all
about making such run-time selection more efficient.

Thanks,
Ludo’.



More information about the nix-dev mailing list