nixpkgs/pkgs/development/libraries/aterm/2.4.2-fixes.nix
Eelco Dolstra da4fb573a7 * Added ATerm 2.8. Also removed some old versions and patches that
were no longer in use.

* A patch for compiling the ATerm library with GCC 4.3.  Without it,
  the code for resizing ATerm tables gets stuck in an infinite loop
  (http://bugzilla.sen.cwi.nl:8080/show_bug.cgi?id=841).  The problem
  is in this bit of code in hash.c, which tries to dynamically figure
  out the maximum signed integer:

    long try_long_max;
    long long_max;
    long delta;

    try_long_max = 1;
    do {
      long_max = try_long_max;
      try_long_max = long_max * 2;
    } while (try_long_max > 0);

  At -O2, GCC 4.3 determines that 1 * 2 * 2 * ... can never be <= 0,
  and so it optimises this into a 1-instruction infinite loop:

    0x0805a782 <keyPut+1282>: jmp  0x805a782 <keyPut+1282>

  Quite beautiful really. ;-)

  The fix is to use the LONG_MAX macro instead.

svn path=/nixpkgs/branches/stdenv-updates/; revision=13888
2009-01-27 17:46:07 +00:00

24 lines
553 B
Nix

{stdenv, fetchurl}:
stdenv.mkDerivation {
name = "aterm-2.4.2-fixes-r2";
src = fetchurl {
url = http://nixos.org/tarballs/aterm-2.4.2-fixes-r2.tar.bz2;
sha256 = "1w3bxdpc2hz29li5ssmdcz3x0fn47r7g62ns0v8nazxwf40vff4j";
};
patches = [
# Fix for http://bugzilla.sen.cwi.nl:8080/show_bug.cgi?id=841
./max-long.patch
];
doCheck = true;
meta = {
homepage = http://www.cwi.nl/htbin/sen1/twiki/bin/view/SEN1/ATerm;
license = "LGPL";
description = "Library for manipulation of term data structures in C";
};
}