Tue May 9 20:43:23 2023 UTC ()
emulators/spim: fix incorrect version comparisons, PR 57056 from "VMS"

It seems the lexer logic was checking the flex version with #if to
perform undocumented/unsupported frobs of the generated scanner's
internal state, but it had the version test wrong and so would have
been failing since flex's last minor version bump. The consequences
are apparently an infinite loop.

With the fix it no longer loops, but it still doesn't pass its own
very basic tests. It also uses its own builtin assembler (hence flex)
with nonstandard syntax (looks like also nonstandard semantics) and
who knows what else, so you're probably better off looking for a
different emulator.


(dholland)
diff -r1.46 -r1.47 pkgsrc/emulators/spim/Makefile
diff -r1.16 -r1.17 pkgsrc/emulators/spim/distinfo
diff -r0 -r1.1 pkgsrc/emulators/spim/patches/patch-scanner.l

cvs diff -r1.46 -r1.47 pkgsrc/emulators/spim/Makefile (expand / switch to unified diff)

--- pkgsrc/emulators/spim/Makefile 2020/03/20 11:57:36 1.46
+++ pkgsrc/emulators/spim/Makefile 2023/05/09 20:43:22 1.47
@@ -1,17 +1,17 @@ @@ -1,17 +1,17 @@
1# $NetBSD: Makefile,v 1.46 2020/03/20 11:57:36 nia Exp $ 1# $NetBSD: Makefile,v 1.47 2023/05/09 20:43:22 dholland Exp $
2 2
3DISTNAME= spim-8.0 3DISTNAME= spim-8.0
4PKGREVISION= 1 4PKGREVISION= 2
5CATEGORIES= emulators 5CATEGORIES= emulators
6MASTER_SITES= http://pages.cs.wisc.edu/~larus/SPIM/ 6MASTER_SITES= http://pages.cs.wisc.edu/~larus/SPIM/
7 7
8MAINTAINER= pkgsrc-users@NetBSD.org 8MAINTAINER= pkgsrc-users@NetBSD.org
9HOMEPAGE= http://spimsimulator.sourceforge.net/ 9HOMEPAGE= http://spimsimulator.sourceforge.net/
10COMMENT= MIPS R2000 Simulator 10COMMENT= MIPS R2000 Simulator
11LICENSE= modified-bsd 11LICENSE= modified-bsd
12 12
13HAS_CONFIGURE= yes 13HAS_CONFIGURE= yes
14CONFIGURE_DIRS= xspim 14CONFIGURE_DIRS= xspim
15BUILD_DIRS= spim xspim 15BUILD_DIRS= spim xspim
16CONFIGURE_SCRIPT= ./Configure 16CONFIGURE_SCRIPT= ./Configure
17USE_IMAKE= yes 17USE_IMAKE= yes

cvs diff -r1.16 -r1.17 pkgsrc/emulators/spim/distinfo (expand / switch to unified diff)

--- pkgsrc/emulators/spim/distinfo 2021/10/26 10:24:01 1.16
+++ pkgsrc/emulators/spim/distinfo 2023/05/09 20:43:22 1.17
@@ -1,7 +1,8 @@ @@ -1,7 +1,8 @@
1$NetBSD: distinfo,v 1.16 2021/10/26 10:24:01 nia Exp $ 1$NetBSD: distinfo,v 1.17 2023/05/09 20:43:22 dholland Exp $
2 2
3BLAKE2s (spim-8.0.tar.gz) = 9a5373bce04ded172e0e063a9ebbcc870977fee6a6c3121de202777b72ff48c7 3BLAKE2s (spim-8.0.tar.gz) = 9a5373bce04ded172e0e063a9ebbcc870977fee6a6c3121de202777b72ff48c7
4SHA512 (spim-8.0.tar.gz) = c4eb66863a931b74d6c6ecd92860d16fd6369c85caecba1e71a1149e73e708502d1070f17a9beb6d0af1368db1ee5a85c040b596866a1236275cdd410a661adf 4SHA512 (spim-8.0.tar.gz) = c4eb66863a931b74d6c6ecd92860d16fd6369c85caecba1e71a1149e73e708502d1070f17a9beb6d0af1368db1ee5a85c040b596866a1236275cdd410a661adf
5Size (spim-8.0.tar.gz) = 355204 bytes 5Size (spim-8.0.tar.gz) = 355204 bytes
6SHA1 (patch-aa) = 8232ff358f1bf2ede3216187faf77aad85b1da87 6SHA1 (patch-aa) = 8232ff358f1bf2ede3216187faf77aad85b1da87
7SHA1 (patch-ad) = 056ef015de5daff3003a834ff4867f97db70c79f 7SHA1 (patch-ad) = 056ef015de5daff3003a834ff4867f97db70c79f
 8SHA1 (patch-scanner.l) = 51e1c1b5e3c0db28d3fa0790729ddfa836631e2d

File Added: pkgsrc/emulators/spim/patches/patch-scanner.l
$NetBSD: patch-scanner.l,v 1.1 2023/05/09 20:43:22 dholland Exp $

Use correct version comparison logic.

--- CPU/scanner.l~	2010-01-09 05:22:52.000000000 +0000
+++ CPU/scanner.l
@@ -316,7 +316,7 @@ initialize_scanner (FILE *in_file)
   yyin = in_file;
 #ifdef FLEX_SCANNER
   yyrestart(in_file);
-#if (YY_FLEX_MAJOR_VERSION==2 && YY_FLEX_MINOR_VERSION==5 && YY_FLEX_SUBMINOR_VERSION>=33)
+#if (YY_FLEX_MAJOR_VERSION==2 && YY_FLEX_MINOR_VERSION==5 && YY_FLEX_SUBMINOR_VERSION>=33) || (YY_FLEX_MAJOR_VERSION==2 && YY_FLEX_MINOR_VERSION>5)
   /* flex 2.5.33 flipped the polarity of this flag (sigh) */
   yy_init = 0;
 #else