cooljeanius / apple-gdb-1824

fork from gdb tarball(s) from opensource.apple.com
Other
6 stars 3 forks source link

opcodes: cgen regeneration errors out with guile v2+ #69

Open cooljeanius opened 1 month ago

cooljeanius commented 1 month ago

trying to regenerate cgen-created files in the opcodes subdirectory fails with the following error:

/Applications/Xcode.app/Contents/Developer/usr/bin/make -w run-cgen arch=fr30 prefix=fr30 options="" \
        archfile=./../cgen/cpu/fr30.cpu opcfile=./../cgen/cpu/fr30.opc extrafiles=""
make[3]: Entering directory `/Users/ericgallager/apple-gdb-1824/src/opcodes'
/bin/sh ./cgen.sh opcodes . "`if test -f ../guile/libguile/guile; then echo ../guile/libguile/guile; else echo /opt/local/bin/guile; fi` -l ./../cgen/guile.scm -s" \
      ./../cgen "-v" fr30 fr30 ./../cgen/cpu/fr30.cpu ./../cgen/cpu/fr30.opc \
      "" ""
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /Users/ericgallager/apple-gdb-1824/src/opcodes/./../cgen/guile.scm
;;; WARNING: compilation of /Users/ericgallager/apple-gdb-1824/src/opcodes/./../cgen/guile.scm failed:
;;; Syntax error:
;;; /Users/ericgallager/apple-gdb-1824/src/opcodes/./../cgen/guile.scm:14:4: definition in expression context, where definitions are not allowed, in form (define (eval1 expr) (eval expr (current-module)))
ice-9/psyntax.scm:1435:12: Syntax error:
/Users/ericgallager/apple-gdb-1824/src/opcodes/./../cgen/guile.scm:14:4: definition in expression context, where definitions are not allowed, in form (define (eval1 expr) (eval expr (current-module)))
make[3]: *** [run-cgen] Error 1
make[3]: Leaving directory `/Users/ericgallager/apple-gdb-1824/src/opcodes'
make[2]: *** [stamp-fr30] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

I'm going to have to actually learn cgen and guile/scheme in order to fix this... Bounty available for anyone who wants to help.

cooljeanius commented 1 month ago

The suggestion to set GUILE_AUTO_COMPILE=0 doesn't help:

$ make GUILE_AUTO_COMPILE=0
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in po
make[2]: Nothing to be done for `all'.
/Applications/Xcode.app/Contents/Developer/usr/bin/make -w run-cgen arch=fr30 prefix=fr30 options="" \
        archfile=./../cgen/cpu/fr30.cpu opcfile=./../cgen/cpu/fr30.opc extrafiles=""
make[3]: Entering directory `/Users/ericgallager/apple-gdb-1824/src/opcodes'
/bin/sh ./cgen.sh opcodes . "`if test -f ../guile/libguile/guile; then echo ../guile/libguile/guile; else echo /opt/local/bin/guile; fi` -l ./../cgen/guile.scm -s" \
      ./../cgen "-v" fr30 fr30 ./../cgen/cpu/fr30.cpu ./../cgen/cpu/fr30.opc \
      "" ""
ice-9/psyntax.scm:1435:12: Syntax error:
/Users/ericgallager/apple-gdb-1824/src/opcodes/./../cgen/guile.scm:14:4: definition in expression context, where definitions are not allowed, in form (define (eval1 expr) (eval expr (current-module)))
make[3]: *** [run-cgen] Error 1
make[3]: Leaving directory `/Users/ericgallager/apple-gdb-1824/src/opcodes'
make[2]: *** [stamp-fr30] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
cooljeanius commented 1 month ago

version info for guile used:

$ /opt/local/bin/guile --version
guile (GNU Guile) 2.2.7
Copyright (C) 2020 Free Software Foundation, Inc.

License LGPLv3+: GNU LGPL 3 or later <http://gnu.org/licenses/lgpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
cooljeanius commented 1 month ago

Also fails with guile 2.0.11:

$ /opt/iains/x86_64-apple-darwin19/gcc-7-5-toolchain/bin/guile --version
guile (GNU Guile) 2.0.11
Copyright (C) 2014 Free Software Foundation, Inc.

License LGPLv3+: GNU LGPL 3 or later <http://gnu.org/licenses/lgpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ make GUILE=/opt/iains/x86_64-apple-darwin19/gcc-7-5-toolchain/bin/guile
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in po
make[2]: Nothing to be done for `all'.
/Applications/Xcode.app/Contents/Developer/usr/bin/make -w run-cgen arch=fr30 prefix=fr30 options="" \
        archfile=./../cgen/cpu/fr30.cpu opcfile=./../cgen/cpu/fr30.opc extrafiles=""
make[3]: Entering directory `/Users/ericgallager/apple-gdb-1824/src/opcodes'
/bin/sh ./cgen.sh opcodes . "`if test -f ../guile/libguile/guile; then echo ../guile/libguile/guile; else echo /opt/iains/x86_64-apple-darwin19/gcc-7-5-toolchain/bin/guile; fi` -l ./../cgen/guile.scm -s" \
      ./../cgen "-v" fr30 fr30 ./../cgen/cpu/fr30.cpu ./../cgen/cpu/fr30.opc \
      "" ""
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /Users/ericgallager/apple-gdb-1824/src/opcodes/./../cgen/guile.scm
;;; WARNING: compilation of /Users/ericgallager/apple-gdb-1824/src/opcodes/./../cgen/guile.scm failed:
;;; ERROR: Syntax error:
;;; /Users/ericgallager/apple-gdb-1824/src/opcodes/./../cgen/guile.scm:14:4: definition in expression context, where definitions are not allowed, in form (define (eval1 expr) (eval expr (current-module)))
ice-9/psyntax.scm:1274:12: In procedure #<procedure 10e28cd70 (test then else)>:
ice-9/psyntax.scm:1274:12: Syntax error:
/Users/ericgallager/apple-gdb-1824/src/opcodes/./../cgen/guile.scm:14:4: definition in expression context, where definitions are not allowed, in form (define (eval1 expr) (eval expr (current-module)))
make[3]: *** [run-cgen] Error 1
make[3]: Leaving directory `/Users/ericgallager/apple-gdb-1824/src/opcodes'
make[2]: *** [stamp-fr30] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
cooljeanius commented 1 month ago

It works when I force GUILE=guile18, so I guess this is a guile2.x incompatibility...

cooljeanius commented 1 month ago

OK, so now that I've remembered that I can use guile1.8 to regenerate... I'm running into a different error regenerating the frv files:

ERROR: unknown operand:  FPCONV-DEFAULT

Just touching them for now instead of regenerating them...

cooljeanius commented 1 month ago

OK, so now that I've remembered that I can use guile1.8 to regenerate... I'm running into a different error regenerating the frv files:

ERROR: unknown operand:  FPCONV-DEFAULT

Just touching them for now instead of regenerating them...

...also, the m32c regeneration seems to be hanging on the following step:

Instantiating multi-insns ...
cooljeanius commented 1 month ago

Note that this is prerequisite for fixing issue #9