From da4fb573a7bfb2d1ef402ed6081131a8ce893038 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 27 Jan 2009 17:46:07 +0000 Subject: [PATCH] * 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 : jmp 0x805a782 Quite beautiful really. ;-) The fix is to use the LONG_MAX macro instead. svn path=/nixpkgs/branches/stdenv-updates/; revision=13888 --- pkgs/development/libraries/aterm/2.3.nix | 13 - .../libraries/aterm/2.4.2-fixes.nix | 8 + pkgs/development/libraries/aterm/2.4.nix | 17 - pkgs/development/libraries/aterm/2.5.nix | 5 + .../libraries/aterm/{2.7.nix => 2.8.nix} | 11 +- .../libraries/aterm/aterm-alias-fix-2.patch | 224 --------- .../libraries/aterm/aterm-alias-fix.patch | 445 ------------------ .../libraries/aterm/max-long.patch | 77 +++ .../libraries/aterm/mingw-asm.patch | 269 ----------- pkgs/top-level/all-packages.nix | 20 +- 10 files changed, 103 insertions(+), 986 deletions(-) delete mode 100644 pkgs/development/libraries/aterm/2.3.nix delete mode 100644 pkgs/development/libraries/aterm/2.4.nix rename pkgs/development/libraries/aterm/{2.7.nix => 2.8.nix} (50%) delete mode 100644 pkgs/development/libraries/aterm/aterm-alias-fix-2.patch delete mode 100644 pkgs/development/libraries/aterm/aterm-alias-fix.patch create mode 100644 pkgs/development/libraries/aterm/max-long.patch delete mode 100644 pkgs/development/libraries/aterm/mingw-asm.patch diff --git a/pkgs/development/libraries/aterm/2.3.nix b/pkgs/development/libraries/aterm/2.3.nix deleted file mode 100644 index e27acb6a21ee..000000000000 --- a/pkgs/development/libraries/aterm/2.3.nix +++ /dev/null @@ -1,13 +0,0 @@ -{stdenv, fetchurl}: - -stdenv.mkDerivation { - name = "aterm-2.3.1"; - configureFlags = "--with-gcc"; - - src = fetchurl { - url = http://nixos.org/tarballs/aterm-2.3.1.tar.gz; - md5 = "5a2d70acc45a9d301e0dba12fcaf77e7"; - }; - - patches = [ ./aterm-alias-fix.patch ]; -} diff --git a/pkgs/development/libraries/aterm/2.4.2-fixes.nix b/pkgs/development/libraries/aterm/2.4.2-fixes.nix index de1ea95a247f..a160d5cd121a 100644 --- a/pkgs/development/libraries/aterm/2.4.2-fixes.nix +++ b/pkgs/development/libraries/aterm/2.4.2-fixes.nix @@ -2,11 +2,19 @@ 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"; diff --git a/pkgs/development/libraries/aterm/2.4.nix b/pkgs/development/libraries/aterm/2.4.nix deleted file mode 100644 index 849faae02513..000000000000 --- a/pkgs/development/libraries/aterm/2.4.nix +++ /dev/null @@ -1,17 +0,0 @@ -{stdenv, fetchurl}: - -stdenv.mkDerivation { - name = "aterm-2.4.2"; - src = fetchurl { - url = http://nixos.org/tarballs/aterm-2.4.2.tar.gz; - md5 = "18617081dd112d85e6c4b1b552628114"; - }; - patches = - [./aterm-alias-fix-2.patch] ++ - (if stdenv ? isMinGW && stdenv.isMinGW then [./mingw-asm.patch] else []); - 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"; - }; -} diff --git a/pkgs/development/libraries/aterm/2.5.nix b/pkgs/development/libraries/aterm/2.5.nix index 88e31d08515c..f30bd7d3d5c2 100644 --- a/pkgs/development/libraries/aterm/2.5.nix +++ b/pkgs/development/libraries/aterm/2.5.nix @@ -8,6 +8,11 @@ stdenv.mkDerivation { md5 = "33ddcb1a229baf406ad1f603eb1d5995"; }; + patches = [ + # Fix for http://bugzilla.sen.cwi.nl:8080/show_bug.cgi?id=841 + ./max-long.patch + ]; + doCheck = true; meta = { diff --git a/pkgs/development/libraries/aterm/2.7.nix b/pkgs/development/libraries/aterm/2.8.nix similarity index 50% rename from pkgs/development/libraries/aterm/2.7.nix rename to pkgs/development/libraries/aterm/2.8.nix index 43ae0a93a0e6..ab92d019f561 100644 --- a/pkgs/development/libraries/aterm/2.7.nix +++ b/pkgs/development/libraries/aterm/2.8.nix @@ -1,13 +1,18 @@ {stdenv, fetchurl}: stdenv.mkDerivation { - name = "aterm-2.7"; + name = "aterm-2.8"; src = fetchurl { - url = http://homepages.cwi.nl/~daybuild/releases//aterm-2.7.tar.gz; - sha256 = "0zhs0rncn4iankr70kbms64dwxm9i0956gs02dbw7ylx4mln8ynn"; + url = http://www.meta-environment.org/releases/aterm-2.8.tar.gz; + sha256 = "1vq4qpmcww3n9v7bklgp7z1yqi9gmk6hcahqjqdzc5ksa089rdms"; }; + patches = [ + # Fix for http://bugzilla.sen.cwi.nl:8080/show_bug.cgi?id=841 + ./max-long.patch + ]; + doCheck = true; meta = { diff --git a/pkgs/development/libraries/aterm/aterm-alias-fix-2.patch b/pkgs/development/libraries/aterm/aterm-alias-fix-2.patch deleted file mode 100644 index c1dfc3e0e737..000000000000 --- a/pkgs/development/libraries/aterm/aterm-alias-fix-2.patch +++ /dev/null @@ -1,224 +0,0 @@ -diff -rc aterm-1142707243.10633/aterm/aterm.c aterm/aterm/aterm.c -*** aterm-1142707243.10633/aterm/aterm.c 2006-02-08 11:35:28.000000000 +0100 ---- aterm/aterm/aterm.c 2006-04-25 17:10:52.000000000 +0200 -*************** -*** 193,198 **** ---- 193,199 ---- - /* that have char == 2 bytes, and sizeof(header_type) == 2 */ - assert(sizeof(header_type) == sizeof(ATerm *)); - assert(sizeof(header_type) >= 4); -+ assert(sizeof(ATerm) == sizeof(MachineWord)); - - /*}}} */ - /*{{{ Initialize buffer */ -diff -rc aterm-1142707243.10633/aterm/memory.c aterm/aterm/memory.c -*** aterm-1142707243.10633/aterm/memory.c 2006-03-09 15:02:56.000000000 +0100 ---- aterm/aterm/memory.c 2006-04-25 18:22:00.000000000 +0200 -*************** -*** 119,130 **** - hash_number(tmp,3)) - */ - - #define HASHNUMBER3(t)\ -! FINISH(COMBINE(START(((MachineWord*)t)[0]), ((MachineWord*)t)[2])) - - #define HASHNUMBER4(t)\ -! FINISH(COMBINE(COMBINE(START(((MachineWord*)t)[0]), \ -! ((MachineWord*)t)[2]),((MachineWord*)t)[3])) - - #define HASHINT(val) \ - FINISH(COMBINE(START( (AT_INT<header = header; -+ -+ and then read it through a MachineWord*, e.g., -+ -+ hnr = hash_number((ATerm) protoAppl, 2); -+ -+ (hash_number walks over the term by casting it to a MachineWord*). -+ -+ However, the same clause of the C standard also specifies that you -+ *can* read the memory location through a union type that contains -+ both the original type (e.g. ATermAppl) and the type used to read -+ the memory location (e.g. MachineWord). That's what we do -+ below: we have a union of all the types that occur in the various -+ ATerm types. We then read the "w" element of the union. The -+ compiler is not allowed to assume absence of aliasing with the -+ other types in the union. -+ -+ A better solution would be to hash the term through a character -+ pointer (since *any* memory location can be legally read as a -+ character), but I'm too lazy right now. Performance might also -+ suffer if we do that. */ -+ -+ typedef union -+ { -+ MachineWord w; -+ header_type header; -+ ATerm term; -+ ATermList list; -+ int i; -+ double d; -+ void* p; -+ } Aliaser; -+ -+ #define GET_WORD(t, n) (((Aliaser*) (((MachineWord*) t) + n))->w) -+ - #define HASHNUMBER3(t)\ -! FINISH(COMBINE(START(GET_WORD(t, 0)), GET_WORD(t, 2))) - - #define HASHNUMBER4(t)\ -! FINISH(COMBINE(COMBINE(START(GET_WORD(t, 0)), \ -! GET_WORD(t, 2)), GET_WORD(t, 3))) - - #define HASHINT(val) \ - FINISH(COMBINE(START( (AT_INT<header = header; - CHECK_HEADER(protoAppl->header); - -! if (args != PROTO_APPL_ARGS) { - for (i=0; iheader = header; - CHECK_HEADER(protoAppl->header); - -! if (args != (ATerm *) PROTO_APPL_ARGS) { - for (i=0; i= 4); -+ assert(sizeof(ATerm) == sizeof(MachineWord)); - - /*}}} */ - /*{{{ Initialize buffer */ -diff -rc aterm-2.3.1-orig/aterm/memory.c aterm-2.3.1/aterm/memory.c -*** aterm-2.3.1-orig/aterm/memory.c 2004-06-09 10:52:33.000000000 +0200 ---- aterm-2.3.1/aterm/memory.c 2005-05-02 18:32:52.000000000 +0200 -*************** -*** 176,182 **** - * Static arrays are not guaranteed to be sizeof(double)-aligned. - */ - static MachineWord *protoTerm = NULL; -- static ATerm *arg_buffer = NULL; - - static ATerm protected_buffer[MAX_ARITY] = { NULL }; - ---- 176,181 ---- -*************** -*** 495,501 **** - HashNumber hnr; - - protoTerm = (MachineWord *) calloc(MAX_TERM_SIZE, sizeof(MachineWord)); -- arg_buffer = (ATerm *) (protoTerm + 2); - - /*{{{ Analyze arguments */ - ---- 494,499 ---- -*************** -*** 1032,1043 **** - va_list args; - - protoAppl = (ATermAppl) protoTerm; -- - va_start(args, sym); - for (i=0; iheader = header; - CHECK_HEADER(cur->header); - for (i=0; inext = hashtable[hnr]; ---- 1070,1076 ---- - cur->header = header; - CHECK_HEADER(cur->header); - for (i=0; inext = hashtable[hnr]; -*************** -*** 1164,1170 **** - protoAppl = (ATermAppl) protoTerm; - protoAppl->header = header; - CHECK_HEADER(protoAppl->header); -! arg_buffer[0] = arg0; - hnr = HASHNUMBER3((ATerm) protoAppl); - - prev = NULL; ---- 1161,1167 ---- - protoAppl = (ATermAppl) protoTerm; - protoAppl->header = header; - CHECK_HEADER(protoAppl->header); -! protoTerm[ARG_OFFSET + 0] = (MachineWord) arg0; - hnr = HASHNUMBER3((ATerm) protoAppl); - - prev = NULL; -*************** -*** 1225,1232 **** - protoAppl = (ATermAppl) protoTerm; - protoAppl->header = header; - CHECK_HEADER(protoAppl->header); -! arg_buffer[0] = arg0; -! arg_buffer[1] = arg1; - hnr = HASHNUMBER4((ATerm) protoAppl); - - prev = NULL; ---- 1222,1229 ---- - protoAppl = (ATermAppl) protoTerm; - protoAppl->header = header; - CHECK_HEADER(protoAppl->header); -! protoTerm[ARG_OFFSET + 0] = (MachineWord) arg0; -! protoTerm[ARG_OFFSET + 1] = (MachineWord) arg1; - hnr = HASHNUMBER4((ATerm) protoAppl); - - prev = NULL; -*************** -*** 1287,1295 **** - protoAppl = (ATermAppl) protoTerm; - protoAppl->header = header; - CHECK_HEADER(protoAppl->header); -! arg_buffer[0] = arg0; -! arg_buffer[1] = arg1; -! arg_buffer[2] = arg2; - hnr = hash_number((ATerm) protoAppl, 5); - - cur = hashtable[hnr & table_mask]; ---- 1284,1292 ---- - protoAppl = (ATermAppl) protoTerm; - protoAppl->header = header; - CHECK_HEADER(protoAppl->header); -! protoTerm[ARG_OFFSET + 0] = (MachineWord) arg0; -! protoTerm[ARG_OFFSET + 1] = (MachineWord) arg1; -! protoTerm[ARG_OFFSET + 2] = (MachineWord) arg2; - hnr = hash_number((ATerm) protoAppl, 5); - - cur = hashtable[hnr & table_mask]; -*************** -*** 1347,1356 **** - protoAppl = (ATermAppl) protoTerm; - protoAppl->header = header; - CHECK_HEADER(protoAppl->header); -! arg_buffer[0] = arg0; -! arg_buffer[1] = arg1; -! arg_buffer[2] = arg2; -! arg_buffer[3] = arg3; - hnr = hash_number((ATerm) protoAppl, 6); - - cur = hashtable[hnr & table_mask]; ---- 1344,1353 ---- - protoAppl = (ATermAppl) protoTerm; - protoAppl->header = header; - CHECK_HEADER(protoAppl->header); -! protoTerm[ARG_OFFSET + 0] = (MachineWord) arg0; -! protoTerm[ARG_OFFSET + 1] = (MachineWord) arg1; -! protoTerm[ARG_OFFSET + 2] = (MachineWord) arg2; -! protoTerm[ARG_OFFSET + 3] = (MachineWord) arg3; - hnr = hash_number((ATerm) protoAppl, 6); - - cur = hashtable[hnr & table_mask]; -*************** -*** 1411,1421 **** - protoAppl = (ATermAppl) protoTerm; - protoAppl->header = header; - CHECK_HEADER(protoAppl->header); -! arg_buffer[0] = arg0; -! arg_buffer[1] = arg1; -! arg_buffer[2] = arg2; -! arg_buffer[3] = arg3; -! arg_buffer[4] = arg4; - hnr = hash_number((ATerm) protoAppl, 7); - - cur = hashtable[hnr & table_mask]; ---- 1408,1418 ---- - protoAppl = (ATermAppl) protoTerm; - protoAppl->header = header; - CHECK_HEADER(protoAppl->header); -! protoTerm[ARG_OFFSET + 0] = (MachineWord) arg0; -! protoTerm[ARG_OFFSET + 1] = (MachineWord) arg1; -! protoTerm[ARG_OFFSET + 2] = (MachineWord) arg2; -! protoTerm[ARG_OFFSET + 3] = (MachineWord) arg3; -! protoTerm[ARG_OFFSET + 4] = (MachineWord) arg4; - hnr = hash_number((ATerm) protoAppl, 7); - - cur = hashtable[hnr & table_mask]; -*************** -*** 1479,1490 **** - protoAppl = (ATermAppl) protoTerm; - protoAppl->header = header; - CHECK_HEADER(protoAppl->header); -! arg_buffer[0] = arg0; -! arg_buffer[1] = arg1; -! arg_buffer[2] = arg2; -! arg_buffer[3] = arg3; -! arg_buffer[4] = arg4; -! arg_buffer[5] = arg5; - hnr = hash_number((ATerm) protoAppl, 8); - - cur = hashtable[hnr & table_mask]; ---- 1476,1487 ---- - protoAppl = (ATermAppl) protoTerm; - protoAppl->header = header; - CHECK_HEADER(protoAppl->header); -! protoTerm[ARG_OFFSET + 0] = (MachineWord) arg0; -! protoTerm[ARG_OFFSET + 1] = (MachineWord) arg1; -! protoTerm[ARG_OFFSET + 2] = (MachineWord) arg2; -! protoTerm[ARG_OFFSET + 3] = (MachineWord) arg3; -! protoTerm[ARG_OFFSET + 4] = (MachineWord) arg4; -! protoTerm[ARG_OFFSET + 5] = (MachineWord) arg5; - hnr = hash_number((ATerm) protoAppl, 8); - - cur = hashtable[hnr & table_mask]; -*************** -*** 1552,1558 **** - CHECK_HEADER(protoAppl->header); - - for (i=0; iheader); - - for (i=0; iheader = header; - CHECK_HEADER(cur->header); - for (i=0; inext = hashtable[hnr]; ---- 1584,1590 ---- - cur->header = header; - CHECK_HEADER(cur->header); - for (i=0; inext = hashtable[hnr]; -*************** -*** 1623,1632 **** - protoAppl->header = header; - CHECK_HEADER(protoAppl->header); - -! if (args != arg_buffer) { - for (i=0; iheader = header; - CHECK_HEADER(protoAppl->header); - -! if (args != (ATerm *) (protoTerm + ARG_OFFSET)) { - for (i=0; iheader = header; - CHECK_HEADER(cur->header); - for (i=0; inext = hashtable[hnr]; - hashtable[hnr] = cur; - } - -! if (args != arg_buffer) { - for (i=0; iheader = header; - CHECK_HEADER(cur->header); - for (i=0; inext = hashtable[hnr]; - hashtable[hnr] = cur; - } - -! if (args != (ATerm *) (protoTerm + ARG_OFFSET)) { - for (i=0; i= 0 && n < arity); - - for (i=0; i= 0 && n < arity); - - for (i=0; i) -- -- Due to several pending issues with the optimizer in the GNU C Compiler -- (most noticable to everyone using gcc version over 2.95), we strongly -- advise AGAINST passing gcc any of its '-O' optimization flags. -- -- More information on GCC optimization bugs can be found at: -- http://gcc.gnu.org/cgi-bin/gnatsweb.pl?database=gcc&cmd=query -- -- and subsequently selecting the Category: -- "optimization -- Issues related to optimization" -- -- As a result, the default configuration of the ATerm Library does not -- pass any optimizer flags to gcc anymore. Should you wish to experiment -- with specific compiler flags anyway, you can use the "--with-cflags" -- configure option. Your mileage may vary from the stress-test failing, -- to coredumps and spontaneous aborts in your program. -- -- -- -- - README with this version of the aterm library. - ============================================== - ---- 1,4 ---- diff --git a/pkgs/development/libraries/aterm/max-long.patch b/pkgs/development/libraries/aterm/max-long.patch new file mode 100644 index 000000000000..a2f260b970b3 --- /dev/null +++ b/pkgs/development/libraries/aterm/max-long.patch @@ -0,0 +1,77 @@ +diff -rc aterm-2.8-orig/aterm/hash.c aterm-2.8/aterm/hash.c +*** aterm-2.8-orig/aterm/hash.c 2008-11-10 13:54:22.000000000 +0100 +--- aterm-2.8/aterm/hash.c 2009-01-27 18:14:14.000000000 +0100 +*************** +*** 93,146 **** + } + + /*}}} */ +- /*{{{ static long calc_long_max() */ +- static long calc_long_max() +- { +- 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); +- +- delta = long_max; +- while (delta > 1) { +- while (long_max + delta < 0) { +- delta /= 2; +- } +- long_max += delta; +- } +- +- return long_max; +- +- } +- /*}}} */ + /*{{{ static long calculateNewSize(sizeMinus1, nrdel, nrentries) */ + + static long calculateNewSize + (long sizeMinus1, long nr_deletions, long nr_entries) + { +- +- /* Hack: LONG_MAX (limits.h) is often unreliable, we need to find +- * out the maximum possible value of a signed long dynamically. +- */ +- static long st_long_max = 0; +- +- /* the resulting length has the form 2^k-1 */ +- + if (nr_deletions >= nr_entries/2) { + return sizeMinus1; + } + +! if (st_long_max == 0) { +! st_long_max = calc_long_max(); +! } +! +! if (sizeMinus1 > st_long_max / 2) { +! return st_long_max-1; + } + + return (2*sizeMinus1)+1; +--- 93,109 ---- + } + + /*}}} */ + /*{{{ static long calculateNewSize(sizeMinus1, nrdel, nrentries) */ + + static long calculateNewSize + (long sizeMinus1, long nr_deletions, long nr_entries) + { + if (nr_deletions >= nr_entries/2) { + return sizeMinus1; + } + +! if (sizeMinus1 > LONG_MAX / 2) { +! return LONG_MAX-1; + } + + return (2*sizeMinus1)+1; diff --git a/pkgs/development/libraries/aterm/mingw-asm.patch b/pkgs/development/libraries/aterm/mingw-asm.patch deleted file mode 100644 index e1e18f4c334c..000000000000 --- a/pkgs/development/libraries/aterm/mingw-asm.patch +++ /dev/null @@ -1,269 +0,0 @@ -diff -urN aterm-2.4.2-old/aterm/gc.c aterm-2.4.2/aterm/gc.c ---- aterm-2.4.2-old/aterm/gc.c 2004-06-01 10:29:02.000000000 +0200 -+++ aterm-2.4.2/aterm/gc.c 2006-08-17 15:17:28.000000000 +0200 -@@ -230,71 +230,17 @@ - AFun oddSym; - #endif - --#ifdef WIN32 -- -- unsigned int r_eax, r_ebx, r_ecx, r_edx, \ -- r_esi, r_edi, r_esp, r_ebp; -- ATerm reg[8], *real_term; -- -- __asm { -- /* Get the registers into local variables to check them -- for aterms later. */ -- mov r_eax, eax -- mov r_ebx, ebx -- mov r_ecx, ecx -- mov r_edx, edx -- mov r_esi, esi -- mov r_edi, edi -- mov r_esp, esp -- mov r_ebp, ebp -- } -- /* Put the register-values into an array */ -- reg[0] = (ATerm) r_eax; -- reg[1] = (ATerm) r_ebx; -- reg[2] = (ATerm) r_ecx; -- reg[3] = (ATerm) r_edx; -- reg[4] = (ATerm) r_esi; -- reg[5] = (ATerm) r_edi; -- reg[6] = (ATerm) r_esp; -- reg[7] = (ATerm) r_ebp; -- -- for(i=0; i<8; i++) { -- real_term = AT_isInsideValidTerm(reg[i]); -- if (real_term != NULL) { -- AT_markTerm(real_term); -- } -- if (AT_isValidSymbol((Symbol)reg[i])) { -- AT_markSymbol((Symbol)reg[i]); -- } -- } -- -- /* The register variables are on the stack aswell -- I set them to zero so they won't be processed again when -- the stack is traversed. The reg-array is also in the stack -- but that will be adjusted later */ -- r_eax = 0; -- r_ebx = 0; -- r_ecx = 0; -- r_edx = 0; -- r_esi = 0; -- r_edi = 0; -- r_esp = 0; -- r_ebp = 0; -- --#else -- sigjmp_buf env; -+ jmp_buf env; - - /* Traverse possible register variables */ -- sigsetjmp(env,0); -+ setjmp(env); - - start = (ATerm *)env; -- stop = ((ATerm *)(((char *)env) + sizeof(sigjmp_buf))); -+ stop = ((ATerm *)(((char *)env) + sizeof(jmp_buf))); - mark_memory(start, stop); --#endif - - stackTop = stack_top(); - -- - start = MIN(stackTop, stackBot); - stop = MAX(stackTop, stackBot); - -@@ -343,67 +289,14 @@ - AFun oddSym; - #endif - --#ifdef WIN32 -- -- unsigned int r_eax, r_ebx, r_ecx, r_edx, \ -- r_esi, r_edi, r_esp, r_ebp; -- ATerm reg[8], *real_term; -- -- __asm { -- /* Get the registers into local variables to check them -- for aterms later. */ -- mov r_eax, eax -- mov r_ebx, ebx -- mov r_ecx, ecx -- mov r_edx, edx -- mov r_esi, esi -- mov r_edi, edi -- mov r_esp, esp -- mov r_ebp, ebp -- } -- /* Put the register-values into an array */ -- reg[0] = (ATerm) r_eax; -- reg[1] = (ATerm) r_ebx; -- reg[2] = (ATerm) r_ecx; -- reg[3] = (ATerm) r_edx; -- reg[4] = (ATerm) r_esi; -- reg[5] = (ATerm) r_edi; -- reg[6] = (ATerm) r_esp; -- reg[7] = (ATerm) r_ebp; -- -- for(i=0; i<8; i++) { -- real_term = AT_isInsideValidTerm(reg[i]); -- if (real_term != NULL) { -- AT_markTerm_young(real_term); -- } -- if (AT_isValidSymbol((Symbol)reg[i])) { -- AT_markSymbol_young((Symbol)reg[i]); -- } -- } -- -- /* The register variables are on the stack aswell -- I set them to zero so they won't be processed again when -- the stack is traversed. The reg-array is also in the stack -- but that will be adjusted later */ -- r_eax = 0; -- r_ebx = 0; -- r_ecx = 0; -- r_edx = 0; -- r_esi = 0; -- r_edi = 0; -- r_esp = 0; -- r_ebp = 0; -- --#else -- sigjmp_buf env; -+ jmp_buf env; - - /* Traverse possible register variables */ -- sigsetjmp(env,0); -+ setjmp(env); - - start = (ATerm *)env; -- stop = ((ATerm *)(((char *)env) + sizeof(sigjmp_buf))); -+ stop = ((ATerm *)(((char *)env) + sizeof(jmp_buf))); - mark_memory_young(start, stop); --#endif - - stackTop = stack_top(); - start = MIN(stackTop, stackBot); -diff -urN aterm-2.4.2-old/test/randgen.c aterm-2.4.2/test/randgen.c ---- aterm-2.4.2-old/test/randgen.c 2002-06-06 10:16:29.000000000 +0200 -+++ aterm-2.4.2/test/randgen.c 2006-08-17 16:09:47.000000000 +0200 -@@ -14,8 +14,13 @@ - #if HAVE_LRAND48 && HAVE_SRAND48 - /* Use the rand48() suite */ - #else --#define lrand48() random() --#define srand48(s) srandom(s) -+# ifdef WIN32 -+# define lrand48() rand() -+# define srand48(s) srand(s) -+# else -+# define lrand48() random() -+# define srand48(s) srandom(s) -+# endif - #endif - - /*}}} */ -diff -urN aterm-2.4.2-old/test/termstats.c aterm-2.4.2/test/termstats.c ---- aterm-2.4.2-old/test/termstats.c 2001-10-09 16:35:21.000000000 +0200 -+++ aterm-2.4.2/test/termstats.c 2006-08-17 17:15:53.000000000 +0200 -@@ -1,7 +1,9 @@ - #include - #include - #include -+#ifndef WIN32 - #include -+#endif - #include - #include - -@@ -14,7 +16,9 @@ - - int main(int argc, char *argv[]) - { -+#ifndef WIN32 - struct tms start, end; -+#endif - ATerm top = NULL; - ATerm t, t2; - ATbool dobafsize = ATfalse; -@@ -29,16 +33,24 @@ - - ATinit(argc, argv, &top); - -+#ifndef WIN32 - times(&start); -+#endif - t = ATreadFromFile(stdin); -+#ifndef WIN32 - times(&end); - textread = end.tms_utime-start.tms_utime; -+#endif - - tmp_file = tmpfile(); -+#ifndef WIN32 - times(&start); -+#endif - ATwriteToTextFile(t, tmp_file); -+#ifndef WIN32 - times(&end); - textwrite = end.tms_utime-start.tms_utime; -+#endif - - subterms = AT_calcSubterms(t); - symbols = AT_calcUniqueSymbols(t); -@@ -56,37 +68,52 @@ - printf(" bytes p/node : %8.2f\n", ((double)incore)/((double)subterms)); - printf("text size : %8d\n",textsize); - printf(" bytes p/node : %8.2f\n", ((double)textsize)/((double)subterms)); -+ -+#ifndef WIN32 - printf("text read time : %8.2fs\n", ((double)textread)/((double)CLK_TCK)); - printf(" per node : %8.2fus\n", ((double)textread*1000000.0/subterms)/((double)CLK_TCK)); - printf("text write time : %8.2fs\n", ((double)textwrite)/((double)CLK_TCK)); - printf(" per node : %8.2fus\n", ((double)textwrite*1000000.0/subterms)/((double)CLK_TCK)); -+#endif - - if(dobafsize) { - struct stat stats; -+#ifndef WIN32 - clock_t bafread, bafwrite; -+#endif - FILE *file = fopen("/tmp/test.baf", "wb+"); - int fd = fileno(file); - -+#ifndef WIN32 - times(&start); -+#endif - ATwriteToBinaryFile(t, file); -+#ifndef WIN32 - times(&end); - bafwrite = end.tms_utime-start.tms_utime; -+#endif - fflush(file); - fstat(fd, &stats); - bafsize = (int)stats.st_size; - fseek(file, 0, SEEK_SET); -+#ifndef WIN32 - times(&start); -+#endif - t2 = ATreadFromBinaryFile(file); -+#ifndef WIN32 - times(&end); - bafread = end.tms_utime-start.tms_utime; -+#endif - printf("baf size : %8d\n", bafsize); - printf(" bytes p/node : %8.2f\n", ((double)bafsize)/((double)subterms)); - printf(" bits p/node : %8.2f\n", ((double)bafsize*8)/((double)subterms)); - printf(" comp.wrs.text : %8.2f%%\n", 100.0-((double)bafsize*100)/((textsize))); -+#ifndef WIN32 - printf("baf write time : %8.2fs\n", ((double)bafwrite)/((double)CLK_TCK)); - printf(" per node : %8.2fus\n", ((double)bafwrite*1000000.0/subterms)/((double)CLK_TCK)); - printf("baf read time : %8.2fs\n", ((double)bafread)/((double)CLK_TCK)); - printf(" per node : %8.2fus\n", ((double)bafread*1000000.0/subterms)/((double)CLK_TCK)); -+#endif - fclose(file); - } - diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 996dee41a30e..0d0139be5f53 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1945,14 +1945,12 @@ let }; transformers = import ../development/compilers/transformers { - inherit fetchurl pkgconfig sdf stlport; - aterm = aterm23; + inherit fetchurl pkgconfig sdf stlport aterm; stdenv = overrideGCC (overrideInStdenv stdenv [gnumake380]) gcc34; strategoxt = import ../development/compilers/strategoxt/strategoxt-0.14.nix { - inherit fetchurl pkgconfig sdf; - aterm = aterm23; + inherit fetchurl pkgconfig sdf aterm; stdenv = overrideGCC (overrideInStdenv stdenv [gnumake380]) gcc34; }; }; @@ -2654,15 +2652,7 @@ let inherit fetchurl stdenv aspell which; }); - aterm = aterm24; - - aterm23 = import ../development/libraries/aterm/2.3.nix { - inherit fetchurl stdenv; - }; - - aterm24 = lowPrio (import ../development/libraries/aterm/2.4.nix { - inherit fetchurl stdenv; - }); + aterm = aterm28; aterm242fixes = import ../development/libraries/aterm/2.4.2-fixes.nix { inherit fetchurl stdenv; @@ -2672,9 +2662,9 @@ let inherit fetchurl stdenv; }; - aterm27 = lowPrio (import ../development/libraries/aterm/2.7.nix { + aterm28 = import ../development/libraries/aterm/2.8.nix { inherit fetchurl stdenv; - }); + }; attr = useFromStdenv "attr" (import ../development/libraries/attr {